Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Hanumantha Reddy Pothula | 28b1e65 | 2015-02-02 21:10:13 +0530 | [diff] [blame] | 2 | * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. |
Kiet Lam | 0fb93dd | 2014-02-19 00:32:59 -0800 | [diff] [blame] | 3 | * |
| 4 | * Previously licensed under the ISC license by Qualcomm Atheros, Inc. |
| 5 | * |
| 6 | * |
| 7 | * Permission to use, copy, modify, and/or distribute this software for |
| 8 | * any purpose with or without fee is hereby granted, provided that the |
| 9 | * above copyright notice and this permission notice appear in all |
| 10 | * copies. |
| 11 | * |
| 12 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL |
| 13 | * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED |
| 14 | * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE |
| 15 | * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL |
| 16 | * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR |
| 17 | * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
| 18 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR |
| 19 | * PERFORMANCE OF THIS SOFTWARE. |
| 20 | */ |
| 21 | |
| 22 | /* |
Kiet Lam | a7f454d | 2014-07-24 12:04:06 -0700 | [diff] [blame] | 23 | * This file was originally distributed by Qualcomm Atheros, Inc. |
| 24 | * under proprietary terms before Copyright ownership was assigned |
| 25 | * to the Linux Foundation. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 26 | */ |
Kiet Lam | 0fb93dd | 2014-02-19 00:32:59 -0800 | [diff] [blame] | 27 | |
| 28 | |
Kiet Lam | a7f454d | 2014-07-24 12:04:06 -0700 | [diff] [blame] | 29 | |
| 30 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 31 | /**========================================================================= |
| 32 | |
| 33 | \file smeApi.c |
| 34 | |
| 35 | \brief Definitions for SME APIs |
| 36 | |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame] | 37 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 38 | ========================================================================*/ |
| 39 | |
| 40 | /*=========================================================================== |
| 41 | |
| 42 | EDIT HISTORY FOR FILE |
| 43 | |
| 44 | |
| 45 | This section contains comments describing changes made to the module. |
| 46 | Notice that changes are listed in reverse chronological order. |
| 47 | |
| 48 | |
| 49 | |
| 50 | when who what, where, why |
| 51 | ---------- --- -------------------------------------------------------- |
| 52 | 06/03/10 js Added support to hostapd driven |
| 53 | * deauth/disassoc/mic failure |
| 54 | |
| 55 | ===========================================================================*/ |
| 56 | |
| 57 | /*-------------------------------------------------------------------------- |
| 58 | Include Files |
| 59 | ------------------------------------------------------------------------*/ |
| 60 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 61 | |
| 62 | #include "smsDebug.h" |
| 63 | #include "sme_Api.h" |
| 64 | #include "csrInsideApi.h" |
| 65 | #include "smeInside.h" |
| 66 | #include "csrInternal.h" |
| 67 | #include "wlan_qct_wda.h" |
| 68 | #include "halMsgApi.h" |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 69 | #include "vos_trace.h" |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 70 | #include "sme_Trace.h" |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 71 | #include "vos_types.h" |
| 72 | #include "vos_trace.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 73 | #include "sapApi.h" |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 74 | #include "macTrace.h" |
Mukul Sharma | be91e2f | 2014-06-29 22:09:20 +0530 | [diff] [blame] | 75 | #include "vos_utils.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 76 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 77 | extern tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); |
| 78 | |
| 79 | #include <wlan_qct_pal_api.h> |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 80 | #define LOG_SIZE 256 |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 81 | #define READ_MEMORY_DUMP_CMD 9 |
Madan Mohan Koyyalamudi | 8af9b40 | 2013-07-11 14:59:10 +0530 | [diff] [blame] | 82 | #define TL_INIT_STATE 0 |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 83 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 84 | |
| 85 | #define CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE 1000*30 //30s |
| 86 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 87 | // TxMB Functions |
| 88 | extern eHalStatus pmcPrepareCommand( tpAniSirGlobal pMac, eSmeCommandType cmdType, void *pvParam, |
| 89 | tANI_U32 size, tSmeCmd **ppCmd ); |
| 90 | extern void pmcReleaseCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 91 | extern void qosReleaseCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
Sushant Kaushik | 298a859 | 2014-12-09 17:34:07 +0530 | [diff] [blame] | 92 | extern void csrReleaseRocReqCommand( tpAniSirGlobal pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 93 | extern eHalStatus p2pProcessRemainOnChannelCmd(tpAniSirGlobal pMac, tSmeCmd *p2pRemainonChn); |
| 94 | extern eHalStatus sme_remainOnChnRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg); |
| 95 | extern eHalStatus sme_mgmtFrmInd( tHalHandle hHal, tpSirSmeMgmtFrameInd pSmeMgmtFrm); |
| 96 | extern eHalStatus sme_remainOnChnReady( tHalHandle hHal, tANI_U8* pMsg); |
| 97 | extern eHalStatus sme_sendActionCnf( tHalHandle hHal, tANI_U8* pMsg); |
| 98 | extern eHalStatus p2pProcessNoAReq(tpAniSirGlobal pMac, tSmeCmd *pNoACmd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 99 | |
| 100 | static eHalStatus initSmeCmdList(tpAniSirGlobal pMac); |
| 101 | static void smeAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ); |
| 102 | |
| 103 | eCsrPhyMode sme_GetPhyMode(tHalHandle hHal); |
| 104 | |
| 105 | eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf); |
| 106 | |
Sushant Kaushik | 1d73256 | 2014-05-21 14:15:37 +0530 | [diff] [blame] | 107 | void sme_DisconnectConnectedSessions(tpAniSirGlobal pMac); |
| 108 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 109 | eHalStatus sme_HandleGenericChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf); |
| 110 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 111 | eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal); |
| 112 | |
| 113 | eHalStatus sme_HandlePostChannelSwitchInd(tHalHandle hHal); |
| 114 | |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 115 | #ifdef FEATURE_WLAN_LFR |
| 116 | tANI_BOOLEAN csrIsScanAllowed(tpAniSirGlobal pMac); |
| 117 | #endif |
| 118 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 119 | #ifdef WLAN_FEATURE_11W |
| 120 | eHalStatus sme_UnprotectedMgmtFrmInd( tHalHandle hHal, |
| 121 | tpSirSmeUnprotMgmtFrameInd pSmeMgmtFrm ); |
| 122 | #endif |
| 123 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 124 | //Internal SME APIs |
| 125 | eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme) |
| 126 | { |
| 127 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 128 | |
| 129 | if(psSme) |
| 130 | { |
| 131 | if( VOS_IS_STATUS_SUCCESS( vos_lock_acquire( &psSme->lkSmeGlobalLock) ) ) |
| 132 | { |
| 133 | status = eHAL_STATUS_SUCCESS; |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | return (status); |
| 138 | } |
| 139 | |
| 140 | |
| 141 | eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme) |
| 142 | { |
| 143 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 144 | |
| 145 | if(psSme) |
| 146 | { |
| 147 | if( VOS_IS_STATUS_SUCCESS( vos_lock_release( &psSme->lkSmeGlobalLock) ) ) |
| 148 | { |
| 149 | status = eHAL_STATUS_SUCCESS; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | return (status); |
| 154 | } |
| 155 | |
| 156 | |
| 157 | |
| 158 | static eHalStatus initSmeCmdList(tpAniSirGlobal pMac) |
| 159 | { |
| 160 | eHalStatus status; |
| 161 | tSmeCmd *pCmd; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 162 | tANI_U32 cmd_idx; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 163 | VOS_STATUS vosStatus; |
| 164 | vos_timer_t* cmdTimeoutTimer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 165 | |
| 166 | pMac->sme.totalSmeCmd = SME_TOTAL_COMMAND; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 167 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 168 | &pMac->sme.smeCmdActiveList))) |
| 169 | goto end; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 170 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 171 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 172 | &pMac->sme.smeCmdPendingList))) |
| 173 | goto end; |
| 174 | |
| 175 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 176 | &pMac->sme.smeScanCmdActiveList))) |
| 177 | goto end; |
| 178 | |
| 179 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 180 | &pMac->sme.smeScanCmdPendingList))) |
| 181 | goto end; |
| 182 | |
| 183 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 184 | &pMac->sme.smeCmdFreeList))) |
| 185 | goto end; |
| 186 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 187 | pCmd = vos_mem_malloc(sizeof(tSmeCmd) * pMac->sme.totalSmeCmd); |
| 188 | if ( NULL == pCmd ) |
| 189 | status = eHAL_STATUS_FAILURE; |
| 190 | else |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 191 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 192 | status = eHAL_STATUS_SUCCESS; |
| 193 | |
| 194 | vos_mem_set(pCmd, sizeof(tSmeCmd) * pMac->sme.totalSmeCmd, 0); |
| 195 | pMac->sme.pSmeCmdBufAddr = pCmd; |
| 196 | |
| 197 | for (cmd_idx = 0; cmd_idx < pMac->sme.totalSmeCmd; cmd_idx++) |
| 198 | { |
| 199 | csrLLInsertTail(&pMac->sme.smeCmdFreeList, |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 200 | &pCmd[cmd_idx].Link, LL_ACCESS_LOCK); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 201 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 202 | } |
| 203 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 204 | /* This timer is only to debug the active list command timeout */ |
| 205 | |
| 206 | cmdTimeoutTimer = (vos_timer_t*)vos_mem_malloc(sizeof(vos_timer_t)); |
| 207 | if (cmdTimeoutTimer) |
| 208 | { |
| 209 | pMac->sme.smeCmdActiveList.cmdTimeoutTimer = cmdTimeoutTimer; |
| 210 | vosStatus = |
| 211 | vos_timer_init( pMac->sme.smeCmdActiveList.cmdTimeoutTimer, |
| 212 | VOS_TIMER_TYPE_SW, |
| 213 | activeListCmdTimeoutHandle, |
| 214 | (void*) pMac); |
| 215 | |
| 216 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 217 | { |
| 218 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 219 | "Init Timer fail for active list command process time out"); |
| 220 | vos_mem_free(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 221 | } |
| 222 | else |
| 223 | { |
| 224 | pMac->sme.smeCmdActiveList.cmdTimeoutDuration = |
| 225 | CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE; |
| 226 | } |
| 227 | } |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 228 | end: |
| 229 | if (!HAL_STATUS_SUCCESS(status)) |
| 230 | smsLog(pMac, LOGE, "failed to initialize sme command list:%d\n", |
| 231 | status); |
| 232 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 233 | return (status); |
| 234 | } |
| 235 | |
| 236 | |
| 237 | void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd) |
| 238 | { |
| 239 | pCmd->command = eSmeNoCommand; |
| 240 | csrLLInsertTail(&pMac->sme.smeCmdFreeList, &pCmd->Link, LL_ACCESS_LOCK); |
| 241 | } |
| 242 | |
| 243 | |
| 244 | |
| 245 | static void smeReleaseCmdList(tpAniSirGlobal pMac, tDblLinkList *pList) |
| 246 | { |
| 247 | tListElem *pEntry; |
| 248 | tSmeCmd *pCommand; |
| 249 | |
| 250 | while((pEntry = csrLLRemoveHead(pList, LL_ACCESS_LOCK)) != NULL) |
| 251 | { |
| 252 | //TODO: base on command type to call release functions |
| 253 | //reinitialize different command types so they can be reused |
| 254 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 255 | smeAbortCommand(pMac, pCommand, eANI_BOOLEAN_TRUE); |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | static void purgeSmeCmdList(tpAniSirGlobal pMac) |
| 260 | { |
| 261 | //release any out standing commands back to free command list |
| 262 | smeReleaseCmdList(pMac, &pMac->sme.smeCmdPendingList); |
| 263 | smeReleaseCmdList(pMac, &pMac->sme.smeCmdActiveList); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 264 | smeReleaseCmdList(pMac, &pMac->sme.smeScanCmdPendingList); |
| 265 | smeReleaseCmdList(pMac, &pMac->sme.smeScanCmdActiveList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 266 | } |
| 267 | |
Madan Mohan Koyyalamudi | 2125599 | 2013-08-01 18:00:25 +0530 | [diff] [blame] | 268 | void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId, |
| 269 | tDblLinkList *pList) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 270 | { |
| 271 | //release any out standing commands back to free command list |
| 272 | tListElem *pEntry, *pNext; |
| 273 | tSmeCmd *pCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 274 | tDblLinkList localList; |
| 275 | |
| 276 | vos_mem_zero(&localList, sizeof(tDblLinkList)); |
| 277 | if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &localList))) |
| 278 | { |
| 279 | smsLog(pMac, LOGE, FL(" failed to open list")); |
| 280 | return; |
| 281 | } |
| 282 | |
| 283 | csrLLLock(pList); |
| 284 | pEntry = csrLLPeekHead(pList, LL_ACCESS_NOLOCK); |
| 285 | while(pEntry != NULL) |
| 286 | { |
| 287 | pNext = csrLLNext(pList, pEntry, LL_ACCESS_NOLOCK); |
| 288 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 289 | if(pCommand->sessionId == sessionId) |
| 290 | { |
| 291 | if(csrLLRemoveEntry(pList, pEntry, LL_ACCESS_NOLOCK)) |
| 292 | { |
| 293 | csrLLInsertTail(&localList, pEntry, LL_ACCESS_NOLOCK); |
| 294 | } |
| 295 | } |
| 296 | pEntry = pNext; |
| 297 | } |
| 298 | csrLLUnlock(pList); |
| 299 | |
| 300 | while( (pEntry = csrLLRemoveHead(&localList, LL_ACCESS_NOLOCK)) ) |
| 301 | { |
| 302 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 303 | smeAbortCommand(pMac, pCommand, eANI_BOOLEAN_TRUE); |
| 304 | } |
| 305 | csrLLClose(&localList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 306 | } |
| 307 | |
| 308 | |
| 309 | static eHalStatus freeSmeCmdList(tpAniSirGlobal pMac) |
| 310 | { |
| 311 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 312 | |
| 313 | purgeSmeCmdList(pMac); |
| 314 | csrLLClose(&pMac->sme.smeCmdPendingList); |
| 315 | csrLLClose(&pMac->sme.smeCmdActiveList); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 316 | csrLLClose(&pMac->sme.smeScanCmdPendingList); |
| 317 | csrLLClose(&pMac->sme.smeScanCmdActiveList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 318 | csrLLClose(&pMac->sme.smeCmdFreeList); |
| 319 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 320 | /*destroy active list command time out timer */ |
| 321 | vos_timer_destroy(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 322 | vos_mem_free(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 323 | pMac->sme.smeCmdActiveList.cmdTimeoutTimer = NULL; |
| 324 | |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 325 | status = vos_lock_acquire(&pMac->sme.lkSmeGlobalLock); |
| 326 | if(status != eHAL_STATUS_SUCCESS) |
| 327 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 328 | smsLog(pMac, LOGE, |
| 329 | FL("Failed to acquire the lock status = %d"), status); |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 330 | goto done; |
| 331 | } |
| 332 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 333 | if(NULL != pMac->sme.pSmeCmdBufAddr) |
| 334 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 335 | vos_mem_free(pMac->sme.pSmeCmdBufAddr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 336 | pMac->sme.pSmeCmdBufAddr = NULL; |
| 337 | } |
| 338 | |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 339 | status = vos_lock_release(&pMac->sme.lkSmeGlobalLock); |
| 340 | if(status != eHAL_STATUS_SUCCESS) |
| 341 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 342 | smsLog(pMac, LOGE, |
| 343 | FL("Failed to release the lock status = %d"), status); |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 344 | } |
| 345 | done: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 346 | return (status); |
| 347 | } |
| 348 | |
| 349 | |
| 350 | void dumpCsrCommandInfo(tpAniSirGlobal pMac, tSmeCmd *pCmd) |
| 351 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 352 | switch( pCmd->command ) |
| 353 | { |
| 354 | case eSmeCommandScan: |
| 355 | smsLog( pMac, LOGE, " scan command reason is %d", pCmd->u.scanCmd.reason ); |
| 356 | break; |
| 357 | |
| 358 | case eSmeCommandRoam: |
| 359 | smsLog( pMac, LOGE, " roam command reason is %d", pCmd->u.roamCmd.roamReason ); |
| 360 | break; |
| 361 | |
| 362 | case eSmeCommandWmStatusChange: |
| 363 | smsLog( pMac, LOGE, " WMStatusChange command type is %d", pCmd->u.wmStatusChangeCmd.Type ); |
| 364 | break; |
| 365 | |
| 366 | case eSmeCommandSetKey: |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 367 | smsLog( pMac, LOGE, " setKey command auth(%d) enc(%d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 368 | pCmd->u.setKeyCmd.authType, pCmd->u.setKeyCmd.encType ); |
| 369 | break; |
| 370 | |
| 371 | case eSmeCommandRemoveKey: |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 372 | smsLog( pMac, LOGE, " removeKey command auth(%d) enc(%d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 373 | pCmd->u.removeKeyCmd.authType, pCmd->u.removeKeyCmd.encType ); |
| 374 | break; |
| 375 | |
| 376 | default: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 377 | smsLog( pMac, LOGE, " default: Unhandled command %d", |
| 378 | pCmd->command); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 379 | break; |
| 380 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 381 | } |
| 382 | |
| 383 | tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac ) |
| 384 | { |
| 385 | tSmeCmd *pRetCmd = NULL, *pTempCmd = NULL; |
| 386 | tListElem *pEntry; |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 387 | static int smeCommandQueueFull = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 388 | pEntry = csrLLRemoveHead( &pMac->sme.smeCmdFreeList, LL_ACCESS_LOCK ); |
| 389 | |
| 390 | // If we can get another MS Msg buffer, then we are ok. Just link |
| 391 | // the entry onto the linked list. (We are using the linked list |
| 392 | // to keep track of tfhe message buffers). |
| 393 | if ( pEntry ) |
| 394 | { |
| 395 | pRetCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 396 | /* reset when free list is available */ |
| 397 | smeCommandQueueFull = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 398 | } |
| 399 | else { |
| 400 | int idx = 1; |
| 401 | |
| 402 | //Cannot change pRetCmd here since it needs to return later. |
| 403 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK ); |
| 404 | if( pEntry ) |
| 405 | { |
| 406 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 407 | } |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 408 | smsLog( pMac, LOGE, "Out of command buffer.... command (0x%X) stuck", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 409 | (pTempCmd) ? pTempCmd->command : eSmeNoCommand ); |
| 410 | if(pTempCmd) |
| 411 | { |
| 412 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 413 | { |
| 414 | //CSR command is stuck. See what the reason code is for that command |
| 415 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 416 | } |
| 417 | } //if(pTempCmd) |
| 418 | |
| 419 | //dump what is in the pending queue |
| 420 | csrLLLock(&pMac->sme.smeCmdPendingList); |
| 421 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK ); |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 422 | while(pEntry && !smeCommandQueueFull) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 423 | { |
| 424 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 425 | /* Print only 1st five commands from pending queue. */ |
| 426 | if (idx <= 5) |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 427 | 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] | 428 | idx, pTempCmd->command ); |
| 429 | idx++; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 430 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 431 | { |
| 432 | //CSR command is stuck. See what the reason code is for that command |
| 433 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 434 | } |
| 435 | pEntry = csrLLNext( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); |
| 436 | } |
Sushant Kaushik | c9d0f42 | 2014-06-23 18:59:30 +0530 | [diff] [blame] | 437 | /* Increament static variable so that it prints pending command only once*/ |
| 438 | smeCommandQueueFull++; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 439 | csrLLUnlock(&pMac->sme.smeCmdPendingList); |
| 440 | |
| 441 | //There may be some more command in CSR's own pending queue |
| 442 | csrLLLock(&pMac->roam.roamCmdPendingList); |
| 443 | pEntry = csrLLPeekHead( &pMac->roam.roamCmdPendingList, LL_ACCESS_NOLOCK ); |
| 444 | while(pEntry) |
| 445 | { |
| 446 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 447 | 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] | 448 | idx++, pTempCmd->command ); |
| 449 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 450 | pEntry = csrLLNext( &pMac->roam.roamCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); |
| 451 | } |
| 452 | csrLLUnlock(&pMac->roam.roamCmdPendingList); |
| 453 | } |
| 454 | |
Masti, Narayanraddi | 5240fbe | 2015-02-05 16:51:28 +0530 | [diff] [blame] | 455 | if( pRetCmd ) |
| 456 | { |
| 457 | vos_mem_set((tANI_U8 *)&pRetCmd->command, sizeof(pRetCmd->command), 0); |
| 458 | vos_mem_set((tANI_U8 *)&pRetCmd->sessionId, sizeof(pRetCmd->sessionId), 0); |
| 459 | vos_mem_set((tANI_U8 *)&pRetCmd->u, sizeof(pRetCmd->u), 0); |
| 460 | } |
| 461 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 462 | return( pRetCmd ); |
| 463 | } |
| 464 | |
| 465 | |
| 466 | void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority ) |
| 467 | { |
Sushant Kaushik | 4928e54 | 2014-12-29 15:25:54 +0530 | [diff] [blame] | 468 | if (!SME_IS_START(pMac)) |
| 469 | { |
| 470 | smsLog( pMac, LOGE, FL("Sme in stop state")); |
| 471 | return; |
| 472 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 473 | if ( fHighPriority ) |
| 474 | { |
| 475 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pCmd->Link, LL_ACCESS_LOCK ); |
| 476 | } |
| 477 | else |
| 478 | { |
| 479 | csrLLInsertTail( &pMac->sme.smeCmdPendingList, &pCmd->Link, LL_ACCESS_LOCK ); |
| 480 | } |
| 481 | |
| 482 | // process the command queue... |
| 483 | smeProcessPendingQueue( pMac ); |
| 484 | |
| 485 | return; |
| 486 | } |
| 487 | |
| 488 | |
| 489 | static eSmeCommandType smeIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand ) |
| 490 | { |
| 491 | eSmeCommandType pmcCommand = eSmeNoCommand; |
| 492 | tANI_BOOLEAN fFullPowerNeeded = eANI_BOOLEAN_FALSE; |
| 493 | tPmcState pmcState; |
| 494 | eHalStatus status; |
| 495 | |
| 496 | do |
| 497 | { |
| 498 | pmcState = pmcGetPmcState(pMac); |
| 499 | |
| 500 | status = csrIsFullPowerNeeded( pMac, pCommand, NULL, &fFullPowerNeeded ); |
| 501 | if( !HAL_STATUS_SUCCESS(status) ) |
| 502 | { |
| 503 | //PMC state is not right for the command, drop it |
| 504 | return ( eSmeDropCommand ); |
| 505 | } |
| 506 | if( fFullPowerNeeded ) break; |
| 507 | fFullPowerNeeded = ( ( eSmeCommandAddTs == pCommand->command ) || |
| 508 | ( eSmeCommandDelTs == pCommand->command ) ); |
| 509 | if( fFullPowerNeeded ) break; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 510 | #ifdef FEATURE_OEM_DATA_SUPPORT |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 511 | fFullPowerNeeded = (pmcState == IMPS && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 512 | eSmeCommandOemDataReq == pCommand->command); |
| 513 | if(fFullPowerNeeded) break; |
| 514 | #endif |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 515 | fFullPowerNeeded = (pmcState == IMPS && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 516 | eSmeCommandRemainOnChannel == pCommand->command); |
| 517 | if(fFullPowerNeeded) break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 518 | } while(0); |
| 519 | |
| 520 | if( fFullPowerNeeded ) |
| 521 | { |
| 522 | switch( pmcState ) |
| 523 | { |
| 524 | case IMPS: |
| 525 | case STANDBY: |
| 526 | pmcCommand = eSmeCommandExitImps; |
| 527 | break; |
| 528 | |
| 529 | case BMPS: |
| 530 | pmcCommand = eSmeCommandExitBmps; |
| 531 | break; |
| 532 | |
| 533 | case UAPSD: |
| 534 | pmcCommand = eSmeCommandExitUapsd; |
| 535 | break; |
| 536 | |
| 537 | case WOWL: |
| 538 | pmcCommand = eSmeCommandExitWowl; |
| 539 | break; |
| 540 | |
| 541 | default: |
| 542 | break; |
| 543 | } |
| 544 | } |
| 545 | |
| 546 | return ( pmcCommand ); |
| 547 | } |
| 548 | |
| 549 | |
| 550 | //For commands that need to do extra cleanup. |
| 551 | static void smeAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ) |
| 552 | { |
| 553 | if( eSmePmcCommandMask & pCommand->command ) |
| 554 | { |
| 555 | pmcAbortCommand( pMac, pCommand, fStopping ); |
| 556 | } |
| 557 | else if ( eSmeCsrCommandMask & pCommand->command ) |
| 558 | { |
| 559 | csrAbortCommand( pMac, pCommand, fStopping ); |
| 560 | } |
| 561 | else |
| 562 | { |
| 563 | switch( pCommand->command ) |
| 564 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 565 | case eSmeCommandRemainOnChannel: |
| 566 | if (NULL != pCommand->u.remainChlCmd.callback) |
| 567 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 568 | remainOnChanCallback callback = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 569 | pCommand->u.remainChlCmd.callback; |
| 570 | /* process the msg */ |
| 571 | if( callback ) |
| 572 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 573 | callback(pMac, pCommand->u.remainChlCmd.callbackCtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 574 | eCSR_SCAN_ABORT ); |
| 575 | } |
| 576 | } |
| 577 | smeReleaseCommand( pMac, pCommand ); |
| 578 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 579 | default: |
| 580 | smeReleaseCommand( pMac, pCommand ); |
| 581 | break; |
| 582 | } |
| 583 | } |
| 584 | } |
| 585 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 586 | tListElem *csrGetCmdToProcess(tpAniSirGlobal pMac, tDblLinkList *pList, |
| 587 | tANI_U8 sessionId, tANI_BOOLEAN fInterlocked) |
| 588 | { |
| 589 | tListElem *pCurEntry = NULL; |
| 590 | tSmeCmd *pCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 591 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 592 | /* Go through the list and return the command whose session id is not |
| 593 | * matching with the current ongoing scan cmd sessionId */ |
| 594 | pCurEntry = csrLLPeekHead( pList, LL_ACCESS_LOCK ); |
| 595 | while (pCurEntry) |
| 596 | { |
| 597 | pCommand = GET_BASE_ADDR(pCurEntry, tSmeCmd, Link); |
| 598 | if (pCommand->sessionId != sessionId) |
| 599 | { |
| 600 | smsLog(pMac, LOG1, "selected the command with different sessionId"); |
| 601 | return pCurEntry; |
| 602 | } |
| 603 | |
| 604 | pCurEntry = csrLLNext(pList, pCurEntry, fInterlocked); |
| 605 | } |
| 606 | |
| 607 | smsLog(pMac, LOG1, "No command pending with different sessionId"); |
| 608 | return NULL; |
| 609 | } |
| 610 | |
| 611 | tANI_BOOLEAN smeProcessScanQueue(tpAniSirGlobal pMac) |
| 612 | { |
| 613 | tListElem *pEntry; |
| 614 | tSmeCmd *pCommand; |
| 615 | tListElem *pSmeEntry; |
| 616 | tSmeCmd *pSmeCommand; |
| 617 | tANI_BOOLEAN status = eANI_BOOLEAN_TRUE; |
| 618 | |
| 619 | csrLLLock( &pMac->sme.smeScanCmdActiveList ); |
| 620 | if (csrLLIsListEmpty( &pMac->sme.smeScanCmdActiveList, |
| 621 | LL_ACCESS_NOLOCK )) |
| 622 | { |
| 623 | if (!csrLLIsListEmpty(&pMac->sme.smeScanCmdPendingList, |
| 624 | LL_ACCESS_LOCK)) |
| 625 | { |
| 626 | pEntry = csrLLPeekHead( &pMac->sme.smeScanCmdPendingList, |
| 627 | LL_ACCESS_LOCK ); |
| 628 | if (pEntry) |
| 629 | { |
| 630 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 631 | //We cannot execute any command in wait-for-key state until setKey is through. |
| 632 | if (CSR_IS_WAIT_FOR_KEY( pMac, pCommand->sessionId)) |
| 633 | { |
| 634 | if (!CSR_IS_SET_KEY_COMMAND(pCommand)) |
| 635 | { |
| 636 | smsLog(pMac, LOGE, |
| 637 | " Cannot process command(%d) while waiting for key", |
| 638 | pCommand->command); |
| 639 | status = eANI_BOOLEAN_FALSE; |
| 640 | goto end; |
| 641 | } |
| 642 | } |
| 643 | |
| 644 | if ((!csrLLIsListEmpty(&pMac->sme.smeCmdActiveList, |
| 645 | LL_ACCESS_LOCK ))) |
| 646 | { |
| 647 | pSmeEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, |
| 648 | LL_ACCESS_LOCK); |
| 649 | if (pEntry) |
| 650 | { |
| 651 | pSmeCommand = GET_BASE_ADDR(pEntry, tSmeCmd, |
| 652 | Link) ; |
| 653 | |
| 654 | /* if scan is running on one interface and SME recei |
| 655 | ves the next command on the same interface then |
| 656 | dont the allow the command to be queued to |
| 657 | smeCmdPendingList. If next scan is allowed on |
| 658 | the same interface the CSR state machine will |
| 659 | get screwed up. */ |
| 660 | if (pSmeCommand->sessionId == pCommand->sessionId) |
| 661 | { |
| 662 | status = eANI_BOOLEAN_FALSE; |
| 663 | goto end; |
| 664 | } |
| 665 | } |
| 666 | } |
| 667 | if ( csrLLRemoveEntry( &pMac->sme.smeScanCmdPendingList, |
| 668 | pEntry, LL_ACCESS_LOCK ) ) |
| 669 | { |
| 670 | csrLLInsertHead( &pMac->sme.smeScanCmdActiveList, |
| 671 | &pCommand->Link, LL_ACCESS_NOLOCK ); |
| 672 | |
| 673 | switch (pCommand->command) |
| 674 | { |
| 675 | case eSmeCommandScan: |
| 676 | smsLog(pMac, LOG1, |
| 677 | " Processing scan offload command "); |
| 678 | csrProcessScanCommand( pMac, pCommand ); |
| 679 | break; |
| 680 | default: |
| 681 | smsLog(pMac, LOGE, |
| 682 | " Something wrong, wrong command enqueued" |
| 683 | " to smeScanCmdPendingList"); |
| 684 | pEntry = csrLLRemoveHead( |
| 685 | &pMac->sme.smeScanCmdActiveList, |
| 686 | LL_ACCESS_NOLOCK ); |
| 687 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 688 | smeReleaseCommand( pMac, pCommand ); |
| 689 | break; |
| 690 | } |
| 691 | } |
| 692 | } |
| 693 | } |
| 694 | } |
| 695 | end: |
| 696 | csrLLUnlock(&pMac->sme.smeScanCmdActiveList); |
| 697 | return status; |
| 698 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 699 | |
Hanumantha Reddy Pothula | 28b1e65 | 2015-02-02 21:10:13 +0530 | [diff] [blame] | 700 | eHalStatus smeProcessPnoCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd) |
| 701 | { |
| 702 | tpSirPNOScanReq pnoReqBuf; |
| 703 | tSirMsgQ msgQ; |
| 704 | |
| 705 | pnoReqBuf = vos_mem_malloc(sizeof(tSirPNOScanReq)); |
| 706 | if ( NULL == pnoReqBuf ) |
| 707 | { |
| 708 | smsLog(pMac, LOGE, FL("failed to allocate memory")); |
| 709 | return eHAL_STATUS_FAILURE; |
| 710 | } |
| 711 | |
| 712 | vos_mem_copy(pnoReqBuf, &(pCmd->u.pnoInfo), sizeof(tSirPNOScanReq)); |
| 713 | |
| 714 | smsLog(pMac, LOG1, FL("post WDA_SET_PNO_REQ comamnd")); |
| 715 | msgQ.type = WDA_SET_PNO_REQ; |
| 716 | msgQ.reserved = 0; |
| 717 | msgQ.bodyptr = pnoReqBuf; |
| 718 | msgQ.bodyval = 0; |
| 719 | wdaPostCtrlMsg( pMac, &msgQ); |
| 720 | |
| 721 | return eHAL_STATUS_SUCCESS; |
| 722 | } |
| 723 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 724 | tANI_BOOLEAN smeProcessCommand( tpAniSirGlobal pMac ) |
| 725 | { |
| 726 | tANI_BOOLEAN fContinue = eANI_BOOLEAN_FALSE; |
| 727 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 728 | tListElem *pEntry; |
| 729 | tSmeCmd *pCommand; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 730 | tListElem *pSmeEntry; |
| 731 | tSmeCmd *pSmeCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 732 | eSmeCommandType pmcCommand = eSmeNoCommand; |
| 733 | |
| 734 | // if the ActiveList is empty, then nothing is active so we can process a |
| 735 | // pending command... |
| 736 | //alwasy lock active list before locking pending list |
| 737 | csrLLLock( &pMac->sme.smeCmdActiveList ); |
| 738 | if ( csrLLIsListEmpty( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ) ) |
| 739 | { |
| 740 | if(!csrLLIsListEmpty(&pMac->sme.smeCmdPendingList, LL_ACCESS_LOCK)) |
| 741 | { |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 742 | /* If scan command is pending in the smeScanCmdActive list |
| 743 | * then pick the command from smeCmdPendingList which is |
| 744 | * not matching with the scan command session id. |
| 745 | * At any point of time only one command will be allowed |
| 746 | * on a single session. */ |
| 747 | if ((pMac->fScanOffload) && |
| 748 | (!csrLLIsListEmpty(&pMac->sme.smeScanCmdActiveList, |
| 749 | LL_ACCESS_LOCK))) |
| 750 | { |
| 751 | pSmeEntry = csrLLPeekHead(&pMac->sme.smeScanCmdActiveList, |
| 752 | LL_ACCESS_LOCK); |
| 753 | if (pSmeEntry) |
| 754 | { |
| 755 | pSmeCommand = GET_BASE_ADDR(pSmeEntry, tSmeCmd, Link); |
| 756 | |
| 757 | pEntry = csrGetCmdToProcess(pMac, |
| 758 | &pMac->sme.smeCmdPendingList, |
| 759 | pSmeCommand->sessionId, |
| 760 | LL_ACCESS_LOCK); |
| 761 | goto sme_process_cmd; |
| 762 | } |
| 763 | } |
| 764 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 765 | //Peek the command |
| 766 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdPendingList, LL_ACCESS_LOCK ); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 767 | sme_process_cmd: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 768 | if( pEntry ) |
| 769 | { |
| 770 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 771 | |
Abhishek Singh | f4669da | 2014-05-26 15:07:49 +0530 | [diff] [blame] | 772 | /* Allow only disconnect command |
| 773 | * in wait-for-key state until setKey is through. |
| 774 | */ |
| 775 | if( CSR_IS_WAIT_FOR_KEY( pMac, pCommand->sessionId ) && |
| 776 | !CSR_IS_DISCONNECT_COMMAND( pCommand ) ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 777 | { |
| 778 | if( !CSR_IS_SET_KEY_COMMAND( pCommand ) ) |
| 779 | { |
| 780 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Abhishek Singh | f4669da | 2014-05-26 15:07:49 +0530 | [diff] [blame] | 781 | smsLog(pMac, LOGE, FL("SessionId %d: Cannot process " |
| 782 | "command(%d) while waiting for key"), |
| 783 | pCommand->sessionId, pCommand->command); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 784 | fContinue = eANI_BOOLEAN_FALSE; |
| 785 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 786 | } |
| 787 | } |
| 788 | pmcCommand = smeIsFullPowerNeeded( pMac, pCommand ); |
| 789 | if( eSmeDropCommand == pmcCommand ) |
| 790 | { |
| 791 | //This command is not ok for current PMC state |
| 792 | if( csrLLRemoveEntry( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_LOCK ) ) |
| 793 | { |
| 794 | smeAbortCommand( pMac, pCommand, eANI_BOOLEAN_FALSE ); |
| 795 | } |
| 796 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 797 | //tell caller to continue |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 798 | fContinue = eANI_BOOLEAN_TRUE; |
| 799 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 800 | } |
| 801 | else if( eSmeNoCommand != pmcCommand ) |
| 802 | { |
| 803 | tExitBmpsInfo exitBmpsInfo; |
| 804 | void *pv = NULL; |
| 805 | tANI_U32 size = 0; |
| 806 | tSmeCmd *pPmcCmd = NULL; |
| 807 | |
| 808 | if( eSmeCommandExitBmps == pmcCommand ) |
| 809 | { |
| 810 | exitBmpsInfo.exitBmpsReason = eSME_REASON_OTHER; |
| 811 | pv = (void *)&exitBmpsInfo; |
| 812 | size = sizeof(tExitBmpsInfo); |
| 813 | } |
| 814 | //pmcCommand has to be one of the exit power save command |
| 815 | status = pmcPrepareCommand( pMac, pmcCommand, pv, size, &pPmcCmd ); |
| 816 | if( HAL_STATUS_SUCCESS( status ) && pPmcCmd ) |
| 817 | { |
| 818 | //Force this command to wake up the chip |
| 819 | csrLLInsertHead( &pMac->sme.smeCmdActiveList, &pPmcCmd->Link, LL_ACCESS_NOLOCK ); |
| 820 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 821 | fContinue = pmcProcessCommand( pMac, pPmcCmd ); |
| 822 | if( fContinue ) |
| 823 | { |
| 824 | //The command failed, remove it |
| 825 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, &pPmcCmd->Link, LL_ACCESS_NOLOCK ) ) |
| 826 | { |
| 827 | pmcReleaseCommand( pMac, pPmcCmd ); |
| 828 | } |
| 829 | } |
| 830 | } |
| 831 | else |
| 832 | { |
| 833 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 834 | 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] | 835 | //Let it retry |
| 836 | fContinue = eANI_BOOLEAN_TRUE; |
| 837 | } |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 838 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 839 | } |
| 840 | if ( csrLLRemoveEntry( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_LOCK ) ) |
| 841 | { |
| 842 | // we can reuse the pCommand |
| 843 | |
| 844 | // Insert the command onto the ActiveList... |
| 845 | csrLLInsertHead( &pMac->sme.smeCmdActiveList, &pCommand->Link, LL_ACCESS_NOLOCK ); |
| 846 | |
Rashmi Ramanna | 68b309c | 2014-05-20 11:52:22 +0530 | [diff] [blame] | 847 | if( pMac->deferImps ) |
| 848 | { |
| 849 | /* IMPS timer is already running so stop it and |
| 850 | * it will get restarted when no command is pending |
| 851 | */ |
| 852 | csrScanStopIdleScanTimer( pMac ); |
| 853 | pMac->scan.fRestartIdleScan = eANI_BOOLEAN_TRUE; |
| 854 | pMac->deferImps = eANI_BOOLEAN_FALSE; |
| 855 | } |
| 856 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 857 | // .... and process the command. |
| 858 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 859 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 860 | TRACE_CODE_SME_COMMAND, pCommand->sessionId, pCommand->command)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 861 | switch ( pCommand->command ) |
| 862 | { |
| 863 | |
| 864 | case eSmeCommandScan: |
| 865 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 866 | status = csrProcessScanCommand( pMac, pCommand ); |
| 867 | break; |
| 868 | |
| 869 | case eSmeCommandRoam: |
| 870 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 871 | status = csrRoamProcessCommand( pMac, pCommand ); |
Madan Mohan Koyyalamudi | 59efbe0 | 2013-01-10 15:38:42 -0800 | [diff] [blame] | 872 | if(!HAL_STATUS_SUCCESS(status)) |
| 873 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 874 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Madan Mohan Koyyalamudi | 59efbe0 | 2013-01-10 15:38:42 -0800 | [diff] [blame] | 875 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 876 | { |
| 877 | csrReleaseCommandRoam( pMac, pCommand ); |
| 878 | } |
| 879 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 880 | break; |
| 881 | |
| 882 | case eSmeCommandWmStatusChange: |
| 883 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 884 | csrRoamProcessWmStatusChangeCommand(pMac, pCommand); |
| 885 | break; |
| 886 | |
| 887 | case eSmeCommandSetKey: |
| 888 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 889 | status = csrRoamProcessSetKeyCommand( pMac, pCommand ); |
| 890 | if(!HAL_STATUS_SUCCESS(status)) |
| 891 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 892 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 893 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 894 | { |
| 895 | csrReleaseCommandSetKey( pMac, pCommand ); |
| 896 | } |
| 897 | } |
| 898 | break; |
| 899 | |
| 900 | case eSmeCommandRemoveKey: |
| 901 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 902 | status = csrRoamProcessRemoveKeyCommand( pMac, pCommand ); |
| 903 | if(!HAL_STATUS_SUCCESS(status)) |
| 904 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 905 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 906 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 907 | { |
| 908 | csrReleaseCommandRemoveKey( pMac, pCommand ); |
| 909 | } |
| 910 | } |
| 911 | break; |
| 912 | |
| 913 | case eSmeCommandAddStaSession: |
| 914 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 915 | csrProcessAddStaSessionCommand( pMac, pCommand ); |
| 916 | break; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 917 | case eSmeCommandDelStaSession: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 918 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 919 | csrProcessDelStaSessionCommand( pMac, pCommand ); |
| 920 | break; |
Siddharth Bhal | d8a95e8 | 2015-02-12 20:14:52 +0530 | [diff] [blame^] | 921 | case eSmeCommandMacSpoofRequest: |
| 922 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 923 | csrProcessMacAddrSpoofCommand( pMac, pCommand ); |
| 924 | // No Rsp expected, free cmd from active list |
| 925 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 926 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 927 | { |
| 928 | csrReleaseCommand( pMac, pCommand ); |
| 929 | } |
| 930 | |
| 931 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 932 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 933 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 934 | case eSmeCommandOemDataReq: |
| 935 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 936 | oemData_ProcessOemDataReqCommand(pMac, pCommand); |
| 937 | break; |
| 938 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 939 | case eSmeCommandRemainOnChannel: |
| 940 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 941 | p2pProcessRemainOnChannelCmd(pMac, pCommand); |
| 942 | break; |
| 943 | case eSmeCommandNoAUpdate: |
| 944 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 945 | p2pProcessNoAReq(pMac,pCommand); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 946 | case eSmeCommandEnterImps: |
| 947 | case eSmeCommandExitImps: |
| 948 | case eSmeCommandEnterBmps: |
| 949 | case eSmeCommandExitBmps: |
| 950 | case eSmeCommandEnterUapsd: |
| 951 | case eSmeCommandExitUapsd: |
| 952 | case eSmeCommandEnterWowl: |
| 953 | case eSmeCommandExitWowl: |
| 954 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 955 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 956 | if( fContinue ) |
| 957 | { |
| 958 | //The command failed, remove it |
| 959 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 960 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 961 | { |
| 962 | pmcReleaseCommand( pMac, pCommand ); |
| 963 | } |
| 964 | } |
| 965 | break; |
| 966 | |
| 967 | //Treat standby differently here because caller may not be able to handle |
| 968 | //the failure so we do our best here |
| 969 | case eSmeCommandEnterStandby: |
| 970 | if( csrIsConnStateDisconnected( pMac, pCommand->sessionId ) ) |
| 971 | { |
| 972 | //It can continue |
| 973 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 974 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 975 | if( fContinue ) |
| 976 | { |
| 977 | //The command failed, remove it |
| 978 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 979 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 980 | { |
| 981 | pmcReleaseCommand( pMac, pCommand ); |
| 982 | } |
| 983 | } |
| 984 | } |
| 985 | else |
| 986 | { |
| 987 | //Need to issue a disconnect first before processing this command |
| 988 | tSmeCmd *pNewCmd; |
| 989 | |
| 990 | //We need to re-run the command |
| 991 | fContinue = eANI_BOOLEAN_TRUE; |
| 992 | //Pull off the standby command first |
| 993 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 994 | &pCommand->Link, LL_ACCESS_NOLOCK ) ) |
| 995 | { |
| 996 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 997 | //Need to call CSR function here because the disconnect command |
| 998 | //is handled by CSR |
| 999 | pNewCmd = csrGetCommandBuffer( pMac ); |
| 1000 | if( NULL != pNewCmd ) |
| 1001 | { |
| 1002 | //Put the standby command to the head of the pending list first |
| 1003 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pCommand->Link, |
| 1004 | LL_ACCESS_LOCK ); |
| 1005 | pNewCmd->command = eSmeCommandRoam; |
| 1006 | pNewCmd->u.roamCmd.roamReason = eCsrForcedDisassoc; |
| 1007 | //Put the disassoc command before the standby command |
| 1008 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pNewCmd->Link, |
| 1009 | LL_ACCESS_LOCK ); |
| 1010 | } |
| 1011 | else |
| 1012 | { |
| 1013 | //Continue the command here |
| 1014 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 1015 | if( fContinue ) |
| 1016 | { |
| 1017 | //The command failed, remove it |
| 1018 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 1019 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 1020 | { |
| 1021 | pmcReleaseCommand( pMac, pCommand ); |
| 1022 | } |
| 1023 | } |
| 1024 | } |
| 1025 | } |
| 1026 | else |
| 1027 | { |
| 1028 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1029 | smsLog( pMac, LOGE, FL(" failed to remove standby command") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1030 | VOS_ASSERT(0); |
| 1031 | } |
| 1032 | } |
| 1033 | break; |
Hanumantha Reddy Pothula | 28b1e65 | 2015-02-02 21:10:13 +0530 | [diff] [blame] | 1034 | case eSmeCommandPnoReq: |
| 1035 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1036 | status = smeProcessPnoCommand(pMac, pCommand); |
| 1037 | if (!HAL_STATUS_SUCCESS(status)){ |
| 1038 | smsLog(pMac, LOGE, |
| 1039 | FL("failed to post SME PNO SCAN %d"), status); |
| 1040 | } |
| 1041 | if (csrLLRemoveEntry(&pMac->sme.smeCmdActiveList, |
| 1042 | &pCommand->Link, LL_ACCESS_LOCK)) |
| 1043 | { |
| 1044 | csrReleaseCommand(pMac, pCommand); |
| 1045 | } |
| 1046 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1047 | case eSmeCommandAddTs: |
| 1048 | case eSmeCommandDelTs: |
| 1049 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1050 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1051 | fContinue = qosProcessCommand( pMac, pCommand ); |
| 1052 | if( fContinue ) |
| 1053 | { |
| 1054 | //The command failed, remove it |
| 1055 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 1056 | &pCommand->Link, LL_ACCESS_NOLOCK ) ) |
| 1057 | { |
| 1058 | //#ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1059 | qosReleaseCommand( pMac, pCommand ); |
| 1060 | //#endif /* WLAN_MDM_CODE_REDUCTION_OPT*/ |
| 1061 | } |
| 1062 | } |
| 1063 | #endif |
| 1064 | break; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1065 | #ifdef FEATURE_WLAN_TDLS |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1066 | case eSmeCommandTdlsSendMgmt: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1067 | case eSmeCommandTdlsAddPeer: |
| 1068 | case eSmeCommandTdlsDelPeer: |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 1069 | case eSmeCommandTdlsLinkEstablish: |
Atul Mittal | c0f739f | 2014-07-31 13:47:47 +0530 | [diff] [blame] | 1070 | case eSmeCommandTdlsChannelSwitch: // tdlsoffchan |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1071 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 1072 | case eSmeCommandTdlsDiscovery: |
| 1073 | case eSmeCommandTdlsLinkSetup: |
| 1074 | case eSmeCommandTdlsLinkTear: |
| 1075 | case eSmeCommandTdlsEnterUapsd: |
| 1076 | case eSmeCommandTdlsExitUapsd: |
| 1077 | #endif |
| 1078 | { |
Hoonki Lee | 1090c6a | 2013-01-16 17:40:54 -0800 | [diff] [blame] | 1079 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1080 | "sending TDLS Command 0x%x to PE", pCommand->command); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 1081 | |
| 1082 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1083 | status = csrTdlsProcessCmd( pMac, pCommand ); |
| 1084 | } |
| 1085 | break ; |
| 1086 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1087 | |
| 1088 | default: |
| 1089 | //something is wrong |
| 1090 | //remove it from the active list |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1091 | smsLog(pMac, LOGE, " csrProcessCommand processes an unknown command %d", pCommand->command); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1092 | pEntry = csrLLRemoveHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ); |
| 1093 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1094 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 1095 | smeReleaseCommand( pMac, pCommand ); |
| 1096 | status = eHAL_STATUS_FAILURE; |
| 1097 | break; |
| 1098 | } |
| 1099 | if(!HAL_STATUS_SUCCESS(status)) |
| 1100 | { |
| 1101 | fContinue = eANI_BOOLEAN_TRUE; |
| 1102 | } |
| 1103 | }//if(pEntry) |
| 1104 | else |
| 1105 | { |
| 1106 | //This is odd. Some one else pull off the command. |
| 1107 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1108 | } |
| 1109 | } |
| 1110 | else |
| 1111 | { |
| 1112 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1113 | } |
| 1114 | } |
| 1115 | else |
| 1116 | { |
| 1117 | //No command waiting |
| 1118 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1119 | //This is only used to restart an idle mode scan, it means at least one other idle scan has finished. |
| 1120 | if(pMac->scan.fRestartIdleScan && eANI_BOOLEAN_FALSE == pMac->scan.fCancelIdleScan) |
| 1121 | { |
| 1122 | tANI_U32 nTime = 0; |
| 1123 | |
| 1124 | pMac->scan.fRestartIdleScan = eANI_BOOLEAN_FALSE; |
| 1125 | if(!HAL_STATUS_SUCCESS(csrScanTriggerIdleScan(pMac, &nTime))) |
| 1126 | { |
| 1127 | csrScanStartIdleScanTimer(pMac, nTime); |
| 1128 | } |
| 1129 | } |
| 1130 | } |
| 1131 | } |
| 1132 | else { |
| 1133 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1134 | } |
| 1135 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 1136 | sme_process_scan_queue: |
| 1137 | if (pMac->fScanOffload && !(smeProcessScanQueue(pMac))) |
| 1138 | fContinue = eANI_BOOLEAN_FALSE; |
| 1139 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1140 | return ( fContinue ); |
| 1141 | } |
| 1142 | |
| 1143 | void smeProcessPendingQueue( tpAniSirGlobal pMac ) |
| 1144 | { |
| 1145 | while( smeProcessCommand( pMac ) ); |
| 1146 | } |
| 1147 | |
| 1148 | |
| 1149 | tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac) |
| 1150 | { |
| 1151 | return ( !csrLLIsListEmpty( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ) || |
| 1152 | !csrLLIsListEmpty(&pMac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK) ); |
| 1153 | } |
| 1154 | |
| 1155 | |
| 1156 | |
| 1157 | //Global APIs |
| 1158 | |
| 1159 | /*-------------------------------------------------------------------------- |
| 1160 | |
| 1161 | \brief sme_Open() - Initialze all SME modules and put them at idle state |
| 1162 | |
| 1163 | The function initializes each module inside SME, PMC, CCM, CSR, etc. . Upon |
| 1164 | successfully return, all modules are at idle state ready to start. |
| 1165 | |
| 1166 | smeOpen must be called before any other SME APIs can be involved. |
| 1167 | smeOpen must be called after macOpen. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1168 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1169 | \param hHal - The handle returned by macOpen. |
| 1170 | |
| 1171 | \return eHAL_STATUS_SUCCESS - SME is successfully initialized. |
| 1172 | |
| 1173 | Other status means SME is failed to be initialized |
| 1174 | \sa |
| 1175 | |
| 1176 | --------------------------------------------------------------------------*/ |
| 1177 | eHalStatus sme_Open(tHalHandle hHal) |
| 1178 | { |
| 1179 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1180 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1181 | |
| 1182 | do { |
| 1183 | pMac->sme.state = SME_STATE_STOP; |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 1184 | pMac->sme.currDeviceMode = VOS_STA_MODE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1185 | if( !VOS_IS_STATUS_SUCCESS( vos_lock_init( &pMac->sme.lkSmeGlobalLock ) ) ) |
| 1186 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1187 | smsLog( pMac, LOGE, "sme_Open failed init lock" ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1188 | status = eHAL_STATUS_FAILURE; |
| 1189 | break; |
| 1190 | } |
| 1191 | |
| 1192 | status = ccmOpen(hHal); |
| 1193 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1194 | smsLog( pMac, LOGE, |
| 1195 | "ccmOpen failed during initialization with status=%d", status ); |
| 1196 | break; |
| 1197 | } |
| 1198 | |
| 1199 | status = csrOpen(pMac); |
| 1200 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1201 | smsLog( pMac, LOGE, |
| 1202 | "csrOpen failed during initialization with status=%d", status ); |
| 1203 | break; |
| 1204 | } |
| 1205 | |
| 1206 | status = pmcOpen(hHal); |
| 1207 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1208 | smsLog( pMac, LOGE, |
| 1209 | "pmcOpen failed during initialization with status=%d", status ); |
| 1210 | break; |
| 1211 | } |
| 1212 | |
Gopichand Nakkala | 34d1b06 | 2013-03-19 15:28:33 -0700 | [diff] [blame] | 1213 | #ifdef FEATURE_WLAN_TDLS |
| 1214 | pMac->isTdlsPowerSaveProhibited = 0; |
| 1215 | #endif |
| 1216 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1217 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1218 | status = sme_QosOpen(pMac); |
| 1219 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1220 | smsLog( pMac, LOGE, |
| 1221 | "Qos open failed during initialization with status=%d", status ); |
| 1222 | break; |
| 1223 | } |
| 1224 | |
| 1225 | status = btcOpen(pMac); |
| 1226 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1227 | smsLog( pMac, LOGE, |
| 1228 | "btcOpen open failed during initialization with status=%d", status ); |
| 1229 | break; |
| 1230 | } |
| 1231 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1232 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1233 | status = oemData_OemDataReqOpen(pMac); |
| 1234 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1235 | smsLog(pMac, LOGE, |
| 1236 | "oemData_OemDataReqOpen failed during initialization with status=%d", status ); |
| 1237 | break; |
| 1238 | } |
| 1239 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1240 | |
| 1241 | if(!HAL_STATUS_SUCCESS((status = initSmeCmdList(pMac)))) |
| 1242 | break; |
| 1243 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1244 | { |
| 1245 | v_PVOID_t pvosGCtx = vos_get_global_context(VOS_MODULE_ID_SAP, NULL); |
| 1246 | if ( NULL == pvosGCtx ){ |
| 1247 | smsLog( pMac, LOGE, "WLANSAP_Open open failed during initialization"); |
| 1248 | status = eHAL_STATUS_FAILURE; |
| 1249 | break; |
| 1250 | } |
| 1251 | |
| 1252 | status = WLANSAP_Open( pvosGCtx ); |
| 1253 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1254 | smsLog( pMac, LOGE, |
| 1255 | "WLANSAP_Open open failed during initialization with status=%d", status ); |
| 1256 | break; |
| 1257 | } |
| 1258 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1259 | #if defined WLAN_FEATURE_VOWIFI |
| 1260 | status = rrmOpen(pMac); |
| 1261 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1262 | smsLog( pMac, LOGE, |
| 1263 | "rrmOpen open failed during initialization with status=%d", status ); |
| 1264 | break; |
| 1265 | } |
| 1266 | #endif |
| 1267 | |
| 1268 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 1269 | sme_FTOpen(pMac); |
| 1270 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1271 | sme_p2pOpen(pMac); |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1272 | smeTraceInit(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1273 | |
| 1274 | }while (0); |
| 1275 | |
| 1276 | return status; |
| 1277 | } |
| 1278 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1279 | /*-------------------------------------------------------------------------- |
| 1280 | |
| 1281 | \brief sme_set11dinfo() - Set the 11d information about valid channels |
| 1282 | and there power using information from nvRAM |
| 1283 | This function is called only for AP. |
| 1284 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1285 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1286 | |
| 1287 | \param hHal - The handle returned by macOpen. |
| 1288 | \Param pSmeConfigParams - a pointer to a caller allocated object of |
| 1289 | typedef struct _smeConfigParams. |
| 1290 | |
| 1291 | \return eHAL_STATUS_SUCCESS - SME update the config parameters successfully. |
| 1292 | |
| 1293 | Other status means SME is failed to update the config parameters. |
| 1294 | \sa |
| 1295 | --------------------------------------------------------------------------*/ |
| 1296 | |
| 1297 | eHalStatus sme_set11dinfo(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) |
| 1298 | { |
| 1299 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1300 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1301 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1302 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1303 | TRACE_CODE_SME_RX_HDD_MSG_SET_11DINFO, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1304 | if (NULL == pSmeConfigParams ) { |
| 1305 | smsLog( pMac, LOGE, |
| 1306 | "Empty config param structure for SME, nothing to update"); |
| 1307 | return status; |
| 1308 | } |
| 1309 | |
| 1310 | status = csrSetChannels(hHal, &pSmeConfigParams->csrConfig ); |
| 1311 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1312 | smsLog( pMac, LOGE, "csrChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1313 | status ); |
| 1314 | } |
| 1315 | return status; |
| 1316 | } |
| 1317 | |
| 1318 | /*-------------------------------------------------------------------------- |
| 1319 | |
| 1320 | \brief sme_getSoftApDomain() - Get the current regulatory domain of softAp. |
| 1321 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1322 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1323 | |
| 1324 | \param hHal - The handle returned by HostapdAdapter. |
| 1325 | \Param v_REGDOMAIN_t - The current Regulatory Domain requested for SoftAp. |
| 1326 | |
| 1327 | \return eHAL_STATUS_SUCCESS - SME successfully completed the request. |
| 1328 | |
| 1329 | Other status means, failed to get the current regulatory domain. |
| 1330 | \sa |
| 1331 | --------------------------------------------------------------------------*/ |
| 1332 | |
| 1333 | eHalStatus sme_getSoftApDomain(tHalHandle hHal, v_REGDOMAIN_t *domainIdSoftAp) |
| 1334 | { |
| 1335 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1336 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1337 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1338 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1339 | TRACE_CODE_SME_RX_HDD_MSG_GET_SOFTAP_DOMAIN, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1340 | if (NULL == domainIdSoftAp ) { |
| 1341 | smsLog( pMac, LOGE, "Uninitialized domain Id"); |
| 1342 | return status; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1343 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1344 | |
| 1345 | *domainIdSoftAp = pMac->scan.domainIdCurrent; |
| 1346 | status = eHAL_STATUS_SUCCESS; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1347 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1348 | return status; |
| 1349 | } |
| 1350 | |
| 1351 | |
| 1352 | eHalStatus sme_setRegInfo(tHalHandle hHal, tANI_U8 *apCntryCode) |
| 1353 | { |
| 1354 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1355 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1356 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1357 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1358 | TRACE_CODE_SME_RX_HDD_MSG_SET_REGINFO, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1359 | if (NULL == apCntryCode ) { |
| 1360 | smsLog( pMac, LOGE, "Empty Country Code, nothing to update"); |
| 1361 | return status; |
| 1362 | } |
| 1363 | |
| 1364 | status = csrSetRegInfo(hHal, apCntryCode ); |
| 1365 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1366 | smsLog( pMac, LOGE, "csrSetRegInfo failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1367 | status ); |
| 1368 | } |
| 1369 | return status; |
| 1370 | } |
| 1371 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1372 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 1373 | /*-------------------------------------------------------------------------- |
| 1374 | |
| 1375 | \brief sme_UpdateChannelConfig() - Update channel configuration in RIVA. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1376 | |
| 1377 | It is used at driver start up to inform RIVA of the default channel |
| 1378 | configuration. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1379 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1380 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1381 | |
| 1382 | \param hHal - The handle returned by macOpen. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1383 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1384 | \return eHAL_STATUS_SUCCESS - SME update the channel config successfully. |
| 1385 | |
| 1386 | Other status means SME is failed to update the channel config. |
| 1387 | \sa |
| 1388 | |
| 1389 | --------------------------------------------------------------------------*/ |
| 1390 | eHalStatus sme_UpdateChannelConfig(tHalHandle hHal) |
| 1391 | { |
| 1392 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1393 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1394 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1395 | TRACE_CODE_SME_RX_HDD_MSG_UPDATE_CHANNEL_CONFIG, NO_SESSION, 0)); |
| 1396 | pmcUpdateScanParams( pMac, &(pMac->roam.configParam), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1397 | &pMac->scan.base20MHzChannels, FALSE); |
| 1398 | return eHAL_STATUS_SUCCESS; |
| 1399 | } |
| 1400 | #endif // FEATURE_WLAN_SCAN_PNLO |
| 1401 | |
Abhishek Singh | f644b27 | 2014-08-21 02:59:39 +0530 | [diff] [blame] | 1402 | eHalStatus sme_UpdateChannelList(tHalHandle hHal) |
| 1403 | { |
| 1404 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1405 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1406 | |
| 1407 | status = csrUpdateChannelList(pMac); |
| 1408 | |
| 1409 | if (eHAL_STATUS_SUCCESS != status) |
| 1410 | { |
| 1411 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1412 | "failed to update the supported channel list"); |
| 1413 | } |
| 1414 | return status; |
| 1415 | } |
| 1416 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1417 | /*-------------------------------------------------------------------------- |
| 1418 | |
| 1419 | \brief sme_UpdateConfig() - Change configurations for all SME moduels |
| 1420 | |
| 1421 | The function updates some configuration for modules in SME, CCM, CSR, etc |
| 1422 | during SMEs close open sequence. |
| 1423 | |
| 1424 | Modules inside SME apply the new configuration at the next transaction. |
| 1425 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1426 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1427 | |
| 1428 | \param hHal - The handle returned by macOpen. |
| 1429 | \Param pSmeConfigParams - a pointer to a caller allocated object of |
| 1430 | typedef struct _smeConfigParams. |
| 1431 | |
| 1432 | \return eHAL_STATUS_SUCCESS - SME update the config parameters successfully. |
| 1433 | |
| 1434 | Other status means SME is failed to update the config parameters. |
| 1435 | \sa |
| 1436 | |
| 1437 | --------------------------------------------------------------------------*/ |
| 1438 | eHalStatus sme_UpdateConfig(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) |
| 1439 | { |
| 1440 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1441 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1442 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1443 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1444 | TRACE_CODE_SME_RX_HDD_MSG_UPDATE_CONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1445 | if (NULL == pSmeConfigParams ) { |
| 1446 | smsLog( pMac, LOGE, |
| 1447 | "Empty config param structure for SME, nothing to update"); |
| 1448 | return status; |
| 1449 | } |
| 1450 | |
| 1451 | status = csrChangeDefaultConfigParam(pMac, &pSmeConfigParams->csrConfig); |
| 1452 | |
| 1453 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1454 | smsLog( pMac, LOGE, "csrChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1455 | status ); |
| 1456 | } |
| 1457 | #if defined WLAN_FEATURE_P2P_INTERNAL |
| 1458 | status = p2pChangeDefaultConfigParam(pMac, &pSmeConfigParams->p2pConfig); |
| 1459 | |
| 1460 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1461 | smsLog( pMac, LOGE, "p2pChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1462 | status ); |
| 1463 | } |
| 1464 | #endif |
| 1465 | #if defined WLAN_FEATURE_VOWIFI |
| 1466 | status = rrmChangeDefaultConfigParam(hHal, &pSmeConfigParams->rrmConfig); |
| 1467 | |
| 1468 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1469 | smsLog( pMac, LOGE, "rrmChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1470 | status ); |
| 1471 | } |
| 1472 | #endif |
| 1473 | //For SOC, CFG is set before start |
| 1474 | //We don't want to apply global CFG in connect state because that may cause some side affect |
| 1475 | if( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1476 | csrIsAllSessionDisconnected( pMac) ) |
| 1477 | { |
| 1478 | csrSetGlobalCfgs(pMac); |
| 1479 | } |
| 1480 | |
Gopichand Nakkala | 86e4266 | 2013-06-11 17:44:11 +0530 | [diff] [blame] | 1481 | /* update the directed scan offload setting */ |
| 1482 | pMac->fScanOffload = pSmeConfigParams->fScanOffload; |
| 1483 | |
Madan Mohan Koyyalamudi | d89feb7 | 2013-07-31 15:47:12 +0530 | [diff] [blame] | 1484 | if (pMac->fScanOffload) |
| 1485 | { |
| 1486 | /* If scan offload is enabled then lim has allow the sending of |
| 1487 | scan request to firmware even in powersave mode. The firmware has |
| 1488 | to take care of exiting from power save mode */ |
| 1489 | status = ccmCfgSetInt(hHal, WNI_CFG_SCAN_IN_POWERSAVE, |
| 1490 | eANI_BOOLEAN_TRUE, NULL, eANI_BOOLEAN_FALSE); |
| 1491 | |
| 1492 | if (eHAL_STATUS_SUCCESS != status) |
| 1493 | { |
| 1494 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1495 | "Could not pass on WNI_CFG_SCAN_IN_POWERSAVE to CCM"); |
| 1496 | } |
| 1497 | } |
krunal soni | e9002db | 2013-11-25 14:24:17 -0800 | [diff] [blame] | 1498 | pMac->isCoalesingInIBSSAllowed = |
| 1499 | pSmeConfigParams->csrConfig.isCoalesingInIBSSAllowed; |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 1500 | pMac->fEnableDebugLog = pSmeConfigParams->fEnableDebugLog; |
Rashmi Ramanna | 68b309c | 2014-05-20 11:52:22 +0530 | [diff] [blame] | 1501 | pMac->fDeferIMPSTime = pSmeConfigParams->fDeferIMPSTime; |
Chandrasekaran, Manishekar | 5cb0acd | 2014-12-23 20:06:52 +0530 | [diff] [blame] | 1502 | pMac->fBtcEnableIndTimerVal = pSmeConfigParams->fBtcEnableIndTimerVal; |
Rashmi Ramanna | 68b309c | 2014-05-20 11:52:22 +0530 | [diff] [blame] | 1503 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1504 | return status; |
| 1505 | } |
| 1506 | |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 1507 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 1508 | void sme_ProcessGetGtkInfoRsp( tHalHandle hHal, |
| 1509 | tpSirGtkOffloadGetInfoRspParams pGtkOffloadGetInfoRsp) |
| 1510 | { |
| 1511 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1512 | |
| 1513 | if (NULL == pMac) |
| 1514 | { |
| 1515 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 1516 | "%s: pMac is null", __func__); |
| 1517 | return ; |
| 1518 | } |
| 1519 | if (pMac->pmc.GtkOffloadGetInfoCB == NULL) |
| 1520 | { |
| 1521 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1522 | "%s: HDD callback is null", __func__); |
| 1523 | return ; |
| 1524 | } |
| 1525 | pMac->pmc.GtkOffloadGetInfoCB(pMac->pmc.GtkOffloadGetInfoCBContext, |
| 1526 | pGtkOffloadGetInfoRsp); |
| 1527 | } |
| 1528 | #endif |
| 1529 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1530 | /* --------------------------------------------------------------------------- |
| 1531 | \fn sme_ChangeConfigParams |
| 1532 | \brief The SME API exposed for HDD to provide config params to SME during |
| 1533 | SMEs stop -> start sequence. |
| 1534 | |
| 1535 | If HDD changed the domain that will cause a reset. This function will |
| 1536 | provide the new set of 11d information for the new domain. Currrently this |
| 1537 | API provides info regarding 11d only at reset but we can extend this for |
| 1538 | other params (PMC, QoS) which needs to be initialized again at reset. |
| 1539 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1540 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1541 | |
| 1542 | \param hHal - The handle returned by macOpen. |
| 1543 | |
| 1544 | \Param |
| 1545 | pUpdateConfigParam - a pointer to a structure (tCsrUpdateConfigParam) that |
| 1546 | currently provides 11d related information like Country code, |
| 1547 | Regulatory domain, valid channel list, Tx power per channel, a |
| 1548 | list with active/passive scan allowed per valid channel. |
| 1549 | |
| 1550 | \return eHalStatus |
| 1551 | ---------------------------------------------------------------------------*/ |
| 1552 | eHalStatus sme_ChangeConfigParams(tHalHandle hHal, |
| 1553 | tCsrUpdateConfigParam *pUpdateConfigParam) |
| 1554 | { |
| 1555 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1556 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1557 | |
| 1558 | if (NULL == pUpdateConfigParam ) { |
| 1559 | smsLog( pMac, LOGE, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1560 | "Empty config param structure for SME, nothing to reset"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1561 | return status; |
| 1562 | } |
| 1563 | |
| 1564 | status = csrChangeConfigParams(pMac, pUpdateConfigParam); |
| 1565 | |
| 1566 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1567 | smsLog( pMac, LOGE, "csrUpdateConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1568 | status ); |
| 1569 | } |
| 1570 | |
| 1571 | return status; |
| 1572 | |
| 1573 | } |
| 1574 | |
| 1575 | /*-------------------------------------------------------------------------- |
| 1576 | |
| 1577 | \brief sme_HDDReadyInd() - SME sends eWNI_SME_SYS_READY_IND to PE to inform |
| 1578 | that the NIC is ready tio run. |
| 1579 | |
| 1580 | The function is called by HDD at the end of initialization stage so PE/HAL can |
| 1581 | enable the NIC to running state. |
| 1582 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1583 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1584 | \param hHal - The handle returned by macOpen. |
| 1585 | |
| 1586 | \return eHAL_STATUS_SUCCESS - eWNI_SME_SYS_READY_IND is sent to PE |
| 1587 | successfully. |
| 1588 | |
| 1589 | Other status means SME failed to send the message to PE. |
| 1590 | \sa |
| 1591 | |
| 1592 | --------------------------------------------------------------------------*/ |
| 1593 | eHalStatus sme_HDDReadyInd(tHalHandle hHal) |
| 1594 | { |
| 1595 | tSirSmeReadyReq Msg; |
| 1596 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1597 | tPmcPowerState powerState; |
| 1598 | tPmcSwitchState hwWlanSwitchState; |
| 1599 | tPmcSwitchState swWlanSwitchState; |
| 1600 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1601 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1602 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1603 | TRACE_CODE_SME_RX_HDD_MSG_HDDREADYIND, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1604 | do |
| 1605 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1606 | |
| 1607 | Msg.messageType = eWNI_SME_SYS_READY_IND; |
| 1608 | Msg.length = sizeof( tSirSmeReadyReq ); |
| 1609 | |
| 1610 | if (eSIR_FAILURE != uMacPostCtrlMsg( hHal, (tSirMbMsg*)&Msg )) |
| 1611 | { |
| 1612 | status = eHAL_STATUS_SUCCESS; |
| 1613 | } |
| 1614 | else |
| 1615 | { |
| 1616 | smsLog( pMac, LOGE, |
| 1617 | "uMacPostCtrlMsg failed to send eWNI_SME_SYS_READY_IND"); |
| 1618 | break; |
| 1619 | } |
| 1620 | |
| 1621 | status = pmcQueryPowerState( hHal, &powerState, |
| 1622 | &hwWlanSwitchState, &swWlanSwitchState ); |
| 1623 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1624 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1625 | smsLog( pMac, LOGE, "pmcQueryPowerState failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1626 | status ); |
| 1627 | break; |
| 1628 | } |
| 1629 | |
| 1630 | if ( (ePMC_SWITCH_OFF != hwWlanSwitchState) && |
| 1631 | (ePMC_SWITCH_OFF != swWlanSwitchState) ) |
| 1632 | { |
| 1633 | status = csrReady(pMac); |
| 1634 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1635 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1636 | smsLog( pMac, LOGE, "csrReady failed with status=%d", status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1637 | break; |
| 1638 | } |
| 1639 | status = pmcReady(hHal); |
| 1640 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1641 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1642 | smsLog( pMac, LOGE, "pmcReady failed with status=%d", status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1643 | break; |
| 1644 | } |
| 1645 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1646 | if(VOS_STATUS_SUCCESS != btcReady(hHal)) |
| 1647 | { |
| 1648 | status = eHAL_STATUS_FAILURE; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1649 | smsLog( pMac, LOGE, "btcReady failed"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1650 | break; |
| 1651 | } |
| 1652 | #endif |
| 1653 | |
| 1654 | #if defined WLAN_FEATURE_VOWIFI |
| 1655 | if(VOS_STATUS_SUCCESS != rrmReady(hHal)) |
| 1656 | { |
| 1657 | status = eHAL_STATUS_FAILURE; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1658 | smsLog( pMac, LOGE, "rrmReady failed"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1659 | break; |
| 1660 | } |
| 1661 | #endif |
| 1662 | } |
| 1663 | pMac->sme.state = SME_STATE_READY; |
| 1664 | } while( 0 ); |
| 1665 | |
| 1666 | return status; |
| 1667 | } |
| 1668 | |
| 1669 | /*-------------------------------------------------------------------------- |
| 1670 | |
| 1671 | \brief sme_Start() - Put all SME modules at ready state. |
| 1672 | |
| 1673 | The function starts each module in SME, PMC, CCM, CSR, etc. . Upon |
| 1674 | successfully return, all modules are ready to run. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1675 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1676 | \param hHal - The handle returned by macOpen. |
| 1677 | |
| 1678 | \return eHAL_STATUS_SUCCESS - SME is ready. |
| 1679 | |
| 1680 | Other status means SME is failed to start |
| 1681 | \sa |
| 1682 | |
| 1683 | --------------------------------------------------------------------------*/ |
| 1684 | eHalStatus sme_Start(tHalHandle hHal) |
| 1685 | { |
| 1686 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1687 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1688 | |
| 1689 | do |
| 1690 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1691 | status = csrStart(pMac); |
| 1692 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1693 | smsLog( pMac, LOGE, "csrStart failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1694 | status ); |
| 1695 | break; |
| 1696 | } |
| 1697 | |
| 1698 | status = pmcStart(hHal); |
| 1699 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1700 | smsLog( pMac, LOGE, "pmcStart failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1701 | status ); |
| 1702 | break; |
| 1703 | } |
| 1704 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1705 | status = WLANSAP_Start(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 1706 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1707 | smsLog( pMac, LOGE, "WLANSAP_Start failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1708 | status ); |
| 1709 | break; |
| 1710 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1711 | pMac->sme.state = SME_STATE_START; |
| 1712 | }while (0); |
| 1713 | |
| 1714 | return status; |
| 1715 | } |
| 1716 | |
| 1717 | |
| 1718 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 1719 | /****************************************************************************** |
| 1720 | * |
| 1721 | * Name: sme_PCFilterMatchCountResponseHandler |
| 1722 | * |
| 1723 | * Description: |
| 1724 | * Invoke Packet Coalescing Filter Match Count callback routine |
| 1725 | * |
| 1726 | * Parameters: |
| 1727 | * hHal - HAL handle for device |
| 1728 | * pMsg - Pointer to tRcvFltPktMatchRsp structure |
| 1729 | * |
| 1730 | * Returns: eHalStatus |
| 1731 | * |
| 1732 | ******************************************************************************/ |
| 1733 | eHalStatus sme_PCFilterMatchCountResponseHandler(tHalHandle hHal, void* pMsg) |
| 1734 | { |
| 1735 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 1736 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1737 | tpSirRcvFltPktMatchRsp pRcvFltPktMatchRsp = (tpSirRcvFltPktMatchRsp)pMsg; |
| 1738 | |
| 1739 | if (NULL == pMsg) |
| 1740 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1741 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1742 | status = eHAL_STATUS_FAILURE; |
| 1743 | } |
| 1744 | else |
| 1745 | { |
| 1746 | smsLog(pMac, LOG2, "SME: entering " |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1747 | "sme_FilterMatchCountResponseHandler"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1748 | |
| 1749 | /* Call Packet Coalescing Filter Match Count callback routine. */ |
| 1750 | if (pMac->pmc.FilterMatchCountCB != NULL) |
| 1751 | pMac->pmc.FilterMatchCountCB(pMac->pmc.FilterMatchCountCBContext, |
| 1752 | pRcvFltPktMatchRsp); |
| 1753 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1754 | smsLog(pMac, LOG1, "%s: status=0x%x", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1755 | pRcvFltPktMatchRsp->status); |
| 1756 | |
| 1757 | pMac->pmc.FilterMatchCountCB = NULL; |
| 1758 | pMac->pmc.FilterMatchCountCBContext = NULL; |
| 1759 | } |
| 1760 | |
| 1761 | return(status); |
| 1762 | } |
| 1763 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 1764 | |
| 1765 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1766 | #ifdef WLAN_FEATURE_11W |
| 1767 | /*------------------------------------------------------------------ |
| 1768 | * |
| 1769 | * Handle the unprotected management frame indication from LIM and |
| 1770 | * forward it to HDD. |
| 1771 | * |
| 1772 | *------------------------------------------------------------------*/ |
| 1773 | |
| 1774 | eHalStatus sme_UnprotectedMgmtFrmInd( tHalHandle hHal, |
| 1775 | tpSirSmeUnprotMgmtFrameInd pSmeMgmtFrm) |
| 1776 | { |
| 1777 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1778 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1779 | tCsrRoamInfo pRoamInfo = {0}; |
| 1780 | tANI_U32 SessionId = pSmeMgmtFrm->sessionId; |
| 1781 | |
| 1782 | pRoamInfo.nFrameLength = pSmeMgmtFrm->frameLen; |
| 1783 | pRoamInfo.pbFrames = pSmeMgmtFrm->frameBuf; |
| 1784 | pRoamInfo.frameType = pSmeMgmtFrm->frameType; |
| 1785 | |
| 1786 | /* forward the mgmt frame to HDD */ |
| 1787 | csrRoamCallCallback(pMac, SessionId, &pRoamInfo, 0, eCSR_ROAM_UNPROT_MGMT_FRAME_IND, 0); |
| 1788 | |
| 1789 | return status; |
| 1790 | } |
| 1791 | #endif |
| 1792 | |
Hardik Kantilal Patel | 81f7634 | 2014-11-14 12:45:26 -0800 | [diff] [blame] | 1793 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 1794 | /* --------------------------------------------------------------------------- |
| 1795 | \fn sme_HT2040CoexInfoInd |
| 1796 | \brief a Send 20/40 Coex info to SAP layer |
| 1797 | |
| 1798 | \param tpSirHT2040CoexInfoInd - 20/40 Coex info param |
| 1799 | \return eHalStatus |
| 1800 | ---------------------------------------------------------------------------*/ |
| 1801 | |
| 1802 | eHalStatus sme_HT2040CoexInfoInd( tHalHandle hHal, |
| 1803 | tpSirHT2040CoexInfoInd pSmeHT2040CoexInfoInd) |
| 1804 | { |
| 1805 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1806 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1807 | tANI_U32 SessionId = pSmeHT2040CoexInfoInd->sessionId; |
| 1808 | tCsrRoamInfo roamInfo = {0}; |
| 1809 | |
| 1810 | roamInfo.pSmeHT2040CoexInfoInd = pSmeHT2040CoexInfoInd; |
| 1811 | |
| 1812 | smsLog(pMac, LOGW, FL("HT40MHzIntolerant: %d HT20MHzBssWidthReq: %d"), |
| 1813 | roamInfo.pSmeHT2040CoexInfoInd->HT40MHzIntolerant, |
| 1814 | roamInfo.pSmeHT2040CoexInfoInd->HT20MHzBssWidthReq); |
| 1815 | |
| 1816 | smsLog(pMac, LOGW, FL("Total Intolerant Channel: %d"), |
| 1817 | roamInfo.pSmeHT2040CoexInfoInd->channel_num); |
| 1818 | |
| 1819 | /* forward the 20/40 BSS Coex information to HDD */ |
| 1820 | smsLog(pMac, LOGW, FL("Sending eCSR_ROAM_2040_COEX_INFO_IND" |
| 1821 | " to WLANSAP_RoamCallback ")); |
| 1822 | |
| 1823 | csrRoamCallCallback(pMac, SessionId, &roamInfo, |
| 1824 | 0, eCSR_ROAM_2040_COEX_INFO_IND, 0); |
| 1825 | return status; |
| 1826 | } |
| 1827 | #endif |
| 1828 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1829 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1830 | /*------------------------------------------------------------------ |
| 1831 | * |
| 1832 | * Handle the tsm ie indication from LIM and forward it to HDD. |
| 1833 | * |
| 1834 | *------------------------------------------------------------------*/ |
| 1835 | |
| 1836 | eHalStatus sme_TsmIeInd(tHalHandle hHal, tSirSmeTsmIEInd *pSmeTsmIeInd) |
| 1837 | { |
| 1838 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1839 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1840 | tCsrRoamInfo pRoamInfo = {0}; |
| 1841 | tANI_U32 SessionId = pSmeTsmIeInd->sessionId; |
| 1842 | |
| 1843 | pRoamInfo.tsmIe.tsid= pSmeTsmIeInd->tsmIe.tsid; |
| 1844 | pRoamInfo.tsmIe.state= pSmeTsmIeInd->tsmIe.state; |
| 1845 | pRoamInfo.tsmIe.msmt_interval= pSmeTsmIeInd->tsmIe.msmt_interval; |
| 1846 | |
| 1847 | /* forward the tsm ie information to HDD */ |
| 1848 | csrRoamCallCallback(pMac, SessionId, &pRoamInfo, 0, eCSR_ROAM_TSM_IE_IND, 0); |
| 1849 | |
| 1850 | return status; |
| 1851 | } |
| 1852 | |
| 1853 | /* --------------------------------------------------------------------------- |
| 1854 | \fn sme_SetCCKMIe |
| 1855 | \brief function to store the CCKM IE passed from supplicant and use it while packing |
| 1856 | reassociation request |
| 1857 | \param hHal - HAL handle for device |
| 1858 | \param pCckmIe - pointer to CCKM IE data |
| 1859 | \param pCckmIeLen - length of the CCKM IE |
| 1860 | \- return Success or failure |
| 1861 | -------------------------------------------------------------------------*/ |
| 1862 | eHalStatus sme_SetCCKMIe(tHalHandle hHal, tANI_U8 sessionId, |
| 1863 | tANI_U8 *pCckmIe, tANI_U8 cckmIeLen) |
| 1864 | { |
| 1865 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1866 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1867 | |
| 1868 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 1869 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 1870 | { |
| 1871 | csrSetCCKMIe(pMac, sessionId, pCckmIe, cckmIeLen); |
| 1872 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 1873 | } |
| 1874 | return status; |
| 1875 | } |
| 1876 | |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1877 | /* --------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1878 | \fn sme_SetEseBeaconRequest |
| 1879 | \brief function to set Ese beacon request parameters |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1880 | \param hHal - HAL handle for device |
| 1881 | \param sessionId - Session id |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1882 | \param pEseBcnReq - pointer to Ese beacon request |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1883 | \- return Success or failure |
| 1884 | -------------------------------------------------------------------------*/ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1885 | eHalStatus sme_SetEseBeaconRequest(tHalHandle hHal, const tANI_U8 sessionId, |
| 1886 | const tCsrEseBeaconReq* pEseBcnReq) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1887 | { |
| 1888 | eHalStatus status = eSIR_SUCCESS; |
| 1889 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1890 | tpSirBeaconReportReqInd pSmeBcnReportReq = NULL; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1891 | tCsrEseBeaconReqParams *pBeaconReq = NULL; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1892 | tANI_U8 counter = 0; |
| 1893 | tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); |
| 1894 | tpRrmSMEContext pSmeRrmContext = &pMac->rrm.rrmSmeContext; |
| 1895 | |
| 1896 | /* Store the info in RRM context */ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1897 | vos_mem_copy(&pSmeRrmContext->eseBcnReqInfo, pEseBcnReq, sizeof(tCsrEseBeaconReq)); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1898 | |
| 1899 | //Prepare the request to send to SME. |
| 1900 | pSmeBcnReportReq = vos_mem_malloc(sizeof( tSirBeaconReportReqInd )); |
| 1901 | if(NULL == pSmeBcnReportReq) |
| 1902 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1903 | smsLog(pMac, LOGP, "Memory Allocation Failure!!! Ese BcnReq Ind to SME"); |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1904 | return eSIR_FAILURE; |
| 1905 | } |
| 1906 | |
| 1907 | smsLog(pMac, LOGE, "Sending Beacon Report Req to SME"); |
| 1908 | vos_mem_zero( pSmeBcnReportReq, sizeof( tSirBeaconReportReqInd )); |
| 1909 | |
| 1910 | pSmeBcnReportReq->messageType = eWNI_SME_BEACON_REPORT_REQ_IND; |
| 1911 | pSmeBcnReportReq->length = sizeof( tSirBeaconReportReqInd ); |
| 1912 | vos_mem_copy( pSmeBcnReportReq->bssId, pSession->connectedProfile.bssid, sizeof(tSirMacAddr) ); |
| 1913 | pSmeBcnReportReq->channelInfo.channelNum = 255; |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1914 | pSmeBcnReportReq->channelList.numChannels = pEseBcnReq->numBcnReqIe; |
| 1915 | pSmeBcnReportReq->msgSource = eRRM_MSG_SOURCE_ESE_UPLOAD; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1916 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1917 | for (counter = 0; counter < pEseBcnReq->numBcnReqIe; counter++) |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1918 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1919 | pBeaconReq = (tCsrEseBeaconReqParams *)&pEseBcnReq->bcnReq[counter]; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1920 | pSmeBcnReportReq->fMeasurementtype[counter] = pBeaconReq->scanMode; |
| 1921 | pSmeBcnReportReq->measurementDuration[counter] = SYS_TU_TO_MS(pBeaconReq->measurementDuration); |
| 1922 | pSmeBcnReportReq->channelList.channelNumber[counter] = pBeaconReq->channel; |
| 1923 | } |
| 1924 | |
| 1925 | sme_RrmProcessBeaconReportReqInd(pMac, pSmeBcnReportReq); |
| 1926 | return status; |
| 1927 | } |
| 1928 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 1929 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1930 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1931 | |
c_hpothu | 9236791 | 2014-05-01 15:18:17 +0530 | [diff] [blame] | 1932 | /* --------------------------------------------------------------------------- |
| 1933 | \fn sme_getBcnMissRate |
| 1934 | \brief function sends 'WDA_GET_BCN_MISS_RATE_REQ' to WDA layer, |
| 1935 | \param hHal - HAL handle for device. |
| 1936 | \param sessionId - session ID. |
| 1937 | \- return Success or Failure. |
| 1938 | -------------------------------------------------------------------------*/ |
| 1939 | |
| 1940 | eHalStatus sme_getBcnMissRate(tHalHandle hHal, tANI_U8 sessionId, void *callback, void *data) |
| 1941 | { |
| 1942 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1943 | VOS_STATUS vosStatus = VOS_STATUS_E_FAILURE; |
| 1944 | vos_msg_t vosMessage; |
| 1945 | tSirBcnMissRateReq *pMsg; |
| 1946 | tCsrRoamSession *pSession; |
| 1947 | |
| 1948 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 1949 | { |
| 1950 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 1951 | |
| 1952 | if (!pSession) |
| 1953 | { |
| 1954 | smsLog(pMac, LOGE, FL("session %d not found"), sessionId); |
| 1955 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 1956 | return eHAL_STATUS_FAILURE; |
| 1957 | } |
| 1958 | |
c_hpothu | 402de81 | 2014-07-10 15:55:45 +0530 | [diff] [blame] | 1959 | pMsg = (tSirBcnMissRateReq *) vos_mem_malloc(sizeof(tSirBcnMissRateReq)); |
c_hpothu | 9236791 | 2014-05-01 15:18:17 +0530 | [diff] [blame] | 1960 | if (NULL == pMsg) |
| 1961 | { |
| 1962 | smsLog(pMac, LOGE, FL("failed to allocated memory")); |
| 1963 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 1964 | return eHAL_STATUS_FAILURE; |
| 1965 | } |
| 1966 | |
| 1967 | vos_mem_copy(pMsg->bssid, pSession->connectedProfile.bssid, |
| 1968 | sizeof(tSirMacAddr)); |
| 1969 | |
| 1970 | pMsg->msgLen = sizeof(tSirBcnMissRateReq); |
| 1971 | pMsg->callback = callback; |
| 1972 | pMsg->data = data; |
| 1973 | |
| 1974 | vosMessage.type = WDA_GET_BCN_MISS_RATE_REQ; |
| 1975 | vosMessage.bodyptr = pMsg; |
| 1976 | vosMessage.reserved = 0; |
| 1977 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 1978 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 1979 | { |
| 1980 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1981 | "%s: Post Set TM Level MSG fail", __func__); |
| 1982 | vos_mem_free(pMsg); |
| 1983 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 1984 | return eHAL_STATUS_FAILURE; |
| 1985 | } |
| 1986 | sme_ReleaseGlobalLock( &pMac->sme); |
| 1987 | return eHAL_STATUS_SUCCESS; |
| 1988 | } |
| 1989 | return eHAL_STATUS_FAILURE; |
| 1990 | } |
| 1991 | |
Srinivas Dasari | b8fdd42 | 2014-11-27 10:44:20 +0530 | [diff] [blame] | 1992 | eHalStatus sme_EncryptMsgResponseHandler(tHalHandle hHal, |
| 1993 | tpSirEncryptedDataRspParams pEncRspParams) |
| 1994 | { |
| 1995 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1996 | |
| 1997 | if (NULL == pMac) |
| 1998 | { |
| 1999 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 2000 | "%s: pMac is null", __func__); |
| 2001 | return eHAL_STATUS_FAILURE; |
| 2002 | } |
| 2003 | if (pMac->sme.pEncMsgInfoParams.pEncMsgCbk == NULL) |
| 2004 | { |
| 2005 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 2006 | "%s: HDD callback is null", __func__); |
| 2007 | return eHAL_STATUS_FAILURE; |
| 2008 | } |
| 2009 | pMac->sme.pEncMsgInfoParams.pEncMsgCbk(pMac->sme.pEncMsgInfoParams.pUserData, |
| 2010 | &pEncRspParams->encryptedDataRsp); |
| 2011 | return eHAL_STATUS_SUCCESS; |
| 2012 | } |
| 2013 | |
Girish Gowli | a95daca | 2015-02-04 20:31:31 +0530 | [diff] [blame] | 2014 | eHalStatus sme_UpdateMaxRateInd(tHalHandle hHal, |
| 2015 | tSirSmeUpdateMaxRateParams *pSmeUpdateMaxRateParams) |
| 2016 | { |
| 2017 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2018 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2019 | tANI_U8 sessionId = pSmeUpdateMaxRateParams->smeSessionId; |
| 2020 | |
| 2021 | /* forward the information to HDD */ |
| 2022 | status = csrRoamCallCallback(pMac, sessionId, NULL, 0, |
| 2023 | eCSR_ROAM_UPDATE_MAX_RATE_IND, |
| 2024 | pSmeUpdateMaxRateParams->maxRateFlag); |
| 2025 | return status; |
| 2026 | } |
| 2027 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2028 | /*-------------------------------------------------------------------------- |
| 2029 | |
| 2030 | \brief sme_ProcessMsg() - The main message processor for SME. |
| 2031 | |
| 2032 | The function is called by a message dispatcher when to process a message |
| 2033 | targeted for SME. |
| 2034 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2035 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2036 | \param hHal - The handle returned by macOpen. |
| 2037 | \param pMsg - A pointer to a caller allocated object of tSirMsgQ. |
| 2038 | |
| 2039 | \return eHAL_STATUS_SUCCESS - SME successfully process the message. |
| 2040 | |
| 2041 | Other status means SME failed to process the message to HAL. |
| 2042 | \sa |
| 2043 | |
| 2044 | --------------------------------------------------------------------------*/ |
| 2045 | eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) |
| 2046 | { |
| 2047 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2048 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2049 | |
| 2050 | if (pMsg == NULL) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2051 | smsLog( pMac, LOGE, "Empty message for SME, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2052 | return status; |
| 2053 | } |
| 2054 | |
| 2055 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2056 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2057 | { |
| 2058 | if( SME_IS_START(pMac) ) |
| 2059 | { |
| 2060 | switch (pMsg->type) { // TODO: Will be modified to do a range check for msgs instead of having cases for each msgs |
| 2061 | case eWNI_PMC_ENTER_BMPS_RSP: |
| 2062 | case eWNI_PMC_EXIT_BMPS_RSP: |
| 2063 | case eWNI_PMC_EXIT_BMPS_IND: |
| 2064 | case eWNI_PMC_ENTER_IMPS_RSP: |
| 2065 | case eWNI_PMC_EXIT_IMPS_RSP: |
| 2066 | case eWNI_PMC_SMPS_STATE_IND: |
| 2067 | case eWNI_PMC_ENTER_UAPSD_RSP: |
| 2068 | case eWNI_PMC_EXIT_UAPSD_RSP: |
| 2069 | case eWNI_PMC_ENTER_WOWL_RSP: |
| 2070 | case eWNI_PMC_EXIT_WOWL_RSP: |
| 2071 | //PMC |
| 2072 | if (pMsg->bodyptr) |
| 2073 | { |
| 2074 | pmcMessageProcessor(hHal, pMsg->bodyptr); |
| 2075 | status = eHAL_STATUS_SUCCESS; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2076 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2077 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2078 | smsLog( pMac, LOGE, "Empty rsp message for PMC, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2079 | } |
| 2080 | break; |
| 2081 | |
| 2082 | case WNI_CFG_SET_CNF: |
| 2083 | case WNI_CFG_DNLD_CNF: |
| 2084 | case WNI_CFG_GET_RSP: |
| 2085 | case WNI_CFG_ADD_GRP_ADDR_CNF: |
| 2086 | case WNI_CFG_DEL_GRP_ADDR_CNF: |
| 2087 | //CCM |
| 2088 | if (pMsg->bodyptr) |
| 2089 | { |
| 2090 | ccmCfgCnfMsgHandler(hHal, pMsg->bodyptr); |
| 2091 | status = eHAL_STATUS_SUCCESS; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2092 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2093 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2094 | smsLog( pMac, LOGE, "Empty rsp message for CCM, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2095 | } |
| 2096 | break; |
| 2097 | |
| 2098 | case eWNI_SME_ADDTS_RSP: |
| 2099 | case eWNI_SME_DELTS_RSP: |
| 2100 | case eWNI_SME_DELTS_IND: |
| 2101 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 2102 | case eWNI_SME_FT_AGGR_QOS_RSP: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2103 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2104 | //QoS |
| 2105 | if (pMsg->bodyptr) |
| 2106 | { |
| 2107 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 2108 | status = sme_QosMsgProcessor(pMac, pMsg->type, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2109 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2110 | #endif |
| 2111 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2112 | smsLog( pMac, LOGE, "Empty rsp message for QoS, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2113 | } |
| 2114 | break; |
| 2115 | #if defined WLAN_FEATURE_VOWIFI |
| 2116 | case eWNI_SME_NEIGHBOR_REPORT_IND: |
| 2117 | case eWNI_SME_BEACON_REPORT_REQ_IND: |
| 2118 | #if defined WLAN_VOWIFI_DEBUG |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2119 | smsLog( pMac, LOGE, "Received RRM message. Message Id = %d", pMsg->type ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2120 | #endif |
| 2121 | if ( pMsg->bodyptr ) |
| 2122 | { |
| 2123 | status = sme_RrmMsgProcessor( pMac, pMsg->type, pMsg->bodyptr ); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2124 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2125 | } |
| 2126 | else |
| 2127 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2128 | smsLog( pMac, LOGE, "Empty message for RRM, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2129 | } |
| 2130 | break; |
| 2131 | #endif |
| 2132 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2133 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 2134 | //Handle the eWNI_SME_OEM_DATA_RSP: |
| 2135 | case eWNI_SME_OEM_DATA_RSP: |
| 2136 | if(pMsg->bodyptr) |
| 2137 | { |
| 2138 | status = sme_HandleOemDataRsp(pMac, pMsg->bodyptr); |
| 2139 | vos_mem_free(pMsg->bodyptr); |
| 2140 | } |
| 2141 | else |
| 2142 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2143 | 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] | 2144 | } |
| 2145 | smeProcessPendingQueue( pMac ); |
| 2146 | break; |
| 2147 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2148 | |
| 2149 | case eWNI_SME_ADD_STA_SELF_RSP: |
| 2150 | if(pMsg->bodyptr) |
| 2151 | { |
| 2152 | status = csrProcessAddStaSessionRsp(pMac, pMsg->bodyptr); |
| 2153 | vos_mem_free(pMsg->bodyptr); |
| 2154 | } |
| 2155 | else |
| 2156 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2157 | smsLog( pMac, LOGE, "Empty rsp message for meas (eWNI_SME_ADD_STA_SELF_RSP), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2158 | } |
| 2159 | break; |
| 2160 | case eWNI_SME_DEL_STA_SELF_RSP: |
| 2161 | if(pMsg->bodyptr) |
| 2162 | { |
| 2163 | status = csrProcessDelStaSessionRsp(pMac, pMsg->bodyptr); |
| 2164 | vos_mem_free(pMsg->bodyptr); |
| 2165 | } |
| 2166 | else |
| 2167 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2168 | 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] | 2169 | } |
| 2170 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2171 | case eWNI_SME_REMAIN_ON_CHN_RSP: |
| 2172 | if(pMsg->bodyptr) |
| 2173 | { |
| 2174 | status = sme_remainOnChnRsp(pMac, pMsg->bodyptr); |
| 2175 | vos_mem_free(pMsg->bodyptr); |
| 2176 | } |
| 2177 | else |
| 2178 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2179 | 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] | 2180 | } |
| 2181 | break; |
| 2182 | case eWNI_SME_REMAIN_ON_CHN_RDY_IND: |
| 2183 | if(pMsg->bodyptr) |
| 2184 | { |
| 2185 | status = sme_remainOnChnReady(pMac, pMsg->bodyptr); |
| 2186 | vos_mem_free(pMsg->bodyptr); |
| 2187 | } |
| 2188 | else |
| 2189 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2190 | 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] | 2191 | } |
| 2192 | break; |
| 2193 | case eWNI_SME_MGMT_FRM_IND: |
| 2194 | if(pMsg->bodyptr) |
| 2195 | { |
| 2196 | sme_mgmtFrmInd(pMac, pMsg->bodyptr); |
| 2197 | vos_mem_free(pMsg->bodyptr); |
| 2198 | } |
| 2199 | else |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2200 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2201 | 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] | 2202 | } |
| 2203 | break; |
Hardik Kantilal Patel | 81f7634 | 2014-11-14 12:45:26 -0800 | [diff] [blame] | 2204 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 2205 | case eWNI_SME_2040_COEX_IND: |
| 2206 | if(pMsg->bodyptr) |
| 2207 | { |
| 2208 | sme_HT2040CoexInfoInd(pMac, pMsg->bodyptr); |
| 2209 | vos_mem_free(pMsg->bodyptr); |
| 2210 | } |
| 2211 | else |
| 2212 | { |
| 2213 | smsLog( pMac, LOGE, "Empty rsp message for meas (eWNI_SME_2040_COEX_IND), nothing to process"); |
| 2214 | } |
| 2215 | break; |
| 2216 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2217 | case eWNI_SME_ACTION_FRAME_SEND_CNF: |
| 2218 | if(pMsg->bodyptr) |
| 2219 | { |
| 2220 | status = sme_sendActionCnf(pMac, pMsg->bodyptr); |
| 2221 | vos_mem_free(pMsg->bodyptr); |
| 2222 | } |
| 2223 | else |
| 2224 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2225 | 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] | 2226 | } |
| 2227 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2228 | case eWNI_SME_COEX_IND: |
| 2229 | if(pMsg->bodyptr) |
| 2230 | { |
c_hpothu | 3ba2a51 | 2014-08-06 14:02:54 +0530 | [diff] [blame] | 2231 | tSirSmeCoexInd *pSmeCoexInd = (tSirSmeCoexInd *)pMsg->bodyptr; |
| 2232 | |
| 2233 | if (pSmeCoexInd->coexIndType == SIR_COEX_IND_TYPE_DISABLE_AGGREGATION_IN_2p4) |
| 2234 | { |
| 2235 | smsLog( pMac, LOG1, FL("SIR_COEX_IND_TYPE_DISABLE_AGGREGATION_IN_2p4")); |
| 2236 | sme_RequestFullPower(hHal, NULL, NULL, eSME_REASON_OTHER); |
| 2237 | pMac->isCoexScoIndSet = 1; |
| 2238 | } |
| 2239 | else if (pSmeCoexInd->coexIndType == SIR_COEX_IND_TYPE_ENABLE_AGGREGATION_IN_2p4) |
| 2240 | { |
| 2241 | smsLog( pMac, LOG1, FL("SIR_COEX_IND_TYPE_ENABLE_AGGREGATION_IN_2p4")); |
| 2242 | pMac->isCoexScoIndSet = 0; |
| 2243 | sme_RequestBmps(hHal, NULL, NULL); |
| 2244 | } |
| 2245 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2246 | status = btcHandleCoexInd((void *)pMac, pMsg->bodyptr); |
| 2247 | vos_mem_free(pMsg->bodyptr); |
| 2248 | } |
| 2249 | else |
| 2250 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2251 | 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] | 2252 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2253 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2254 | |
| 2255 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 2256 | case eWNI_SME_PREF_NETWORK_FOUND_IND: |
| 2257 | if(pMsg->bodyptr) |
| 2258 | { |
| 2259 | status = sme_PreferredNetworkFoundInd((void *)pMac, pMsg->bodyptr); |
| 2260 | vos_mem_free(pMsg->bodyptr); |
| 2261 | } |
| 2262 | else |
| 2263 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2264 | 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] | 2265 | } |
| 2266 | break; |
| 2267 | #endif // FEATURE_WLAN_SCAN_PNO |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2268 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2269 | case eWNI_SME_TX_PER_HIT_IND: |
| 2270 | if (pMac->sme.pTxPerHitCallback) |
| 2271 | { |
| 2272 | pMac->sme.pTxPerHitCallback(pMac->sme.pTxPerHitCbContext); |
| 2273 | } |
| 2274 | break; |
| 2275 | |
| 2276 | case eWNI_SME_CHANGE_COUNTRY_CODE: |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 2277 | if(pMsg->bodyptr) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2278 | { |
| 2279 | status = sme_HandleChangeCountryCode((void *)pMac, pMsg->bodyptr); |
| 2280 | vos_mem_free(pMsg->bodyptr); |
| 2281 | } |
| 2282 | else |
| 2283 | { |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 2284 | smsLog(pMac, LOGE, "Empty rsp message for message (eWNI_SME_CHANGE_COUNTRY_CODE), nothing to process"); |
| 2285 | } |
| 2286 | break; |
| 2287 | |
| 2288 | case eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE: |
| 2289 | if (pMsg->bodyptr) |
| 2290 | { |
| 2291 | status = sme_HandleGenericChangeCountryCode((void *)pMac, pMsg->bodyptr); |
| 2292 | vos_mem_free(pMsg->bodyptr); |
| 2293 | } |
| 2294 | else |
| 2295 | { |
| 2296 | 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] | 2297 | } |
| 2298 | break; |
| 2299 | |
| 2300 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 2301 | case eWNI_PMC_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP: |
| 2302 | if(pMsg->bodyptr) |
| 2303 | { |
| 2304 | status = sme_PCFilterMatchCountResponseHandler((void *)pMac, pMsg->bodyptr); |
| 2305 | vos_mem_free(pMsg->bodyptr); |
| 2306 | } |
| 2307 | else |
| 2308 | { |
| 2309 | smsLog(pMac, LOGE, "Empty rsp message for meas " |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2310 | "(PACKET_COALESCING_FILTER_MATCH_COUNT_RSP), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2311 | } |
| 2312 | break; |
| 2313 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 2314 | case eWNI_SME_PRE_SWITCH_CHL_IND: |
| 2315 | { |
| 2316 | status = sme_HandlePreChannelSwitchInd(pMac); |
| 2317 | break; |
| 2318 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2319 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2320 | case eWNI_SME_POST_SWITCH_CHL_IND: |
| 2321 | { |
| 2322 | status = sme_HandlePostChannelSwitchInd(pMac); |
| 2323 | break; |
| 2324 | } |
| 2325 | |
| 2326 | #ifdef WLAN_WAKEUP_EVENTS |
| 2327 | case eWNI_SME_WAKE_REASON_IND: |
| 2328 | if(pMsg->bodyptr) |
| 2329 | { |
| 2330 | status = sme_WakeReasonIndCallback((void *)pMac, pMsg->bodyptr); |
| 2331 | vos_mem_free(pMsg->bodyptr); |
| 2332 | } |
| 2333 | else |
| 2334 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2335 | 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] | 2336 | } |
| 2337 | break; |
| 2338 | #endif // WLAN_WAKEUP_EVENTS |
| 2339 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2340 | #ifdef FEATURE_WLAN_TDLS |
| 2341 | /* |
| 2342 | * command rescived from PE, SME tdls msg processor shall be called |
| 2343 | * to process commands recieved from PE |
| 2344 | */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2345 | case eWNI_SME_TDLS_SEND_MGMT_RSP: |
| 2346 | case eWNI_SME_TDLS_ADD_STA_RSP: |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 2347 | case eWNI_SME_TDLS_DEL_STA_RSP: |
| 2348 | case eWNI_SME_TDLS_DEL_STA_IND: |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2349 | case eWNI_SME_TDLS_DEL_ALL_PEER_IND: |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 2350 | case eWNI_SME_MGMT_FRM_TX_COMPLETION_IND: |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 2351 | case eWNI_SME_TDLS_LINK_ESTABLISH_RSP: |
Atul Mittal | 60bd429 | 2014-08-14 12:19:27 +0530 | [diff] [blame] | 2352 | case eWNI_SME_TDLS_CHANNEL_SWITCH_RSP: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2353 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 2354 | case eWNI_SME_TDLS_DISCOVERY_START_RSP: |
| 2355 | case eWNI_SME_TDLS_DISCOVERY_START_IND: |
| 2356 | case eWNI_SME_TDLS_LINK_START_RSP: |
| 2357 | case eWNI_SME_TDLS_LINK_START_IND: |
| 2358 | case eWNI_SME_TDLS_TEARDOWN_RSP: |
| 2359 | case eWNI_SME_TDLS_TEARDOWN_IND: |
| 2360 | case eWNI_SME_ADD_TDLS_PEER_IND: |
| 2361 | case eWNI_SME_DELETE_TDLS_PEER_IND: |
| 2362 | #endif |
| 2363 | { |
| 2364 | if (pMsg->bodyptr) |
| 2365 | { |
| 2366 | status = tdlsMsgProcessor(pMac, pMsg->type, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2367 | vos_mem_free(pMsg->bodyptr); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2368 | } |
| 2369 | else |
| 2370 | { |
| 2371 | smsLog( pMac, LOGE, "Empty rsp message for TDLS, \ |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2372 | nothing to process"); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2373 | } |
| 2374 | break; |
| 2375 | } |
| 2376 | #endif |
| 2377 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2378 | #ifdef WLAN_FEATURE_11W |
| 2379 | case eWNI_SME_UNPROT_MGMT_FRM_IND: |
| 2380 | if (pMsg->bodyptr) |
| 2381 | { |
| 2382 | sme_UnprotectedMgmtFrmInd(pMac, pMsg->bodyptr); |
| 2383 | vos_mem_free(pMsg->bodyptr); |
| 2384 | } |
| 2385 | else |
| 2386 | { |
| 2387 | smsLog(pMac, LOGE, "Empty rsp message for meas (eWNI_SME_UNPROT_MGMT_FRM_IND), nothing to process"); |
| 2388 | } |
| 2389 | break; |
| 2390 | #endif |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2391 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2392 | case eWNI_SME_TSM_IE_IND: |
| 2393 | { |
| 2394 | if (pMsg->bodyptr) |
| 2395 | { |
| 2396 | sme_TsmIeInd(pMac, pMsg->bodyptr); |
| 2397 | vos_mem_free(pMsg->bodyptr); |
| 2398 | } |
| 2399 | else |
| 2400 | { |
| 2401 | smsLog(pMac, LOGE, "Empty rsp message for (eWNI_SME_TSM_IE_IND), nothing to process"); |
| 2402 | } |
| 2403 | break; |
| 2404 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 2405 | #endif /* FEATURE_WLAN_ESE && FEATURE_WLAN_ESE_UPLOAD */ |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 2406 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 2407 | case eWNI_SME_ROAM_SCAN_OFFLOAD_RSP: |
| 2408 | status = csrRoamOffloadScanRspHdlr((void *)pMac, pMsg->bodyval); |
| 2409 | break; |
| 2410 | #endif // WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2411 | |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 2412 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 2413 | case eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP: |
| 2414 | if (pMsg->bodyptr) |
| 2415 | { |
| 2416 | sme_ProcessGetGtkInfoRsp(pMac, pMsg->bodyptr); |
Vinay Krishna Eranna | 6f22c1f | 2014-10-13 16:03:06 +0530 | [diff] [blame] | 2417 | vos_mem_zero(pMsg->bodyptr, |
| 2418 | sizeof(tSirGtkOffloadGetInfoRspParams)); |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 2419 | vos_mem_free(pMsg->bodyptr); |
| 2420 | } |
| 2421 | else |
| 2422 | { |
| 2423 | smsLog(pMac, LOGE, "Empty rsp message for (eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP), nothing to process"); |
| 2424 | } |
| 2425 | break ; |
| 2426 | #endif |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2427 | |
| 2428 | #ifdef FEATURE_WLAN_LPHB |
| 2429 | /* LPHB timeout indication arrived, send IND to client */ |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 2430 | case eWNI_SME_LPHB_IND: |
| 2431 | if (pMac->sme.pLphbIndCb) |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2432 | { |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 2433 | pMac->sme.pLphbIndCb(pMac->pAdapter, pMsg->bodyptr); |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2434 | } |
| 2435 | vos_mem_free(pMsg->bodyptr); |
| 2436 | |
| 2437 | break; |
| 2438 | #endif /* FEATURE_WLAN_LPHB */ |
| 2439 | |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 2440 | #ifdef FEATURE_WLAN_CH_AVOID |
| 2441 | /* LPHB timeout indication arrived, send IND to client */ |
| 2442 | case eWNI_SME_CH_AVOID_IND: |
| 2443 | if (pMac->sme.pChAvoidNotificationCb) |
| 2444 | { |
| 2445 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 2446 | "%s: CH avoid notification", __func__); |
| 2447 | pMac->sme.pChAvoidNotificationCb(pMac->pAdapter, pMsg->bodyptr); |
| 2448 | } |
| 2449 | vos_mem_free(pMsg->bodyptr); |
| 2450 | |
| 2451 | break; |
| 2452 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 2453 | |
Srinivas Dasari | b8fdd42 | 2014-11-27 10:44:20 +0530 | [diff] [blame] | 2454 | case eWNI_SME_ENCRYPT_MSG_RSP: |
| 2455 | if (pMsg->bodyptr) |
| 2456 | { |
| 2457 | sme_EncryptMsgResponseHandler(pMac, pMsg->bodyptr); |
| 2458 | vos_mem_free(pMsg->bodyptr); |
| 2459 | } |
| 2460 | else |
| 2461 | { |
| 2462 | smsLog(pMac, LOGE, |
| 2463 | "Empty rsp message for (eWNI_SME_ENCRYPT_MSG_RSP)," |
| 2464 | " nothing to process"); |
| 2465 | } |
| 2466 | break ; |
| 2467 | |
Girish Gowli | a95daca | 2015-02-04 20:31:31 +0530 | [diff] [blame] | 2468 | case eWNI_SME_UPDATE_MAX_RATE_IND: |
| 2469 | if (pMsg->bodyptr) |
| 2470 | { |
| 2471 | sme_UpdateMaxRateInd(pMac, pMsg->bodyptr); |
| 2472 | vos_mem_free(pMsg->bodyptr); |
| 2473 | } |
| 2474 | else |
| 2475 | { |
| 2476 | smsLog(pMac, LOGE, |
| 2477 | "Empty message for (eWNI_SME_UPDATE_MAX_RATE_IND)," |
| 2478 | " nothing to process"); |
| 2479 | } |
| 2480 | break; |
Srinivas Dasari | b8fdd42 | 2014-11-27 10:44:20 +0530 | [diff] [blame] | 2481 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2482 | default: |
| 2483 | |
| 2484 | if ( ( pMsg->type >= eWNI_SME_MSG_TYPES_BEGIN ) |
| 2485 | && ( pMsg->type <= eWNI_SME_MSG_TYPES_END ) ) |
| 2486 | { |
| 2487 | //CSR |
| 2488 | if (pMsg->bodyptr) |
| 2489 | { |
| 2490 | status = csrMsgProcessor(hHal, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2491 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2492 | } |
| 2493 | else |
| 2494 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2495 | smsLog( pMac, LOGE, "Empty rsp message for CSR, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2496 | } |
| 2497 | } |
| 2498 | else |
| 2499 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2500 | smsLog( pMac, LOGW, "Unknown message type %d, nothing to process", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2501 | pMsg->type); |
| 2502 | if (pMsg->bodyptr) |
| 2503 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2504 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2505 | } |
| 2506 | } |
| 2507 | }//switch |
| 2508 | } //SME_IS_START |
| 2509 | else |
| 2510 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2511 | smsLog( pMac, LOGW, "message type %d in stop state ignored", pMsg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2512 | if (pMsg->bodyptr) |
| 2513 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2514 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2515 | } |
| 2516 | } |
| 2517 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2518 | } |
| 2519 | else |
| 2520 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2521 | smsLog( pMac, LOGW, "Locking failed, bailing out"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2522 | if (pMsg->bodyptr) |
| 2523 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2524 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2525 | } |
| 2526 | } |
| 2527 | |
| 2528 | return status; |
| 2529 | } |
| 2530 | |
| 2531 | |
| 2532 | //No need to hold the global lock here because this function can only be called |
| 2533 | //after sme_Stop. |
| 2534 | v_VOID_t sme_FreeMsg( tHalHandle hHal, vos_msg_t* pMsg ) |
| 2535 | { |
| 2536 | if( pMsg ) |
| 2537 | { |
| 2538 | if (pMsg->bodyptr) |
| 2539 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2540 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2541 | } |
| 2542 | } |
| 2543 | |
| 2544 | } |
| 2545 | |
| 2546 | |
| 2547 | /*-------------------------------------------------------------------------- |
| 2548 | |
| 2549 | \brief sme_Stop() - Stop all SME modules and put them at idle state |
| 2550 | |
| 2551 | The function stops each module in SME, PMC, CCM, CSR, etc. . Upon |
| 2552 | return, all modules are at idle state ready to start. |
| 2553 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2554 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2555 | \param hHal - The handle returned by macOpen |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2556 | \param tHalStopType - reason for stopping |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2557 | |
| 2558 | \return eHAL_STATUS_SUCCESS - SME is stopped. |
| 2559 | |
| 2560 | Other status means SME is failed to stop but caller should still |
| 2561 | consider SME is stopped. |
| 2562 | \sa |
| 2563 | |
| 2564 | --------------------------------------------------------------------------*/ |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2565 | eHalStatus sme_Stop(tHalHandle hHal, tHalStopType stopType) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2566 | { |
| 2567 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2568 | eHalStatus fail_status = eHAL_STATUS_SUCCESS; |
| 2569 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2570 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2571 | status = WLANSAP_Stop(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 2572 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2573 | smsLog( pMac, LOGE, "WLANSAP_Stop failed during smeStop with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2574 | status ); |
| 2575 | fail_status = status; |
| 2576 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2577 | |
| 2578 | p2pStop(hHal); |
| 2579 | |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2580 | status = pmcStop(hHal); |
| 2581 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 2582 | smsLog( pMac, LOGE, "pmcStop failed during smeStop with status=%d", |
| 2583 | status ); |
| 2584 | fail_status = status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2585 | } |
| 2586 | |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2587 | status = csrStop(pMac, stopType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2588 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2589 | smsLog( pMac, LOGE, "csrStop failed during smeStop with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2590 | status ); |
| 2591 | fail_status = status; |
| 2592 | } |
| 2593 | |
| 2594 | ccmStop(hHal); |
| 2595 | |
| 2596 | purgeSmeCmdList(pMac); |
| 2597 | |
| 2598 | if (!HAL_STATUS_SUCCESS( fail_status )) { |
| 2599 | status = fail_status; |
| 2600 | } |
| 2601 | |
| 2602 | pMac->sme.state = SME_STATE_STOP; |
| 2603 | |
| 2604 | return status; |
| 2605 | } |
| 2606 | |
| 2607 | /*-------------------------------------------------------------------------- |
| 2608 | |
| 2609 | \brief sme_Close() - Release all SME modules and their resources. |
| 2610 | |
| 2611 | The function release each module in SME, PMC, CCM, CSR, etc. . Upon |
| 2612 | return, all modules are at closed state. |
| 2613 | |
| 2614 | No SME APIs can be involved after smeClose except smeOpen. |
| 2615 | smeClose must be called before macClose. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2616 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2617 | \param hHal - The handle returned by macOpen |
| 2618 | |
| 2619 | \return eHAL_STATUS_SUCCESS - SME is successfully close. |
| 2620 | |
| 2621 | Other status means SME is failed to be closed but caller still cannot |
| 2622 | call any other SME functions except smeOpen. |
| 2623 | \sa |
| 2624 | |
| 2625 | --------------------------------------------------------------------------*/ |
| 2626 | eHalStatus sme_Close(tHalHandle hHal) |
| 2627 | { |
| 2628 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2629 | eHalStatus fail_status = eHAL_STATUS_SUCCESS; |
| 2630 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2631 | |
| 2632 | status = csrClose(pMac); |
| 2633 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2634 | smsLog( pMac, LOGE, "csrClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2635 | status ); |
| 2636 | fail_status = status; |
| 2637 | } |
| 2638 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2639 | status = WLANSAP_Close(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 2640 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2641 | smsLog( pMac, LOGE, "WLANSAP_close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2642 | status ); |
| 2643 | fail_status = status; |
| 2644 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2645 | |
| 2646 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 2647 | status = btcClose(hHal); |
| 2648 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2649 | smsLog( pMac, LOGE, "BTC close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2650 | status ); |
| 2651 | fail_status = status; |
| 2652 | } |
| 2653 | |
| 2654 | status = sme_QosClose(pMac); |
| 2655 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2656 | smsLog( pMac, LOGE, "Qos close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2657 | status ); |
| 2658 | fail_status = status; |
| 2659 | } |
| 2660 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2661 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 2662 | status = oemData_OemDataReqClose(hHal); |
| 2663 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2664 | 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] | 2665 | status ); |
| 2666 | fail_status = status; |
| 2667 | } |
| 2668 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2669 | |
| 2670 | status = ccmClose(hHal); |
| 2671 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2672 | smsLog( pMac, LOGE, "ccmClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2673 | status ); |
| 2674 | fail_status = status; |
| 2675 | } |
| 2676 | |
| 2677 | status = pmcClose(hHal); |
| 2678 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2679 | smsLog( pMac, LOGE, "pmcClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2680 | status ); |
| 2681 | fail_status = status; |
| 2682 | } |
| 2683 | #if defined WLAN_FEATURE_VOWIFI |
| 2684 | status = rrmClose(hHal); |
| 2685 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2686 | smsLog( pMac, LOGE, "RRM close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2687 | status ); |
| 2688 | fail_status = status; |
| 2689 | } |
| 2690 | #endif |
| 2691 | |
| 2692 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 2693 | sme_FTClose(hHal); |
| 2694 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2695 | sme_p2pClose(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2696 | |
| 2697 | freeSmeCmdList(pMac); |
| 2698 | |
| 2699 | if( !VOS_IS_STATUS_SUCCESS( vos_lock_destroy( &pMac->sme.lkSmeGlobalLock ) ) ) |
| 2700 | { |
| 2701 | fail_status = eHAL_STATUS_FAILURE; |
| 2702 | } |
| 2703 | |
| 2704 | if (!HAL_STATUS_SUCCESS( fail_status )) { |
| 2705 | status = fail_status; |
| 2706 | } |
| 2707 | |
| 2708 | pMac->sme.state = SME_STATE_STOP; |
| 2709 | |
| 2710 | return status; |
| 2711 | } |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2712 | #ifdef FEATURE_WLAN_LFR |
| 2713 | tANI_BOOLEAN csrIsScanAllowed(tpAniSirGlobal pMac) |
| 2714 | { |
Madan Mohan Koyyalamudi | fb534bb | 2012-10-24 14:35:45 -0700 | [diff] [blame] | 2715 | #if 0 |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2716 | switch(pMac->roam.neighborRoamInfo.neighborRoamState) { |
| 2717 | case eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN: |
| 2718 | case eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING: |
| 2719 | case eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE: |
| 2720 | case eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING: |
| 2721 | return eANI_BOOLEAN_FALSE; |
| 2722 | default: |
| 2723 | return eANI_BOOLEAN_TRUE; |
| 2724 | } |
Madan Mohan Koyyalamudi | fb534bb | 2012-10-24 14:35:45 -0700 | [diff] [blame] | 2725 | #else |
| 2726 | /* |
| 2727 | * TODO: always return TRUE for now until |
| 2728 | * we figure out why we could be stuck in |
| 2729 | * one of the roaming states forever. |
| 2730 | */ |
| 2731 | return eANI_BOOLEAN_TRUE; |
| 2732 | #endif |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2733 | } |
| 2734 | #endif |
c_hpothu | 5890146 | 2014-11-01 16:44:34 +0530 | [diff] [blame] | 2735 | |
| 2736 | /* --------------------------------------------------------------------------- |
| 2737 | \fn sco_isScanAllowed |
| 2738 | \brief check for scan interface connection status |
| 2739 | \param pMac - Pointer to the global MAC parameter structure |
| 2740 | \param pScanReq - scan request structure. |
| 2741 | |
| 2742 | \return tANI_BOOLEAN TRUE to allow scan otherwise FALSE |
| 2743 | ---------------------------------------------------------------------------*/ |
| 2744 | tANI_BOOLEAN sco_isScanAllowed(tpAniSirGlobal pMac, tCsrScanRequest *pscanReq) |
| 2745 | { |
| 2746 | tANI_BOOLEAN ret; |
| 2747 | |
| 2748 | if (pscanReq->p2pSearch) |
| 2749 | ret = csrIsP2pSessionConnected(pMac); |
| 2750 | else |
| 2751 | ret = csrIsStaSessionConnected(pMac); |
| 2752 | |
| 2753 | return !ret; |
| 2754 | } |
| 2755 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2756 | /* --------------------------------------------------------------------------- |
| 2757 | \fn sme_ScanRequest |
| 2758 | \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] | 2759 | This is an asynchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2760 | \param pScanRequestID - pointer to an object to get back the request ID |
| 2761 | \param callback - a callback function that scan calls upon finish, will not |
| 2762 | be called if csrScanRequest returns error |
| 2763 | \param pContext - a pointer passed in for the callback |
| 2764 | \return eHalStatus |
| 2765 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2766 | eHalStatus sme_ScanRequest(tHalHandle hHal, tANI_U8 sessionId, tCsrScanRequest *pscanReq, |
| 2767 | tANI_U32 *pScanRequestID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2768 | csrScanCompleteCallback callback, void *pContext) |
| 2769 | { |
| 2770 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2771 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2772 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2773 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_REQ, sessionId, pscanReq->scanType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2774 | smsLog(pMac, LOG2, FL("enter")); |
| 2775 | do |
| 2776 | { |
c_hpothu | 304c052 | 2014-09-30 10:22:57 +0530 | [diff] [blame] | 2777 | if(pMac->scan.fScanEnable && |
c_hpothu | 5890146 | 2014-11-01 16:44:34 +0530 | [diff] [blame] | 2778 | (pMac->isCoexScoIndSet ? sco_isScanAllowed(pMac, pscanReq) : TRUE)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2779 | { |
| 2780 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2781 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2782 | { |
| 2783 | { |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2784 | #ifdef FEATURE_WLAN_LFR |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2785 | if(csrIsScanAllowed(pMac)) |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2786 | { |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2787 | #endif |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2788 | status = csrScanRequest( hHal, sessionId, pscanReq, |
| 2789 | pScanRequestID, callback, pContext ); |
Vinay Krishna Eranna | 636b7bc | 2013-12-18 20:49:08 +0530 | [diff] [blame] | 2790 | if ( !HAL_STATUS_SUCCESS( status ) ) |
| 2791 | { |
| 2792 | smsLog(pMac, LOGE, FL("csrScanRequest failed" |
| 2793 | " SId=%d"), sessionId); |
| 2794 | } |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2795 | #ifdef FEATURE_WLAN_LFR |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2796 | } |
| 2797 | else |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2798 | { |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 2799 | smsLog(pMac, LOGE, FL("Scan denied in state %s" |
Mahesh A Saptasagar | 14addb6 | 2014-02-17 17:17:51 +0530 | [diff] [blame] | 2800 | "(sub-state %s)"), |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 2801 | macTraceGetNeighbourRoamState( |
| 2802 | pMac->roam.neighborRoamInfo.neighborRoamState), |
Mahesh A Saptasagar | 14addb6 | 2014-02-17 17:17:51 +0530 | [diff] [blame] | 2803 | macTraceGetcsrRoamSubState( |
| 2804 | pMac->roam.curSubState[sessionId])); |
Madan Mohan Koyyalamudi | ab4ab0d | 2012-10-24 14:26:50 -0700 | [diff] [blame] | 2805 | /*HandOff is in progress. So schedule this scan later*/ |
| 2806 | status = eHAL_STATUS_RESOURCES; |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2807 | } |
| 2808 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2809 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2810 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2811 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2812 | } //sme_AcquireGlobalLock success |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2813 | else |
| 2814 | { |
| 2815 | smsLog(pMac, LOGE, FL("sme_AcquireGlobalLock failed")); |
| 2816 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2817 | } //if(pMac->scan.fScanEnable) |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2818 | else |
| 2819 | { |
c_hpothu | 3ba2a51 | 2014-08-06 14:02:54 +0530 | [diff] [blame] | 2820 | smsLog(pMac, LOGE, FL("fScanEnable %d isCoexScoIndSet: %d "), |
| 2821 | pMac->scan.fScanEnable, pMac->isCoexScoIndSet); |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2822 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2823 | } while( 0 ); |
| 2824 | |
| 2825 | return (status); |
| 2826 | |
| 2827 | |
| 2828 | } |
| 2829 | |
| 2830 | /* --------------------------------------------------------------------------- |
| 2831 | \fn sme_ScanGetResult |
| 2832 | \brief a wrapper function to request scan results from CSR. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2833 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2834 | \param pFilter - If pFilter is NULL, all cached results are returned |
| 2835 | \param phResult - an object for the result. |
| 2836 | \return eHalStatus |
| 2837 | ---------------------------------------------------------------------------*/ |
| 2838 | eHalStatus sme_ScanGetResult(tHalHandle hHal, tANI_U8 sessionId, tCsrScanResultFilter *pFilter, |
| 2839 | tScanResultHandle *phResult) |
| 2840 | { |
| 2841 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2842 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2843 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2844 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2845 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_GET_RESULTS, sessionId,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2846 | smsLog(pMac, LOG2, FL("enter")); |
| 2847 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2848 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2849 | { |
Madan Mohan Koyyalamudi | ca43cdf | 2012-09-24 13:15:49 -0700 | [diff] [blame] | 2850 | status = csrScanGetResult( hHal, pFilter, phResult ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2851 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2852 | } |
| 2853 | smsLog(pMac, LOG2, FL("exit status %d"), status); |
| 2854 | |
| 2855 | return (status); |
| 2856 | } |
| 2857 | |
| 2858 | |
| 2859 | /* --------------------------------------------------------------------------- |
| 2860 | \fn sme_ScanFlushResult |
| 2861 | \brief a wrapper function to request CSR to clear scan results. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2862 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2863 | \return eHalStatus |
| 2864 | ---------------------------------------------------------------------------*/ |
| 2865 | eHalStatus sme_ScanFlushResult(tHalHandle hHal, tANI_U8 sessionId) |
| 2866 | { |
| 2867 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2868 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2869 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2870 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2871 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_RESULTS, sessionId,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2872 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2873 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2874 | { |
Madan Mohan Koyyalamudi | ca43cdf | 2012-09-24 13:15:49 -0700 | [diff] [blame] | 2875 | status = csrScanFlushResult( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2876 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2877 | } |
| 2878 | |
| 2879 | return (status); |
| 2880 | } |
| 2881 | |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 2882 | /* --------------------------------------------------------------------------- |
| 2883 | \fn sme_FilterScanResults |
| 2884 | \brief a wrapper function to request CSR to clear scan results. |
| 2885 | This is a synchronous call |
| 2886 | \return eHalStatus |
| 2887 | ---------------------------------------------------------------------------*/ |
| 2888 | eHalStatus sme_FilterScanResults(tHalHandle hHal, tANI_U8 sessionId) |
| 2889 | { |
| 2890 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2891 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2892 | |
| 2893 | MTRACE(macTraceNew(pMac, VOS_MODULE_ID_SME, |
| 2894 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_RESULTS, sessionId,0 )); |
| 2895 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2896 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2897 | { |
| 2898 | csrScanFilterResults(pMac); |
| 2899 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2900 | } |
| 2901 | |
| 2902 | return (status); |
| 2903 | } |
| 2904 | |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2905 | eHalStatus sme_ScanFlushP2PResult(tHalHandle hHal, tANI_U8 sessionId) |
| 2906 | { |
| 2907 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2908 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2909 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2910 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2911 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_P2PRESULTS, sessionId,0 )); |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2912 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2913 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2914 | { |
Madan Mohan Koyyalamudi | 5850f31 | 2012-11-27 19:00:25 +0530 | [diff] [blame] | 2915 | status = csrScanFlushSelectiveResult( hHal, VOS_TRUE ); |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2916 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2917 | } |
| 2918 | |
| 2919 | return (status); |
| 2920 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2921 | |
| 2922 | /* --------------------------------------------------------------------------- |
| 2923 | \fn sme_ScanResultGetFirst |
| 2924 | \brief a wrapper function to request CSR to returns the first element of |
| 2925 | scan result. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2926 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2927 | \param hScanResult - returned from csrScanGetResult |
| 2928 | \return tCsrScanResultInfo * - NULL if no result |
| 2929 | ---------------------------------------------------------------------------*/ |
| 2930 | tCsrScanResultInfo *sme_ScanResultGetFirst(tHalHandle hHal, |
| 2931 | tScanResultHandle hScanResult) |
| 2932 | { |
| 2933 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2934 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2935 | tCsrScanResultInfo *pRet = NULL; |
| 2936 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2937 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2938 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_GETFIRST, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2939 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2940 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2941 | { |
| 2942 | pRet = csrScanResultGetFirst( pMac, hScanResult ); |
| 2943 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2944 | } |
| 2945 | |
| 2946 | return (pRet); |
| 2947 | } |
| 2948 | |
| 2949 | |
| 2950 | /* --------------------------------------------------------------------------- |
| 2951 | \fn sme_ScanResultGetNext |
| 2952 | \brief a wrapper function to request CSR to returns the next element of |
| 2953 | scan result. It can be called without calling csrScanResultGetFirst |
| 2954 | first |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2955 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2956 | \param hScanResult - returned from csrScanGetResult |
| 2957 | \return Null if no result or reach the end |
| 2958 | ---------------------------------------------------------------------------*/ |
| 2959 | tCsrScanResultInfo *sme_ScanResultGetNext(tHalHandle hHal, |
| 2960 | tScanResultHandle hScanResult) |
| 2961 | { |
| 2962 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2963 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2964 | tCsrScanResultInfo *pRet = NULL; |
| 2965 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2966 | MTRACE(vos_trace(VOS_MODULE_ID_SME , |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2967 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_GETNEXT, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2968 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2969 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2970 | { |
| 2971 | pRet = csrScanResultGetNext( pMac, hScanResult ); |
| 2972 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2973 | } |
| 2974 | |
| 2975 | return (pRet); |
| 2976 | } |
| 2977 | |
| 2978 | |
| 2979 | /* --------------------------------------------------------------------------- |
| 2980 | \fn sme_ScanSetBGScanparams |
| 2981 | \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] | 2982 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2983 | \param pScanReq - BG scan request structure |
| 2984 | \return eHalStatus |
| 2985 | ---------------------------------------------------------------------------*/ |
| 2986 | eHalStatus sme_ScanSetBGScanparams(tHalHandle hHal, tANI_U8 sessionId, tCsrBGScanRequest *pScanReq) |
| 2987 | { |
| 2988 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2989 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2990 | |
| 2991 | if( NULL != pScanReq ) |
| 2992 | { |
| 2993 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2994 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2995 | { |
| 2996 | status = csrScanSetBGScanparams( hHal, pScanReq ); |
| 2997 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2998 | } |
| 2999 | } |
| 3000 | |
| 3001 | return (status); |
| 3002 | } |
| 3003 | |
| 3004 | |
| 3005 | /* --------------------------------------------------------------------------- |
| 3006 | \fn sme_ScanResultPurge |
| 3007 | \brief a wrapper function to request CSR to remove all items(tCsrScanResult) |
| 3008 | in the list and free memory for each item |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3009 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3010 | \param hScanResult - returned from csrScanGetResult. hScanResult is |
| 3011 | considered gone by |
| 3012 | calling this function and even before this function reutrns. |
| 3013 | \return eHalStatus |
| 3014 | ---------------------------------------------------------------------------*/ |
| 3015 | eHalStatus sme_ScanResultPurge(tHalHandle hHal, tScanResultHandle hScanResult) |
| 3016 | { |
| 3017 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3018 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3019 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3020 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3021 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_PURGE, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3022 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3023 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3024 | { |
| 3025 | status = csrScanResultPurge( hHal, hScanResult ); |
| 3026 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3027 | } |
| 3028 | |
| 3029 | return (status); |
| 3030 | } |
| 3031 | |
| 3032 | /* --------------------------------------------------------------------------- |
| 3033 | \fn sme_ScanGetPMKIDCandidateList |
| 3034 | \brief a wrapper function to return the PMKID candidate list |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3035 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3036 | \param pPmkidList - caller allocated buffer point to an array of |
| 3037 | tPmkidCandidateInfo |
| 3038 | \param pNumItems - pointer to a variable that has the number of |
| 3039 | tPmkidCandidateInfo allocated when retruning, this is |
| 3040 | either the number needed or number of items put into |
| 3041 | pPmkidList |
| 3042 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3043 | big enough and pNumItems |
| 3044 | has the number of tPmkidCandidateInfo. |
| 3045 | \Note: pNumItems is a number of tPmkidCandidateInfo, |
| 3046 | not sizeof(tPmkidCandidateInfo) * something |
| 3047 | ---------------------------------------------------------------------------*/ |
| 3048 | eHalStatus sme_ScanGetPMKIDCandidateList(tHalHandle hHal, tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3049 | tPmkidCandidateInfo *pPmkidList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3050 | tANI_U32 *pNumItems ) |
| 3051 | { |
| 3052 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3053 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3054 | |
| 3055 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3056 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3057 | { |
| 3058 | status = csrScanGetPMKIDCandidateList( pMac, sessionId, pPmkidList, pNumItems ); |
| 3059 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3060 | } |
| 3061 | |
| 3062 | return (status); |
| 3063 | } |
| 3064 | |
| 3065 | /*---------------------------------------------------------------------------- |
| 3066 | \fn sme_RoamRegisterLinkQualityIndCallback |
| 3067 | |
| 3068 | \brief |
| 3069 | a wrapper function to allow HDD to register a callback handler with CSR for |
| 3070 | link quality indications. |
| 3071 | |
| 3072 | Only one callback may be registered at any time. |
| 3073 | In order to deregister the callback, a NULL cback may be provided. |
| 3074 | |
| 3075 | Registration happens in the task context of the caller. |
| 3076 | |
| 3077 | \param callback - Call back being registered |
| 3078 | \param pContext - user data |
| 3079 | |
| 3080 | DEPENDENCIES: After CSR open |
| 3081 | |
| 3082 | \return eHalStatus |
| 3083 | -----------------------------------------------------------------------------*/ |
| 3084 | eHalStatus sme_RoamRegisterLinkQualityIndCallback(tHalHandle hHal, tANI_U8 sessionId, |
| 3085 | csrRoamLinkQualityIndCallback callback, |
| 3086 | void *pContext) |
| 3087 | { |
| 3088 | return(csrRoamRegisterLinkQualityIndCallback((tpAniSirGlobal)hHal, callback, pContext)); |
| 3089 | } |
| 3090 | |
| 3091 | /* --------------------------------------------------------------------------- |
| 3092 | \fn sme_RoamRegisterCallback |
| 3093 | \brief a wrapper function to allow HDD to register a callback with CSR. |
| 3094 | Unlike scan, roam has one callback for all the roam requests |
| 3095 | \param callback - a callback function that roam calls upon when state changes |
| 3096 | \param pContext - a pointer passed in for the callback |
| 3097 | \return eHalStatus |
| 3098 | ---------------------------------------------------------------------------*/ |
| 3099 | eHalStatus sme_RoamRegisterCallback(tHalHandle hHal, |
| 3100 | csrRoamCompleteCallback callback, |
| 3101 | void *pContext) |
| 3102 | { |
| 3103 | return(csrRoamRegisterCallback((tpAniSirGlobal)hHal, callback, pContext)); |
| 3104 | } |
| 3105 | |
| 3106 | eCsrPhyMode sme_GetPhyMode(tHalHandle hHal) |
| 3107 | { |
| 3108 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 3109 | return pMac->roam.configParam.phyMode; |
| 3110 | } |
| 3111 | |
| 3112 | /* --------------------------------------------------------------------------- |
Peng Xu | 117eab4 | 2014-09-25 13:33:27 +0530 | [diff] [blame] | 3113 | \fn sme_GetChannelBondingMode5G |
| 3114 | \brief get the channel bonding mode for 5G band |
| 3115 | \param hHal - HAL handle |
| 3116 | \return channel bonding mode for 5G |
| 3117 | ---------------------------------------------------------------------------*/ |
| 3118 | tANI_U32 sme_GetChannelBondingMode5G(tHalHandle hHal) |
| 3119 | { |
| 3120 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 3121 | tSmeConfigParams smeConfig; |
| 3122 | |
| 3123 | sme_GetConfigParam(pMac, &smeConfig); |
| 3124 | |
| 3125 | return smeConfig.csrConfig.channelBondingMode5GHz; |
| 3126 | } |
| 3127 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 3128 | #ifdef WLAN_FEATURE_AP_HT40_24G |
Peng Xu | 117eab4 | 2014-09-25 13:33:27 +0530 | [diff] [blame] | 3129 | /* --------------------------------------------------------------------------- |
| 3130 | \fn sme_GetChannelBondingMode24G |
| 3131 | \brief get the channel bonding mode for 2.4G band |
| 3132 | \param hHal - HAL handle |
| 3133 | \return channel bonding mode for 2.4G |
| 3134 | ---------------------------------------------------------------------------*/ |
| 3135 | tANI_U32 sme_GetChannelBondingMode24G(tHalHandle hHal) |
| 3136 | { |
| 3137 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 3138 | tSmeConfigParams smeConfig; |
| 3139 | |
| 3140 | sme_GetConfigParam(pMac, &smeConfig); |
| 3141 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 3142 | return smeConfig.csrConfig.channelBondingAPMode24GHz; |
Peng Xu | 117eab4 | 2014-09-25 13:33:27 +0530 | [diff] [blame] | 3143 | } |
| 3144 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 3145 | /* --------------------------------------------------------------------------- |
| 3146 | \fn sme_UpdateChannelBondingMode24G |
| 3147 | \brief update the channel bonding mode for 2.4G band |
| 3148 | \param hHal - HAL handle |
| 3149 | \param cbMode - channel bonding mode |
| 3150 | \return |
| 3151 | ---------------------------------------------------------------------------*/ |
| 3152 | void sme_UpdateChannelBondingMode24G(tHalHandle hHal, tANI_U8 cbMode) |
| 3153 | { |
| 3154 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 3155 | tSmeConfigParams smeConfig; |
| 3156 | |
| 3157 | vos_mem_zero(&smeConfig, sizeof (tSmeConfigParams)); |
| 3158 | sme_GetConfigParam(pMac, &smeConfig); |
| 3159 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, |
| 3160 | FL("Previous Channel Bonding : = %d"), |
| 3161 | smeConfig.csrConfig.channelBondingAPMode24GHz); |
| 3162 | |
| 3163 | smeConfig.csrConfig.channelBondingAPMode24GHz = cbMode; |
| 3164 | sme_UpdateConfig(hHal, &smeConfig); |
| 3165 | VOS_TRACE( VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO, |
| 3166 | FL("New Channel Bonding : = %d"), |
| 3167 | sme_GetChannelBondingMode24G(hHal)); |
| 3168 | return; |
| 3169 | } |
Hardik Kantilal Patel | 62a3a76 | 2014-11-21 12:55:57 +0530 | [diff] [blame] | 3170 | |
| 3171 | /* --------------------------------------------------------------------------- |
| 3172 | |
| 3173 | \fn sme_SetHT2040Mode |
| 3174 | |
| 3175 | \brief To update HT Operation beacon IE & Channel Bonding. |
| 3176 | |
| 3177 | \param |
| 3178 | |
| 3179 | \return eHalStatus SUCCESS |
| 3180 | FAILURE or RESOURCES |
| 3181 | The API finished and failed. |
| 3182 | |
| 3183 | -------------------------------------------------------------------------------*/ |
| 3184 | eHalStatus sme_SetHT2040Mode(tHalHandle hHal, tANI_U8 sessionId, tANI_U8 cbMode) |
| 3185 | { |
| 3186 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3187 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3188 | |
| 3189 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 3190 | FL("Channel Bonding =%d"), |
| 3191 | cbMode); |
| 3192 | |
| 3193 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 3194 | if (HAL_STATUS_SUCCESS(status)) |
| 3195 | { |
| 3196 | status = csrSetHT2040Mode(pMac, sessionId, cbMode); |
| 3197 | sme_ReleaseGlobalLock(&pMac->sme ); |
| 3198 | } |
| 3199 | return (status); |
| 3200 | } |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 3201 | #endif |
Peng Xu | 117eab4 | 2014-09-25 13:33:27 +0530 | [diff] [blame] | 3202 | |
| 3203 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3204 | \fn sme_RoamConnect |
| 3205 | \brief a wrapper function to request CSR to inititiate an association |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3206 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3207 | \param sessionId - the sessionId returned by sme_OpenSession. |
| 3208 | \param pProfile - description of the network to which to connect |
| 3209 | \param hBssListIn - a list of BSS descriptor to roam to. It is returned |
| 3210 | from csrScanGetResult |
| 3211 | \param pRoamId - to get back the request ID |
| 3212 | \return eHalStatus |
| 3213 | ---------------------------------------------------------------------------*/ |
| 3214 | eHalStatus sme_RoamConnect(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamProfile *pProfile, |
| 3215 | tANI_U32 *pRoamId) |
| 3216 | { |
| 3217 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3218 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3219 | |
Yue Ma | e36e355 | 2014-03-05 17:06:20 -0800 | [diff] [blame] | 3220 | if (!pMac) |
| 3221 | { |
| 3222 | return eHAL_STATUS_FAILURE; |
| 3223 | } |
| 3224 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3225 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3226 | TRACE_CODE_SME_RX_HDD_MSG_CONNECT, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3227 | smsLog(pMac, LOG2, FL("enter")); |
| 3228 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3229 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3230 | { |
| 3231 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3232 | { |
| 3233 | status = csrRoamConnect( pMac, sessionId, pProfile, NULL, pRoamId ); |
| 3234 | } |
| 3235 | else |
| 3236 | { |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 3237 | smsLog(pMac, LOGE, FL("invalid sessionID %d"), sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3238 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3239 | } |
| 3240 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3241 | } |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 3242 | else |
| 3243 | { |
| 3244 | smsLog(pMac, LOGE, FL("sme_AcquireGlobalLock failed")); |
| 3245 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3246 | |
| 3247 | return (status); |
| 3248 | } |
| 3249 | |
| 3250 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | dacbcb5 | 2013-04-18 16:41:54 +0530 | [diff] [blame] | 3251 | |
| 3252 | \fn sme_SetPhyMode |
| 3253 | |
| 3254 | \brief Changes the PhyMode. |
| 3255 | |
| 3256 | \param hHal - The handle returned by macOpen. |
| 3257 | |
| 3258 | \param phyMode new phyMode which is to set |
| 3259 | |
| 3260 | \return eHalStatus SUCCESS. |
| 3261 | |
| 3262 | -------------------------------------------------------------------------------*/ |
| 3263 | eHalStatus sme_SetPhyMode(tHalHandle hHal, eCsrPhyMode phyMode) |
| 3264 | { |
| 3265 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3266 | |
| 3267 | if (NULL == pMac) |
| 3268 | { |
| 3269 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 3270 | "%s: invalid context", __func__); |
| 3271 | return eHAL_STATUS_FAILURE; |
| 3272 | } |
| 3273 | |
| 3274 | pMac->roam.configParam.phyMode = phyMode; |
| 3275 | pMac->roam.configParam.uCfgDot11Mode = csrGetCfgDot11ModeFromCsrPhyMode(NULL, |
| 3276 | pMac->roam.configParam.phyMode, |
| 3277 | pMac->roam.configParam.ProprietaryRatesEnabled); |
| 3278 | |
| 3279 | return eHAL_STATUS_SUCCESS; |
| 3280 | } |
| 3281 | |
| 3282 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3283 | \fn sme_RoamReassoc |
| 3284 | \brief a wrapper function to request CSR to inititiate a re-association |
| 3285 | \param pProfile - can be NULL to join the currently connected AP. In that |
| 3286 | case modProfileFields should carry the modified field(s) which could trigger |
| 3287 | reassoc |
| 3288 | \param modProfileFields - fields which are part of tCsrRoamConnectedProfile |
| 3289 | that might need modification dynamically once STA is up & running and this |
| 3290 | could trigger a reassoc |
| 3291 | \param pRoamId - to get back the request ID |
| 3292 | \return eHalStatus |
| 3293 | -------------------------------------------------------------------------------*/ |
| 3294 | eHalStatus sme_RoamReassoc(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamProfile *pProfile, |
| 3295 | tCsrRoamModifyProfileFields modProfileFields, |
Madan Mohan Koyyalamudi | ea22cdc | 2012-10-18 21:02:23 -0700 | [diff] [blame] | 3296 | tANI_U32 *pRoamId, v_BOOL_t fForce) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3297 | { |
| 3298 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3299 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3300 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3301 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3302 | TRACE_CODE_SME_RX_HDD_ROAM_REASSOC, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3303 | smsLog(pMac, LOG2, FL("enter")); |
| 3304 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3305 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3306 | { |
| 3307 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3308 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3309 | if((NULL == pProfile) && (fForce == 1)) |
| 3310 | { |
Madan Mohan Koyyalamudi | 0d0e171 | 2012-10-21 12:02:45 -0700 | [diff] [blame] | 3311 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 3312 | /* to force the AP initiate fresh 802.1x authentication need to clear |
| 3313 | * the PMKID cache for that set the following boolean. this is needed |
| 3314 | * by the HS 2.0 passpoint certification 5.2.a and b testcases */ |
| 3315 | pSession->fIgnorePMKIDCache = TRUE; |
Madan Mohan Koyyalamudi | ea22cdc | 2012-10-18 21:02:23 -0700 | [diff] [blame] | 3316 | status = csrReassoc( pMac, sessionId, &modProfileFields, pRoamId , fForce); |
| 3317 | } |
| 3318 | else |
| 3319 | { |
| 3320 | status = csrRoamReassoc( pMac, sessionId, pProfile, modProfileFields, pRoamId ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3321 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3322 | } |
| 3323 | else |
| 3324 | { |
| 3325 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3326 | } |
| 3327 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3328 | } |
| 3329 | |
| 3330 | return (status); |
| 3331 | } |
| 3332 | |
| 3333 | /* --------------------------------------------------------------------------- |
| 3334 | \fn sme_RoamConnectToLastProfile |
| 3335 | \brief a wrapper function to request CSR to disconnect and reconnect with |
| 3336 | the same profile |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3337 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3338 | \return eHalStatus. It returns fail if currently connected |
| 3339 | ---------------------------------------------------------------------------*/ |
| 3340 | eHalStatus sme_RoamConnectToLastProfile(tHalHandle hHal, tANI_U8 sessionId) |
| 3341 | { |
| 3342 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3343 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3344 | |
| 3345 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3346 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3347 | { |
| 3348 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3349 | { |
| 3350 | status = csrRoamConnectToLastProfile( pMac, sessionId ); |
| 3351 | } |
| 3352 | else |
| 3353 | { |
| 3354 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3355 | } |
| 3356 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3357 | } |
| 3358 | |
| 3359 | return (status); |
| 3360 | } |
| 3361 | |
| 3362 | /* --------------------------------------------------------------------------- |
| 3363 | \fn sme_RoamDisconnect |
| 3364 | \brief a wrapper function to request CSR to disconnect from a network |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3365 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3366 | \param reason -- To indicate the reason for disconnecting. Currently, only |
| 3367 | eCSR_DISCONNECT_REASON_MIC_ERROR is meanful. |
| 3368 | \return eHalStatus |
| 3369 | ---------------------------------------------------------------------------*/ |
| 3370 | eHalStatus sme_RoamDisconnect(tHalHandle hHal, tANI_U8 sessionId, eCsrRoamDisconnectReason reason) |
| 3371 | { |
| 3372 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3373 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3374 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3375 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3376 | TRACE_CODE_SME_RX_HDD_ROAM_DISCONNECT, sessionId, reason)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3377 | smsLog(pMac, LOG2, FL("enter")); |
| 3378 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3379 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3380 | { |
| 3381 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3382 | { |
| 3383 | status = csrRoamDisconnect( pMac, sessionId, reason ); |
| 3384 | } |
| 3385 | else |
| 3386 | { |
| 3387 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3388 | } |
| 3389 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3390 | } |
| 3391 | |
| 3392 | return (status); |
| 3393 | } |
| 3394 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3395 | /* --------------------------------------------------------------------------- |
| 3396 | \fn sme_RoamStopBss |
| 3397 | \brief To stop BSS for Soft AP. This is an asynchronous API. |
| 3398 | \param hHal - Global structure |
| 3399 | \param sessionId - sessionId of SoftAP |
| 3400 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3401 | -------------------------------------------------------------------------------*/ |
| 3402 | eHalStatus sme_RoamStopBss(tHalHandle hHal, tANI_U8 sessionId) |
| 3403 | { |
| 3404 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3405 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3406 | |
| 3407 | smsLog(pMac, LOG2, FL("enter")); |
| 3408 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3409 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3410 | { |
| 3411 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3412 | { |
Gopichand Nakkala | f44bdc5 | 2013-02-16 00:54:45 +0530 | [diff] [blame] | 3413 | status = csrRoamIssueStopBssCmd( pMac, sessionId, eANI_BOOLEAN_FALSE ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3414 | } |
| 3415 | else |
| 3416 | { |
| 3417 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3418 | } |
| 3419 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3420 | } |
| 3421 | |
| 3422 | return (status); |
| 3423 | } |
| 3424 | |
| 3425 | /* --------------------------------------------------------------------------- |
| 3426 | \fn sme_RoamDisconnectSta |
| 3427 | \brief To disassociate a station. This is an asynchronous API. |
| 3428 | \param hHal - Global structure |
| 3429 | \param sessionId - sessionId of SoftAP |
| 3430 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3431 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3432 | -------------------------------------------------------------------------------*/ |
| 3433 | eHalStatus sme_RoamDisconnectSta(tHalHandle hHal, tANI_U8 sessionId, |
| 3434 | tANI_U8 *pPeerMacAddr) |
| 3435 | { |
| 3436 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3437 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3438 | |
| 3439 | if ( NULL == pMac ) |
| 3440 | { |
| 3441 | VOS_ASSERT(0); |
| 3442 | return status; |
| 3443 | } |
| 3444 | |
| 3445 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3446 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3447 | { |
| 3448 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3449 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3450 | status = csrRoamIssueDisassociateStaCmd( pMac, sessionId, pPeerMacAddr, |
Madan Mohan Koyyalamudi | 299b486 | 2013-01-30 19:59:23 +0530 | [diff] [blame] | 3451 | eSIR_MAC_DEAUTH_LEAVING_BSS_REASON); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3452 | } |
| 3453 | else |
| 3454 | { |
| 3455 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3456 | } |
| 3457 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3458 | } |
| 3459 | |
| 3460 | return (status); |
| 3461 | } |
| 3462 | |
| 3463 | /* --------------------------------------------------------------------------- |
| 3464 | \fn sme_RoamDeauthSta |
| 3465 | \brief To disassociate a station. This is an asynchronous API. |
| 3466 | \param hHal - Global structure |
| 3467 | \param sessionId - sessionId of SoftAP |
Hanumantha Reddy Pothula | f57da15 | 2014-10-31 13:02:08 +0530 | [diff] [blame] | 3468 | \param pDelStaParams -Pointer to parameters of the station to deauthenticate |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3469 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3470 | -------------------------------------------------------------------------------*/ |
| 3471 | eHalStatus sme_RoamDeauthSta(tHalHandle hHal, tANI_U8 sessionId, |
Hanumantha Reddy Pothula | f57da15 | 2014-10-31 13:02:08 +0530 | [diff] [blame] | 3472 | struct tagCsrDelStaParams *pDelStaParams) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3473 | { |
| 3474 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3475 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3476 | |
| 3477 | if ( NULL == pMac ) |
| 3478 | { |
| 3479 | VOS_ASSERT(0); |
| 3480 | return status; |
| 3481 | } |
| 3482 | |
| 3483 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3484 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3485 | { |
| 3486 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3487 | { |
Hanumantha Reddy Pothula | f57da15 | 2014-10-31 13:02:08 +0530 | [diff] [blame] | 3488 | status = csrRoamIssueDeauthStaCmd( pMac, sessionId, pDelStaParams); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3489 | } |
| 3490 | else |
| 3491 | { |
| 3492 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3493 | } |
| 3494 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3495 | } |
| 3496 | |
| 3497 | return (status); |
| 3498 | } |
| 3499 | |
| 3500 | /* --------------------------------------------------------------------------- |
| 3501 | \fn sme_RoamTKIPCounterMeasures |
| 3502 | \brief To start or stop TKIP counter measures. This is an asynchronous API. |
| 3503 | \param sessionId - sessionId of SoftAP |
| 3504 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3505 | \return eHalStatus |
| 3506 | -------------------------------------------------------------------------------*/ |
| 3507 | eHalStatus sme_RoamTKIPCounterMeasures(tHalHandle hHal, tANI_U8 sessionId, |
| 3508 | tANI_BOOLEAN bEnable) |
| 3509 | { |
| 3510 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3511 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3512 | |
| 3513 | if ( NULL == pMac ) |
| 3514 | { |
| 3515 | VOS_ASSERT(0); |
| 3516 | return status; |
| 3517 | } |
| 3518 | |
| 3519 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3520 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3521 | { |
| 3522 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3523 | { |
| 3524 | status = csrRoamIssueTkipCounterMeasures( pMac, sessionId, bEnable); |
| 3525 | } |
| 3526 | else |
| 3527 | { |
| 3528 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3529 | } |
| 3530 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3531 | } |
| 3532 | |
| 3533 | return (status); |
| 3534 | } |
| 3535 | |
| 3536 | /* --------------------------------------------------------------------------- |
| 3537 | \fn sme_RoamGetAssociatedStas |
| 3538 | \brief To probe the list of associated stations from various modules of CORE stack. |
| 3539 | \This is an asynchronous API. |
| 3540 | \param sessionId - sessionId of SoftAP |
| 3541 | \param modId - Module from whom list of associtated stations is to be probed. |
| 3542 | If an invalid module is passed then by default VOS_MODULE_ID_PE will be probed |
| 3543 | \param pUsrContext - Opaque HDD context |
| 3544 | \param pfnSapEventCallback - Sap event callback in HDD |
| 3545 | \param pAssocBuf - Caller allocated memory to be filled with associatd stations info |
| 3546 | \return eHalStatus |
| 3547 | -------------------------------------------------------------------------------*/ |
| 3548 | eHalStatus sme_RoamGetAssociatedStas(tHalHandle hHal, tANI_U8 sessionId, |
| 3549 | VOS_MODULE_ID modId, void *pUsrContext, |
| 3550 | void *pfnSapEventCallback, tANI_U8 *pAssocStasBuf) |
| 3551 | { |
| 3552 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3553 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3554 | |
| 3555 | if ( NULL == pMac ) |
| 3556 | { |
| 3557 | VOS_ASSERT(0); |
| 3558 | return status; |
| 3559 | } |
| 3560 | |
| 3561 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3562 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3563 | { |
| 3564 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3565 | { |
| 3566 | status = csrRoamGetAssociatedStas( pMac, sessionId, modId, pUsrContext, pfnSapEventCallback, pAssocStasBuf ); |
| 3567 | } |
| 3568 | else |
| 3569 | { |
| 3570 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3571 | } |
| 3572 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3573 | } |
| 3574 | |
| 3575 | return (status); |
| 3576 | } |
| 3577 | |
| 3578 | /* --------------------------------------------------------------------------- |
| 3579 | \fn sme_RoamGetWpsSessionOverlap |
| 3580 | \brief To get the WPS PBC session overlap information. |
| 3581 | \This is an asynchronous API. |
| 3582 | \param sessionId - sessionId of SoftAP |
| 3583 | \param pUsrContext - Opaque HDD context |
| 3584 | \param pfnSapEventCallback - Sap event callback in HDD |
| 3585 | \pRemoveMac - pointer to Mac address which needs to be removed from session |
| 3586 | \return eHalStatus |
| 3587 | -------------------------------------------------------------------------------*/ |
| 3588 | eHalStatus sme_RoamGetWpsSessionOverlap(tHalHandle hHal, tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3589 | void *pUsrContext, void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3590 | *pfnSapEventCallback, v_MACADDR_t pRemoveMac) |
| 3591 | { |
| 3592 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3593 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3594 | |
| 3595 | if ( NULL == pMac ) |
| 3596 | { |
| 3597 | VOS_ASSERT(0); |
| 3598 | return status; |
| 3599 | } |
| 3600 | |
| 3601 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3602 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3603 | { |
| 3604 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3605 | { |
| 3606 | status = csrRoamGetWpsSessionOverlap( pMac, sessionId, pUsrContext, pfnSapEventCallback, pRemoveMac); |
| 3607 | } |
| 3608 | else |
| 3609 | { |
| 3610 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3611 | } |
| 3612 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3613 | } |
| 3614 | |
| 3615 | return (status); |
| 3616 | } |
| 3617 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3618 | |
| 3619 | /* --------------------------------------------------------------------------- |
| 3620 | \fn sme_RoamGetConnectState |
| 3621 | \brief a wrapper function to request CSR to return the current connect state |
| 3622 | of Roaming |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3623 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3624 | \return eHalStatus |
| 3625 | ---------------------------------------------------------------------------*/ |
| 3626 | eHalStatus sme_RoamGetConnectState(tHalHandle hHal, tANI_U8 sessionId, eCsrConnectState *pState) |
| 3627 | { |
| 3628 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3629 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3630 | |
| 3631 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3632 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3633 | { |
| 3634 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3635 | { |
| 3636 | status = csrRoamGetConnectState( pMac, sessionId, pState ); |
| 3637 | } |
| 3638 | else |
| 3639 | { |
| 3640 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3641 | } |
| 3642 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3643 | } |
| 3644 | |
| 3645 | return (status); |
| 3646 | } |
| 3647 | |
| 3648 | /* --------------------------------------------------------------------------- |
| 3649 | \fn sme_RoamGetConnectProfile |
| 3650 | \brief a wrapper function to request CSR to return the current connect |
| 3651 | profile. Caller must call csrRoamFreeConnectProfile after it is done |
| 3652 | and before reuse for another csrRoamGetConnectProfile call. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3653 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3654 | \param pProfile - pointer to a caller allocated structure |
| 3655 | tCsrRoamConnectedProfile |
| 3656 | \return eHalStatus. Failure if not connected |
| 3657 | ---------------------------------------------------------------------------*/ |
| 3658 | eHalStatus sme_RoamGetConnectProfile(tHalHandle hHal, tANI_U8 sessionId, |
| 3659 | tCsrRoamConnectedProfile *pProfile) |
| 3660 | { |
| 3661 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3662 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3663 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3664 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3665 | TRACE_CODE_SME_RX_HDD_ROAM_GET_CONNECTPROFILE, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3666 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3667 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3668 | { |
| 3669 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3670 | { |
| 3671 | status = csrRoamGetConnectProfile( pMac, sessionId, pProfile ); |
| 3672 | } |
| 3673 | else |
| 3674 | { |
| 3675 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3676 | } |
| 3677 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3678 | } |
| 3679 | |
| 3680 | return (status); |
| 3681 | } |
| 3682 | |
| 3683 | /* --------------------------------------------------------------------------- |
| 3684 | \fn sme_RoamFreeConnectProfile |
| 3685 | \brief a wrapper function to request CSR to free and reinitialize the |
| 3686 | profile returned previously by csrRoamGetConnectProfile. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3687 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3688 | \param pProfile - pointer to a caller allocated structure |
| 3689 | tCsrRoamConnectedProfile |
| 3690 | \return eHalStatus. |
| 3691 | ---------------------------------------------------------------------------*/ |
| 3692 | eHalStatus sme_RoamFreeConnectProfile(tHalHandle hHal, |
| 3693 | tCsrRoamConnectedProfile *pProfile) |
| 3694 | { |
| 3695 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3696 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3697 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3698 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3699 | TRACE_CODE_SME_RX_HDD_ROAM_FREE_CONNECTPROFILE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3700 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3701 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3702 | { |
| 3703 | status = csrRoamFreeConnectProfile( pMac, pProfile ); |
| 3704 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3705 | } |
| 3706 | |
| 3707 | return (status); |
| 3708 | } |
| 3709 | |
| 3710 | /* --------------------------------------------------------------------------- |
| 3711 | \fn sme_RoamSetPMKIDCache |
| 3712 | \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] | 3713 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3714 | \param pPMKIDCache - caller allocated buffer point to an array of |
| 3715 | tPmkidCacheInfo |
| 3716 | \param numItems - a variable that has the number of tPmkidCacheInfo |
| 3717 | allocated when retruning, this is either the number needed |
| 3718 | or number of items put into pPMKIDCache |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 3719 | \param update_entire_cache - this bool value specifies if the entire pmkid |
| 3720 | cache should be overwritten or should it be |
| 3721 | updated entry by entry. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3722 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3723 | big enough and pNumItems has the number of |
| 3724 | tPmkidCacheInfo. |
| 3725 | \Note: pNumItems is a number of tPmkidCacheInfo, |
| 3726 | not sizeof(tPmkidCacheInfo) * something |
| 3727 | ---------------------------------------------------------------------------*/ |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 3728 | eHalStatus sme_RoamSetPMKIDCache( tHalHandle hHal, tANI_U8 sessionId, |
| 3729 | tPmkidCacheInfo *pPMKIDCache, |
| 3730 | tANI_U32 numItems, |
| 3731 | tANI_BOOLEAN update_entire_cache ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3732 | { |
| 3733 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3734 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3735 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3736 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3737 | TRACE_CODE_SME_RX_HDD_ROAM_SET_PMKIDCACHE, sessionId, numItems)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3738 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3739 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3740 | { |
| 3741 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3742 | { |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 3743 | status = csrRoamSetPMKIDCache( pMac, sessionId, pPMKIDCache, |
| 3744 | numItems, update_entire_cache ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3745 | } |
| 3746 | else |
| 3747 | { |
| 3748 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3749 | } |
| 3750 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3751 | } |
| 3752 | |
| 3753 | return (status); |
| 3754 | } |
| 3755 | |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 3756 | eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, |
| 3757 | tANI_U8 *pBSSId, |
| 3758 | tANI_BOOLEAN flush_cache ) |
Leela Venkata Kiran Kumar Reddy Chirala | ede1065 | 2013-09-11 18:48:46 -0700 | [diff] [blame] | 3759 | { |
| 3760 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3761 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3762 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3763 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3764 | { |
| 3765 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3766 | { |
Kanchanapally, Vidyullatha | 2633ace | 2014-09-25 15:16:50 +0530 | [diff] [blame] | 3767 | status = csrRoamDelPMKIDfromCache( pMac, sessionId, |
| 3768 | pBSSId, flush_cache ); |
Leela Venkata Kiran Kumar Reddy Chirala | ede1065 | 2013-09-11 18:48:46 -0700 | [diff] [blame] | 3769 | } |
| 3770 | else |
| 3771 | { |
| 3772 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3773 | } |
| 3774 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3775 | } |
| 3776 | return (status); |
| 3777 | } |
Wilson Yang | 47b5819 | 2013-12-11 11:40:19 -0800 | [diff] [blame] | 3778 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3779 | /* --------------------------------------------------------------------------- |
| 3780 | \fn sme_RoamGetSecurityReqIE |
| 3781 | \brief a wrapper function to request CSR to return the WPA or RSN or WAPI IE CSR |
| 3782 | passes to PE to JOIN request or START_BSS request |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3783 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3784 | \param pLen - caller allocated memory that has the length of pBuf as input. |
| 3785 | Upon returned, *pLen has the needed or IE length in pBuf. |
| 3786 | \param pBuf - Caller allocated memory that contain the IE field, if any, |
| 3787 | upon return |
| 3788 | \param secType - Specifies whether looking for WPA/WPA2/WAPI IE |
| 3789 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3790 | big enough |
| 3791 | ---------------------------------------------------------------------------*/ |
| 3792 | eHalStatus sme_RoamGetSecurityReqIE(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pLen, |
| 3793 | tANI_U8 *pBuf, eCsrSecurityType secType) |
| 3794 | { |
| 3795 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3796 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3797 | |
| 3798 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3799 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3800 | { |
| 3801 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3802 | { |
| 3803 | status = csrRoamGetWpaRsnReqIE( hHal, sessionId, pLen, pBuf ); |
| 3804 | } |
| 3805 | else |
| 3806 | { |
| 3807 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3808 | } |
| 3809 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3810 | } |
| 3811 | |
| 3812 | return (status); |
| 3813 | } |
| 3814 | |
| 3815 | /* --------------------------------------------------------------------------- |
| 3816 | \fn sme_RoamGetSecurityRspIE |
| 3817 | \brief a wrapper function to request CSR to return the WPA or RSN or WAPI IE from |
| 3818 | the beacon or probe rsp if connected |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3819 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3820 | \param pLen - caller allocated memory that has the length of pBuf as input. |
| 3821 | Upon returned, *pLen has the needed or IE length in pBuf. |
| 3822 | \param pBuf - Caller allocated memory that contain the IE field, if any, |
| 3823 | upon return |
| 3824 | \param secType - Specifies whether looking for WPA/WPA2/WAPI IE |
| 3825 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3826 | big enough |
| 3827 | ---------------------------------------------------------------------------*/ |
| 3828 | eHalStatus sme_RoamGetSecurityRspIE(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pLen, |
| 3829 | tANI_U8 *pBuf, eCsrSecurityType secType) |
| 3830 | { |
| 3831 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3832 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3833 | |
| 3834 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3835 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3836 | { |
| 3837 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3838 | { |
| 3839 | status = csrRoamGetWpaRsnRspIE( pMac, sessionId, pLen, pBuf ); |
| 3840 | } |
| 3841 | else |
| 3842 | { |
| 3843 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3844 | } |
| 3845 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3846 | } |
| 3847 | |
| 3848 | return (status); |
| 3849 | |
| 3850 | } |
| 3851 | |
| 3852 | |
| 3853 | /* --------------------------------------------------------------------------- |
| 3854 | \fn sme_RoamGetNumPMKIDCache |
| 3855 | \brief a wrapper function to request CSR to return number of PMKID cache |
| 3856 | entries |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3857 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3858 | \return tANI_U32 - the number of PMKID cache entries |
| 3859 | ---------------------------------------------------------------------------*/ |
| 3860 | tANI_U32 sme_RoamGetNumPMKIDCache(tHalHandle hHal, tANI_U8 sessionId) |
| 3861 | { |
| 3862 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3863 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3864 | tANI_U32 numPmkidCache = 0; |
| 3865 | |
| 3866 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3867 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3868 | { |
| 3869 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3870 | { |
| 3871 | numPmkidCache = csrRoamGetNumPMKIDCache( pMac, sessionId ); |
| 3872 | status = eHAL_STATUS_SUCCESS; |
| 3873 | } |
| 3874 | else |
| 3875 | { |
| 3876 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3877 | } |
| 3878 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3879 | } |
| 3880 | |
| 3881 | return (numPmkidCache); |
| 3882 | } |
| 3883 | |
| 3884 | /* --------------------------------------------------------------------------- |
| 3885 | \fn sme_RoamGetPMKIDCache |
| 3886 | \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] | 3887 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3888 | \param pNum - caller allocated memory that has the space of the number of |
| 3889 | pBuf tPmkidCacheInfo as input. Upon returned, *pNum has the |
| 3890 | needed or actually number in tPmkidCacheInfo. |
| 3891 | \param pPmkidCache - Caller allocated memory that contains PMKID cache, if |
| 3892 | any, upon return |
| 3893 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3894 | big enough |
| 3895 | ---------------------------------------------------------------------------*/ |
| 3896 | eHalStatus sme_RoamGetPMKIDCache(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pNum, |
| 3897 | tPmkidCacheInfo *pPmkidCache) |
| 3898 | { |
| 3899 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3900 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3901 | |
| 3902 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3903 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3904 | { |
| 3905 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3906 | { |
| 3907 | status = csrRoamGetPMKIDCache( pMac, sessionId, pNum, pPmkidCache ); |
| 3908 | } |
| 3909 | else |
| 3910 | { |
| 3911 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3912 | } |
| 3913 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3914 | } |
| 3915 | |
| 3916 | return (status); |
| 3917 | } |
| 3918 | |
| 3919 | |
| 3920 | /* --------------------------------------------------------------------------- |
| 3921 | \fn sme_GetConfigParam |
| 3922 | \brief a wrapper function that HDD calls to get the global settings |
| 3923 | currently maintained by CSR. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3924 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3925 | \param pParam - caller allocated memory |
| 3926 | \return eHalStatus |
| 3927 | ---------------------------------------------------------------------------*/ |
| 3928 | eHalStatus sme_GetConfigParam(tHalHandle hHal, tSmeConfigParams *pParam) |
| 3929 | { |
| 3930 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3931 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3932 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3933 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3934 | TRACE_CODE_SME_RX_HDD_GET_CONFIGPARAM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3935 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3936 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3937 | { |
| 3938 | status = csrGetConfigParam(pMac, &pParam->csrConfig); |
| 3939 | if (status != eHAL_STATUS_SUCCESS) |
| 3940 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3941 | smsLog( pMac, LOGE, "%s csrGetConfigParam failed", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3942 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3943 | return status; |
| 3944 | } |
| 3945 | #if defined WLAN_FEATURE_P2P_INTERNAL |
| 3946 | status = p2pGetConfigParam(pMac, &pParam->p2pConfig); |
| 3947 | if (status != eHAL_STATUS_SUCCESS) |
| 3948 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3949 | smsLog( pMac, LOGE, "%s p2pGetConfigParam failed", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3950 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3951 | return status; |
| 3952 | } |
| 3953 | #endif |
| 3954 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3955 | } |
| 3956 | |
| 3957 | return (status); |
| 3958 | } |
| 3959 | |
| 3960 | /* --------------------------------------------------------------------------- |
| 3961 | \fn sme_CfgSetInt |
| 3962 | \brief a wrapper function that HDD calls to set parameters in CFG. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3963 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3964 | \param cfgId - Configuration Parameter ID (type) for STA. |
| 3965 | \param ccmValue - The information related to Configuration Parameter ID |
| 3966 | which needs to be saved in CFG |
| 3967 | \param callback - To be registered by CSR with CCM. Once the CFG done with |
| 3968 | saving the information in the database, it notifies CCM & |
| 3969 | then the callback will be invoked to notify. |
| 3970 | \param toBeSaved - To save the request for future reference |
| 3971 | \return eHalStatus |
| 3972 | ---------------------------------------------------------------------------*/ |
| 3973 | eHalStatus sme_CfgSetInt(tHalHandle hHal, tANI_U32 cfgId, tANI_U32 ccmValue, |
| 3974 | tCcmCfgSetCallback callback, eAniBoolean toBeSaved) |
| 3975 | { |
| 3976 | return(ccmCfgSetInt(hHal, cfgId, ccmValue, callback, toBeSaved)); |
| 3977 | } |
| 3978 | |
| 3979 | /* --------------------------------------------------------------------------- |
| 3980 | \fn sme_CfgSetStr |
| 3981 | \brief a wrapper function that HDD calls to set parameters in CFG. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3982 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3983 | \param cfgId - Configuration Parameter ID (type) for STA. |
| 3984 | \param pStr - Pointer to the byte array which carries the information needs |
| 3985 | to be saved in CFG |
| 3986 | \param length - Length of the data to be saved |
| 3987 | \param callback - To be registered by CSR with CCM. Once the CFG done with |
| 3988 | saving the information in the database, it notifies CCM & |
| 3989 | then the callback will be invoked to notify. |
| 3990 | \param toBeSaved - To save the request for future reference |
| 3991 | \return eHalStatus |
| 3992 | ---------------------------------------------------------------------------*/ |
| 3993 | eHalStatus sme_CfgSetStr(tHalHandle hHal, tANI_U32 cfgId, tANI_U8 *pStr, |
| 3994 | tANI_U32 length, tCcmCfgSetCallback callback, |
| 3995 | eAniBoolean toBeSaved) |
| 3996 | { |
| 3997 | return(ccmCfgSetStr(hHal, cfgId, pStr, length, callback, toBeSaved)); |
| 3998 | } |
| 3999 | |
| 4000 | /* --------------------------------------------------------------------------- |
Sandeep Puligilla | a3e7695 | 2014-06-23 15:53:11 +0530 | [diff] [blame] | 4001 | \fn sme_GetModifyProfileFields |
| 4002 | \brief HDD or SME - QOS calls this function to get the current values of |
| 4003 | connected profile fields, changing which can cause reassoc. |
| 4004 | This function must be called after CFG is downloaded and STA is in connected |
| 4005 | state. Also, make sure to call this function to get the current profile |
| 4006 | fields before calling the reassoc. So that pModifyProfileFields will have |
| 4007 | all the latest values plus the one(s) has been updated as part of reassoc |
| 4008 | request. |
| 4009 | \param pModifyProfileFields - pointer to the connected profile fields |
| 4010 | changing which can cause reassoc |
| 4011 | |
| 4012 | \return eHalStatus |
| 4013 | -------------------------------------------------------------------------------*/ |
| 4014 | eHalStatus sme_GetModifyProfileFields(tHalHandle hHal, tANI_U8 sessionId, |
| 4015 | tCsrRoamModifyProfileFields * pModifyProfileFields) |
| 4016 | { |
| 4017 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4018 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4019 | |
| 4020 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 4021 | TRACE_CODE_SME_RX_HDD_GET_MODPROFFIELDS, sessionId, 0)); |
| 4022 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4023 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4024 | { |
| 4025 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4026 | { |
| 4027 | status = csrGetModifyProfileFields(pMac, sessionId, pModifyProfileFields); |
| 4028 | } |
| 4029 | else |
| 4030 | { |
| 4031 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4032 | } |
| 4033 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4034 | } |
| 4035 | |
| 4036 | return (status); |
| 4037 | } |
| 4038 | |
| 4039 | /* --------------------------------------------------------------------------- |
Sandeep Puligilla | 332ea91 | 2014-02-04 00:16:24 +0530 | [diff] [blame] | 4040 | \fn sme_HT40StopOBSSScan |
| 4041 | \brief HDD or SME - Command to stop the OBSS scan |
| 4042 | THis is implemented only for debugging purpose. |
| 4043 | As per spec while operating in 2.4GHz OBSS scan shouldnt be stopped. |
| 4044 | \param sessionId - sessionId |
| 4045 | changing which can cause reassoc |
| 4046 | |
| 4047 | \return eHalStatus |
| 4048 | -------------------------------------------------------------------------------*/ |
| 4049 | eHalStatus sme_HT40StopOBSSScan(tHalHandle hHal, tANI_U8 sessionId) |
| 4050 | { |
| 4051 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4052 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4053 | |
| 4054 | smsLog(pMac, LOG2, FL("enter")); |
| 4055 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4056 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4057 | { |
| 4058 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 4059 | { |
| 4060 | csrHT40StopOBSSScan( pMac, sessionId ); |
| 4061 | } |
| 4062 | else |
| 4063 | { |
| 4064 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 4065 | "%s: Invalid session sessionId %d", __func__,sessionId); |
| 4066 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4067 | } |
| 4068 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4069 | } |
| 4070 | return (status); |
| 4071 | } |
| 4072 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4073 | /*-------------------------------------------------------------------------- |
| 4074 | \fn sme_SetConfigPowerSave |
| 4075 | \brief Wrapper fn to change power save configuration in SME (PMC) module. |
| 4076 | For BMPS related configuration, this function also updates the CFG |
| 4077 | and sends a message to FW to pick up the new values. Note: Calling |
| 4078 | this function only updates the configuration and does not enable |
| 4079 | the specified power save mode. |
| 4080 | \param hHal - The handle returned by macOpen. |
| 4081 | \param psMode - Power Saving mode being modified |
| 4082 | \param pConfigParams - a pointer to a caller allocated object of type |
| 4083 | tPmcSmpsConfigParams or tPmcBmpsConfigParams or tPmcImpsConfigParams |
| 4084 | \return eHalStatus |
| 4085 | --------------------------------------------------------------------------*/ |
| 4086 | eHalStatus sme_SetConfigPowerSave(tHalHandle hHal, tPmcPowerSavingMode psMode, |
| 4087 | void *pConfigParams) |
| 4088 | { |
| 4089 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4090 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4091 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4092 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4093 | TRACE_CODE_SME_RX_HDD_SET_CONFIG_PWRSAVE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4094 | if (NULL == pConfigParams ) { |
| 4095 | smsLog( pMac, LOGE, "Empty config param structure for PMC, " |
| 4096 | "nothing to update"); |
| 4097 | return eHAL_STATUS_FAILURE; |
| 4098 | } |
| 4099 | |
| 4100 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4101 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4102 | { |
| 4103 | status = pmcSetConfigPowerSave(hHal, psMode, pConfigParams); |
| 4104 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4105 | } |
| 4106 | |
| 4107 | return (status); |
| 4108 | } |
| 4109 | |
| 4110 | /*-------------------------------------------------------------------------- |
| 4111 | \fn sme_GetConfigPowerSave |
| 4112 | \brief Wrapper fn to retrieve power save configuration in SME (PMC) module |
| 4113 | \param hHal - The handle returned by macOpen. |
| 4114 | \param psMode - Power Saving mode |
| 4115 | \param pConfigParams - a pointer to a caller allocated object of type |
| 4116 | tPmcSmpsConfigParams or tPmcBmpsConfigParams or tPmcImpsConfigParams |
| 4117 | \return eHalStatus |
| 4118 | --------------------------------------------------------------------------*/ |
| 4119 | eHalStatus sme_GetConfigPowerSave(tHalHandle hHal, tPmcPowerSavingMode psMode, |
| 4120 | void *pConfigParams) |
| 4121 | { |
| 4122 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4123 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4124 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4125 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4126 | TRACE_CODE_SME_RX_HDD_GET_CONFIG_PWRSAVE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4127 | if (NULL == pConfigParams ) { |
| 4128 | smsLog( pMac, LOGE, "Empty config param structure for PMC, " |
| 4129 | "nothing to update"); |
| 4130 | return eHAL_STATUS_FAILURE; |
| 4131 | } |
| 4132 | |
| 4133 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4134 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4135 | { |
| 4136 | status = pmcGetConfigPowerSave(hHal, psMode, pConfigParams); |
| 4137 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4138 | } |
| 4139 | |
| 4140 | return (status); |
| 4141 | } |
| 4142 | |
| 4143 | /* --------------------------------------------------------------------------- |
| 4144 | \fn sme_SignalPowerEvent |
| 4145 | \brief Signals to PMC that a power event has occurred. Used for putting |
| 4146 | the chip into deep sleep mode. |
| 4147 | \param hHal - The handle returned by macOpen. |
| 4148 | \param event - the event that has occurred |
| 4149 | \return eHalStatus |
| 4150 | ---------------------------------------------------------------------------*/ |
| 4151 | eHalStatus sme_SignalPowerEvent (tHalHandle hHal, tPmcPowerEvent event) |
| 4152 | { |
| 4153 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4154 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4155 | |
| 4156 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4157 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4158 | { |
| 4159 | status = pmcSignalPowerEvent(hHal, event); |
| 4160 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4161 | } |
| 4162 | |
| 4163 | return (status); |
| 4164 | } |
| 4165 | |
| 4166 | /* --------------------------------------------------------------------------- |
| 4167 | \fn sme_EnablePowerSave |
| 4168 | \brief Enables one of the power saving modes. |
| 4169 | \param hHal - The handle returned by macOpen. |
| 4170 | \param psMode - The power saving mode to enable. If BMPS mode is enabled |
| 4171 | while the chip is operating in Full Power, PMC will start |
| 4172 | a timer that will try to put the chip in BMPS mode after |
| 4173 | expiry. |
| 4174 | \return eHalStatus |
| 4175 | ---------------------------------------------------------------------------*/ |
| 4176 | eHalStatus sme_EnablePowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 4177 | { |
| 4178 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4179 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4180 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4181 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4182 | TRACE_CODE_SME_RX_HDD_ENABLE_PWRSAVE, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4183 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4184 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4185 | { |
| 4186 | status = pmcEnablePowerSave(hHal, psMode); |
| 4187 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4188 | } |
| 4189 | |
| 4190 | return (status); |
| 4191 | } |
| 4192 | |
| 4193 | /* --------------------------------------------------------------------------- |
| 4194 | \fn sme_DisablePowerSave |
| 4195 | \brief Disables one of the power saving modes. |
| 4196 | \param hHal - The handle returned by macOpen. |
| 4197 | \param psMode - The power saving mode to disable. Disabling does not imply |
| 4198 | that device will be brought out of the current PS mode. This |
| 4199 | is purely a configuration API. |
| 4200 | \return eHalStatus |
| 4201 | ---------------------------------------------------------------------------*/ |
| 4202 | eHalStatus sme_DisablePowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 4203 | { |
| 4204 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4205 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4206 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4207 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4208 | TRACE_CODE_SME_RX_HDD_DISABLE_PWRSAVE, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4209 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4210 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4211 | { |
| 4212 | status = pmcDisablePowerSave(hHal, psMode); |
| 4213 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4214 | } |
| 4215 | |
| 4216 | return (status); |
| 4217 | } |
| 4218 | |
| 4219 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 69b3418 | 2013-01-16 08:51:40 +0530 | [diff] [blame] | 4220 | + \fn sme_SetHostPowerSave |
| 4221 | + \brief Enables BMPS logic to be controlled by User level apps |
| 4222 | + \param hHal - The handle returned by macOpen. |
| 4223 | + \param psMode - The power saving mode to disable. Disabling does not imply |
| 4224 | + that device will be brought out of the current PS mode. This |
| 4225 | + is purely a configuration API. |
| 4226 | + \return eHalStatus |
| 4227 | + ---------------------------------------------------------------------------*/ |
| 4228 | eHalStatus sme_SetHostPowerSave (tHalHandle hHal, v_BOOL_t psMode) |
| 4229 | { |
| 4230 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4231 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4232 | |
| 4233 | pMac->pmc.isHostPsEn = psMode; |
| 4234 | |
| 4235 | return (status); |
| 4236 | } |
| 4237 | |
| 4238 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4239 | \fn sme_StartAutoBmpsTimer |
| 4240 | \brief Starts a timer that periodically polls all the registered |
| 4241 | module for entry into Bmps mode. This timer is started only if BMPS is |
| 4242 | enabled and whenever the device is in full power. |
| 4243 | \param hHal - The handle returned by macOpen. |
| 4244 | \return eHalStatus |
| 4245 | ---------------------------------------------------------------------------*/ |
| 4246 | eHalStatus sme_StartAutoBmpsTimer ( tHalHandle hHal) |
| 4247 | { |
| 4248 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4249 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4250 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4251 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4252 | TRACE_CODE_SME_RX_HDD_START_AUTO_BMPSTIMER, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4253 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4254 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4255 | { |
| 4256 | status = pmcStartAutoBmpsTimer(hHal); |
| 4257 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4258 | } |
| 4259 | |
| 4260 | return (status); |
| 4261 | } |
| 4262 | /* --------------------------------------------------------------------------- |
| 4263 | \fn sme_StopAutoBmpsTimer |
| 4264 | \brief Stops the Auto BMPS Timer that was started using sme_startAutoBmpsTimer |
| 4265 | Stopping the timer does not cause a device state change. Only the timer |
| 4266 | is stopped. If "Full Power" is desired, use the sme_RequestFullPower API |
| 4267 | \param hHal - The handle returned by macOpen. |
| 4268 | \return eHalStatus |
| 4269 | ---------------------------------------------------------------------------*/ |
| 4270 | eHalStatus sme_StopAutoBmpsTimer ( tHalHandle hHal) |
| 4271 | { |
| 4272 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4273 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4274 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4275 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4276 | TRACE_CODE_SME_RX_HDD_STOP_AUTO_BMPSTIMER, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4277 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4278 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4279 | { |
| 4280 | status = pmcStopAutoBmpsTimer(hHal); |
| 4281 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4282 | } |
| 4283 | |
| 4284 | return (status); |
| 4285 | } |
| 4286 | /* --------------------------------------------------------------------------- |
| 4287 | \fn sme_QueryPowerState |
| 4288 | \brief Returns the current power state of the device. |
| 4289 | \param hHal - The handle returned by macOpen. |
| 4290 | \param pPowerState - pointer to location to return power state (LOW or HIGH) |
| 4291 | \param pSwWlanSwitchState - ptr to location to return SW WLAN Switch state |
| 4292 | \return eHalStatus |
| 4293 | ---------------------------------------------------------------------------*/ |
| 4294 | eHalStatus sme_QueryPowerState ( |
| 4295 | tHalHandle hHal, |
| 4296 | tPmcPowerState *pPowerState, |
| 4297 | tPmcSwitchState *pSwWlanSwitchState) |
| 4298 | { |
| 4299 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4300 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4301 | |
| 4302 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4303 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4304 | { |
| 4305 | status = pmcQueryPowerState (hHal, pPowerState, NULL, pSwWlanSwitchState); |
| 4306 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4307 | } |
| 4308 | |
| 4309 | return (status); |
| 4310 | } |
| 4311 | |
| 4312 | /* --------------------------------------------------------------------------- |
| 4313 | \fn sme_IsPowerSaveEnabled |
| 4314 | \brief Checks if the device is able to enter a particular power save mode |
| 4315 | This does not imply that the device is in a particular PS mode |
| 4316 | \param hHal - The handle returned by macOpen. |
| 4317 | \param psMode - the power saving mode |
| 4318 | \return eHalStatus |
| 4319 | ---------------------------------------------------------------------------*/ |
| 4320 | tANI_BOOLEAN sme_IsPowerSaveEnabled (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 4321 | { |
| 4322 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4323 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4324 | tANI_BOOLEAN result = false; |
| 4325 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4326 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4327 | TRACE_CODE_SME_RX_HDD_IS_PWRSAVE_ENABLED, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4328 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4329 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4330 | { |
| 4331 | result = pmcIsPowerSaveEnabled(hHal, psMode); |
| 4332 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4333 | return result; |
| 4334 | } |
| 4335 | |
| 4336 | return false; |
| 4337 | } |
| 4338 | |
| 4339 | /* --------------------------------------------------------------------------- |
| 4340 | \fn sme_RequestFullPower |
| 4341 | \brief Request that the device be brought to full power state. When the |
| 4342 | device enters Full Power PMC will start a BMPS timer if BMPS PS mode |
| 4343 | is enabled. On timer expiry PMC will attempt to put the device in |
| 4344 | BMPS mode if following holds true: |
| 4345 | - BMPS mode is enabled |
| 4346 | - Polling of all modules through the Power Save Check routine passes |
| 4347 | - STA is associated to an access point |
| 4348 | \param hHal - The handle returned by macOpen. |
| 4349 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4350 | \return eHalStatus - status |
| 4351 | eHAL_STATUS_SUCCESS - device brought to full power state |
| 4352 | eHAL_STATUS_FAILURE - device cannot be brought to full power state |
| 4353 | eHAL_STATUS_PMC_PENDING - device is being brought to full power state, |
| 4354 | ---------------------------------------------------------------------------*/ |
| 4355 | eHalStatus sme_RequestFullPower ( |
| 4356 | tHalHandle hHal, |
| 4357 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4358 | void *callbackContext, |
| 4359 | tRequestFullPowerReason fullPowerReason) |
| 4360 | { |
| 4361 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4362 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4363 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4364 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4365 | TRACE_CODE_SME_RX_HDD_REQUEST_FULLPOWER, NO_SESSION, fullPowerReason)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4366 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4367 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4368 | { |
| 4369 | status = pmcRequestFullPower(hHal, callbackRoutine, callbackContext, fullPowerReason); |
| 4370 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4371 | } |
| 4372 | |
| 4373 | return (status); |
| 4374 | } |
| 4375 | |
| 4376 | /* --------------------------------------------------------------------------- |
| 4377 | \fn sme_RequestBmps |
| 4378 | \brief Request that the device be put in BMPS state. Request will be |
| 4379 | accepted only if BMPS mode is enabled and power save check routine |
| 4380 | passes. |
| 4381 | \param hHal - The handle returned by macOpen. |
| 4382 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4383 | \return eHalStatus |
| 4384 | eHAL_STATUS_SUCCESS - device is in BMPS state |
| 4385 | eHAL_STATUS_FAILURE - device cannot be brought to BMPS state |
| 4386 | eHAL_STATUS_PMC_PENDING - device is being brought to BMPS state |
| 4387 | ---------------------------------------------------------------------------*/ |
| 4388 | eHalStatus sme_RequestBmps ( |
| 4389 | tHalHandle hHal, |
| 4390 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4391 | void *callbackContext) |
| 4392 | { |
| 4393 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4394 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4395 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4396 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4397 | TRACE_CODE_SME_RX_HDD_REQUEST_BMPS, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4398 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4399 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4400 | { |
| 4401 | status = pmcRequestBmps(hHal, callbackRoutine, callbackContext); |
| 4402 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4403 | } |
| 4404 | |
| 4405 | return (status); |
| 4406 | } |
| 4407 | |
| 4408 | |
| 4409 | /* --------------------------------------------------------------------------- |
| 4410 | \fn sme_SetDHCPTillPowerActiveFlag |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4411 | \brief Sets/Clears DHCP related flag in PMC to disable/enable auto BMPS |
| 4412 | entry by PMC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4413 | \param hHal - The handle returned by macOpen. |
| 4414 | ---------------------------------------------------------------------------*/ |
| 4415 | void sme_SetDHCPTillPowerActiveFlag(tHalHandle hHal, tANI_U8 flag) |
| 4416 | { |
| 4417 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4418 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4419 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4420 | TRACE_CODE_SME_RX_HDD_SET_DHCP_FLAG, NO_SESSION, flag)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4421 | // Set/Clear the DHCP flag which will disable/enable auto BMPS entery by PMC |
| 4422 | pMac->pmc.remainInPowerActiveTillDHCP = flag; |
| 4423 | } |
| 4424 | |
| 4425 | |
| 4426 | /* --------------------------------------------------------------------------- |
| 4427 | \fn sme_StartUapsd |
| 4428 | \brief Request that the device be put in UAPSD state. If the device is in |
| 4429 | Full Power it will be put in BMPS mode first and then into UAPSD |
| 4430 | mode. |
| 4431 | \param hHal - The handle returned by macOpen. |
| 4432 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4433 | eHAL_STATUS_SUCCESS - device is in UAPSD state |
| 4434 | eHAL_STATUS_FAILURE - device cannot be brought to UAPSD state |
| 4435 | eHAL_STATUS_PMC_PENDING - device is being brought to UAPSD state |
| 4436 | eHAL_STATUS_PMC_DISABLED - UAPSD is disabled or BMPS mode is disabled |
| 4437 | \return eHalStatus |
| 4438 | ---------------------------------------------------------------------------*/ |
| 4439 | eHalStatus sme_StartUapsd ( |
| 4440 | tHalHandle hHal, |
| 4441 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4442 | void *callbackContext) |
| 4443 | { |
| 4444 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4445 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4446 | |
| 4447 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4448 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4449 | { |
| 4450 | status = pmcStartUapsd(hHal, callbackRoutine, callbackContext); |
| 4451 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4452 | } |
| 4453 | |
| 4454 | return (status); |
| 4455 | } |
| 4456 | |
| 4457 | /* --------------------------------------------------------------------------- |
| 4458 | \fn sme_StopUapsd |
| 4459 | \brief Request that the device be put out of UAPSD state. Device will be |
| 4460 | put in in BMPS state after stop UAPSD completes. |
| 4461 | \param hHal - The handle returned by macOpen. |
| 4462 | \return eHalStatus |
| 4463 | eHAL_STATUS_SUCCESS - device is put out of UAPSD and back in BMPS state |
| 4464 | eHAL_STATUS_FAILURE - device cannot be brought out of UAPSD state |
| 4465 | ---------------------------------------------------------------------------*/ |
| 4466 | eHalStatus sme_StopUapsd (tHalHandle hHal) |
| 4467 | { |
| 4468 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4469 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4470 | |
| 4471 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4472 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4473 | { |
| 4474 | status = pmcStopUapsd(hHal); |
| 4475 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4476 | } |
| 4477 | |
| 4478 | return (status); |
| 4479 | } |
| 4480 | |
| 4481 | /* --------------------------------------------------------------------------- |
| 4482 | \fn sme_RequestStandby |
| 4483 | \brief Request that the device be put in standby. It is HDD's responsibility |
| 4484 | to bring the chip to full power and do a disassoc before calling |
| 4485 | this API. |
| 4486 | \param hHal - The handle returned by macOpen. |
| 4487 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4488 | \return eHalStatus |
| 4489 | eHAL_STATUS_SUCCESS - device is in Standby mode |
| 4490 | eHAL_STATUS_FAILURE - device cannot be put in standby mode |
| 4491 | eHAL_STATUS_PMC_PENDING - device is being put in standby mode |
| 4492 | ---------------------------------------------------------------------------*/ |
| 4493 | eHalStatus sme_RequestStandby ( |
| 4494 | tHalHandle hHal, |
| 4495 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4496 | void *callbackContext) |
| 4497 | { |
| 4498 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4499 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4500 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4501 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4502 | TRACE_CODE_SME_RX_HDD_REQUEST_STANDBY, NO_SESSION, 0)); |
Agarwal Ashish | e3cca2a | 2013-07-21 03:01:48 +0530 | [diff] [blame] | 4503 | smsLog( pMac, LOG1, FL(" called") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4504 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4505 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4506 | { |
| 4507 | status = pmcRequestStandby(hHal, callbackRoutine, callbackContext); |
| 4508 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4509 | } |
| 4510 | |
| 4511 | return (status); |
| 4512 | } |
| 4513 | |
| 4514 | /* --------------------------------------------------------------------------- |
| 4515 | \fn sme_RegisterPowerSaveCheck |
| 4516 | \brief Register a power save check routine that is called whenever |
| 4517 | the device is about to enter one of the power save modes. |
| 4518 | \param hHal - The handle returned by macOpen. |
| 4519 | \param checkRoutine - Power save check routine to be registered |
| 4520 | \return eHalStatus |
| 4521 | eHAL_STATUS_SUCCESS - successfully registered |
| 4522 | eHAL_STATUS_FAILURE - not successfully registered |
| 4523 | ---------------------------------------------------------------------------*/ |
| 4524 | eHalStatus sme_RegisterPowerSaveCheck ( |
| 4525 | tHalHandle hHal, |
| 4526 | tANI_BOOLEAN (*checkRoutine) (void *checkContext), void *checkContext) |
| 4527 | { |
| 4528 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4529 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4530 | |
| 4531 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4532 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4533 | { |
| 4534 | status = pmcRegisterPowerSaveCheck (hHal, checkRoutine, checkContext); |
| 4535 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4536 | } |
| 4537 | |
| 4538 | return (status); |
| 4539 | } |
| 4540 | |
| 4541 | /* --------------------------------------------------------------------------- |
Mihir Shete | fc7ff5b | 2014-01-27 11:30:05 +0530 | [diff] [blame] | 4542 | \fn sme_Register11dScanDoneCallback |
| 4543 | \brief Register a routine of type csrScanCompleteCallback which is |
| 4544 | called whenever an 11d scan is done |
| 4545 | \param hHal - The handle returned by macOpen. |
| 4546 | \param callback - 11d scan complete routine to be registered |
| 4547 | \return eHalStatus |
| 4548 | ---------------------------------------------------------------------------*/ |
| 4549 | eHalStatus sme_Register11dScanDoneCallback ( |
| 4550 | tHalHandle hHal, |
| 4551 | csrScanCompleteCallback callback) |
| 4552 | { |
| 4553 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 4554 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4555 | |
| 4556 | pMac->scan.callback11dScanDone = callback; |
| 4557 | |
| 4558 | return (status); |
| 4559 | } |
| 4560 | |
| 4561 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4562 | \fn sme_DeregisterPowerSaveCheck |
| 4563 | \brief Deregister a power save check routine |
| 4564 | \param hHal - The handle returned by macOpen. |
| 4565 | \param checkRoutine - Power save check routine to be deregistered |
| 4566 | \return eHalStatus |
| 4567 | eHAL_STATUS_SUCCESS - successfully deregistered |
| 4568 | eHAL_STATUS_FAILURE - not successfully deregistered |
| 4569 | ---------------------------------------------------------------------------*/ |
| 4570 | eHalStatus sme_DeregisterPowerSaveCheck ( |
| 4571 | tHalHandle hHal, |
| 4572 | tANI_BOOLEAN (*checkRoutine) (void *checkContext)) |
| 4573 | { |
| 4574 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4575 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4576 | |
| 4577 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4578 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4579 | { |
| 4580 | status = pmcDeregisterPowerSaveCheck (hHal, checkRoutine); |
| 4581 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4582 | } |
| 4583 | |
| 4584 | return (status); |
| 4585 | } |
| 4586 | |
| 4587 | /* --------------------------------------------------------------------------- |
| 4588 | \fn sme_RegisterDeviceStateUpdateInd |
| 4589 | \brief Register a callback routine that is called whenever |
| 4590 | the device enters a new device state (Full Power, BMPS, UAPSD) |
| 4591 | \param hHal - The handle returned by macOpen. |
| 4592 | \param callbackRoutine - Callback routine to be registered |
| 4593 | \param callbackContext - Cookie to be passed back during callback |
| 4594 | \return eHalStatus |
| 4595 | eHAL_STATUS_SUCCESS - successfully registered |
| 4596 | eHAL_STATUS_FAILURE - not successfully registered |
| 4597 | ---------------------------------------------------------------------------*/ |
| 4598 | eHalStatus sme_RegisterDeviceStateUpdateInd ( |
| 4599 | tHalHandle hHal, |
| 4600 | void (*callbackRoutine) (void *callbackContext, tPmcState pmcState), |
| 4601 | void *callbackContext) |
| 4602 | { |
| 4603 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4604 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4605 | |
| 4606 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4607 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4608 | { |
| 4609 | status = pmcRegisterDeviceStateUpdateInd (hHal, callbackRoutine, callbackContext); |
| 4610 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4611 | } |
| 4612 | |
| 4613 | return (status); |
| 4614 | } |
| 4615 | |
| 4616 | /* --------------------------------------------------------------------------- |
| 4617 | \fn sme_DeregisterDeviceStateUpdateInd |
| 4618 | \brief Deregister a routine that was registered for device state changes |
| 4619 | \param hHal - The handle returned by macOpen. |
| 4620 | \param callbackRoutine - Callback routine to be deregistered |
| 4621 | \return eHalStatus |
| 4622 | eHAL_STATUS_SUCCESS - successfully deregistered |
| 4623 | eHAL_STATUS_FAILURE - not successfully deregistered |
| 4624 | ---------------------------------------------------------------------------*/ |
| 4625 | eHalStatus sme_DeregisterDeviceStateUpdateInd ( |
| 4626 | tHalHandle hHal, |
| 4627 | void (*callbackRoutine) (void *callbackContext, tPmcState pmcState)) |
| 4628 | { |
| 4629 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4630 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4631 | |
| 4632 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4633 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4634 | { |
| 4635 | status = pmcDeregisterDeviceStateUpdateInd (hHal, callbackRoutine); |
| 4636 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4637 | } |
| 4638 | |
| 4639 | return (status); |
| 4640 | } |
| 4641 | |
| 4642 | /* --------------------------------------------------------------------------- |
| 4643 | \fn sme_WowlAddBcastPattern |
| 4644 | \brief Add a pattern for Pattern Byte Matching in Wowl mode. Firmware will |
| 4645 | do a pattern match on these patterns when Wowl is enabled during BMPS |
| 4646 | mode. Note that Firmware performs the pattern matching only on |
| 4647 | broadcast frames and while Libra is in BMPS mode. |
| 4648 | \param hHal - The handle returned by macOpen. |
| 4649 | \param pattern - Pattern to be added |
| 4650 | \return eHalStatus |
| 4651 | eHAL_STATUS_FAILURE Cannot add pattern |
| 4652 | eHAL_STATUS_SUCCESS Request accepted. |
| 4653 | ---------------------------------------------------------------------------*/ |
| 4654 | eHalStatus sme_WowlAddBcastPattern ( |
| 4655 | tHalHandle hHal, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4656 | tpSirWowlAddBcastPtrn pattern, |
| 4657 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4658 | { |
| 4659 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4660 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4661 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4662 | TRACE_CODE_SME_RX_HDD_WOWL_ADDBCAST_PATTERN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4663 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4664 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4665 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4666 | status = pmcWowlAddBcastPattern (hHal, pattern, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4667 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4668 | } |
| 4669 | |
| 4670 | return (status); |
| 4671 | } |
| 4672 | |
| 4673 | /* --------------------------------------------------------------------------- |
| 4674 | \fn sme_WowlDelBcastPattern |
| 4675 | \brief Delete a pattern that was added for Pattern Byte Matching. |
| 4676 | \param hHal - The handle returned by macOpen. |
| 4677 | \param pattern - Pattern to be deleted |
| 4678 | \return eHalStatus |
| 4679 | eHAL_STATUS_FAILURE Cannot delete pattern |
| 4680 | eHAL_STATUS_SUCCESS Request accepted. |
| 4681 | ---------------------------------------------------------------------------*/ |
| 4682 | eHalStatus sme_WowlDelBcastPattern ( |
| 4683 | tHalHandle hHal, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4684 | tpSirWowlDelBcastPtrn pattern, |
| 4685 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4686 | { |
| 4687 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4688 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4689 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4690 | TRACE_CODE_SME_RX_HDD_WOWL_DELBCAST_PATTERN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4691 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4692 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4693 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4694 | status = pmcWowlDelBcastPattern (hHal, pattern, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4695 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4696 | } |
| 4697 | |
| 4698 | return (status); |
| 4699 | } |
| 4700 | |
| 4701 | /* --------------------------------------------------------------------------- |
| 4702 | \fn sme_EnterWowl |
| 4703 | \brief This is the SME API exposed to HDD to request enabling of WOWL mode. |
| 4704 | WoWLAN works on top of BMPS mode. If the device is not in BMPS mode, |
| 4705 | SME will will cache the information that WOWL has been enabled and |
| 4706 | attempt to put the device in BMPS. On entry into BMPS, SME will |
| 4707 | enable the WOWL mode. |
| 4708 | Note 1: If we exit BMPS mode (someone requests full power), we |
| 4709 | will NOT resume WOWL when we go back to BMPS again. Request for full |
| 4710 | power (while in WOWL mode) means disable WOWL and go to full power. |
| 4711 | Note 2: Both UAPSD and WOWL work on top of BMPS. On entry into BMPS, SME |
| 4712 | will give priority to UAPSD and enable only UAPSD if both UAPSD and WOWL |
| 4713 | are required. Currently there is no requirement or use case to support |
| 4714 | UAPSD and WOWL at the same time. |
| 4715 | |
| 4716 | \param hHal - The handle returned by macOpen. |
| 4717 | \param enterWowlCallbackRoutine - Callback routine provided by HDD. |
| 4718 | Used for success/failure notification by SME |
| 4719 | \param enterWowlCallbackContext - A cookie passed by HDD, that is passed back to HDD |
| 4720 | at the time of callback. |
| 4721 | \param wakeReasonIndCB - Callback routine provided by HDD. |
| 4722 | Used for Wake Reason Indication by SME |
| 4723 | \param wakeReasonIndCBContext - A cookie passed by HDD, that is passed back to HDD |
| 4724 | at the time of callback. |
| 4725 | \return eHalStatus |
| 4726 | eHAL_STATUS_SUCCESS Device is already in WoWLAN mode |
| 4727 | eHAL_STATUS_FAILURE Device cannot enter WoWLAN mode. |
| 4728 | eHAL_STATUS_PMC_PENDING Request accepted. SME will enable WOWL after |
| 4729 | BMPS mode is entered. |
| 4730 | ---------------------------------------------------------------------------*/ |
| 4731 | eHalStatus sme_EnterWowl ( |
| 4732 | tHalHandle hHal, |
| 4733 | void (*enterWowlCallbackRoutine) (void *callbackContext, eHalStatus status), |
| 4734 | void *enterWowlCallbackContext, |
| 4735 | #ifdef WLAN_WAKEUP_EVENTS |
| 4736 | void (*wakeIndicationCB) (void *callbackContext, tpSirWakeReasonInd pWakeReasonInd), |
| 4737 | void *wakeIndicationCBContext, |
| 4738 | #endif // WLAN_WAKEUP_EVENTS |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4739 | tpSirSmeWowlEnterParams wowlEnterParams, tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4740 | { |
| 4741 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4742 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4743 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4744 | TRACE_CODE_SME_RX_HDD_ENTER_WOWL, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4745 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4746 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4747 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4748 | status = pmcEnterWowl (hHal, enterWowlCallbackRoutine, enterWowlCallbackContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4749 | #ifdef WLAN_WAKEUP_EVENTS |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4750 | wakeIndicationCB, wakeIndicationCBContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4751 | #endif // WLAN_WAKEUP_EVENTS |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4752 | wowlEnterParams, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4753 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4754 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4755 | return (status); |
| 4756 | } |
| 4757 | /* --------------------------------------------------------------------------- |
| 4758 | \fn sme_ExitWowl |
| 4759 | \brief This is the SME API exposed to HDD to request exit from WoWLAN mode. |
| 4760 | SME will initiate exit from WoWLAN mode and device will be put in BMPS |
| 4761 | mode. |
| 4762 | \param hHal - The handle returned by macOpen. |
| 4763 | \return eHalStatus |
| 4764 | eHAL_STATUS_FAILURE Device cannot exit WoWLAN mode. |
| 4765 | eHAL_STATUS_SUCCESS Request accepted to exit WoWLAN mode. |
| 4766 | ---------------------------------------------------------------------------*/ |
c_hpothu | 01484c0 | 2014-05-16 14:05:15 +0530 | [diff] [blame] | 4767 | eHalStatus sme_ExitWowl (tHalHandle hHal, tWowlExitSource wowlExitSrc) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4768 | { |
| 4769 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4770 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4771 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4772 | TRACE_CODE_SME_RX_HDD_EXIT_WOWL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4773 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4774 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4775 | { |
c_hpothu | 01484c0 | 2014-05-16 14:05:15 +0530 | [diff] [blame] | 4776 | status = pmcExitWowl (hHal, wowlExitSrc); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4777 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4778 | } |
| 4779 | |
| 4780 | return (status); |
| 4781 | } |
| 4782 | |
| 4783 | /* --------------------------------------------------------------------------- |
| 4784 | |
| 4785 | \fn sme_RoamSetKey |
| 4786 | |
| 4787 | \brief To set encryption key. This function should be called only when connected |
| 4788 | This is an asynchronous API. |
| 4789 | |
| 4790 | \param pSetKeyInfo - pointer to a caller allocated object of tCsrSetContextInfo |
| 4791 | |
| 4792 | \param pRoamId Upon success return, this is the id caller can use to identify the request in roamcallback |
| 4793 | |
| 4794 | \return eHalStatus SUCCESS Roam callback will be called indicate actually results |
| 4795 | |
| 4796 | FAILURE or RESOURCES The API finished and failed. |
| 4797 | |
| 4798 | -------------------------------------------------------------------------------*/ |
| 4799 | eHalStatus sme_RoamSetKey(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 *pRoamId) |
| 4800 | { |
| 4801 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4802 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4803 | tANI_U32 roamId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4804 | tANI_U32 i; |
| 4805 | tCsrRoamSession *pSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4806 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4807 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4808 | TRACE_CODE_SME_RX_HDD_SET_KEY, sessionId, 0)); |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 4809 | if (pSetKey->keyLength > CSR_MAX_KEY_LEN) |
| 4810 | { |
| 4811 | smsLog(pMac, LOGE, FL("Invalid key length %d"), pSetKey->keyLength); |
| 4812 | return eHAL_STATUS_FAILURE; |
| 4813 | } |
Abhishek Singh | 36abbcb | 2014-03-20 13:04:09 +0530 | [diff] [blame] | 4814 | /*Once Setkey is done, we can go in BMPS*/ |
| 4815 | if(pSetKey->keyLength) |
Abhishek Singh | 65d939e | 2014-04-25 13:33:07 +0530 | [diff] [blame] | 4816 | { |
Abhishek Singh | 36abbcb | 2014-03-20 13:04:09 +0530 | [diff] [blame] | 4817 | pMac->pmc.remainInPowerActiveTillDHCP = FALSE; |
Abhishek Singh | 65d939e | 2014-04-25 13:33:07 +0530 | [diff] [blame] | 4818 | smsLog(pMac, LOG1, FL("Reset remainInPowerActiveTillDHCP" |
| 4819 | " to allow BMPS")); |
| 4820 | } |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 4821 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4822 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4823 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4824 | { |
| 4825 | roamId = GET_NEXT_ROAM_ID(&pMac->roam); |
| 4826 | if(pRoamId) |
| 4827 | { |
| 4828 | *pRoamId = roamId; |
| 4829 | } |
| 4830 | |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 4831 | smsLog(pMac, LOG2, FL("keyLength %d"), pSetKey->keyLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4832 | |
| 4833 | for(i=0; i<pSetKey->keyLength; i++) |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4834 | smsLog(pMac, LOG2, FL("%02x"), pSetKey->Key[i]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4835 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4836 | smsLog(pMac, LOG2, "\n sessionId=%d roamId=%d", sessionId, roamId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4837 | |
| 4838 | pSession = CSR_GET_SESSION(pMac, sessionId); |
| 4839 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4840 | if(!pSession) |
| 4841 | { |
| 4842 | 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] | 4843 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4844 | return eHAL_STATUS_FAILURE; |
| 4845 | } |
| 4846 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4847 | if(CSR_IS_INFRA_AP(&pSession->connectedProfile)) |
| 4848 | { |
| 4849 | if(pSetKey->keyDirection == eSIR_TX_DEFAULT) |
| 4850 | { |
| 4851 | if ( ( eCSR_ENCRYPT_TYPE_WEP40 == pSetKey->encType ) || |
| 4852 | ( eCSR_ENCRYPT_TYPE_WEP40_STATICKEY == pSetKey->encType )) |
| 4853 | { |
| 4854 | pSession->pCurRoamProfile->negotiatedUCEncryptionType = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY; |
| 4855 | } |
| 4856 | if ( ( eCSR_ENCRYPT_TYPE_WEP104 == pSetKey->encType ) || |
| 4857 | ( eCSR_ENCRYPT_TYPE_WEP104_STATICKEY == pSetKey->encType )) |
| 4858 | { |
| 4859 | pSession->pCurRoamProfile->negotiatedUCEncryptionType = eCSR_ENCRYPT_TYPE_WEP104_STATICKEY; |
| 4860 | } |
| 4861 | } |
| 4862 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4863 | |
| 4864 | status = csrRoamSetKey ( pMac, sessionId, pSetKey, roamId ); |
| 4865 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4866 | } |
Girish Gowli | 1c2fc80 | 2015-01-19 16:18:07 +0530 | [diff] [blame] | 4867 | if (pMac->roam.configParam.roamDelayStatsEnabled) |
Mukul Sharma | be91e2f | 2014-06-29 22:09:20 +0530 | [diff] [blame] | 4868 | { |
Girish Gowli | 1c2fc80 | 2015-01-19 16:18:07 +0530 | [diff] [blame] | 4869 | //Store sent PTK key time |
| 4870 | if(pSetKey->keyDirection == eSIR_TX_RX) |
| 4871 | { |
| 4872 | vos_record_roam_event(e_HDD_SET_PTK_REQ, NULL, 0); |
| 4873 | } |
| 4874 | else if(pSetKey->keyDirection == eSIR_RX_ONLY) |
| 4875 | { |
| 4876 | vos_record_roam_event(e_HDD_SET_GTK_REQ, NULL, 0); |
| 4877 | } |
| 4878 | else |
| 4879 | { |
| 4880 | return (status); |
| 4881 | } |
Mukul Sharma | be91e2f | 2014-06-29 22:09:20 +0530 | [diff] [blame] | 4882 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4883 | |
| 4884 | return (status); |
| 4885 | } |
| 4886 | |
| 4887 | |
| 4888 | /* --------------------------------------------------------------------------- |
| 4889 | |
| 4890 | \fn sme_RoamRemoveKey |
| 4891 | |
| 4892 | \brief To set encryption key. This is an asynchronous API. |
| 4893 | |
| 4894 | \param pRemoveKey - pointer to a caller allocated object of tCsrRoamRemoveKey |
| 4895 | |
| 4896 | \param pRoamId Upon success return, this is the id caller can use to identify the request in roamcallback |
| 4897 | |
| 4898 | \return eHalStatus SUCCESS Roam callback will be called indicate actually results |
| 4899 | |
| 4900 | FAILURE or RESOURCES The API finished and failed. |
| 4901 | |
| 4902 | -------------------------------------------------------------------------------*/ |
| 4903 | eHalStatus sme_RoamRemoveKey(tHalHandle hHal, tANI_U8 sessionId, |
| 4904 | tCsrRoamRemoveKey *pRemoveKey, tANI_U32 *pRoamId) |
| 4905 | { |
| 4906 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4907 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4908 | tANI_U32 roamId; |
| 4909 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4910 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4911 | TRACE_CODE_SME_RX_HDD_REMOVE_KEY, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4912 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4913 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4914 | { |
| 4915 | roamId = GET_NEXT_ROAM_ID(&pMac->roam); |
| 4916 | if(pRoamId) |
| 4917 | { |
| 4918 | *pRoamId = roamId; |
| 4919 | } |
| 4920 | status = csrRoamIssueRemoveKeyCommand( pMac, sessionId, pRemoveKey, roamId ); |
| 4921 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4922 | } |
| 4923 | |
| 4924 | return (status); |
| 4925 | } |
| 4926 | |
| 4927 | /* --------------------------------------------------------------------------- |
| 4928 | \fn sme_GetRssi |
| 4929 | \brief a wrapper function that client calls to register a callback to get RSSI |
| 4930 | |
| 4931 | \param callback - SME sends back the requested stats using the callback |
| 4932 | \param staId - The station ID for which the stats is requested for |
| 4933 | \param pContext - user context to be passed back along with the callback |
| 4934 | \param pVosContext - vos context |
| 4935 | \return eHalStatus |
| 4936 | ---------------------------------------------------------------------------*/ |
| 4937 | eHalStatus sme_GetRssi(tHalHandle hHal, |
| 4938 | tCsrRssiCallback callback, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4939 | tANI_U8 staId, tCsrBssid bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4940 | void *pContext, void* pVosContext) |
| 4941 | { |
| 4942 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4943 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4944 | |
| 4945 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4946 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4947 | { |
| 4948 | status = csrGetRssi( pMac, callback, |
| 4949 | staId, bssId, pContext, pVosContext); |
| 4950 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4951 | } |
| 4952 | return (status); |
| 4953 | } |
Madan Mohan Koyyalamudi | d9383fd | 2013-08-13 09:27:30 +0530 | [diff] [blame] | 4954 | |
| 4955 | /* --------------------------------------------------------------------------- |
| 4956 | \fn sme_GetSnr |
| 4957 | \brief a wrapper function that client calls to register a callback to |
| 4958 | get SNR |
| 4959 | |
| 4960 | \param callback - SME sends back the requested stats using the callback |
| 4961 | \param staId - The station ID for which the stats is requested for |
| 4962 | \param pContext - user context to be passed back along with the callback |
| 4963 | \param pVosContext - vos context |
| 4964 | \return eHalStatus |
| 4965 | ---------------------------------------------------------------------------*/ |
| 4966 | eHalStatus sme_GetSnr(tHalHandle hHal, |
| 4967 | tCsrSnrCallback callback, |
| 4968 | tANI_U8 staId, tCsrBssid bssId, |
| 4969 | void *pContext) |
| 4970 | { |
| 4971 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4972 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4973 | |
| 4974 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4975 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4976 | { |
| 4977 | status = csrGetSnr(pMac, callback, |
| 4978 | staId, bssId, pContext); |
| 4979 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4980 | } |
| 4981 | return status; |
| 4982 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 4983 | #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] | 4984 | /* --------------------------------------------------------------------------- |
| 4985 | \fn sme_GetRoamRssi |
| 4986 | \brief a wrapper function that client calls to register a callback to get Roam RSSI |
| 4987 | |
| 4988 | \param callback - SME sends back the requested stats using the callback |
| 4989 | \param staId - The station ID for which the stats is requested for |
| 4990 | \param pContext - user context to be passed back along with the callback |
| 4991 | \param pVosContext - vos context |
| 4992 | \return eHalStatus |
| 4993 | ---------------------------------------------------------------------------*/ |
| 4994 | eHalStatus sme_GetRoamRssi(tHalHandle hHal, |
| 4995 | tCsrRssiCallback callback, |
| 4996 | tANI_U8 staId, tCsrBssid bssId, |
| 4997 | void *pContext, void* pVosContext) |
| 4998 | { |
| 4999 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5000 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5001 | |
| 5002 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5003 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5004 | { |
| 5005 | status = csrGetRoamRssi( pMac, callback, |
| 5006 | staId, bssId, pContext, pVosContext); |
| 5007 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5008 | } |
| 5009 | return (status); |
| 5010 | } |
| 5011 | #endif |
| 5012 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 5013 | #if defined(FEATURE_WLAN_ESE) && defined(FEATURE_WLAN_ESE_UPLOAD) |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 5014 | /* --------------------------------------------------------------------------- |
| 5015 | \fn sme_GetTsmStats |
| 5016 | \brief a wrapper function that client calls to register a callback to get TSM Stats |
| 5017 | |
| 5018 | \param callback - SME sends back the requested stats using the callback |
| 5019 | \param staId - The station ID for which the stats is requested for |
| 5020 | \param pContext - user context to be passed back along with the callback |
| 5021 | \param pVosContext - vos context |
| 5022 | \return eHalStatus |
| 5023 | ---------------------------------------------------------------------------*/ |
| 5024 | eHalStatus sme_GetTsmStats(tHalHandle hHal, |
| 5025 | tCsrTsmStatsCallback callback, |
| 5026 | tANI_U8 staId, tCsrBssid bssId, |
| 5027 | void *pContext, void* pVosContext, tANI_U8 tid) |
| 5028 | { |
| 5029 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5030 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5031 | |
| 5032 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5033 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5034 | { |
| 5035 | status = csrGetTsmStats( pMac, callback, |
| 5036 | staId, bssId, pContext, pVosContext, tid); |
| 5037 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5038 | } |
| 5039 | return (status); |
| 5040 | } |
| 5041 | #endif |
| 5042 | |
| 5043 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5044 | /* --------------------------------------------------------------------------- |
| 5045 | \fn sme_GetStatistics |
| 5046 | \brief a wrapper function that client calls to register a callback to get |
| 5047 | different PHY level statistics from CSR. |
| 5048 | |
| 5049 | \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc |
| 5050 | \param statsMask - The different category/categories of stats requester is looking for |
| 5051 | \param callback - SME sends back the requested stats using the callback |
| 5052 | \param periodicity - If requester needs periodic update in millisec, 0 means |
| 5053 | it's an one time request |
| 5054 | \param cache - If requester is happy with cached stats |
| 5055 | \param staId - The station ID for which the stats is requested for |
| 5056 | \param pContext - user context to be passed back along with the callback |
| 5057 | \return eHalStatus |
| 5058 | ---------------------------------------------------------------------------*/ |
| 5059 | eHalStatus sme_GetStatistics(tHalHandle hHal, eCsrStatsRequesterType requesterId, |
| 5060 | tANI_U32 statsMask, |
| 5061 | tCsrStatsCallback callback, |
| 5062 | tANI_U32 periodicity, tANI_BOOLEAN cache, |
| 5063 | tANI_U8 staId, void *pContext) |
| 5064 | { |
| 5065 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5066 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5067 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5068 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5069 | TRACE_CODE_SME_RX_HDD_GET_STATS, NO_SESSION, periodicity)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5070 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5071 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5072 | { |
| 5073 | status = csrGetStatistics( pMac, requesterId , statsMask, callback, |
| 5074 | periodicity, cache, staId, pContext); |
| 5075 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5076 | } |
| 5077 | |
| 5078 | return (status); |
| 5079 | |
| 5080 | } |
| 5081 | |
Abhishek Singh | 08aa776 | 2014-12-16 13:59:03 +0530 | [diff] [blame] | 5082 | eHalStatus sme_GetFwStats(tHalHandle hHal, tANI_U32 stats, |
| 5083 | void *pContext, tSirFWStatsCallback callback) |
Abhishek Singh | 3ae443b | 2014-10-08 11:49:27 +0530 | [diff] [blame] | 5084 | { |
| 5085 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5086 | vos_msg_t msg; |
| 5087 | tSirFWStatsGetReq *pGetFWStatsReq; |
| 5088 | |
| 5089 | smsLog(pMac, LOG1, FL(" ENTER stats = %d "),stats); |
| 5090 | |
| 5091 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme )) |
| 5092 | { |
| 5093 | pGetFWStatsReq = (tSirFWStatsGetReq *)vos_mem_malloc(sizeof(tSirFWStatsGetReq)); |
| 5094 | if ( NULL == pGetFWStatsReq) |
| 5095 | { |
| 5096 | smsLog(pMac, LOGE, FL("Not able to allocate memory for " |
| 5097 | "WDA_FW_STATS_GET_REQ")); |
| 5098 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5099 | return eHAL_STATUS_FAILURE; |
| 5100 | } |
| 5101 | pGetFWStatsReq->stats = stats; |
| 5102 | pGetFWStatsReq->callback = (tSirFWStatsCallback)callback; |
Abhishek Singh | 08aa776 | 2014-12-16 13:59:03 +0530 | [diff] [blame] | 5103 | pGetFWStatsReq->data = pContext; |
Abhishek Singh | 3ae443b | 2014-10-08 11:49:27 +0530 | [diff] [blame] | 5104 | |
| 5105 | msg.type = WDA_FW_STATS_GET_REQ; |
| 5106 | msg.reserved = 0; |
| 5107 | msg.bodyptr = pGetFWStatsReq; |
| 5108 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_WDA, &msg)) |
| 5109 | { |
| 5110 | smsLog(pMac, LOGE, |
| 5111 | FL("Not able to post WDA_FW_STATS_GET_REQ message to HAL")); |
| 5112 | vos_mem_free(pGetFWStatsReq); |
| 5113 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5114 | return eHAL_STATUS_FAILURE; |
| 5115 | } |
| 5116 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5117 | return eHAL_STATUS_SUCCESS; |
| 5118 | } |
| 5119 | return eHAL_STATUS_FAILURE; |
| 5120 | } |
| 5121 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5122 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 8af9b40 | 2013-07-11 14:59:10 +0530 | [diff] [blame] | 5123 | \fn smeGetTLSTAState |
| 5124 | \helper function to get the TL STA State whenever the function is called. |
| 5125 | |
| 5126 | \param staId - The staID to be passed to the TL |
| 5127 | to get the relevant TL STA State |
| 5128 | \return the state as tANI_U16 |
| 5129 | ---------------------------------------------------------------------------*/ |
| 5130 | tANI_U16 smeGetTLSTAState(tHalHandle hHal, tANI_U8 staId) |
| 5131 | { |
| 5132 | tANI_U16 tlSTAState = TL_INIT_STATE; |
| 5133 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5134 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5135 | |
| 5136 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5137 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5138 | { |
| 5139 | tlSTAState = csrGetTLSTAState( pMac, staId); |
| 5140 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5141 | } |
| 5142 | |
| 5143 | return tlSTAState; |
| 5144 | } |
| 5145 | |
| 5146 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5147 | |
| 5148 | \fn sme_GetCountryCode |
| 5149 | |
| 5150 | \brief To return the current country code. If no country code is applied, default country code is |
| 5151 | used to fill the buffer. |
| 5152 | If 11d supported is turned off, an error is return and the last applied/default country code is used. |
| 5153 | This is a synchronous API. |
| 5154 | |
| 5155 | \param pBuf - pointer to a caller allocated buffer for returned country code. |
| 5156 | |
| 5157 | \param pbLen For input, this parameter indicates how big is the buffer. |
| 5158 | Upon return, this parameter has the number of bytes for country. If pBuf |
| 5159 | doesn't have enough space, this function returns |
| 5160 | fail status and this parameter contains the number that is needed. |
| 5161 | |
| 5162 | \return eHalStatus SUCCESS. |
| 5163 | |
| 5164 | FAILURE or RESOURCES The API finished and failed. |
| 5165 | |
| 5166 | -------------------------------------------------------------------------------*/ |
| 5167 | eHalStatus sme_GetCountryCode(tHalHandle hHal, tANI_U8 *pBuf, tANI_U8 *pbLen) |
| 5168 | { |
| 5169 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5170 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5171 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5172 | TRACE_CODE_SME_RX_HDD_GET_CNTRYCODE, NO_SESSION, 0)); |
| 5173 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5174 | return ( csrGetCountryCode( pMac, pBuf, pbLen ) ); |
| 5175 | } |
| 5176 | |
| 5177 | |
| 5178 | /* --------------------------------------------------------------------------- |
| 5179 | |
| 5180 | \fn sme_SetCountryCode |
| 5181 | |
| 5182 | \brief To change the current/default country code. |
| 5183 | If 11d supported is turned off, an error is return. |
| 5184 | This is a synchronous API. |
| 5185 | |
| 5186 | \param pCountry - pointer to a caller allocated buffer for the country code. |
| 5187 | |
| 5188 | \param pfRestartNeeded A pointer to caller allocated memory, upon successful return, it indicates |
| 5189 | whether a reset is required. |
| 5190 | |
| 5191 | \return eHalStatus SUCCESS. |
| 5192 | |
| 5193 | FAILURE or RESOURCES The API finished and failed. |
| 5194 | |
| 5195 | -------------------------------------------------------------------------------*/ |
| 5196 | eHalStatus sme_SetCountryCode(tHalHandle hHal, tANI_U8 *pCountry, tANI_BOOLEAN *pfRestartNeeded) |
| 5197 | { |
| 5198 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5199 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5200 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5201 | TRACE_CODE_SME_RX_HDD_SET_CNTRYCODE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5202 | return ( csrSetCountryCode( pMac, pCountry, pfRestartNeeded ) ); |
| 5203 | } |
| 5204 | |
| 5205 | |
| 5206 | /* --------------------------------------------------------------------------- |
| 5207 | \fn sme_ResetCountryCodeInformation |
| 5208 | \brief this function is to reset the country code current being used back to EEPROM default |
| 5209 | this includes channel list and power setting. This is a synchronous API. |
| 5210 | \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether |
| 5211 | a restart is needed to apply the change |
| 5212 | \return eHalStatus |
| 5213 | -------------------------------------------------------------------------------*/ |
| 5214 | eHalStatus sme_ResetCountryCodeInformation(tHalHandle hHal, tANI_BOOLEAN *pfRestartNeeded) |
| 5215 | { |
| 5216 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5217 | |
| 5218 | return ( csrResetCountryCodeInformation( pMac, pfRestartNeeded ) ); |
| 5219 | } |
| 5220 | |
| 5221 | |
| 5222 | /* --------------------------------------------------------------------------- |
| 5223 | \fn sme_GetSupportedCountryCode |
| 5224 | \brief this function is to get a list of the country code current being supported |
| 5225 | \param pBuf - Caller allocated buffer with at least 3 bytes, upon success return, |
| 5226 | this has the country code list. 3 bytes for each country code. This may be NULL if |
| 5227 | caller wants to know the needed byte count. |
| 5228 | \param pbLen - Caller allocated, as input, it indicates the length of pBuf. Upon success return, |
| 5229 | this contains the length of the data in pBuf. If pbuf is NULL, as input, *pbLen should be 0. |
| 5230 | \return eHalStatus |
| 5231 | -------------------------------------------------------------------------------*/ |
| 5232 | eHalStatus sme_GetSupportedCountryCode(tHalHandle hHal, tANI_U8 *pBuf, tANI_U32 *pbLen) |
| 5233 | { |
| 5234 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5235 | |
| 5236 | return ( csrGetSupportedCountryCode( pMac, pBuf, pbLen ) ); |
| 5237 | } |
| 5238 | |
| 5239 | |
| 5240 | /* --------------------------------------------------------------------------- |
| 5241 | \fn sme_GetCurrentRegulatoryDomain |
| 5242 | \brief this function is to get the current regulatory domain. This is a synchronous API. |
| 5243 | This function must be called after CFG is downloaded and all the band/mode setting already passed into |
| 5244 | SME. The function fails if 11d support is turned off. |
| 5245 | \param pDomain - Caller allocated buffer to return the current domain. |
| 5246 | \return eHalStatus SUCCESS. |
| 5247 | |
| 5248 | FAILURE or RESOURCES The API finished and failed. |
| 5249 | -------------------------------------------------------------------------------*/ |
| 5250 | eHalStatus sme_GetCurrentRegulatoryDomain(tHalHandle hHal, v_REGDOMAIN_t *pDomain) |
| 5251 | { |
| 5252 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5253 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 5254 | |
| 5255 | if( pDomain ) |
| 5256 | { |
| 5257 | if( csrIs11dSupported( pMac ) ) |
| 5258 | { |
| 5259 | *pDomain = csrGetCurrentRegulatoryDomain( pMac ); |
| 5260 | status = eHAL_STATUS_SUCCESS; |
| 5261 | } |
| 5262 | else |
| 5263 | { |
| 5264 | status = eHAL_STATUS_FAILURE; |
| 5265 | } |
| 5266 | } |
| 5267 | |
| 5268 | return ( status ); |
| 5269 | } |
| 5270 | |
| 5271 | |
| 5272 | /* --------------------------------------------------------------------------- |
| 5273 | \fn sme_SetRegulatoryDomain |
| 5274 | \brief this function is to set the current regulatory domain. |
| 5275 | This function must be called after CFG is downloaded and all the band/mode setting already passed into |
| 5276 | SME. This is a synchronous API. |
| 5277 | \param domainId - indicate the domain (defined in the driver) needs to set to. |
| 5278 | See v_REGDOMAIN_t for definition |
| 5279 | \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether |
| 5280 | a restart is needed to apply the change |
| 5281 | \return eHalStatus |
| 5282 | -------------------------------------------------------------------------------*/ |
| 5283 | eHalStatus sme_SetRegulatoryDomain(tHalHandle hHal, v_REGDOMAIN_t domainId, tANI_BOOLEAN *pfRestartNeeded) |
| 5284 | { |
| 5285 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5286 | |
| 5287 | return ( csrSetRegulatoryDomain( pMac, domainId, pfRestartNeeded ) ); |
| 5288 | } |
| 5289 | |
| 5290 | |
| 5291 | /* --------------------------------------------------------------------------- |
| 5292 | |
| 5293 | \fn sme_GetRegulatoryDomainForCountry |
| 5294 | |
| 5295 | \brief To return a regulatory domain base on a country code. This is a synchronous API. |
| 5296 | |
| 5297 | \param pCountry - pointer to a caller allocated buffer for input country code. |
| 5298 | |
| 5299 | \param pDomainId Upon successful return, it is the domain that country belongs to. |
| 5300 | If it is NULL, returning success means that the country code is known. |
| 5301 | |
| 5302 | \return eHalStatus SUCCESS. |
| 5303 | |
| 5304 | FAILURE or RESOURCES The API finished and failed. |
| 5305 | |
| 5306 | -------------------------------------------------------------------------------*/ |
| 5307 | eHalStatus sme_GetRegulatoryDomainForCountry(tHalHandle hHal, tANI_U8 *pCountry, v_REGDOMAIN_t *pDomainId) |
| 5308 | { |
| 5309 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5310 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 5311 | return csrGetRegulatoryDomainForCountry(pMac, pCountry, pDomainId, |
| 5312 | COUNTRY_QUERY); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5313 | } |
| 5314 | |
| 5315 | |
| 5316 | |
| 5317 | |
| 5318 | /* --------------------------------------------------------------------------- |
| 5319 | |
| 5320 | \fn sme_GetSupportedRegulatoryDomains |
| 5321 | |
| 5322 | \brief To return a list of supported regulatory domains. This is a synchronous API. |
| 5323 | |
| 5324 | \param pDomains - pointer to a caller allocated buffer for returned regulatory domains. |
| 5325 | |
| 5326 | \param pNumDomains For input, this parameter indicates howm many domains pDomains can hold. |
| 5327 | Upon return, this parameter has the number for supported domains. If pDomains |
| 5328 | doesn't have enough space for all the supported domains, this function returns |
| 5329 | fail status and this parameter contains the number that is needed. |
| 5330 | |
| 5331 | \return eHalStatus SUCCESS. |
| 5332 | |
| 5333 | FAILURE or RESOURCES The API finished and failed. |
| 5334 | |
| 5335 | -------------------------------------------------------------------------------*/ |
| 5336 | eHalStatus sme_GetSupportedRegulatoryDomains(tHalHandle hHal, v_REGDOMAIN_t *pDomains, tANI_U32 *pNumDomains) |
| 5337 | { |
| 5338 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 5339 | |
| 5340 | //We support all domains for now |
| 5341 | if( pNumDomains ) |
| 5342 | { |
| 5343 | if( NUM_REG_DOMAINS <= *pNumDomains ) |
| 5344 | { |
| 5345 | status = eHAL_STATUS_SUCCESS; |
| 5346 | } |
| 5347 | *pNumDomains = NUM_REG_DOMAINS; |
| 5348 | } |
| 5349 | if( HAL_STATUS_SUCCESS( status ) ) |
| 5350 | { |
| 5351 | if( pDomains ) |
| 5352 | { |
| 5353 | pDomains[0] = REGDOMAIN_FCC; |
| 5354 | pDomains[1] = REGDOMAIN_ETSI; |
| 5355 | pDomains[2] = REGDOMAIN_JAPAN; |
| 5356 | pDomains[3] = REGDOMAIN_WORLD; |
| 5357 | pDomains[4] = REGDOMAIN_N_AMER_EXC_FCC; |
| 5358 | pDomains[5] = REGDOMAIN_APAC; |
| 5359 | pDomains[6] = REGDOMAIN_KOREA; |
| 5360 | pDomains[7] = REGDOMAIN_HI_5GHZ; |
| 5361 | pDomains[8] = REGDOMAIN_NO_5GHZ; |
| 5362 | } |
| 5363 | else |
| 5364 | { |
| 5365 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 5366 | } |
| 5367 | } |
| 5368 | |
| 5369 | return ( status ); |
| 5370 | } |
| 5371 | |
| 5372 | |
| 5373 | //some support functions |
| 5374 | tANI_BOOLEAN sme_Is11dSupported(tHalHandle hHal) |
| 5375 | { |
| 5376 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5377 | |
| 5378 | return ( csrIs11dSupported( pMac ) ); |
| 5379 | } |
| 5380 | |
| 5381 | |
| 5382 | tANI_BOOLEAN sme_Is11hSupported(tHalHandle hHal) |
| 5383 | { |
| 5384 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5385 | |
| 5386 | return ( csrIs11hSupported( pMac ) ); |
| 5387 | } |
| 5388 | |
| 5389 | |
| 5390 | tANI_BOOLEAN sme_IsWmmSupported(tHalHandle hHal) |
| 5391 | { |
| 5392 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5393 | |
| 5394 | return ( csrIsWmmSupported( pMac ) ); |
| 5395 | } |
| 5396 | |
| 5397 | //Upper layer to get the list of the base channels to scan for passively 11d info from csr |
| 5398 | eHalStatus sme_ScanGetBaseChannels( tHalHandle hHal, tCsrChannelInfo * pChannelInfo ) |
| 5399 | { |
| 5400 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5401 | |
| 5402 | return(csrScanGetBaseChannels(pMac,pChannelInfo) ); |
| 5403 | } |
| 5404 | |
| 5405 | /* --------------------------------------------------------------------------- |
| 5406 | |
| 5407 | \fn sme_ChangeCountryCode |
| 5408 | |
| 5409 | \brief Change Country code from upperlayer during WLAN driver operation. |
| 5410 | This is a synchronous API. |
| 5411 | |
| 5412 | \param hHal - The handle returned by macOpen. |
| 5413 | |
| 5414 | \param pCountry New Country Code String |
| 5415 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 5416 | \param sendRegHint If we want to send reg hint to nl80211 |
| 5417 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5418 | \return eHalStatus SUCCESS. |
| 5419 | |
| 5420 | FAILURE or RESOURCES The API finished and failed. |
| 5421 | |
| 5422 | -------------------------------------------------------------------------------*/ |
| 5423 | eHalStatus sme_ChangeCountryCode( tHalHandle hHal, |
| 5424 | tSmeChangeCountryCallback callback, |
| 5425 | tANI_U8 *pCountry, |
| 5426 | void *pContext, |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 5427 | void* pVosContext, |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 5428 | tAniBool countryFromUserSpace, |
| 5429 | tAniBool sendRegHint ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5430 | { |
| 5431 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5432 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5433 | vos_msg_t msg; |
| 5434 | tAniChangeCountryCodeReq *pMsg; |
| 5435 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5436 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5437 | TRACE_CODE_SME_RX_HDD_CHANGE_CNTRYCODE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5438 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5439 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5440 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5441 | smsLog(pMac, LOG1, FL(" called")); |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 5442 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 5443 | if ((pMac->roam.configParam.Is11dSupportEnabledOriginal == true) && |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 5444 | (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority)) |
| 5445 | { |
| 5446 | |
| 5447 | smsLog(pMac, LOGW, "Set Country Code Fail since the STA is associated and userspace does not have priority "); |
| 5448 | |
| 5449 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5450 | status = eHAL_STATUS_FAILURE; |
| 5451 | return status; |
| 5452 | } |
| 5453 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5454 | pMsg = vos_mem_malloc(sizeof(tAniChangeCountryCodeReq)); |
| 5455 | if ( NULL == pMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5456 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5457 | 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] | 5458 | sme_ReleaseGlobalLock( &pMac->sme ); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5459 | return eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5460 | } |
| 5461 | |
| 5462 | pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_CHANGE_COUNTRY_CODE); |
| 5463 | pMsg->msgLen = (tANI_U16)sizeof(tAniChangeCountryCodeReq); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5464 | vos_mem_copy(pMsg->countryCode, pCountry, 3); |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 5465 | pMsg->countryFromUserSpace = countryFromUserSpace; |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 5466 | pMsg->sendRegHint = sendRegHint; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5467 | pMsg->changeCCCallback = callback; |
| 5468 | pMsg->pDevContext = pContext; |
| 5469 | pMsg->pVosContext = pVosContext; |
| 5470 | |
| 5471 | msg.type = eWNI_SME_CHANGE_COUNTRY_CODE; |
| 5472 | msg.bodyptr = pMsg; |
| 5473 | msg.reserved = 0; |
| 5474 | |
| 5475 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg)) |
| 5476 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5477 | smsLog(pMac, LOGE, " sme_ChangeCountryCode failed to post msg to self "); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 5478 | vos_mem_free((void *)pMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5479 | status = eHAL_STATUS_FAILURE; |
| 5480 | } |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5481 | smsLog(pMac, LOG1, FL(" returned")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5482 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5483 | } |
| 5484 | |
| 5485 | return (status); |
| 5486 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5487 | |
| 5488 | /*-------------------------------------------------------------------------- |
| 5489 | |
| 5490 | \fn sme_GenericChangeCountryCode |
| 5491 | |
| 5492 | \brief Change Country code from upperlayer during WLAN driver operation. |
| 5493 | This is a synchronous API. |
| 5494 | |
| 5495 | \param hHal - The handle returned by macOpen. |
| 5496 | |
| 5497 | \param pCountry New Country Code String |
| 5498 | |
| 5499 | \param reg_domain regulatory domain |
| 5500 | |
| 5501 | \return eHalStatus SUCCESS. |
| 5502 | |
| 5503 | FAILURE or RESOURCES The API finished and failed. |
| 5504 | |
| 5505 | -----------------------------------------------------------------------------*/ |
| 5506 | eHalStatus sme_GenericChangeCountryCode( tHalHandle hHal, |
| 5507 | tANI_U8 *pCountry, |
| 5508 | v_REGDOMAIN_t reg_domain) |
| 5509 | { |
| 5510 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5511 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5512 | vos_msg_t msg; |
| 5513 | tAniGenericChangeCountryCodeReq *pMsg; |
| 5514 | |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 5515 | if (NULL == pMac) |
| 5516 | { |
| 5517 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 5518 | "%s: pMac is null", __func__); |
| 5519 | return status; |
| 5520 | } |
| 5521 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5522 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5523 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5524 | { |
| 5525 | smsLog(pMac, LOG1, FL(" called")); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5526 | pMsg = vos_mem_malloc(sizeof(tAniGenericChangeCountryCodeReq)); |
| 5527 | if (NULL == pMsg) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5528 | { |
| 5529 | smsLog(pMac, LOGE, " sme_GenericChangeCountryCode: failed to allocate mem for req"); |
| 5530 | sme_ReleaseGlobalLock( &pMac->sme ); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5531 | return eHAL_STATUS_FAILURE; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5532 | } |
| 5533 | |
| 5534 | pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE); |
| 5535 | pMsg->msgLen = (tANI_U16)sizeof(tAniGenericChangeCountryCodeReq); |
Sameer Thalappil | 7324e8b | 2014-01-15 10:32:54 -0800 | [diff] [blame] | 5536 | vos_mem_copy(pMsg->countryCode, pCountry, 2); |
Dino Mycle | 6c77a96 | 2014-08-19 15:34:23 +0530 | [diff] [blame] | 5537 | |
| 5538 | pMsg->countryCode[2] = ' '; /* For ASCII space */ |
| 5539 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5540 | pMsg->domain_index = reg_domain; |
| 5541 | |
| 5542 | msg.type = eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE; |
| 5543 | msg.bodyptr = pMsg; |
| 5544 | msg.reserved = 0; |
| 5545 | |
| 5546 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg)) |
| 5547 | { |
| 5548 | smsLog(pMac, LOGE, "sme_GenericChangeCountryCode failed to post msg to self"); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5549 | vos_mem_free(pMsg); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5550 | status = eHAL_STATUS_FAILURE; |
| 5551 | } |
| 5552 | smsLog(pMac, LOG1, FL(" returned")); |
| 5553 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5554 | } |
| 5555 | |
| 5556 | return (status); |
| 5557 | } |
Mihir Shete | e1093ba | 2014-01-21 20:13:32 +0530 | [diff] [blame] | 5558 | |
| 5559 | /* --------------------------------------------------------------------------- |
| 5560 | |
| 5561 | \fn sme_InitChannels |
| 5562 | |
| 5563 | \brief Used to initialize CSR channel lists while driver loading |
| 5564 | |
| 5565 | \param hHal - global pMac structure |
| 5566 | |
| 5567 | \return eHalStatus SUCCESS. |
| 5568 | |
| 5569 | FAILURE or RESOURCES The API finished and failed. |
| 5570 | |
| 5571 | -------------------------------------------------------------------------------*/ |
| 5572 | eHalStatus sme_InitChannels(tHalHandle hHal) |
| 5573 | { |
| 5574 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5575 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 5576 | |
| 5577 | if (NULL == pMac) |
| 5578 | { |
| 5579 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 5580 | "%s: pMac is null", __func__); |
| 5581 | return status; |
| 5582 | } |
| 5583 | |
Vinay Krishna Eranna | b9295ae | 2014-05-09 13:43:23 +0530 | [diff] [blame] | 5584 | status = csrInitChannels(pMac); |
| 5585 | |
Mihir Shete | e1093ba | 2014-01-21 20:13:32 +0530 | [diff] [blame] | 5586 | return status; |
| 5587 | } |
| 5588 | |
Mihir Shete | 0420645 | 2014-11-20 17:50:58 +0530 | [diff] [blame] | 5589 | #ifdef CONFIG_ENABLE_LINUX_REG |
Mahesh A Saptasagar | 74289d2 | 2014-05-14 12:43:37 +0530 | [diff] [blame] | 5590 | /*------------------------------------------------------------------------- |
| 5591 | \fn sme_InitChannelsForCC |
| 5592 | |
| 5593 | \brief Used to issue regulatory hint to user |
| 5594 | |
| 5595 | \param hHal - global pMac structure |
| 5596 | |
| 5597 | \return eHalStatus SUCCESS. |
| 5598 | |
| 5599 | FAILURE or RESOURCES The API finished and failed. |
| 5600 | --------------------------------------------------------------------------*/ |
| 5601 | |
Agarwal Ashish | 6db9d53 | 2014-09-30 18:19:10 +0530 | [diff] [blame] | 5602 | eHalStatus sme_InitChannelsForCC(tHalHandle hHal, driver_load_type init) |
Mahesh A Saptasagar | 74289d2 | 2014-05-14 12:43:37 +0530 | [diff] [blame] | 5603 | { |
| 5604 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5605 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 5606 | |
| 5607 | if (NULL == pMac) |
| 5608 | { |
| 5609 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 5610 | "%s: pMac is null", __func__); |
| 5611 | return status; |
| 5612 | } |
Agarwal Ashish | 6db9d53 | 2014-09-30 18:19:10 +0530 | [diff] [blame] | 5613 | status = csrInitChannelsForCC(pMac, init); |
Mahesh A Saptasagar | 74289d2 | 2014-05-14 12:43:37 +0530 | [diff] [blame] | 5614 | |
| 5615 | return status; |
| 5616 | } |
Mihir Shete | 0420645 | 2014-11-20 17:50:58 +0530 | [diff] [blame] | 5617 | #endif |
Mahesh A Saptasagar | 74289d2 | 2014-05-14 12:43:37 +0530 | [diff] [blame] | 5618 | |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5619 | /* --------------------------------------------------------------------------- |
| 5620 | |
| 5621 | \fn sme_DHCPStartInd |
| 5622 | |
| 5623 | \brief API to signal the FW about the DHCP Start event. |
| 5624 | |
| 5625 | \param hHal - HAL handle for device. |
| 5626 | |
| 5627 | \param device_mode - mode(AP,SAP etc) of the device. |
| 5628 | |
| 5629 | \param macAddr - MAC address of the device. |
| 5630 | |
| 5631 | \return eHalStatus SUCCESS. |
| 5632 | |
| 5633 | FAILURE or RESOURCES The API finished and failed. |
| 5634 | --------------------------------------------------------------------------*/ |
| 5635 | eHalStatus sme_DHCPStartInd( tHalHandle hHal, |
| 5636 | tANI_U8 device_mode, |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5637 | tANI_U8 sessionId ) |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5638 | { |
| 5639 | eHalStatus status; |
| 5640 | VOS_STATUS vosStatus; |
| 5641 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5642 | vos_msg_t vosMessage; |
| 5643 | tAniDHCPInd *pMsg; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5644 | tCsrRoamSession *pSession; |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5645 | |
| 5646 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5647 | if ( eHAL_STATUS_SUCCESS == status) |
| 5648 | { |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5649 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 5650 | |
| 5651 | if (!pSession) |
| 5652 | { |
| 5653 | smsLog(pMac, LOGE, FL("session %d not found "), sessionId); |
| 5654 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5655 | return eHAL_STATUS_FAILURE; |
| 5656 | } |
| 5657 | |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5658 | pMsg = (tAniDHCPInd*)vos_mem_malloc(sizeof(tAniDHCPInd)); |
| 5659 | if (NULL == pMsg) |
| 5660 | { |
| 5661 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5662 | "%s: Not able to allocate memory for dhcp start", __func__); |
| 5663 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5664 | return eHAL_STATUS_FAILURE; |
| 5665 | } |
| 5666 | pMsg->msgType = WDA_DHCP_START_IND; |
| 5667 | pMsg->msgLen = (tANI_U16)sizeof(tAniDHCPInd); |
| 5668 | pMsg->device_mode = device_mode; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5669 | vos_mem_copy(pMsg->macAddr, pSession->connectedProfile.bssid, |
| 5670 | sizeof(tSirMacAddr)); |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5671 | vosMessage.type = WDA_DHCP_START_IND; |
| 5672 | vosMessage.bodyptr = pMsg; |
| 5673 | vosMessage.reserved = 0; |
| 5674 | |
| 5675 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 5676 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 5677 | { |
| 5678 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5679 | "%s: Post DHCP Start MSG fail", __func__); |
| 5680 | vos_mem_free(pMsg); |
| 5681 | status = eHAL_STATUS_FAILURE; |
| 5682 | } |
| 5683 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5684 | } |
| 5685 | return (status); |
| 5686 | } |
| 5687 | /* --------------------------------------------------------------------------- |
| 5688 | \fn sme_DHCPStopInd |
| 5689 | |
| 5690 | \brief API to signal the FW about the DHCP complete event. |
| 5691 | |
| 5692 | \param hHal - HAL handle for device. |
| 5693 | |
| 5694 | \param device_mode - mode(AP, SAP etc) of the device. |
| 5695 | |
| 5696 | \param macAddr - MAC address of the device. |
| 5697 | |
| 5698 | \return eHalStatus SUCCESS. |
| 5699 | FAILURE or RESOURCES The API finished and failed. |
| 5700 | --------------------------------------------------------------------------*/ |
| 5701 | eHalStatus sme_DHCPStopInd( tHalHandle hHal, |
| 5702 | tANI_U8 device_mode, |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5703 | tANI_U8 sessionId ) |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5704 | { |
| 5705 | eHalStatus status; |
| 5706 | VOS_STATUS vosStatus; |
| 5707 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5708 | vos_msg_t vosMessage; |
| 5709 | tAniDHCPInd *pMsg; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5710 | tCsrRoamSession *pSession; |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5711 | |
| 5712 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5713 | if ( eHAL_STATUS_SUCCESS == status) |
| 5714 | { |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5715 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 5716 | |
| 5717 | if (!pSession) |
| 5718 | { |
| 5719 | smsLog(pMac, LOGE, FL("session %d not found "), sessionId); |
| 5720 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5721 | return eHAL_STATUS_FAILURE; |
| 5722 | } |
| 5723 | |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5724 | pMsg = (tAniDHCPInd*)vos_mem_malloc(sizeof(tAniDHCPInd)); |
| 5725 | if (NULL == pMsg) |
| 5726 | { |
| 5727 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5728 | "%s: Not able to allocate memory for dhcp stop", __func__); |
| 5729 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5730 | return eHAL_STATUS_FAILURE; |
| 5731 | } |
| 5732 | |
| 5733 | pMsg->msgType = WDA_DHCP_STOP_IND; |
| 5734 | pMsg->msgLen = (tANI_U16)sizeof(tAniDHCPInd); |
| 5735 | pMsg->device_mode = device_mode; |
c_hpothu | 0b0cab7 | 2014-02-13 21:52:40 +0530 | [diff] [blame] | 5736 | vos_mem_copy(pMsg->macAddr, pSession->connectedProfile.bssid, |
| 5737 | sizeof(tSirMacAddr)); |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5738 | |
| 5739 | vosMessage.type = WDA_DHCP_STOP_IND; |
| 5740 | vosMessage.bodyptr = pMsg; |
| 5741 | vosMessage.reserved = 0; |
| 5742 | |
| 5743 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 5744 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 5745 | { |
| 5746 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5747 | "%s: Post DHCP Stop MSG fail", __func__); |
| 5748 | vos_mem_free(pMsg); |
| 5749 | status = eHAL_STATUS_FAILURE; |
| 5750 | } |
| 5751 | |
| 5752 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5753 | } |
| 5754 | return (status); |
| 5755 | } |
| 5756 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5757 | |
| 5758 | /* --------------------------------------------------------------------------- |
| 5759 | \fn sme_BtcSignalBtEvent |
| 5760 | \brief API to signal Bluetooth (BT) event to the WLAN driver. Based on the |
| 5761 | BT event type and the current operating mode of Libra (full power, |
| 5762 | BMPS, UAPSD etc), appropriate Bluetooth Coexistence (BTC) strategy |
| 5763 | would be employed. |
| 5764 | \param hHal - The handle returned by macOpen. |
| 5765 | \param pBtEvent - Pointer to a caller allocated object of type tSmeBtEvent |
| 5766 | Caller owns the memory and is responsible for freeing it. |
| 5767 | \return VOS_STATUS |
| 5768 | VOS_STATUS_E_FAILURE BT Event not passed to HAL. This can happen |
| 5769 | if BTC execution mode is set to BTC_WLAN_ONLY |
| 5770 | or BTC_PTA_ONLY. |
| 5771 | VOS_STATUS_SUCCESS BT Event passed to HAL |
| 5772 | ---------------------------------------------------------------------------*/ |
| 5773 | VOS_STATUS sme_BtcSignalBtEvent (tHalHandle hHal, tpSmeBtEvent pBtEvent) |
| 5774 | { |
| 5775 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5776 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5777 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5778 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5779 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5780 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5781 | TRACE_CODE_SME_RX_HDD_BTC_SIGNALEVENT, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5782 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5783 | { |
| 5784 | status = btcSignalBTEvent (hHal, pBtEvent); |
| 5785 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5786 | } |
| 5787 | #endif |
| 5788 | return (status); |
| 5789 | } |
| 5790 | |
| 5791 | /* --------------------------------------------------------------------------- |
| 5792 | \fn sme_BtcSetConfig |
| 5793 | \brief API to change the current Bluetooth Coexistence (BTC) configuration |
| 5794 | This function should be invoked only after CFG download has completed. |
| 5795 | Calling it after sme_HDDReadyInd is recommended. |
| 5796 | \param hHal - The handle returned by macOpen. |
| 5797 | \param pSmeBtcConfig - Pointer to a caller allocated object of type tSmeBtcConfig. |
| 5798 | Caller owns the memory and is responsible for freeing it. |
| 5799 | \return VOS_STATUS |
| 5800 | VOS_STATUS_E_FAILURE Config not passed to HAL. |
| 5801 | VOS_STATUS_SUCCESS Config passed to HAL |
| 5802 | ---------------------------------------------------------------------------*/ |
| 5803 | VOS_STATUS sme_BtcSetConfig (tHalHandle hHal, tpSmeBtcConfig pSmeBtcConfig) |
| 5804 | { |
| 5805 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5806 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5807 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5808 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5809 | TRACE_CODE_SME_RX_HDD_BTC_SETCONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5810 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5811 | { |
| 5812 | status = btcSetConfig (hHal, pSmeBtcConfig); |
| 5813 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5814 | } |
| 5815 | #endif |
| 5816 | return (status); |
| 5817 | } |
| 5818 | |
| 5819 | /* --------------------------------------------------------------------------- |
| 5820 | \fn sme_BtcGetConfig |
| 5821 | \brief API to retrieve the current Bluetooth Coexistence (BTC) configuration |
| 5822 | \param hHal - The handle returned by macOpen. |
| 5823 | \param pSmeBtcConfig - Pointer to a caller allocated object of type |
| 5824 | tSmeBtcConfig. Caller owns the memory and is responsible |
| 5825 | for freeing it. |
| 5826 | \return VOS_STATUS |
| 5827 | VOS_STATUS_E_FAILURE - failure |
| 5828 | VOS_STATUS_SUCCESS success |
| 5829 | ---------------------------------------------------------------------------*/ |
| 5830 | VOS_STATUS sme_BtcGetConfig (tHalHandle hHal, tpSmeBtcConfig pSmeBtcConfig) |
| 5831 | { |
| 5832 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5833 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5834 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5835 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5836 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5837 | TRACE_CODE_SME_RX_HDD_BTC_GETCONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5838 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5839 | { |
| 5840 | status = btcGetConfig (hHal, pSmeBtcConfig); |
| 5841 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5842 | } |
| 5843 | #endif |
| 5844 | return (status); |
| 5845 | } |
| 5846 | /* --------------------------------------------------------------------------- |
| 5847 | \fn sme_SetCfgPrivacy |
| 5848 | \brief API to set configure privacy parameters |
| 5849 | \param hHal - The handle returned by macOpen. |
| 5850 | \param pProfile - Pointer CSR Roam profile. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5851 | \param fPrivacy - This parameter indicates status of privacy |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5852 | |
| 5853 | \return void |
| 5854 | ---------------------------------------------------------------------------*/ |
| 5855 | void sme_SetCfgPrivacy( tHalHandle hHal, |
| 5856 | tCsrRoamProfile *pProfile, |
| 5857 | tANI_BOOLEAN fPrivacy |
| 5858 | ) |
| 5859 | { |
| 5860 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5861 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5862 | TRACE_CODE_SME_RX_HDD_SET_CFGPRIVACY, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5863 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5864 | { |
| 5865 | csrSetCfgPrivacy(pMac, pProfile, fPrivacy); |
| 5866 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5867 | } |
| 5868 | } |
| 5869 | |
| 5870 | #if defined WLAN_FEATURE_VOWIFI |
| 5871 | /* --------------------------------------------------------------------------- |
| 5872 | \fn sme_NeighborReportRequest |
| 5873 | \brief API to request neighbor report. |
| 5874 | \param hHal - The handle returned by macOpen. |
| 5875 | \param pRrmNeighborReq - Pointer to a caller allocated object of type |
| 5876 | tRrmNeighborReq. Caller owns the memory and is responsible |
| 5877 | for freeing it. |
| 5878 | \return VOS_STATUS |
| 5879 | VOS_STATUS_E_FAILURE - failure |
| 5880 | VOS_STATUS_SUCCESS success |
| 5881 | ---------------------------------------------------------------------------*/ |
| 5882 | VOS_STATUS sme_NeighborReportRequest (tHalHandle hHal, tANI_U8 sessionId, |
| 5883 | tpRrmNeighborReq pRrmNeighborReq, tpRrmNeighborRspCallbackInfo callbackInfo) |
| 5884 | { |
| 5885 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5886 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5887 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5888 | TRACE_CODE_SME_RX_HDD_NEIGHBOR_REPORTREQ, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5889 | |
| 5890 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5891 | { |
| 5892 | status = sme_RrmNeighborReportRequest (hHal, sessionId, pRrmNeighborReq, callbackInfo); |
| 5893 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5894 | } |
| 5895 | |
| 5896 | return (status); |
| 5897 | } |
| 5898 | #endif |
| 5899 | |
| 5900 | //The following are debug APIs to support direct read/write register/memory |
| 5901 | //They are placed in SME because HW cannot be access when in LOW_POWER state |
| 5902 | //AND not connected. The knowledge and synchronization is done in SME |
| 5903 | |
| 5904 | //sme_DbgReadRegister |
| 5905 | //Caller needs to validate the input values |
| 5906 | VOS_STATUS sme_DbgReadRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t *pRegValue) |
| 5907 | { |
| 5908 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5909 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5910 | tPmcPowerState PowerState; |
| 5911 | tANI_U32 sessionId = 0; |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5912 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5913 | TRACE_CODE_SME_RX_HDD_DBG_READREG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5914 | |
| 5915 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5916 | |
| 5917 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5918 | { |
Hoonki Lee | 0af6aaf | 2013-02-08 12:26:44 -0800 | [diff] [blame] | 5919 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgReadRegister(regAddr, pRegValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5920 | { |
| 5921 | return VOS_STATUS_SUCCESS; |
| 5922 | } |
| 5923 | return VOS_STATUS_E_FAILURE; |
| 5924 | } |
| 5925 | |
| 5926 | /* 2) NON FTM mode driver *************************************************/ |
| 5927 | |
| 5928 | /* Acquire SME global lock */ |
| 5929 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5930 | { |
| 5931 | return VOS_STATUS_E_FAILURE; |
| 5932 | } |
| 5933 | |
| 5934 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5935 | { |
| 5936 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5937 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5938 | { |
Hoonki Lee | 0af6aaf | 2013-02-08 12:26:44 -0800 | [diff] [blame] | 5939 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgReadRegister(regAddr, pRegValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5940 | { |
| 5941 | status = VOS_STATUS_SUCCESS; |
| 5942 | } |
| 5943 | else |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5944 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5945 | status = VOS_STATUS_E_FAILURE; |
| 5946 | } |
| 5947 | } |
| 5948 | else |
| 5949 | { |
| 5950 | status = VOS_STATUS_E_FAILURE; |
| 5951 | } |
| 5952 | } |
| 5953 | |
| 5954 | /* This is a hack for Qualky/pttWniSocket |
| 5955 | Current implementation doesn't allow pttWniSocket to inform Qualky an error */ |
| 5956 | if ( VOS_STATUS_SUCCESS != status ) |
| 5957 | { |
| 5958 | *pRegValue = 0xDEADBEEF; |
| 5959 | status = VOS_STATUS_SUCCESS; |
| 5960 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5961 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5962 | /* Release SME global lock */ |
| 5963 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5964 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5965 | return (status); |
| 5966 | } |
| 5967 | |
| 5968 | |
| 5969 | //sme_DbgWriteRegister |
| 5970 | //Caller needs to validate the input values |
| 5971 | VOS_STATUS sme_DbgWriteRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t regValue) |
| 5972 | { |
| 5973 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5974 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5975 | tPmcPowerState PowerState; |
| 5976 | tANI_U32 sessionId = 0; |
| 5977 | |
| 5978 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5979 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5980 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5981 | TRACE_CODE_SME_RX_HDD_DBG_WRITEREG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5982 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5983 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5984 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteRegister(regAddr, regValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5985 | { |
| 5986 | return VOS_STATUS_SUCCESS; |
| 5987 | } |
| 5988 | return VOS_STATUS_E_FAILURE; |
| 5989 | } |
| 5990 | |
| 5991 | /* 2) NON FTM mode driver *************************************************/ |
| 5992 | |
| 5993 | /* Acquire SME global lock */ |
| 5994 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5995 | { |
| 5996 | return VOS_STATUS_E_FAILURE; |
| 5997 | } |
| 5998 | |
| 5999 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 6000 | { |
| 6001 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 6002 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 6003 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6004 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteRegister(regAddr, regValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6005 | { |
| 6006 | status = VOS_STATUS_SUCCESS; |
| 6007 | } |
| 6008 | else |
| 6009 | { |
| 6010 | status = VOS_STATUS_E_FAILURE; |
| 6011 | } |
| 6012 | } |
| 6013 | else |
| 6014 | { |
| 6015 | status = VOS_STATUS_E_FAILURE; |
| 6016 | } |
| 6017 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6018 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6019 | /* Release SME global lock */ |
| 6020 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6021 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6022 | return (status); |
| 6023 | } |
| 6024 | |
| 6025 | |
| 6026 | |
| 6027 | //sme_DbgReadMemory |
| 6028 | //Caller needs to validate the input values |
| 6029 | //pBuf caller allocated buffer has the length of nLen |
| 6030 | VOS_STATUS sme_DbgReadMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen) |
| 6031 | { |
| 6032 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 6033 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6034 | tPmcPowerState PowerState; |
| 6035 | tANI_U32 sessionId = 0; |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 6036 | tANI_U32 cmd = READ_MEMORY_DUMP_CMD; |
| 6037 | tANI_U32 arg1 = memAddr; |
| 6038 | tANI_U32 arg2 = nLen/4; |
| 6039 | tANI_U32 arg3 = 4; |
| 6040 | tANI_U32 arg4 = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6041 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 6042 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6043 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6044 | TRACE_CODE_SME_RX_HDD_DBG_READMEM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6045 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 6046 | { |
Siddharth Bhal | 6811560 | 2015-01-18 20:44:55 +0530 | [diff] [blame] | 6047 | if (VOS_STATUS_SUCCESS == WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, (tANI_U8*)pBuf, 0)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6048 | { |
| 6049 | return VOS_STATUS_SUCCESS; |
| 6050 | } |
| 6051 | return VOS_STATUS_E_FAILURE; |
| 6052 | } |
| 6053 | |
| 6054 | /* 2) NON FTM mode driver *************************************************/ |
| 6055 | |
| 6056 | /* Acquire SME global lock */ |
| 6057 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 6058 | { |
| 6059 | return VOS_STATUS_E_FAILURE; |
| 6060 | } |
| 6061 | |
| 6062 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 6063 | { |
| 6064 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 6065 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 6066 | { |
Siddharth Bhal | 6811560 | 2015-01-18 20:44:55 +0530 | [diff] [blame] | 6067 | if (VOS_STATUS_SUCCESS == WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, (tANI_U8 *)pBuf, 0)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6068 | { |
| 6069 | status = VOS_STATUS_SUCCESS; |
| 6070 | } |
| 6071 | else |
| 6072 | { |
| 6073 | status = VOS_STATUS_E_FAILURE; |
| 6074 | } |
| 6075 | } |
| 6076 | else |
| 6077 | { |
| 6078 | status = VOS_STATUS_E_FAILURE; |
| 6079 | } |
| 6080 | } |
| 6081 | |
| 6082 | /* This is a hack for Qualky/pttWniSocket |
| 6083 | Current implementation doesn't allow pttWniSocket to inform Qualky an error */ |
| 6084 | if (VOS_STATUS_SUCCESS != status) |
| 6085 | { |
| 6086 | vos_mem_set(pBuf, nLen, 0xCD); |
| 6087 | status = VOS_STATUS_SUCCESS; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6088 | 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] | 6089 | } |
| 6090 | |
| 6091 | /* Release SME lock */ |
| 6092 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6093 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6094 | return (status); |
| 6095 | } |
| 6096 | |
| 6097 | |
| 6098 | //sme_DbgWriteMemory |
| 6099 | //Caller needs to validate the input values |
| 6100 | VOS_STATUS sme_DbgWriteMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen) |
| 6101 | { |
| 6102 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 6103 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6104 | tPmcPowerState PowerState; |
| 6105 | tANI_U32 sessionId = 0; |
| 6106 | |
| 6107 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 6108 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6109 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6110 | TRACE_CODE_SME_RX_HDD_DBG_WRITEMEM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6111 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 6112 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6113 | { |
| 6114 | return VOS_STATUS_SUCCESS; |
| 6115 | } |
| 6116 | return VOS_STATUS_E_FAILURE; |
| 6117 | } |
| 6118 | |
| 6119 | /* 2) NON FTM mode driver *************************************************/ |
| 6120 | |
| 6121 | /* Acquire SME global lock */ |
| 6122 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 6123 | { |
| 6124 | return VOS_STATUS_E_FAILURE; |
| 6125 | } |
| 6126 | |
| 6127 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 6128 | { |
| 6129 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 6130 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 6131 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6132 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteMemory(memAddr, (void *)pBuf, nLen)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6133 | { |
| 6134 | status = VOS_STATUS_SUCCESS; |
| 6135 | } |
| 6136 | else |
| 6137 | { |
| 6138 | status = VOS_STATUS_E_FAILURE; |
| 6139 | } |
| 6140 | } |
| 6141 | else |
| 6142 | { |
| 6143 | status = VOS_STATUS_E_FAILURE; |
| 6144 | } |
| 6145 | } |
| 6146 | |
| 6147 | /* Release Global lock */ |
| 6148 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6149 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6150 | return (status); |
| 6151 | } |
| 6152 | |
| 6153 | |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 6154 | void pmcLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...) |
| 6155 | { |
| 6156 | VOS_TRACE_LEVEL vosDebugLevel; |
| 6157 | char logBuffer[LOG_SIZE]; |
| 6158 | va_list marker; |
| 6159 | |
| 6160 | /* getting proper Debug level */ |
| 6161 | vosDebugLevel = getVosDebugLevel(loglevel); |
| 6162 | |
| 6163 | /* extracting arguments from pstring */ |
| 6164 | va_start( marker, pString ); |
| 6165 | vsnprintf(logBuffer, LOG_SIZE, pString, marker); |
| 6166 | |
| 6167 | VOS_TRACE(VOS_MODULE_ID_PMC, vosDebugLevel, "%s", logBuffer); |
| 6168 | va_end( marker ); |
| 6169 | } |
| 6170 | |
| 6171 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6172 | void smsLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString,...) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6173 | { |
| 6174 | #ifdef WLAN_DEBUG |
| 6175 | // Verify against current log level |
| 6176 | if ( loglevel > pMac->utils.gLogDbgLevel[LOG_INDEX_FOR_MODULE( SIR_SMS_MODULE_ID )] ) |
| 6177 | return; |
| 6178 | else |
| 6179 | { |
| 6180 | va_list marker; |
| 6181 | |
| 6182 | va_start( marker, pString ); /* Initialize variable arguments. */ |
| 6183 | |
| 6184 | logDebug(pMac, SIR_SMS_MODULE_ID, loglevel, pString, marker); |
| 6185 | |
| 6186 | va_end( marker ); /* Reset variable arguments. */ |
| 6187 | } |
| 6188 | #endif |
| 6189 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6190 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6191 | /* --------------------------------------------------------------------------- |
| 6192 | \fn sme_GetWcnssWlanCompiledVersion |
| 6193 | \brief This API returns the version of the WCNSS WLAN API with |
| 6194 | which the HOST driver was built |
| 6195 | \param hHal - The handle returned by macOpen. |
| 6196 | \param pVersion - Points to the Version structure to be filled |
| 6197 | \return VOS_STATUS |
| 6198 | VOS_STATUS_E_INVAL - failure |
| 6199 | VOS_STATUS_SUCCESS success |
| 6200 | ---------------------------------------------------------------------------*/ |
| 6201 | VOS_STATUS sme_GetWcnssWlanCompiledVersion(tHalHandle hHal, |
| 6202 | tSirVersionType *pVersion) |
| 6203 | { |
| 6204 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 6205 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6206 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 6207 | |
| 6208 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6209 | { |
| 6210 | if( pVersion != NULL ) |
| 6211 | { |
| 6212 | status = WDA_GetWcnssWlanCompiledVersion(vosContext, pVersion); |
| 6213 | } |
| 6214 | else |
| 6215 | { |
| 6216 | status = VOS_STATUS_E_INVAL; |
| 6217 | } |
| 6218 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6219 | } |
| 6220 | |
| 6221 | return (status); |
| 6222 | } |
| 6223 | |
| 6224 | |
| 6225 | /* --------------------------------------------------------------------------- |
| 6226 | \fn sme_GetWcnssWlanReportedVersion |
| 6227 | \brief This API returns the version of the WCNSS WLAN API with |
| 6228 | which the WCNSS driver reports it was built |
| 6229 | \param hHal - The handle returned by macOpen. |
| 6230 | \param pVersion - Points to the Version structure to be filled |
| 6231 | \return VOS_STATUS |
| 6232 | VOS_STATUS_E_INVAL - failure |
| 6233 | VOS_STATUS_SUCCESS success |
| 6234 | ---------------------------------------------------------------------------*/ |
| 6235 | VOS_STATUS sme_GetWcnssWlanReportedVersion(tHalHandle hHal, |
| 6236 | tSirVersionType *pVersion) |
| 6237 | { |
| 6238 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 6239 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6240 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 6241 | |
| 6242 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6243 | { |
| 6244 | if( pVersion != NULL ) |
| 6245 | { |
| 6246 | status = WDA_GetWcnssWlanReportedVersion(vosContext, pVersion); |
| 6247 | } |
| 6248 | else |
| 6249 | { |
| 6250 | status = VOS_STATUS_E_INVAL; |
| 6251 | } |
| 6252 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6253 | } |
| 6254 | |
| 6255 | return (status); |
| 6256 | } |
| 6257 | |
| 6258 | |
| 6259 | /* --------------------------------------------------------------------------- |
| 6260 | \fn sme_GetWcnssSoftwareVersion |
| 6261 | \brief This API returns the version string of the WCNSS driver |
| 6262 | \param hHal - The handle returned by macOpen. |
| 6263 | \param pVersion - Points to the Version string buffer to be filled |
| 6264 | \param versionBufferSize - THe size of the Version string buffer |
| 6265 | \return VOS_STATUS |
| 6266 | VOS_STATUS_E_INVAL - failure |
| 6267 | VOS_STATUS_SUCCESS success |
| 6268 | ---------------------------------------------------------------------------*/ |
| 6269 | VOS_STATUS sme_GetWcnssSoftwareVersion(tHalHandle hHal, |
| 6270 | tANI_U8 *pVersion, |
| 6271 | tANI_U32 versionBufferSize) |
| 6272 | { |
| 6273 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 6274 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6275 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 6276 | |
| 6277 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6278 | { |
| 6279 | if( pVersion != NULL ) |
| 6280 | { |
| 6281 | status = WDA_GetWcnssSoftwareVersion(vosContext, pVersion, |
| 6282 | versionBufferSize); |
| 6283 | } |
| 6284 | else |
| 6285 | { |
| 6286 | status = VOS_STATUS_E_INVAL; |
| 6287 | } |
| 6288 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6289 | } |
| 6290 | |
| 6291 | return (status); |
| 6292 | } |
| 6293 | |
| 6294 | |
| 6295 | /* --------------------------------------------------------------------------- |
| 6296 | \fn sme_GetWcnssHardwareVersion |
| 6297 | \brief This API returns the version string of the WCNSS hardware |
| 6298 | \param hHal - The handle returned by macOpen. |
| 6299 | \param pVersion - Points to the Version string buffer to be filled |
| 6300 | \param versionBufferSize - THe size of the Version string buffer |
| 6301 | \return VOS_STATUS |
| 6302 | VOS_STATUS_E_INVAL - failure |
| 6303 | VOS_STATUS_SUCCESS success |
| 6304 | ---------------------------------------------------------------------------*/ |
| 6305 | VOS_STATUS sme_GetWcnssHardwareVersion(tHalHandle hHal, |
| 6306 | tANI_U8 *pVersion, |
| 6307 | tANI_U32 versionBufferSize) |
| 6308 | { |
| 6309 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 6310 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6311 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 6312 | |
| 6313 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 6314 | { |
| 6315 | if( pVersion != NULL ) |
| 6316 | { |
| 6317 | status = WDA_GetWcnssHardwareVersion(vosContext, pVersion, |
| 6318 | versionBufferSize); |
| 6319 | } |
| 6320 | else |
| 6321 | { |
| 6322 | status = VOS_STATUS_E_INVAL; |
| 6323 | } |
| 6324 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6325 | } |
| 6326 | |
| 6327 | return (status); |
| 6328 | } |
Jeff Johnson | 4824d4c | 2013-02-12 14:23:57 -0800 | [diff] [blame] | 6329 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6330 | |
| 6331 | #ifdef FEATURE_WLAN_WAPI |
| 6332 | /* --------------------------------------------------------------------------- |
| 6333 | \fn sme_RoamSetBKIDCache |
| 6334 | \brief The SME API exposed to HDD to allow HDD to provde SME the BKID |
| 6335 | candidate list. |
| 6336 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 6337 | it is opened (by calling halOpen). |
| 6338 | \param pBKIDCache - caller allocated buffer point to an array of tBkidCacheInfo |
| 6339 | \param numItems - a variable that has the number of tBkidCacheInfo allocated |
| 6340 | when retruning, this is the number of items put into pBKIDCache |
| 6341 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 6342 | big enough and pNumItems has the number of tBkidCacheInfo. |
| 6343 | ---------------------------------------------------------------------------*/ |
| 6344 | eHalStatus sme_RoamSetBKIDCache( tHalHandle hHal, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache, |
| 6345 | tANI_U32 numItems ) |
| 6346 | { |
| 6347 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6348 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6349 | |
| 6350 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6351 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6352 | { |
| 6353 | status = csrRoamSetBKIDCache( pMac, sessionId, pBKIDCache, numItems ); |
| 6354 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6355 | } |
| 6356 | |
| 6357 | return (status); |
| 6358 | } |
| 6359 | |
| 6360 | /* --------------------------------------------------------------------------- |
| 6361 | \fn sme_RoamGetBKIDCache |
| 6362 | \brief The SME API exposed to HDD to allow HDD to request SME to return its |
| 6363 | BKID cache. |
| 6364 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 6365 | it is opened (by calling halOpen). |
| 6366 | \param pNum - caller allocated memory that has the space of the number of |
| 6367 | tBkidCacheInfo as input. Upon returned, *pNum has the needed number of entries |
| 6368 | in SME cache. |
| 6369 | \param pBkidCache - Caller allocated memory that contains BKID cache, if any, |
| 6370 | upon return |
| 6371 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 6372 | big enough. |
| 6373 | ---------------------------------------------------------------------------*/ |
| 6374 | eHalStatus sme_RoamGetBKIDCache(tHalHandle hHal, tANI_U32 *pNum, |
| 6375 | tBkidCacheInfo *pBkidCache) |
| 6376 | { |
| 6377 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6378 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6379 | |
| 6380 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6381 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6382 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6383 | smsLog(pMac, LOGE, FL(" !!!!!!!!!!!!!!!!!!SessionId is hardcoded")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6384 | status = csrRoamGetBKIDCache( pMac, 0, pNum, pBkidCache ); |
| 6385 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6386 | } |
| 6387 | |
| 6388 | return (status); |
| 6389 | } |
| 6390 | |
| 6391 | /* --------------------------------------------------------------------------- |
| 6392 | \fn sme_RoamGetNumBKIDCache |
| 6393 | \brief The SME API exposed to HDD to allow HDD to request SME to return the |
| 6394 | number of BKID cache entries. |
| 6395 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 6396 | it is opened (by calling halOpen). |
| 6397 | \return tANI_U32 - the number of BKID cache entries. |
| 6398 | ---------------------------------------------------------------------------*/ |
| 6399 | tANI_U32 sme_RoamGetNumBKIDCache(tHalHandle hHal, tANI_U32 sessionId) |
| 6400 | { |
| 6401 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6402 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6403 | tANI_U32 numBkidCache = 0; |
| 6404 | |
| 6405 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6406 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6407 | { |
| 6408 | numBkidCache = csrRoamGetNumBKIDCache( pMac, sessionId ); |
| 6409 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6410 | } |
| 6411 | |
| 6412 | return (numBkidCache); |
| 6413 | } |
| 6414 | |
| 6415 | /* --------------------------------------------------------------------------- |
| 6416 | \fn sme_ScanGetBKIDCandidateList |
| 6417 | \brief a wrapper function to return the BKID candidate list |
| 6418 | \param pBkidList - caller allocated buffer point to an array of |
| 6419 | tBkidCandidateInfo |
| 6420 | \param pNumItems - pointer to a variable that has the number of |
| 6421 | tBkidCandidateInfo allocated when retruning, this is |
| 6422 | either the number needed or number of items put into |
| 6423 | pPmkidList |
| 6424 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 6425 | big enough and pNumItems |
| 6426 | has the number of tBkidCandidateInfo. |
| 6427 | \Note: pNumItems is a number of tBkidCandidateInfo, |
| 6428 | not sizeof(tBkidCandidateInfo) * something |
| 6429 | ---------------------------------------------------------------------------*/ |
| 6430 | eHalStatus sme_ScanGetBKIDCandidateList(tHalHandle hHal, tANI_U32 sessionId, |
| 6431 | tBkidCandidateInfo *pBkidList, |
| 6432 | tANI_U32 *pNumItems ) |
| 6433 | { |
| 6434 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6435 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6436 | |
| 6437 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6438 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6439 | { |
| 6440 | status = csrScanGetBKIDCandidateList( pMac, sessionId, pBkidList, pNumItems ); |
| 6441 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6442 | } |
| 6443 | |
| 6444 | return (status); |
| 6445 | } |
| 6446 | #endif /* FEATURE_WLAN_WAPI */ |
| 6447 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6448 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 6449 | |
| 6450 | /***************************************************************************** |
| 6451 | OEM DATA related modifications and function additions |
| 6452 | *****************************************************************************/ |
| 6453 | |
| 6454 | /* --------------------------------------------------------------------------- |
| 6455 | \fn sme_getOemDataRsp |
| 6456 | \brief a wrapper function to obtain the OEM DATA RSP |
| 6457 | \param pOemDataRsp - A pointer to the response object |
| 6458 | \param pContext - a pointer passed in for the callback |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6459 | \return eHalStatus |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6460 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6461 | eHalStatus sme_getOemDataRsp(tHalHandle hHal, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6462 | tOemDataRsp **pOemDataRsp) |
| 6463 | { |
| 6464 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6465 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6466 | |
| 6467 | do |
| 6468 | { |
| 6469 | //acquire the lock for the sme object |
| 6470 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6471 | |
| 6472 | if(!HAL_STATUS_SUCCESS(status)) |
| 6473 | { |
| 6474 | break; |
| 6475 | } |
| 6476 | |
| 6477 | if(pMac->oemData.pOemDataRsp != NULL) |
| 6478 | { |
| 6479 | *pOemDataRsp = pMac->oemData.pOemDataRsp; |
| 6480 | } |
| 6481 | else |
| 6482 | { |
| 6483 | status = eHAL_STATUS_FAILURE; |
| 6484 | } |
| 6485 | |
| 6486 | //release the lock for the sme object |
| 6487 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6488 | |
| 6489 | } while(0); |
| 6490 | |
| 6491 | return status; |
| 6492 | } |
| 6493 | |
| 6494 | /* --------------------------------------------------------------------------- |
| 6495 | \fn sme_OemDataReq |
| 6496 | \brief a wrapper function for OEM DATA REQ |
| 6497 | \param sessionId - session id to be used. |
| 6498 | \param pOemDataReqId - pointer to an object to get back the request ID |
| 6499 | \param callback - a callback function that is called upon finish |
| 6500 | \param pContext - a pointer passed in for the callback |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6501 | \return eHalStatus |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6502 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6503 | eHalStatus sme_OemDataReq(tHalHandle hHal, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6504 | tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6505 | tOemDataReqConfig *pOemDataReqConfig, |
| 6506 | tANI_U32 *pOemDataReqID, |
| 6507 | oemData_OemDataReqCompleteCallback callback, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6508 | void *pContext) |
| 6509 | { |
| 6510 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6511 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6512 | |
| 6513 | do |
| 6514 | { |
| 6515 | //acquire the lock for the sme object |
| 6516 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6517 | if(HAL_STATUS_SUCCESS(status)) |
| 6518 | { |
| 6519 | tANI_U32 lOemDataReqId = pMac->oemData.oemDataReqID++; //let it wrap around |
| 6520 | |
| 6521 | if(pOemDataReqID) |
| 6522 | { |
| 6523 | *pOemDataReqID = lOemDataReqId; |
| 6524 | } |
| 6525 | else |
Leela Venkata Kiran Kumar Reddy Chirala | 090cc1f | 2013-03-07 17:40:17 -0800 | [diff] [blame] | 6526 | { |
| 6527 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6528 | return eHAL_STATUS_FAILURE; |
| 6529 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6530 | |
| 6531 | status = oemData_OemDataReq(hHal, sessionId, pOemDataReqConfig, pOemDataReqID, callback, pContext); |
| 6532 | |
| 6533 | //release the lock for the sme object |
| 6534 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6535 | } |
| 6536 | } while(0); |
| 6537 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6538 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6539 | |
| 6540 | return(status); |
| 6541 | } |
| 6542 | |
| 6543 | #endif /*FEATURE_OEM_DATA_SUPPORT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6544 | |
| 6545 | /*-------------------------------------------------------------------------- |
| 6546 | |
| 6547 | \brief sme_OpenSession() - Open a session for scan/roam operation. |
| 6548 | |
| 6549 | This is a synchronous API. |
| 6550 | |
| 6551 | |
| 6552 | \param hHal - The handle returned by macOpen. |
| 6553 | \param callback - A pointer to the function caller specifies for roam/connect status indication |
| 6554 | \param pContext - The context passed with callback |
| 6555 | \param pSelfMacAddr - Caller allocated memory filled with self MAC address (6 bytes) |
| 6556 | \param pbSessionId - pointer to a caller allocated buffer for returned session ID |
| 6557 | |
| 6558 | \return eHAL_STATUS_SUCCESS - session is opened. sessionId returned. |
| 6559 | |
| 6560 | Other status means SME is failed to open the session. |
| 6561 | eHAL_STATUS_RESOURCES - no more session available. |
| 6562 | \sa |
| 6563 | |
| 6564 | --------------------------------------------------------------------------*/ |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 6565 | eHalStatus sme_OpenSession(tHalHandle hHal, csrRoamCompleteCallback callback, |
| 6566 | void *pContext, tANI_U8 *pSelfMacAddr, |
| 6567 | tANI_U8 *pbSessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6568 | { |
| 6569 | eHalStatus status; |
| 6570 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6571 | |
| 6572 | if( NULL == pbSessionId ) |
| 6573 | { |
| 6574 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 6575 | } |
| 6576 | else |
| 6577 | { |
| 6578 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6579 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6580 | { |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 6581 | status = csrRoamOpenSession(pMac, callback, pContext, |
| 6582 | pSelfMacAddr, pbSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6583 | |
| 6584 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6585 | } |
| 6586 | } |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6587 | if( NULL != pbSessionId ) |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6588 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6589 | TRACE_CODE_SME_RX_HDD_OPEN_SESSION,*pbSessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6590 | |
| 6591 | return ( status ); |
| 6592 | } |
| 6593 | |
| 6594 | |
| 6595 | /*-------------------------------------------------------------------------- |
| 6596 | |
| 6597 | \brief sme_CloseSession() - Open a session for scan/roam operation. |
| 6598 | |
| 6599 | This is a synchronous API. |
| 6600 | |
| 6601 | |
| 6602 | \param hHal - The handle returned by macOpen. |
| 6603 | |
| 6604 | \param sessionId - A previous opened session's ID. |
| 6605 | |
| 6606 | \return eHAL_STATUS_SUCCESS - session is closed. |
| 6607 | |
| 6608 | Other status means SME is failed to open the session. |
| 6609 | eHAL_STATUS_INVALID_PARAMETER - session is not opened. |
| 6610 | \sa |
| 6611 | |
| 6612 | --------------------------------------------------------------------------*/ |
| 6613 | eHalStatus sme_CloseSession(tHalHandle hHal, tANI_U8 sessionId, |
| 6614 | csrRoamSessionCloseCallback callback, void *pContext) |
| 6615 | { |
| 6616 | eHalStatus status; |
| 6617 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6618 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6619 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6620 | TRACE_CODE_SME_RX_HDD_CLOSE_SESSION, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6621 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6622 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6623 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6624 | status = csrRoamCloseSession( pMac, sessionId, FALSE, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6625 | callback, pContext ); |
| 6626 | |
| 6627 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6628 | } |
| 6629 | |
| 6630 | return ( status ); |
| 6631 | } |
| 6632 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6633 | /* --------------------------------------------------------------------------- |
| 6634 | |
| 6635 | \fn sme_RoamUpdateAPWPSIE |
| 6636 | |
| 6637 | \brief To update AP's WPS IE. This function should be called after SME AP session is created |
| 6638 | This is an asynchronous API. |
| 6639 | |
| 6640 | \param pAPWPSIES - pointer to a caller allocated object of tSirAPWPSIEs |
| 6641 | |
| 6642 | \return eHalStatus – SUCCESS – |
| 6643 | |
| 6644 | FAILURE or RESOURCES – The API finished and failed. |
| 6645 | |
| 6646 | -------------------------------------------------------------------------------*/ |
| 6647 | eHalStatus sme_RoamUpdateAPWPSIE(tHalHandle hHal, tANI_U8 sessionId, tSirAPWPSIEs *pAPWPSIES) |
| 6648 | { |
| 6649 | |
| 6650 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6651 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6652 | |
| 6653 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6654 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6655 | { |
| 6656 | |
| 6657 | status = csrRoamUpdateAPWPSIE( pMac, sessionId, pAPWPSIES ); |
| 6658 | |
| 6659 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6660 | } |
| 6661 | |
| 6662 | return (status); |
| 6663 | } |
| 6664 | /* --------------------------------------------------------------------------- |
| 6665 | |
| 6666 | \fn sme_RoamUpdateAPWPARSNIEs |
| 6667 | |
| 6668 | \brief To update AP's WPA/RSN IEs. This function should be called after SME AP session is created |
| 6669 | This is an asynchronous API. |
| 6670 | |
| 6671 | \param pAPSirRSNie - pointer to a caller allocated object of tSirRSNie with WPS/RSN IEs |
| 6672 | |
| 6673 | \return eHalStatus – SUCCESS – |
| 6674 | |
| 6675 | FAILURE or RESOURCES – The API finished and failed. |
| 6676 | |
| 6677 | -------------------------------------------------------------------------------*/ |
| 6678 | eHalStatus sme_RoamUpdateAPWPARSNIEs(tHalHandle hHal, tANI_U8 sessionId, tSirRSNie * pAPSirRSNie) |
| 6679 | { |
| 6680 | |
| 6681 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6682 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6683 | |
| 6684 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6685 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6686 | { |
| 6687 | |
| 6688 | status = csrRoamUpdateWPARSNIEs( pMac, sessionId, pAPSirRSNie); |
| 6689 | |
| 6690 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6691 | } |
| 6692 | |
| 6693 | return (status); |
| 6694 | } |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6695 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6696 | |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6697 | \fn sme_ChangeMCCBeaconInterval |
| 6698 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6699 | \brief To update P2P-GO beaconInterval. This function should be called after |
| 6700 | disassociating all the station is done |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6701 | This is an asynchronous API. |
| 6702 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6703 | \param |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6704 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6705 | \return eHalStatus SUCCESS |
| 6706 | FAILURE or RESOURCES |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 6707 | The API finished and failed. |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6708 | |
| 6709 | -------------------------------------------------------------------------------*/ |
| 6710 | eHalStatus sme_ChangeMCCBeaconInterval(tHalHandle hHal, tANI_U8 sessionId) |
| 6711 | { |
| 6712 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6713 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6714 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6715 | smsLog(pMac, LOG1, FL("Update Beacon PARAMS ")); |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6716 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6717 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6718 | { |
| 6719 | status = csrSendChngMCCBeaconInterval( pMac, sessionId); |
| 6720 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6721 | } |
| 6722 | return (status); |
| 6723 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6724 | |
| 6725 | /*-------------------------------------------------------------------------------* |
| 6726 | |
| 6727 | \fn sme_sendBTAmpEvent |
| 6728 | |
| 6729 | \brief to receive the coex priorty request from BT-AMP PAL |
| 6730 | and send the BT_AMP link state to HAL |
| 6731 | |
| 6732 | \param btAmpEvent - btAmpEvent |
| 6733 | |
Jeff Johnson | feddb2d | 2012-12-10 14:41:22 -0800 | [diff] [blame] | 6734 | \return eHalStatus: SUCCESS : BTAmp event successfully sent to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6735 | |
| 6736 | FAILURE: API failed |
| 6737 | |
| 6738 | -------------------------------------------------------------------------------*/ |
| 6739 | |
| 6740 | eHalStatus sme_sendBTAmpEvent(tHalHandle hHal, tSmeBtAmpEvent btAmpEvent) |
| 6741 | { |
| 6742 | vos_msg_t msg; |
| 6743 | tpSmeBtAmpEvent ptrSmeBtAmpEvent = NULL; |
| 6744 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6745 | |
Leela Venkata Kiran Kumar Reddy Chirala | f7ea543 | 2013-11-15 11:03:04 -0800 | [diff] [blame] | 6746 | ptrSmeBtAmpEvent = vos_mem_malloc(sizeof(tSmeBtAmpEvent)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6747 | if (NULL == ptrSmeBtAmpEvent) |
| 6748 | { |
| 6749 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6750 | "Not able to allocate memory for BTAmp event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6751 | return status; |
| 6752 | } |
| 6753 | |
| 6754 | vos_mem_copy(ptrSmeBtAmpEvent, (void*)&btAmpEvent, sizeof(tSmeBtAmpEvent)); |
| 6755 | msg.type = WDA_SIGNAL_BTAMP_EVENT; |
| 6756 | msg.reserved = 0; |
| 6757 | msg.bodyptr = ptrSmeBtAmpEvent; |
| 6758 | |
| 6759 | //status = halFW_SendBTAmpEventMesg(pMac, event); |
| 6760 | |
| 6761 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 6762 | { |
| 6763 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6764 | "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] | 6765 | vos_mem_free(ptrSmeBtAmpEvent); |
| 6766 | return status; |
| 6767 | } |
| 6768 | |
| 6769 | return eHAL_STATUS_SUCCESS; |
| 6770 | |
| 6771 | } |
| 6772 | |
| 6773 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6774 | \fn smeIssueFastRoamNeighborAPEvent |
| 6775 | \brief API to trigger fast BSS roam independent of RSSI triggers |
| 6776 | \param hHal - The handle returned by macOpen. |
| 6777 | \param bssid - Pointer to the BSSID to roam to. |
| 6778 | \param fastRoamTrig - Trigger to Scan or roam |
Mukul Sharma | 9e4e0f9 | 2015-02-13 18:45:20 +0530 | [diff] [blame] | 6779 | \param channel - channel number on which fastroam is requested |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6780 | \return eHalStatus |
| 6781 | ---------------------------------------------------------------------------*/ |
| 6782 | eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, |
| 6783 | tANI_U8 *bssid, |
Mukul Sharma | 9e4e0f9 | 2015-02-13 18:45:20 +0530 | [diff] [blame] | 6784 | tSmeFastRoamTrigger fastRoamTrig, |
| 6785 | tANI_U8 channel) |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6786 | { |
| 6787 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6788 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 6789 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 6790 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6791 | |
| 6792 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6793 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6794 | { |
| 6795 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 6796 | "%s: invoked", __func__); |
| 6797 | |
| 6798 | if (eSME_ROAM_TRIGGER_SCAN == fastRoamTrig) |
| 6799 | { |
| 6800 | smsLog(pMac, LOG1, FL("CFG Channel list scan... ")); |
| 6801 | pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_SCAN; |
| 6802 | vos_mem_copy((void *)(&pNeighborRoamInfo->cfgRoambssId), |
| 6803 | (void *)bssid, sizeof(tSirMacAddr)); |
Mukul Sharma | 9e4e0f9 | 2015-02-13 18:45:20 +0530 | [diff] [blame] | 6804 | smsLog(pMac, LOG1, "Calling Roam Look Up down Event BSSID" |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 6805 | MAC_ADDRESS_STR, MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); |
Mukul Sharma | 9e4e0f9 | 2015-02-13 18:45:20 +0530 | [diff] [blame] | 6806 | /* |
| 6807 | * As FastReassoc is based on assumption that roamable AP should be |
| 6808 | * present into the occupied channel list.We shd add i/p channel |
| 6809 | * in occupied channel list if roamable-ap(BSSID in fastreassoc cmd) |
| 6810 | * aged out prior to connection and there is no scan from aged out |
| 6811 | * to till connection indication. |
| 6812 | */ |
| 6813 | csrAddChannelToOccupiedChannelList(pMac, channel); |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6814 | vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); |
| 6815 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 6816 | { |
| 6817 | smsLog(pMac, LOGE, |
| 6818 | FL("CFG Channel list scan state failed with status %d "), |
| 6819 | vosStatus); |
| 6820 | } |
| 6821 | } |
| 6822 | else if (eSME_ROAM_TRIGGER_FAST_ROAM == fastRoamTrig) |
| 6823 | { |
| 6824 | vos_mem_copy((void *)(&pNeighborRoamInfo->cfgRoambssId), |
| 6825 | (void *)bssid, sizeof(tSirMacAddr)); |
| 6826 | pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_FAST_ROAM; |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 6827 | smsLog(pMac, LOG1, "Roam to BSSID "MAC_ADDRESS_STR, |
| 6828 | MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6829 | |
| 6830 | vosStatus = csrNeighborRoamReassocIndCallback(pMac->roam.gVosContext, |
| 6831 | 0, |
| 6832 | pMac, |
| 6833 | 0); |
| 6834 | |
| 6835 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 6836 | { |
| 6837 | smsLog(pMac, |
| 6838 | LOGE, |
| 6839 | FL(" Call to csrNeighborRoamReassocIndCallback failed, status = %d"), |
| 6840 | vosStatus); |
| 6841 | } |
| 6842 | } |
| 6843 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6844 | } |
| 6845 | return vosStatus; |
| 6846 | } |
| 6847 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6848 | \fn sme_SetHostOffload |
| 6849 | \brief API to set the host offload feature. |
| 6850 | \param hHal - The handle returned by macOpen. |
| 6851 | \param pRequest - Pointer to the offload request. |
| 6852 | \return eHalStatus |
| 6853 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6854 | eHalStatus sme_SetHostOffload (tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6855 | tpSirHostOffloadReq pRequest) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6856 | { |
| 6857 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6858 | eHalStatus status = eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6859 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6860 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6861 | TRACE_CODE_SME_RX_HDD_SET_HOSTOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6862 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6863 | { |
| 6864 | #ifdef WLAN_NS_OFFLOAD |
| 6865 | if(SIR_IPV6_NS_OFFLOAD == pRequest->offloadType) |
| 6866 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6867 | status = pmcSetNSOffload( hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6868 | } |
| 6869 | else |
| 6870 | #endif //WLAN_NS_OFFLOAD |
| 6871 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6872 | status = pmcSetHostOffload (hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6873 | } |
| 6874 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6875 | } |
| 6876 | |
| 6877 | return (status); |
| 6878 | } |
| 6879 | |
| 6880 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 6881 | /* --------------------------------------------------------------------------- |
| 6882 | \fn sme_SetGTKOffload |
| 6883 | \brief API to set GTK offload information. |
| 6884 | \param hHal - The handle returned by macOpen. |
| 6885 | \param pRequest - Pointer to the GTK offload request. |
| 6886 | \return eHalStatus |
| 6887 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6888 | eHalStatus sme_SetGTKOffload (tHalHandle hHal, tpSirGtkOffloadParams pRequest, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6889 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6890 | { |
| 6891 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6892 | eHalStatus status; |
| 6893 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6894 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6895 | TRACE_CODE_SME_RX_HDD_SET_GTKOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6896 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6897 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6898 | status = pmcSetGTKOffload( hHal, pRequest, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6899 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6900 | } |
| 6901 | |
| 6902 | return (status); |
| 6903 | } |
| 6904 | |
| 6905 | /* --------------------------------------------------------------------------- |
| 6906 | \fn sme_GetGTKOffload |
| 6907 | \brief API to get GTK offload information. |
| 6908 | \param hHal - The handle returned by macOpen. |
| 6909 | \param pRequest - Pointer to the GTK offload response. |
| 6910 | \return eHalStatus |
| 6911 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6912 | eHalStatus sme_GetGTKOffload (tHalHandle hHal, GTKOffloadGetInfoCallback callbackRoutine, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6913 | void *callbackContext, tANI_U8 sessionId ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6914 | { |
| 6915 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6916 | eHalStatus status; |
| 6917 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6918 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6919 | TRACE_CODE_SME_RX_HDD_GET_GTKOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6920 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6921 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6922 | pmcGetGTKOffload(hHal, callbackRoutine, callbackContext, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6923 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6924 | } |
| 6925 | |
| 6926 | return (status); |
| 6927 | } |
| 6928 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 6929 | |
| 6930 | /* --------------------------------------------------------------------------- |
| 6931 | \fn sme_SetKeepAlive |
| 6932 | \brief API to set the Keep Alive feature. |
| 6933 | \param hHal - The handle returned by macOpen. |
| 6934 | \param pRequest - Pointer to the Keep Alive request. |
| 6935 | \return eHalStatus |
| 6936 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6937 | eHalStatus sme_SetKeepAlive (tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6938 | tpSirKeepAliveReq pRequest) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6939 | { |
| 6940 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6941 | eHalStatus status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6942 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6943 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6944 | status = pmcSetKeepAlive (hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6945 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6946 | } |
| 6947 | |
| 6948 | return (status); |
| 6949 | } |
| 6950 | |
| 6951 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 6952 | /* --------------------------------------------------------------------------- |
| 6953 | \fn sme_SetPreferredNetworkList |
| 6954 | \brief API to set the Preferred Network List Offload feature. |
| 6955 | \param hHal - The handle returned by macOpen. |
| 6956 | \param pRequest - Pointer to the offload request. |
| 6957 | \return eHalStatus |
| 6958 | ---------------------------------------------------------------------------*/ |
| 6959 | eHalStatus sme_SetPreferredNetworkList (tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, void (*callbackRoutine) (void *callbackContext, tSirPrefNetworkFoundInd *pPrefNetworkFoundInd), void *callbackContext ) |
| 6960 | { |
| 6961 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6962 | eHalStatus status; |
| 6963 | |
| 6964 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6965 | { |
| 6966 | pmcSetPreferredNetworkList(hHal, pRequest, sessionId, callbackRoutine, callbackContext); |
| 6967 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6968 | } |
| 6969 | |
| 6970 | return (status); |
| 6971 | } |
| 6972 | |
| 6973 | eHalStatus sme_SetRSSIFilter(tHalHandle hHal, v_U8_t rssiThreshold) |
| 6974 | { |
| 6975 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6976 | eHalStatus status; |
| 6977 | |
| 6978 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6979 | { |
| 6980 | pmcSetRssiFilter(hHal, rssiThreshold); |
| 6981 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6982 | } |
| 6983 | |
| 6984 | return (status); |
| 6985 | } |
| 6986 | |
| 6987 | #endif // FEATURE_WLAN_SCAN_PNO |
| 6988 | |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 6989 | eHalStatus sme_SetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6990 | { |
| 6991 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6992 | eHalStatus status; |
| 6993 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6994 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6995 | TRACE_CODE_SME_RX_HDD_SET_POWERPARAMS, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6996 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6997 | { |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 6998 | pmcSetPowerParams(hHal, pwParams, forced); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6999 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7000 | } |
| 7001 | |
| 7002 | return (status); |
| 7003 | } |
| 7004 | |
| 7005 | /* --------------------------------------------------------------------------- |
| 7006 | \fn sme_AbortMacScan |
| 7007 | \brief API to cancel MAC scan. |
| 7008 | \param hHal - The handle returned by macOpen. |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 7009 | \param sessionId - sessionId on which we need to abort scan. |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 7010 | \param reason - Reason to abort the scan. |
c_hpothu | a3d45d5 | 2015-01-05 14:11:17 +0530 | [diff] [blame] | 7011 | \return tSirAbortScanStatus Abort scan status |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7012 | ---------------------------------------------------------------------------*/ |
c_hpothu | a3d45d5 | 2015-01-05 14:11:17 +0530 | [diff] [blame] | 7013 | tSirAbortScanStatus sme_AbortMacScan(tHalHandle hHal, tANI_U8 sessionId, |
| 7014 | eCsrAbortReason reason) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7015 | { |
c_hpothu | a3d45d5 | 2015-01-05 14:11:17 +0530 | [diff] [blame] | 7016 | tSirAbortScanStatus scanAbortStatus = eSIR_ABORT_SCAN_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7017 | eHalStatus status; |
| 7018 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7019 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7020 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7021 | TRACE_CODE_SME_RX_HDD_ABORT_MACSCAN, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7022 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7023 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7024 | { |
c_hpothu | a3d45d5 | 2015-01-05 14:11:17 +0530 | [diff] [blame] | 7025 | scanAbortStatus = csrScanAbortMacScan(pMac, sessionId, reason); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7026 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7027 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7028 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7029 | |
c_hpothu | a3d45d5 | 2015-01-05 14:11:17 +0530 | [diff] [blame] | 7030 | return ( scanAbortStatus ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7031 | } |
| 7032 | |
| 7033 | /* ---------------------------------------------------------------------------- |
| 7034 | \fn sme_GetOperationChannel |
| 7035 | \brief API to get current channel on which STA is parked |
| 7036 | this function gives channel information only of infra station or IBSS station |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 7037 | \param hHal, pointer to memory location and sessionId |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7038 | \returns eHAL_STATUS_SUCCESS |
| 7039 | eHAL_STATUS_FAILURE |
| 7040 | -------------------------------------------------------------------------------*/ |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 7041 | eHalStatus sme_GetOperationChannel(tHalHandle hHal, tANI_U32 *pChannel, tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7042 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7043 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7044 | tCsrRoamSession *pSession; |
| 7045 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 7046 | if (CSR_IS_SESSION_VALID( pMac, sessionId )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7047 | { |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 7048 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7049 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7050 | if(( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRASTRUCTURE ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 7051 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_IBSS ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 7052 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRA_AP ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 7053 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_START_IBSS )) |
| 7054 | { |
| 7055 | *pChannel =pSession->connectedProfile.operationChannel; |
| 7056 | return eHAL_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7057 | } |
| 7058 | } |
| 7059 | return eHAL_STATUS_FAILURE; |
| 7060 | }// sme_GetOperationChannel ends here |
| 7061 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7062 | /* --------------------------------------------------------------------------- |
| 7063 | |
| 7064 | \fn sme_RegisterMgtFrame |
| 7065 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7066 | \brief To register managment frame of specified type and subtype. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7067 | \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] | 7068 | \param matchData - data which needs to be matched before passing frame |
| 7069 | to HDD. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7070 | \param matchDataLen - Length of matched data. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7071 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7072 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7073 | eHalStatus sme_RegisterMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7074 | tANI_U16 frameType, tANI_U8* matchData, tANI_U16 matchLen) |
| 7075 | { |
| 7076 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7077 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7078 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7079 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7080 | TRACE_CODE_SME_RX_HDD_REGISTER_MGMTFR, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7081 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7082 | { |
| 7083 | tSirRegisterMgmtFrame *pMsg; |
| 7084 | tANI_U16 len; |
| 7085 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 7086 | |
| 7087 | if(!pSession) |
| 7088 | { |
| 7089 | 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] | 7090 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 7091 | return eHAL_STATUS_FAILURE; |
| 7092 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7093 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7094 | if( !pSession->sessionActive ) |
| 7095 | { |
| 7096 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7097 | "%s Invalid Sessionid", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7098 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7099 | return eHAL_STATUS_FAILURE; |
| 7100 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7101 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7102 | len = sizeof(tSirRegisterMgmtFrame) + matchLen; |
| 7103 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7104 | pMsg = vos_mem_malloc(len); |
| 7105 | if ( NULL == pMsg ) |
| 7106 | status = eHAL_STATUS_FAILURE; |
| 7107 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7108 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7109 | vos_mem_set(pMsg, len, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7110 | pMsg->messageType = eWNI_SME_REGISTER_MGMT_FRAME_REQ; |
| 7111 | pMsg->length = len; |
| 7112 | pMsg->sessionId = sessionId; |
| 7113 | pMsg->registerFrame = VOS_TRUE; |
| 7114 | pMsg->frameType = frameType; |
| 7115 | pMsg->matchLen = matchLen; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7116 | vos_mem_copy(pMsg->matchData, matchData, matchLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7117 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 7118 | } |
| 7119 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7120 | } |
| 7121 | return status; |
| 7122 | } |
| 7123 | |
| 7124 | /* --------------------------------------------------------------------------- |
| 7125 | |
| 7126 | \fn sme_DeregisterMgtFrame |
| 7127 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7128 | \brief To De-register managment frame of specified type and subtype. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7129 | \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] | 7130 | \param matchData - data which needs to be matched before passing frame |
| 7131 | to HDD. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7132 | \param matchDataLen - Length of matched data. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7133 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7134 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7135 | eHalStatus sme_DeregisterMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7136 | tANI_U16 frameType, tANI_U8* matchData, tANI_U16 matchLen) |
| 7137 | { |
| 7138 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7139 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7140 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7141 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7142 | TRACE_CODE_SME_RX_HDD_DEREGISTER_MGMTFR, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7143 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7144 | { |
| 7145 | tSirRegisterMgmtFrame *pMsg; |
| 7146 | tANI_U16 len; |
| 7147 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 7148 | |
| 7149 | if(!pSession) |
| 7150 | { |
| 7151 | 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] | 7152 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 7153 | return eHAL_STATUS_FAILURE; |
| 7154 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7155 | |
| 7156 | if( !pSession->sessionActive ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7157 | { |
| 7158 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7159 | "%s Invalid Sessionid", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7160 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7161 | return eHAL_STATUS_FAILURE; |
| 7162 | } |
| 7163 | |
| 7164 | len = sizeof(tSirRegisterMgmtFrame) + matchLen; |
| 7165 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7166 | pMsg = vos_mem_malloc(len); |
| 7167 | if ( NULL == pMsg ) |
| 7168 | status = eHAL_STATUS_FAILURE; |
| 7169 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7170 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7171 | vos_mem_set(pMsg, len, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7172 | pMsg->messageType = eWNI_SME_REGISTER_MGMT_FRAME_REQ; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7173 | pMsg->length = len; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7174 | pMsg->registerFrame = VOS_FALSE; |
| 7175 | pMsg->frameType = frameType; |
| 7176 | pMsg->matchLen = matchLen; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7177 | vos_mem_copy(pMsg->matchData, matchData, matchLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7178 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 7179 | } |
| 7180 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7181 | } |
| 7182 | return status; |
| 7183 | } |
| 7184 | |
| 7185 | /* --------------------------------------------------------------------------- |
| 7186 | \fn sme_RemainOnChannel |
| 7187 | \brief API to request remain on channel for 'x' duration. used in p2p in listen state |
| 7188 | \param hHal - The handle returned by macOpen. |
| 7189 | \param pRequest - channel |
| 7190 | \param duration - duration in ms |
| 7191 | \param callback - HDD registered callback to process reaminOnChannelRsp |
| 7192 | \param context - HDD Callback param |
| 7193 | \return eHalStatus |
| 7194 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7195 | eHalStatus sme_RemainOnChannel(tHalHandle hHal, tANI_U8 sessionId, |
| 7196 | tANI_U8 channel, tANI_U32 duration, |
Gopichand Nakkala | 924e455 | 2013-05-08 19:18:14 +0530 | [diff] [blame] | 7197 | remainOnChanCallback callback, |
| 7198 | void *pContext, |
| 7199 | tANI_U8 isP2PProbeReqAllowed) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7200 | { |
| 7201 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7202 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7203 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7204 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7205 | TRACE_CODE_SME_RX_HDD_REMAIN_ONCHAN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7206 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7207 | { |
Gopichand Nakkala | 924e455 | 2013-05-08 19:18:14 +0530 | [diff] [blame] | 7208 | status = p2pRemainOnChannel (hHal, sessionId, channel, duration, callback, pContext, |
| 7209 | isP2PProbeReqAllowed |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7210 | #ifdef WLAN_FEATURE_P2P_INTERNAL |
| 7211 | , eP2PRemainOnChnReasonUnknown |
| 7212 | #endif |
| 7213 | ); |
| 7214 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7215 | } |
| 7216 | return(status); |
| 7217 | } |
| 7218 | |
| 7219 | /* --------------------------------------------------------------------------- |
| 7220 | \fn sme_ReportProbeReq |
| 7221 | \brief API to enable/disable forwarding of probeReq to apps in p2p. |
| 7222 | \param hHal - The handle returned by macOpen. |
| 7223 | \param falg: to set the Probe request forarding to wpa_supplicant in listen state in p2p |
| 7224 | \return eHalStatus |
| 7225 | ---------------------------------------------------------------------------*/ |
| 7226 | |
| 7227 | #ifndef WLAN_FEATURE_CONCURRENT_P2P |
| 7228 | eHalStatus sme_ReportProbeReq(tHalHandle hHal, tANI_U8 flag) |
| 7229 | { |
| 7230 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7231 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7232 | |
| 7233 | do |
| 7234 | { |
| 7235 | //acquire the lock for the sme object |
| 7236 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 7237 | if(HAL_STATUS_SUCCESS(status)) |
| 7238 | { |
| 7239 | /* call set in context */ |
| 7240 | pMac->p2pContext.probeReqForwarding = flag; |
| 7241 | //release the lock for the sme object |
| 7242 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7243 | } |
| 7244 | } while(0); |
| 7245 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7246 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7247 | |
| 7248 | return(status); |
| 7249 | } |
| 7250 | |
| 7251 | /* --------------------------------------------------------------------------- |
| 7252 | \fn sme_updateP2pIe |
| 7253 | \brief API to set the P2p Ie in p2p context |
| 7254 | \param hHal - The handle returned by macOpen. |
| 7255 | \param p2pIe - Ptr to p2pIe from HDD. |
| 7256 | \param p2pIeLength: length of p2pIe |
| 7257 | \return eHalStatus |
| 7258 | ---------------------------------------------------------------------------*/ |
| 7259 | |
| 7260 | eHalStatus sme_updateP2pIe(tHalHandle hHal, void *p2pIe, tANI_U32 p2pIeLength) |
| 7261 | { |
| 7262 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7263 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7264 | |
| 7265 | //acquire the lock for the sme object |
| 7266 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 7267 | if(HAL_STATUS_SUCCESS(status)) |
| 7268 | { |
| 7269 | if(NULL != pMac->p2pContext.probeRspIe){ |
| 7270 | vos_mem_free(pMac->p2pContext.probeRspIe); |
| 7271 | pMac->p2pContext.probeRspIeLength = 0; |
| 7272 | } |
| 7273 | |
| 7274 | pMac->p2pContext.probeRspIe = vos_mem_malloc(p2pIeLength); |
| 7275 | if (NULL == pMac->p2pContext.probeRspIe) |
| 7276 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7277 | smsLog(pMac, LOGE, "%s: Unable to allocate P2P IE", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7278 | pMac->p2pContext.probeRspIeLength = 0; |
| 7279 | status = eHAL_STATUS_FAILURE; |
| 7280 | } |
| 7281 | else |
| 7282 | { |
| 7283 | pMac->p2pContext.probeRspIeLength = p2pIeLength; |
| 7284 | |
| 7285 | sirDumpBuf( pMac, SIR_LIM_MODULE_ID, LOG2, |
| 7286 | pMac->p2pContext.probeRspIe, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7287 | pMac->p2pContext.probeRspIeLength ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7288 | vos_mem_copy((tANI_U8 *)pMac->p2pContext.probeRspIe, p2pIe, |
| 7289 | p2pIeLength); |
| 7290 | } |
| 7291 | |
| 7292 | //release the lock for the sme object |
| 7293 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7294 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7295 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7296 | smsLog(pMac, LOG2, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7297 | |
| 7298 | return(status); |
| 7299 | } |
| 7300 | #endif |
| 7301 | |
| 7302 | /* --------------------------------------------------------------------------- |
| 7303 | \fn sme_sendAction |
| 7304 | \brief API to send action frame from supplicant. |
| 7305 | \param hHal - The handle returned by macOpen. |
| 7306 | \return eHalStatus |
| 7307 | ---------------------------------------------------------------------------*/ |
| 7308 | |
| 7309 | eHalStatus sme_sendAction(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7310 | const tANI_U8 *pBuf, tANI_U32 len, |
| 7311 | tANI_U16 wait, tANI_BOOLEAN noack) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7312 | { |
| 7313 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7314 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7315 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7316 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7317 | TRACE_CODE_SME_RX_HDD_SEND_ACTION, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7318 | //acquire the lock for the sme object |
| 7319 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 7320 | if(HAL_STATUS_SUCCESS(status)) |
| 7321 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7322 | p2pSendAction(hHal, sessionId, pBuf, len, wait, noack); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7323 | //release the lock for the sme object |
| 7324 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7325 | } |
| 7326 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7327 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7328 | |
| 7329 | return(status); |
| 7330 | } |
| 7331 | |
| 7332 | eHalStatus sme_CancelRemainOnChannel(tHalHandle hHal, tANI_U8 sessionId ) |
| 7333 | { |
| 7334 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7335 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7336 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7337 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7338 | TRACE_CODE_SME_RX_HDD_CANCEL_REMAIN_ONCHAN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7339 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7340 | { |
| 7341 | status = p2pCancelRemainOnChannel (hHal, sessionId); |
| 7342 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7343 | } |
| 7344 | return(status); |
| 7345 | } |
| 7346 | |
| 7347 | //Power Save Related |
| 7348 | eHalStatus sme_p2pSetPs(tHalHandle hHal, tP2pPsConfig * data) |
| 7349 | { |
| 7350 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7351 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7352 | |
| 7353 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7354 | { |
| 7355 | status = p2pSetPs (hHal, data); |
| 7356 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7357 | } |
| 7358 | return(status); |
| 7359 | } |
| 7360 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7361 | |
| 7362 | /* --------------------------------------------------------------------------- |
| 7363 | |
| 7364 | \fn sme_ConfigureRxpFilter |
| 7365 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7366 | \brief |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7367 | SME will pass this request to lower mac to set/reset the filter on RXP for |
| 7368 | multicast & broadcast traffic. |
| 7369 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7370 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7371 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7372 | hHal - The handle returned by macOpen. |
| 7373 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7374 | filterMask- Currently the API takes a 1 or 0 (set or reset) as filter. |
| 7375 | Basically to enable/disable the filter (to filter "all" mcbc traffic) based |
| 7376 | on this param. In future we can use this as a mask to set various types of |
| 7377 | filters as suggested below: |
| 7378 | FILTER_ALL_MULTICAST: |
| 7379 | FILTER_ALL_BROADCAST: |
| 7380 | FILTER_ALL_MULTICAST_BROADCAST: |
| 7381 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7382 | |
| 7383 | \return eHalStatus |
| 7384 | |
| 7385 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7386 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7387 | eHalStatus sme_ConfigureRxpFilter( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7388 | tpSirWlanSetRxpFilters wlanRxpFilterParam) |
| 7389 | { |
| 7390 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7391 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 7392 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7393 | vos_msg_t vosMessage; |
| 7394 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7395 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7396 | TRACE_CODE_SME_RX_HDD_CONFIG_RXPFIL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7397 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7398 | { |
| 7399 | /* serialize the req through MC thread */ |
| 7400 | vosMessage.bodyptr = wlanRxpFilterParam; |
| 7401 | vosMessage.type = WDA_CFG_RXP_FILTER_REQ; |
| 7402 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 7403 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 7404 | { |
| 7405 | status = eHAL_STATUS_FAILURE; |
| 7406 | } |
| 7407 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7408 | } |
| 7409 | return(status); |
| 7410 | } |
| 7411 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7412 | /* --------------------------------------------------------------------------- |
| 7413 | |
| 7414 | \fn sme_ConfigureSuspendInd |
| 7415 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7416 | \brief |
| 7417 | 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] | 7418 | be suspended |
| 7419 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7420 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7421 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7422 | hHal - The handle returned by macOpen. |
| 7423 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7424 | wlanSuspendParam- Depicts the wlan suspend params |
| 7425 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7426 | |
| 7427 | \return eHalStatus |
| 7428 | |
| 7429 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7430 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7431 | eHalStatus sme_ConfigureSuspendInd( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7432 | tpSirWlanSuspendParam wlanSuspendParam) |
| 7433 | { |
| 7434 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7435 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 7436 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7437 | vos_msg_t vosMessage; |
| 7438 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7439 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7440 | TRACE_CODE_SME_RX_HDD_CONFIG_SUSPENDIND, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7441 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7442 | { |
| 7443 | /* serialize the req through MC thread */ |
| 7444 | vosMessage.bodyptr = wlanSuspendParam; |
| 7445 | vosMessage.type = WDA_WLAN_SUSPEND_IND; |
| 7446 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 7447 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 7448 | { |
| 7449 | status = eHAL_STATUS_FAILURE; |
| 7450 | } |
| 7451 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7452 | } |
| 7453 | return(status); |
| 7454 | } |
| 7455 | |
| 7456 | /* --------------------------------------------------------------------------- |
| 7457 | |
| 7458 | \fn sme_ConfigureResumeReq |
| 7459 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7460 | \brief |
| 7461 | 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] | 7462 | be Resumed |
| 7463 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7464 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7465 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7466 | hHal - The handle returned by macOpen. |
| 7467 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7468 | wlanResumeParam- Depicts the wlan resume params |
| 7469 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7470 | |
| 7471 | \return eHalStatus |
| 7472 | |
| 7473 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7474 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7475 | eHalStatus sme_ConfigureResumeReq( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7476 | tpSirWlanResumeParam wlanResumeParam) |
| 7477 | { |
| 7478 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7479 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 7480 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7481 | vos_msg_t vosMessage; |
| 7482 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7483 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7484 | TRACE_CODE_SME_RX_HDD_CONFIG_RESUMEREQ, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7485 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 7486 | { |
| 7487 | /* serialize the req through MC thread */ |
| 7488 | vosMessage.bodyptr = wlanResumeParam; |
| 7489 | vosMessage.type = WDA_WLAN_RESUME_REQ; |
| 7490 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 7491 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 7492 | { |
| 7493 | status = eHAL_STATUS_FAILURE; |
| 7494 | } |
| 7495 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7496 | } |
| 7497 | return(status); |
| 7498 | } |
| 7499 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7500 | /* --------------------------------------------------------------------------- |
| 7501 | |
| 7502 | \fn sme_GetInfraSessionId |
| 7503 | |
| 7504 | \brief To get the session ID for infra session, if connected |
| 7505 | This is a synchronous API. |
| 7506 | |
| 7507 | \param hHal - The handle returned by macOpen. |
| 7508 | |
| 7509 | \return sessionid, -1 if infra session is not connected |
| 7510 | |
| 7511 | -------------------------------------------------------------------------------*/ |
| 7512 | tANI_S8 sme_GetInfraSessionId(tHalHandle hHal) |
| 7513 | { |
| 7514 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7515 | tANI_S8 sessionid = -1; |
| 7516 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7517 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7518 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7519 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7520 | { |
| 7521 | |
| 7522 | sessionid = csrGetInfraSessionId( pMac); |
| 7523 | |
| 7524 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7525 | } |
| 7526 | |
| 7527 | return (sessionid); |
| 7528 | } |
| 7529 | |
| 7530 | /* --------------------------------------------------------------------------- |
| 7531 | |
| 7532 | \fn sme_GetInfraOperationChannel |
| 7533 | |
| 7534 | \brief To get the operating channel for infra session, if connected |
| 7535 | This is a synchronous API. |
| 7536 | |
| 7537 | \param hHal - The handle returned by macOpen. |
| 7538 | \param sessionId - the sessionId returned by sme_OpenSession. |
| 7539 | |
| 7540 | \return operating channel, 0 if infra session is not connected |
| 7541 | |
| 7542 | -------------------------------------------------------------------------------*/ |
| 7543 | tANI_U8 sme_GetInfraOperationChannel( tHalHandle hHal, tANI_U8 sessionId) |
| 7544 | { |
| 7545 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7546 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7547 | tANI_U8 channel = 0; |
| 7548 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7549 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7550 | { |
| 7551 | |
| 7552 | channel = csrGetInfraOperationChannel( pMac, sessionId); |
| 7553 | |
| 7554 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7555 | } |
| 7556 | |
| 7557 | return (channel); |
| 7558 | } |
| 7559 | |
| 7560 | //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] | 7561 | //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] | 7562 | tANI_U8 sme_GetConcurrentOperationChannel( tHalHandle hHal ) |
| 7563 | { |
| 7564 | eHalStatus status = eHAL_STATUS_FAILURE; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7565 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7566 | tANI_U8 channel = 0; |
| 7567 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7568 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7569 | { |
| 7570 | |
| 7571 | channel = csrGetConcurrentOperationChannel( pMac ); |
| 7572 | 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] | 7573 | " Other Concurrent Channel = %d", __func__,channel); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7574 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7575 | } |
| 7576 | |
| 7577 | return (channel); |
| 7578 | } |
| 7579 | |
| 7580 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 7581 | /****************************************************************************** |
| 7582 | * |
| 7583 | * Name: sme_PreferredNetworkFoundInd |
| 7584 | * |
| 7585 | * Description: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7586 | * Invoke Preferred Network Found Indication |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7587 | * |
| 7588 | * Parameters: |
| 7589 | * hHal - HAL handle for device |
| 7590 | * pMsg - found network description |
| 7591 | * |
| 7592 | * Returns: eHalStatus |
| 7593 | * |
| 7594 | ******************************************************************************/ |
| 7595 | eHalStatus sme_PreferredNetworkFoundInd (tHalHandle hHal, void* pMsg) |
| 7596 | { |
| 7597 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7598 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7599 | tSirPrefNetworkFoundInd *pPrefNetworkFoundInd = (tSirPrefNetworkFoundInd *)pMsg; |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7600 | v_U8_t dumpSsId[SIR_MAC_MAX_SSID_LENGTH + 1]; |
| 7601 | tANI_U8 ssIdLength = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7602 | |
| 7603 | if (NULL == pMsg) |
| 7604 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7605 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7606 | status = eHAL_STATUS_FAILURE; |
| 7607 | } |
| 7608 | else |
| 7609 | { |
| 7610 | if (pPrefNetworkFoundInd->ssId.length > 0) |
| 7611 | { |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7612 | ssIdLength = CSR_MIN(SIR_MAC_MAX_SSID_LENGTH, |
| 7613 | pPrefNetworkFoundInd->ssId.length); |
| 7614 | vos_mem_copy(dumpSsId, pPrefNetworkFoundInd->ssId.ssId, ssIdLength); |
| 7615 | dumpSsId[ssIdLength] = 0; |
Abhishek Singh | 195c03e | 2014-05-14 17:21:30 +0530 | [diff] [blame] | 7616 | smsLog(pMac, LOG1, FL(" SSID=%s frame length %d"), |
| 7617 | dumpSsId, pPrefNetworkFoundInd->frameLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7618 | |
Vinay Krishna Eranna | b13043b | 2013-12-06 11:50:21 +0530 | [diff] [blame] | 7619 | /* Flush scan results, So as to avoid indication/updation of |
| 7620 | * stale entries, which may not have aged out during APPS collapse |
| 7621 | */ |
| 7622 | sme_ScanFlushResult(hHal,0); |
| 7623 | |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7624 | //Save the frame to scan result |
| 7625 | if (pPrefNetworkFoundInd->mesgLen > sizeof(tSirPrefNetworkFoundInd)) |
| 7626 | { |
| 7627 | //we may have a frame |
| 7628 | status = csrScanSavePreferredNetworkFound(pMac, |
| 7629 | pPrefNetworkFoundInd); |
| 7630 | if (!HAL_STATUS_SUCCESS(status)) |
| 7631 | { |
| 7632 | smsLog(pMac, LOGE, FL(" fail to save preferred network")); |
| 7633 | } |
| 7634 | } |
| 7635 | else |
| 7636 | { |
Jeff Johnson | afeb958 | 2013-11-22 18:39:00 -0800 | [diff] [blame] | 7637 | smsLog(pMac, LOGE, FL(" not enough data length %u needed %zu"), |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7638 | pPrefNetworkFoundInd->mesgLen, sizeof(tSirPrefNetworkFoundInd)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7639 | } |
| 7640 | |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7641 | /* Call Preferred Netowrk Found Indication callback routine. */ |
| 7642 | if (HAL_STATUS_SUCCESS(status) && (pMac->pmc.prefNetwFoundCB != NULL)) |
| 7643 | { |
| 7644 | pMac->pmc.prefNetwFoundCB( |
| 7645 | pMac->pmc.preferredNetworkFoundIndCallbackContext, |
| 7646 | pPrefNetworkFoundInd); |
| 7647 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7648 | } |
| 7649 | else |
| 7650 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7651 | smsLog(pMac, LOGE, "%s: callback failed - SSID is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7652 | status = eHAL_STATUS_FAILURE; |
| 7653 | } |
| 7654 | } |
| 7655 | |
| 7656 | |
| 7657 | return(status); |
| 7658 | } |
| 7659 | |
| 7660 | #endif // FEATURE_WLAN_SCAN_PNO |
| 7661 | |
| 7662 | |
| 7663 | eHalStatus sme_GetCfgValidChannels(tHalHandle hHal, tANI_U8 *aValidChannels, tANI_U32 *len) |
| 7664 | { |
| 7665 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7666 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7667 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7668 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7669 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7670 | { |
| 7671 | status = csrGetCfgValidChannels(pMac, aValidChannels, len); |
| 7672 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7673 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7674 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7675 | return (status); |
| 7676 | } |
| 7677 | |
| 7678 | |
| 7679 | /* --------------------------------------------------------------------------- |
| 7680 | |
| 7681 | \fn sme_SetTxPerTracking |
| 7682 | |
| 7683 | \brief Set Tx PER tracking configuration parameters |
| 7684 | |
| 7685 | \param hHal - The handle returned by macOpen. |
| 7686 | \param pTxPerTrackingConf - Tx PER configuration parameters |
| 7687 | |
| 7688 | \return eHalStatus |
| 7689 | |
| 7690 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7691 | eHalStatus sme_SetTxPerTracking(tHalHandle hHal, |
| 7692 | void (*pCallbackfn) (void *pCallbackContext), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7693 | void *pCallbackContext, |
| 7694 | tpSirTxPerTrackingParam pTxPerTrackingParam) |
| 7695 | { |
| 7696 | vos_msg_t msg; |
| 7697 | tpSirTxPerTrackingParam pTxPerTrackingParamReq = NULL; |
| 7698 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7699 | |
| 7700 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 7701 | { |
| 7702 | pMac->sme.pTxPerHitCallback = pCallbackfn; |
| 7703 | pMac->sme.pTxPerHitCbContext = pCallbackContext; |
| 7704 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7705 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7706 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7707 | // free this memory in failure case or WDA request callback function |
| 7708 | pTxPerTrackingParamReq = vos_mem_malloc(sizeof(tSirTxPerTrackingParam)); |
| 7709 | if (NULL == pTxPerTrackingParamReq) |
| 7710 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7711 | 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] | 7712 | return eHAL_STATUS_FAILURE; |
| 7713 | } |
| 7714 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7715 | vos_mem_copy(pTxPerTrackingParamReq, (void*)pTxPerTrackingParam, |
| 7716 | sizeof(tSirTxPerTrackingParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7717 | msg.type = WDA_SET_TX_PER_TRACKING_REQ; |
| 7718 | msg.reserved = 0; |
| 7719 | msg.bodyptr = pTxPerTrackingParamReq; |
| 7720 | |
| 7721 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7722 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7723 | 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] | 7724 | vos_mem_free(pTxPerTrackingParamReq); |
| 7725 | return eHAL_STATUS_FAILURE; |
| 7726 | } |
| 7727 | |
| 7728 | return eHAL_STATUS_SUCCESS; |
| 7729 | } |
| 7730 | |
| 7731 | /* --------------------------------------------------------------------------- |
| 7732 | |
| 7733 | \fn sme_HandleChangeCountryCode |
| 7734 | |
| 7735 | \brief Change Country code, Reg Domain and channel list |
| 7736 | |
| 7737 | \details Country Code Priority |
| 7738 | 0 = 11D > Configured Country > NV |
| 7739 | 1 = Configured Country > 11D > NV |
| 7740 | If Supplicant country code is priority than 11d is disabled. |
| 7741 | If 11D is enabled, we update the country code after every scan. |
| 7742 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 7743 | Country code from Supplicant is set as current courtry code. |
| 7744 | User can send reset command XX (instead of country code) to reset the |
| 7745 | country code to default values which is read from NV. |
| 7746 | In case of reset, 11D is enabled and default NV code is Set as current country code |
| 7747 | If 11D is priority, |
| 7748 | Than Supplicant country code code is set to default code. But 11D code is set as current country code |
| 7749 | |
| 7750 | \param pMac - The handle returned by macOpen. |
| 7751 | \param pMsgBuf - MSG Buffer |
| 7752 | |
| 7753 | \return eHalStatus |
| 7754 | |
| 7755 | -------------------------------------------------------------------------------*/ |
| 7756 | eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) |
| 7757 | { |
| 7758 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7759 | tAniChangeCountryCodeReq *pMsg; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7760 | v_REGDOMAIN_t domainIdIoctl; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7761 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 7762 | static uNvTables nvTables; |
| 7763 | pMsg = (tAniChangeCountryCodeReq *)pMsgBuf; |
| 7764 | |
| 7765 | |
| 7766 | /* if the reset Supplicant country code command is triggered, enable 11D, reset the NV country code and return */ |
| 7767 | if( VOS_TRUE == vos_mem_compare(pMsg->countryCode, SME_INVALID_COUNTRY_CODE, 2) ) |
| 7768 | { |
| 7769 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7770 | |
| 7771 | vosStatus = vos_nv_readDefaultCountryTable( &nvTables ); |
| 7772 | |
| 7773 | /* read the country code from NV and use it */ |
| 7774 | if ( VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 7775 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7776 | vos_mem_copy(pMsg->countryCode, |
| 7777 | nvTables.defaultCountryTable.countryCode, |
| 7778 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7779 | } |
| 7780 | else |
| 7781 | { |
| 7782 | status = eHAL_STATUS_FAILURE; |
| 7783 | return status; |
| 7784 | } |
Abhishek Singh | 4d6b54c | 2014-10-14 12:31:00 +0530 | [diff] [blame] | 7785 | /* Update the 11d country to default country from NV bin so that when |
| 7786 | * callback is received for this default country, driver will not |
| 7787 | * disable the 11d taking it as valid country by user. |
| 7788 | */ |
| 7789 | smsLog(pMac, LOG1, |
| 7790 | FL("Set default country code (%c%c) from NV as invalid country received"), |
| 7791 | pMsg->countryCode[0],pMsg->countryCode[1]); |
| 7792 | vos_mem_copy(pMac->scan.countryCode11d, pMsg->countryCode, |
| 7793 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7794 | } |
| 7795 | else |
| 7796 | { |
| 7797 | /* if Supplicant country code has priority, disable 11d */ |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 7798 | if(pMac->roam.configParam.fSupplicantCountryCodeHasPriority && |
| 7799 | pMsg->countryFromUserSpace) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7800 | { |
| 7801 | pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE; |
| 7802 | } |
| 7803 | } |
| 7804 | |
| 7805 | /* WEXT set country code means |
| 7806 | * 11D should be supported? |
| 7807 | * 11D Channel should be enforced? |
| 7808 | * 11D Country code should be matched? |
| 7809 | * 11D Reg Domian should be matched? |
| 7810 | * Country string changed */ |
| 7811 | if(pMac->roam.configParam.Is11dSupportEnabled && |
| 7812 | pMac->roam.configParam.fEnforce11dChannels && |
| 7813 | pMac->roam.configParam.fEnforceCountryCodeMatch && |
| 7814 | pMac->roam.configParam.fEnforceDefaultDomain && |
| 7815 | !csrSave11dCountryString(pMac, pMsg->countryCode, eANI_BOOLEAN_TRUE)) |
| 7816 | { |
| 7817 | /* All 11D related options are already enabled |
| 7818 | * Country string is not changed |
| 7819 | * Do not need do anything for country code change request */ |
| 7820 | return eHAL_STATUS_SUCCESS; |
| 7821 | } |
| 7822 | |
| 7823 | /* Set Current Country code and Current Regulatory domain */ |
| 7824 | status = csrSetCountryCode(pMac, pMsg->countryCode, NULL); |
| 7825 | if(eHAL_STATUS_SUCCESS != status) |
| 7826 | { |
| 7827 | /* Supplicant country code failed. So give 11D priority */ |
| 7828 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7829 | smsLog(pMac, LOGE, "Set Country Code Fail %d", status); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7830 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7831 | } |
| 7832 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7833 | /* overwrite the defualt country code */ |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7834 | vos_mem_copy(pMac->scan.countryCodeDefault, |
| 7835 | pMac->scan.countryCodeCurrent, |
| 7836 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7837 | |
| 7838 | /* Get Domain ID from country code */ |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7839 | status = csrGetRegulatoryDomainForCountry(pMac, |
| 7840 | pMac->scan.countryCodeCurrent, |
| 7841 | (v_REGDOMAIN_t *) &domainIdIoctl, |
| 7842 | COUNTRY_QUERY); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7843 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7844 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7845 | smsLog( pMac, LOGE, FL(" fail to get regId %d"), domainIdIoctl ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7846 | return status; |
| 7847 | } |
Tushnim Bhattacharyya | 796ffe8 | 2013-11-05 16:31:36 -0800 | [diff] [blame] | 7848 | else if (REGDOMAIN_WORLD == domainIdIoctl) |
| 7849 | { |
| 7850 | /* Supplicant country code is invalid, so we are on world mode now. So |
| 7851 | give 11D chance to update */ |
| 7852 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7853 | smsLog(pMac, LOG1, FL("Country Code unrecognized by driver")); |
| 7854 | } |
| 7855 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7856 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 7857 | status = WDA_SetRegDomain(pMac, domainIdIoctl, pMsg->sendRegHint); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7858 | |
| 7859 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7860 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7861 | smsLog( pMac, LOGE, FL(" fail to set regId %d"), domainIdIoctl ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7862 | return status; |
| 7863 | } |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7864 | else |
| 7865 | { |
| 7866 | //if 11d has priority, clear currentCountryBssid & countryCode11d to get |
| 7867 | //set again if we find AP with 11d info during scan |
Sachin Ahuja | cb64fc8 | 2015-01-12 17:01:05 +0530 | [diff] [blame] | 7868 | status = csrSetRegulatoryDomain(pMac, domainIdIoctl, NULL); |
| 7869 | if (status != eHAL_STATUS_SUCCESS) |
| 7870 | { |
| 7871 | smsLog( pMac, LOGE, FL("fail to set regId.status : %d"), status); |
| 7872 | } |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7873 | if (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) |
| 7874 | { |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7875 | smsLog( pMac, LOGW, FL("Clearing currentCountryBssid, countryCode11d")); |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7876 | vos_mem_zero(&pMac->scan.currentCountryBssid, sizeof(tCsrBssid)); |
| 7877 | vos_mem_zero( pMac->scan.countryCode11d, sizeof( pMac->scan.countryCode11d ) ); |
| 7878 | } |
| 7879 | } |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7880 | #ifndef CONFIG_ENABLE_LINUX_REG |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7881 | /* set to default domain ID */ |
| 7882 | pMac->scan.domainIdDefault = pMac->scan.domainIdCurrent; |
| 7883 | |
| 7884 | /* get the channels based on new cc */ |
| 7885 | status = csrInitGetChannels( pMac ); |
| 7886 | |
| 7887 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7888 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7889 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7890 | return status; |
| 7891 | } |
| 7892 | |
| 7893 | /* reset info based on new cc, and we are done */ |
Gopichand Nakkala | b9185f2 | 2012-12-21 08:03:42 -0800 | [diff] [blame] | 7894 | csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7895 | /* Country code Changed, Purge Only scan result |
| 7896 | * which does not have channel number belong to 11d |
| 7897 | * channel list |
| 7898 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 7899 | csrScanFilterResults(pMac); |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7900 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7901 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7902 | if( pMsg->changeCCCallback ) |
| 7903 | { |
| 7904 | ((tSmeChangeCountryCallback)(pMsg->changeCCCallback))((void *)pMsg->pDevContext); |
| 7905 | } |
| 7906 | |
| 7907 | return eHAL_STATUS_SUCCESS; |
| 7908 | } |
| 7909 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7910 | /* --------------------------------------------------------------------------- |
| 7911 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7912 | \fn sme_HandleChangeCountryCodeByUser |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7913 | |
| 7914 | \brief Change Country code, Reg Domain and channel list |
| 7915 | |
| 7916 | If Supplicant country code is priority than 11d is disabled. |
| 7917 | If 11D is enabled, we update the country code after every scan. |
| 7918 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 7919 | Country code from Supplicant is set as current country code. |
| 7920 | |
| 7921 | \param pMac - The handle returned by macOpen. |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7922 | \param pMsg - Carrying new CC & domain set in kernel by user |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7923 | |
| 7924 | \return eHalStatus |
| 7925 | |
| 7926 | -------------------------------------------------------------------------------*/ |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7927 | eHalStatus sme_HandleChangeCountryCodeByUser(tpAniSirGlobal pMac, |
| 7928 | tAniGenericChangeCountryCodeReq *pMsg) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7929 | { |
| 7930 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7931 | v_REGDOMAIN_t reg_domain_id; |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7932 | v_BOOL_t is11dCountry = VOS_FALSE; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7933 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7934 | smsLog(pMac, LOG1, FL(" called")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7935 | reg_domain_id = (v_REGDOMAIN_t)pMsg->domain_index; |
| 7936 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7937 | if (memcmp(pMsg->countryCode, pMac->scan.countryCode11d, |
| 7938 | VOS_COUNTRY_CODE_LEN) == 0) |
| 7939 | { |
| 7940 | is11dCountry = VOS_TRUE; |
| 7941 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7942 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7943 | /* Set the country code given by userspace when 11dOriginal is FALSE |
| 7944 | * when 11doriginal is True,is11dCountry =0 and |
| 7945 | * fSupplicantCountryCodeHasPriority = 0, then revert the country code, |
| 7946 | * and return failure |
| 7947 | */ |
| 7948 | if (pMac->roam.configParam.Is11dSupportEnabledOriginal == true) |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7949 | { |
Abhishek Singh | 2ec36ab | 2014-08-07 16:14:25 +0530 | [diff] [blame] | 7950 | if ((!is11dCountry) && (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority)&& |
| 7951 | (!pMac->roam.configParam.fEnforceCountryCode) ) |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7952 | { |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7953 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7954 | smsLog( pMac, LOGW, FL(" incorrect country being set, nullify this request")); |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7955 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7956 | status = csrGetRegulatoryDomainForCountry(pMac, |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7957 | pMac->scan.countryCode11d, |
| 7958 | (v_REGDOMAIN_t *) ®_domain_id, |
| 7959 | COUNTRY_IE); |
| 7960 | |
Agarwal Ashish | 04dd7c7 | 2014-04-24 14:25:28 +0530 | [diff] [blame] | 7961 | return eHAL_STATUS_FAILURE; |
| 7962 | } |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7963 | } |
Abhishek Singh | 2ec36ab | 2014-08-07 16:14:25 +0530 | [diff] [blame] | 7964 | pMac->roam.configParam.fEnforceCountryCode = eANI_BOOLEAN_FALSE; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7965 | /* if Supplicant country code has priority, disable 11d */ |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7966 | if (!is11dCountry && pMac->roam.configParam.fSupplicantCountryCodeHasPriority) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7967 | { |
| 7968 | pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE; |
Agarwal Ashish | cd9b8e6 | 2014-07-21 19:48:24 +0530 | [diff] [blame] | 7969 | smsLog( pMac, LOG1, FL(" 11d is being disabled")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7970 | } |
| 7971 | |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7972 | vos_mem_copy(pMac->scan.countryCodeCurrent, pMsg->countryCode, |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7973 | WNI_CFG_COUNTRY_CODE_LEN); |
| 7974 | |
Sachin Ahuja | cb64fc8 | 2015-01-12 17:01:05 +0530 | [diff] [blame] | 7975 | status = csrSetRegulatoryDomain(pMac, reg_domain_id, NULL); |
| 7976 | if (status != eHAL_STATUS_SUCCESS) |
| 7977 | { |
| 7978 | smsLog( pMac, LOGE, FL("fail to set regId.status : %d"), status); |
| 7979 | } |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 7980 | status = WDA_SetRegDomain(pMac, reg_domain_id, eSIR_TRUE); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7981 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7982 | if (VOS_FALSE == is11dCountry ) |
| 7983 | { |
| 7984 | /* overwrite the defualt country code */ |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7985 | vos_mem_copy(pMac->scan.countryCodeDefault, |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7986 | pMac->scan.countryCodeCurrent, WNI_CFG_COUNTRY_CODE_LEN); |
| 7987 | /* set to default domain ID */ |
| 7988 | pMac->scan.domainIdDefault = pMac->scan.domainIdCurrent; |
| 7989 | } |
| 7990 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7991 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7992 | { |
| 7993 | smsLog( pMac, LOGE, FL(" fail to set regId %d"), reg_domain_id ); |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7994 | return status; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7995 | } |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7996 | else |
| 7997 | { |
| 7998 | //if 11d has priority, clear currentCountryBssid & countryCode11d to get |
| 7999 | //set again if we find AP with 11d info during scan |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8000 | if((!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) && |
| 8001 | (VOS_FALSE == is11dCountry )) |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 8002 | { |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8003 | smsLog( pMac, LOGW, FL("Clearing currentCountryBssid, countryCode11d")); |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 8004 | vos_mem_zero(&pMac->scan.currentCountryBssid, sizeof(tCsrBssid)); |
| 8005 | vos_mem_zero( pMac->scan.countryCode11d, sizeof( pMac->scan.countryCode11d ) ); |
| 8006 | } |
| 8007 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 8008 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 8009 | /* get the channels based on new cc */ |
| 8010 | status = csrInitGetChannels(pMac); |
| 8011 | |
| 8012 | if ( status != eHAL_STATUS_SUCCESS ) |
| 8013 | { |
| 8014 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
| 8015 | return status; |
| 8016 | } |
| 8017 | |
| 8018 | /* reset info based on new cc, and we are done */ |
| 8019 | csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 8020 | if (VOS_TRUE == is11dCountry) |
| 8021 | { |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 8022 | pMac->scan.f11dInfoApplied = eANI_BOOLEAN_TRUE; |
| 8023 | pMac->scan.f11dInfoReset = eANI_BOOLEAN_FALSE; |
| 8024 | } |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 8025 | /* Country code Changed, Purge Only scan result |
| 8026 | * which does not have channel number belong to 11d |
| 8027 | * channel list |
| 8028 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 8029 | csrScanFilterResults(pMac); |
Kiet Lam | bd5cd9b | 2013-11-11 19:01:45 +0530 | [diff] [blame] | 8030 | // Do active scans after the country is set by User hints or Country IE |
| 8031 | pMac->scan.curScanType = eSIR_ACTIVE_SCAN; |
Sushant Kaushik | 1d73256 | 2014-05-21 14:15:37 +0530 | [diff] [blame] | 8032 | sme_DisconnectConnectedSessions(pMac); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8033 | smsLog(pMac, LOG1, FL(" returned")); |
| 8034 | return eHAL_STATUS_SUCCESS; |
| 8035 | } |
| 8036 | |
| 8037 | /* --------------------------------------------------------------------------- |
| 8038 | |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 8039 | \fn sme_HandleChangeCountryCodeByCore |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8040 | |
| 8041 | \brief Update Country code in the driver if set by kernel as world |
| 8042 | |
| 8043 | If 11D is enabled, we update the country code after every scan & notify kernel. |
| 8044 | This is to make sure kernel & driver are in sync in case of CC found in |
| 8045 | driver but not in kernel database |
| 8046 | |
| 8047 | \param pMac - The handle returned by macOpen. |
| 8048 | \param pMsg - Carrying new CC set in kernel |
| 8049 | |
| 8050 | \return eHalStatus |
| 8051 | |
| 8052 | -------------------------------------------------------------------------------*/ |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 8053 | eHalStatus sme_HandleChangeCountryCodeByCore(tpAniSirGlobal pMac, tAniGenericChangeCountryCodeReq *pMsg) |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8054 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 8055 | eHalStatus status; |
| 8056 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8057 | smsLog(pMac, LOG1, FL(" called")); |
| 8058 | |
| 8059 | //this is to make sure kernel & driver are in sync in case of CC found in |
| 8060 | //driver but not in kernel database |
| 8061 | if (('0' == pMsg->countryCode[0]) && ('0' == pMsg->countryCode[1])) |
| 8062 | { |
Tushnim Bhattacharyya | 582ac1d | 2013-11-07 23:44:09 -0800 | [diff] [blame] | 8063 | smsLog( pMac, LOGW, FL("Setting countryCode11d & countryCodeCurrent to world CC")); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 8064 | vos_mem_copy(pMac->scan.countryCode11d, pMsg->countryCode, |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8065 | WNI_CFG_COUNTRY_CODE_LEN); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 8066 | vos_mem_copy(pMac->scan.countryCodeCurrent, pMsg->countryCode, |
Tushnim Bhattacharyya | 582ac1d | 2013-11-07 23:44:09 -0800 | [diff] [blame] | 8067 | WNI_CFG_COUNTRY_CODE_LEN); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8068 | } |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 8069 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 8070 | status = WDA_SetRegDomain(pMac, REGDOMAIN_WORLD, eSIR_TRUE); |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 8071 | |
| 8072 | if ( status != eHAL_STATUS_SUCCESS ) |
| 8073 | { |
| 8074 | smsLog( pMac, LOGE, FL(" fail to set regId") ); |
| 8075 | return status; |
| 8076 | } |
| 8077 | else |
| 8078 | { |
Sachin Ahuja | cb64fc8 | 2015-01-12 17:01:05 +0530 | [diff] [blame] | 8079 | status = csrSetRegulatoryDomain(pMac, REGDOMAIN_WORLD, NULL); |
| 8080 | if (status != eHAL_STATUS_SUCCESS) |
| 8081 | { |
| 8082 | smsLog( pMac, LOGE, FL("fail to set regId.status : %d"), status); |
| 8083 | } |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 8084 | status = csrInitGetChannels(pMac); |
| 8085 | if ( status != eHAL_STATUS_SUCCESS ) |
| 8086 | { |
| 8087 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
| 8088 | } |
| 8089 | else |
| 8090 | { |
| 8091 | csrInitChannelList(pMac); |
| 8092 | } |
| 8093 | } |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 8094 | /* Country code Changed, Purge Only scan result |
| 8095 | * which does not have channel number belong to 11d |
| 8096 | * channel list |
| 8097 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 8098 | csrScanFilterResults(pMac); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8099 | smsLog(pMac, LOG1, FL(" returned")); |
| 8100 | return eHAL_STATUS_SUCCESS; |
| 8101 | } |
| 8102 | |
| 8103 | /* --------------------------------------------------------------------------- |
| 8104 | |
Sushant Kaushik | 1d73256 | 2014-05-21 14:15:37 +0530 | [diff] [blame] | 8105 | \fn sme_DisconnectConnectedSessions |
| 8106 | |
| 8107 | \brief Disconnect STA and P2P client session if channel is not supported |
| 8108 | |
| 8109 | If new country code does not support the channel on which STA/P2P client |
| 8110 | is connetced, it sends the disconnect to the AP/P2P GO |
| 8111 | |
| 8112 | \param pMac - The handle returned by macOpen |
| 8113 | |
| 8114 | \return eHalStatus |
| 8115 | |
| 8116 | -------------------------------------------------------------------------------*/ |
| 8117 | |
| 8118 | void sme_DisconnectConnectedSessions(tpAniSirGlobal pMac) |
| 8119 | { |
| 8120 | v_U8_t i, sessionId, isChanFound = false; |
| 8121 | tANI_U8 currChannel; |
| 8122 | |
| 8123 | for (sessionId=0; sessionId < CSR_ROAM_SESSION_MAX; sessionId++) |
| 8124 | { |
| 8125 | if (csrIsSessionClientAndConnected(pMac, sessionId)) |
| 8126 | { |
| 8127 | isChanFound = false; |
| 8128 | //Session is connected.Check the channel |
| 8129 | currChannel = csrGetInfraOperationChannel(pMac, sessionId); |
| 8130 | smsLog(pMac, LOGW, "Current Operating channel : %d, session :%d", |
| 8131 | currChannel, sessionId); |
| 8132 | for (i=0; i < pMac->scan.base20MHzChannels.numChannels; i++) |
| 8133 | { |
| 8134 | if (pMac->scan.base20MHzChannels.channelList[i] == currChannel) |
| 8135 | { |
| 8136 | isChanFound = true; |
| 8137 | break; |
| 8138 | } |
| 8139 | } |
| 8140 | |
| 8141 | if (!isChanFound) |
| 8142 | { |
| 8143 | for (i=0; i < pMac->scan.base40MHzChannels.numChannels; i++) |
| 8144 | { |
| 8145 | if (pMac->scan.base40MHzChannels.channelList[i] == currChannel) |
| 8146 | { |
| 8147 | isChanFound = true; |
| 8148 | break; |
| 8149 | } |
| 8150 | } |
| 8151 | } |
| 8152 | if (!isChanFound) |
| 8153 | { |
| 8154 | smsLog(pMac, LOGW, "%s : Disconnect Session :%d", __func__, sessionId); |
| 8155 | csrRoamDisconnect(pMac, sessionId, eCSR_DISCONNECT_REASON_UNSPECIFIED); |
| 8156 | } |
| 8157 | } |
| 8158 | } |
| 8159 | } |
| 8160 | /* --------------------------------------------------------------------------- |
| 8161 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8162 | \fn sme_HandleGenericChangeCountryCode |
| 8163 | |
| 8164 | \brief Change Country code, Reg Domain and channel list |
| 8165 | |
| 8166 | If Supplicant country code is priority than 11d is disabled. |
| 8167 | If 11D is enabled, we update the country code after every scan. |
| 8168 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 8169 | Country code from kernel is set as current country code. |
| 8170 | |
| 8171 | \param pMac - The handle returned by macOpen. |
| 8172 | \param pMsgBuf - message buffer |
| 8173 | |
| 8174 | \return eHalStatus |
| 8175 | |
| 8176 | -------------------------------------------------------------------------------*/ |
| 8177 | eHalStatus sme_HandleGenericChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) |
| 8178 | { |
| 8179 | tAniGenericChangeCountryCodeReq *pMsg; |
| 8180 | v_REGDOMAIN_t reg_domain_id; |
| 8181 | |
| 8182 | smsLog(pMac, LOG1, FL(" called")); |
| 8183 | pMsg = (tAniGenericChangeCountryCodeReq *)pMsgBuf; |
| 8184 | reg_domain_id = (v_REGDOMAIN_t)pMsg->domain_index; |
| 8185 | |
| 8186 | if (REGDOMAIN_COUNT == reg_domain_id) |
| 8187 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 8188 | sme_HandleChangeCountryCodeByCore(pMac, pMsg); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 8189 | } |
| 8190 | else |
| 8191 | { |
| 8192 | sme_HandleChangeCountryCodeByUser(pMac, pMsg); |
| 8193 | } |
| 8194 | smsLog(pMac, LOG1, FL(" returned")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 8195 | return eHAL_STATUS_SUCCESS; |
| 8196 | } |
| 8197 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8198 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 8199 | eHalStatus sme_8023MulticastList (tHalHandle hHal, tANI_U8 sessionId, tpSirRcvFltMcAddrList pMulticastAddrs) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8200 | { |
| 8201 | tpSirRcvFltMcAddrList pRequestBuf; |
| 8202 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8203 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8204 | tCsrRoamSession *pSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8205 | |
| 8206 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: " |
Gopichand Nakkala | 66c0bd0 | 2013-04-10 11:36:29 +0530 | [diff] [blame] | 8207 | "ulMulticastAddrCnt=%d, multicastAddr[0]=%p", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8208 | pMulticastAddrs->ulMulticastAddrCnt, |
| 8209 | pMulticastAddrs->multicastAddr[0]); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8210 | |
| 8211 | /* |
| 8212 | *Find the connected Infra / P2P_client connected session |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 8213 | */ |
| 8214 | if (CSR_IS_SESSION_VALID(pMac, sessionId) && |
| 8215 | csrIsConnStateInfra(pMac, sessionId)) |
| 8216 | { |
| 8217 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 8218 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8219 | |
| 8220 | if(pSession == NULL ) |
| 8221 | { |
| 8222 | 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] | 8223 | "the right session", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8224 | return eHAL_STATUS_FAILURE; |
| 8225 | } |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 8226 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8227 | pRequestBuf = vos_mem_malloc(sizeof(tSirRcvFltMcAddrList)); |
| 8228 | if (NULL == pRequestBuf) |
| 8229 | { |
| 8230 | 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] | 8231 | "allocate memory for 8023 Multicast List request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8232 | return eHAL_STATUS_FAILED_ALLOC; |
| 8233 | } |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 8234 | |
| 8235 | if( !csrIsConnStateConnectedInfra (pMac, sessionId )) |
| 8236 | { |
| 8237 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Ignoring the " |
| 8238 | "indication as we are not connected", __func__); |
| 8239 | vos_mem_free(pRequestBuf); |
| 8240 | return eHAL_STATUS_FAILURE; |
| 8241 | } |
| 8242 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8243 | vos_mem_copy(pRequestBuf, pMulticastAddrs, sizeof(tSirRcvFltMcAddrList)); |
| 8244 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8245 | vos_mem_copy(pRequestBuf->selfMacAddr, pSession->selfMacAddr, |
| 8246 | sizeof(tSirMacAddr)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8247 | vos_mem_copy(pRequestBuf->bssId, pSession->connectedProfile.bssid, |
| 8248 | sizeof(tSirMacAddr)); |
| 8249 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8250 | msg.type = WDA_8023_MULTICAST_LIST_REQ; |
| 8251 | msg.reserved = 0; |
| 8252 | msg.bodyptr = pRequestBuf; |
| 8253 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8254 | { |
| 8255 | 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] | 8256 | "post WDA_8023_MULTICAST_LIST message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8257 | vos_mem_free(pRequestBuf); |
| 8258 | return eHAL_STATUS_FAILURE; |
| 8259 | } |
| 8260 | |
| 8261 | return eHAL_STATUS_SUCCESS; |
| 8262 | } |
| 8263 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8264 | eHalStatus sme_ReceiveFilterSetFilter(tHalHandle hHal, tpSirRcvPktFilterCfgType pRcvPktFilterCfg, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8265 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8266 | { |
| 8267 | tpSirRcvPktFilterCfgType pRequestBuf; |
| 8268 | v_SINT_t allocSize; |
| 8269 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8270 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8271 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8272 | v_U8_t idx=0; |
| 8273 | |
| 8274 | 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] | 8275 | "filterId = %d", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8276 | pRcvPktFilterCfg->filterType, pRcvPktFilterCfg->filterId); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8277 | |
Madan Mohan Koyyalamudi | d402962 | 2012-10-18 20:30:17 -0700 | [diff] [blame] | 8278 | allocSize = sizeof(tSirRcvPktFilterCfgType); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8279 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8280 | pRequestBuf = vos_mem_malloc(allocSize); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8281 | |
| 8282 | if (NULL == pRequestBuf) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8283 | { |
| 8284 | 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] | 8285 | "allocate memory for Receive Filter Set Filter request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8286 | return eHAL_STATUS_FAILED_ALLOC; |
| 8287 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8288 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8289 | if( NULL == pSession ) |
| 8290 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8291 | 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] | 8292 | vos_mem_free(pRequestBuf); |
| 8293 | return eHAL_STATUS_FAILURE; |
| 8294 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8295 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8296 | vos_mem_copy(pRcvPktFilterCfg->selfMacAddr, pSession->selfMacAddr, |
| 8297 | sizeof(tSirMacAddr)); |
| 8298 | vos_mem_copy(pRcvPktFilterCfg->bssId, pSession->connectedProfile.bssid, |
| 8299 | sizeof(tSirMacAddr)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8300 | vos_mem_copy(pRequestBuf, pRcvPktFilterCfg, allocSize); |
| 8301 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8302 | msg.type = WDA_RECEIVE_FILTER_SET_FILTER_REQ; |
| 8303 | msg.reserved = 0; |
| 8304 | msg.bodyptr = pRequestBuf; |
| 8305 | |
| 8306 | 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] | 8307 | "FT %d FID %d ", |
| 8308 | pRequestBuf->filterType, pRequestBuf->filterId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8309 | |
| 8310 | 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] | 8311 | "params %d CT %d", |
| 8312 | pRequestBuf->numFieldParams, pRequestBuf->coalesceTime); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8313 | |
| 8314 | for (idx=0; idx<pRequestBuf->numFieldParams; idx++) |
| 8315 | { |
| 8316 | |
| 8317 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8318 | "Proto %d Comp Flag %d ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8319 | pRequestBuf->paramsData[idx].protocolLayer, |
| 8320 | pRequestBuf->paramsData[idx].cmpFlag); |
| 8321 | |
| 8322 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8323 | "Data Offset %d Data Len %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8324 | pRequestBuf->paramsData[idx].dataOffset, |
| 8325 | pRequestBuf->paramsData[idx].dataLength); |
| 8326 | |
| 8327 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8328 | "CData: %d:%d:%d:%d:%d:%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8329 | pRequestBuf->paramsData[idx].compareData[0], |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8330 | pRequestBuf->paramsData[idx].compareData[1], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8331 | pRequestBuf->paramsData[idx].compareData[2], |
| 8332 | pRequestBuf->paramsData[idx].compareData[3], |
| 8333 | pRequestBuf->paramsData[idx].compareData[4], |
| 8334 | pRequestBuf->paramsData[idx].compareData[5]); |
| 8335 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8336 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8337 | "MData: %d:%d:%d:%d:%d:%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8338 | pRequestBuf->paramsData[idx].dataMask[0], |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8339 | pRequestBuf->paramsData[idx].dataMask[1], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8340 | pRequestBuf->paramsData[idx].dataMask[2], |
| 8341 | pRequestBuf->paramsData[idx].dataMask[3], |
| 8342 | pRequestBuf->paramsData[idx].dataMask[4], |
| 8343 | pRequestBuf->paramsData[idx].dataMask[5]); |
| 8344 | |
| 8345 | } |
| 8346 | |
| 8347 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8348 | { |
| 8349 | 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] | 8350 | "WDA_RECEIVE_FILTER_SET_FILTER message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8351 | vos_mem_free(pRequestBuf); |
| 8352 | return eHAL_STATUS_FAILURE; |
| 8353 | } |
| 8354 | |
| 8355 | return eHAL_STATUS_SUCCESS; |
| 8356 | } |
| 8357 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8358 | eHalStatus sme_GetFilterMatchCount(tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8359 | FilterMatchCountCallback callbackRoutine, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8360 | void *callbackContext, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8361 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8362 | { |
| 8363 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8364 | eHalStatus status; |
| 8365 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8366 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "+%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8367 | |
| 8368 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme))) |
| 8369 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8370 | pmcGetFilterMatchCount(hHal, callbackRoutine, callbackContext, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8371 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8372 | } |
| 8373 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8374 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "-%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8375 | |
| 8376 | return (status); |
| 8377 | } |
| 8378 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8379 | eHalStatus sme_ReceiveFilterClearFilter(tHalHandle hHal, tpSirRcvFltPktClearParam pRcvFltPktClearParam, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8380 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8381 | { |
| 8382 | tpSirRcvFltPktClearParam pRequestBuf; |
| 8383 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8384 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8385 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8386 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8387 | 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] | 8388 | pRcvFltPktClearParam->filterId); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8389 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8390 | pRequestBuf = vos_mem_malloc(sizeof(tSirRcvFltPktClearParam)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8391 | if (NULL == pRequestBuf) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8392 | { |
| 8393 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8394 | "%s: Not able to allocate memory for Receive Filter " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8395 | "Clear Filter request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8396 | return eHAL_STATUS_FAILED_ALLOC; |
| 8397 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8398 | if( NULL == pSession ) |
| 8399 | { |
| 8400 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8401 | "%s: Session Not find ", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8402 | vos_mem_free(pRequestBuf); |
| 8403 | return eHAL_STATUS_FAILURE; |
| 8404 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8405 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8406 | vos_mem_copy(pRcvFltPktClearParam->selfMacAddr, pSession->selfMacAddr, |
| 8407 | sizeof(tSirMacAddr)); |
| 8408 | vos_mem_copy(pRcvFltPktClearParam->bssId, pSession->connectedProfile.bssid, |
| 8409 | sizeof(tSirMacAddr)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 8410 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 8411 | vos_mem_copy(pRequestBuf, pRcvFltPktClearParam, sizeof(tSirRcvFltPktClearParam)); |
| 8412 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8413 | msg.type = WDA_RECEIVE_FILTER_CLEAR_FILTER_REQ; |
| 8414 | msg.reserved = 0; |
| 8415 | msg.bodyptr = pRequestBuf; |
| 8416 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8417 | { |
| 8418 | 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] | 8419 | "WDA_RECEIVE_FILTER_CLEAR_FILTER message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8420 | vos_mem_free(pRequestBuf); |
| 8421 | return eHAL_STATUS_FAILURE; |
| 8422 | } |
| 8423 | |
| 8424 | return eHAL_STATUS_SUCCESS; |
| 8425 | } |
| 8426 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 8427 | |
| 8428 | /* --------------------------------------------------------------------------- |
| 8429 | \fn sme_PreChannelSwitchIndFullPowerCB |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8430 | \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] | 8431 | channel switch. |
| 8432 | \param callbackContext |
| 8433 | \param status |
| 8434 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8435 | void sme_PreChannelSwitchIndFullPowerCB(void *callbackContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8436 | eHalStatus status) |
| 8437 | { |
| 8438 | tpAniSirGlobal pMac = (tpAniSirGlobal)callbackContext; |
| 8439 | tSirMbMsg *pMsg; |
| 8440 | tANI_U16 msgLen; |
| 8441 | |
| 8442 | msgLen = (tANI_U16)(sizeof( tSirMbMsg )); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8443 | pMsg = vos_mem_malloc(msgLen); |
| 8444 | if ( NULL != pMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8445 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8446 | vos_mem_set(pMsg, msgLen, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8447 | pMsg->type = pal_cpu_to_be16((tANI_U16)eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER); |
| 8448 | pMsg->msgLen = pal_cpu_to_be16(msgLen); |
| 8449 | status = palSendMBMessage(pMac->hHdd, pMsg); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8450 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8451 | |
| 8452 | return; |
| 8453 | } |
| 8454 | |
| 8455 | /* --------------------------------------------------------------------------- |
| 8456 | \fn sme_HandlePreChannelSwitchInd |
| 8457 | \brief Processes the indcation from PE for pre-channel switch. |
| 8458 | \param hHal |
| 8459 | \- The handle returned by macOpen. return eHalStatus |
| 8460 | ---------------------------------------------------------------------------*/ |
| 8461 | eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal) |
| 8462 | { |
| 8463 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8464 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8465 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8466 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8467 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8468 | status = pmcRequestFullPower(hHal, sme_PreChannelSwitchIndFullPowerCB, |
| 8469 | pMac, eSME_FULL_PWR_NEEDED_BY_CHANNEL_SWITCH); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8470 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8471 | } |
| 8472 | |
| 8473 | return (status); |
| 8474 | } |
| 8475 | |
| 8476 | /* --------------------------------------------------------------------------- |
| 8477 | \fn sme_HandlePostChannelSwitchInd |
| 8478 | \brief Processes the indcation from PE for post-channel switch. |
| 8479 | \param hHal |
| 8480 | \- The handle returned by macOpen. return eHalStatus |
| 8481 | ---------------------------------------------------------------------------*/ |
| 8482 | eHalStatus sme_HandlePostChannelSwitchInd(tHalHandle hHal) |
| 8483 | { |
| 8484 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8485 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8486 | |
| 8487 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8488 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8489 | { |
| 8490 | status = pmcRequestBmps(hHal, NULL, NULL); |
| 8491 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8492 | } |
| 8493 | |
| 8494 | return (status); |
| 8495 | } |
| 8496 | |
| 8497 | /* --------------------------------------------------------------------------- |
| 8498 | |
| 8499 | \fn sme_IsChannelValid |
| 8500 | |
| 8501 | \brief To check if the channel is valid for currently established domain |
| 8502 | This is a synchronous API. |
| 8503 | |
| 8504 | \param hHal - The handle returned by macOpen. |
| 8505 | \param channel - channel to verify |
| 8506 | |
| 8507 | \return TRUE/FALSE, TRUE if channel is valid |
| 8508 | |
| 8509 | -------------------------------------------------------------------------------*/ |
| 8510 | tANI_BOOLEAN sme_IsChannelValid(tHalHandle hHal, tANI_U8 channel) |
| 8511 | { |
| 8512 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8513 | tANI_BOOLEAN valid = FALSE; |
| 8514 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8515 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8516 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8517 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8518 | { |
| 8519 | |
| 8520 | valid = csrRoamIsChannelValid( pMac, channel); |
| 8521 | |
| 8522 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8523 | } |
| 8524 | |
| 8525 | return (valid); |
| 8526 | } |
| 8527 | |
| 8528 | /* --------------------------------------------------------------------------- |
| 8529 | \fn sme_SetFreqBand |
| 8530 | \brief Used to set frequency band. |
| 8531 | \param hHal |
| 8532 | \eBand band value to be configured |
| 8533 | \- return eHalStatus |
| 8534 | -------------------------------------------------------------------------*/ |
| 8535 | eHalStatus sme_SetFreqBand(tHalHandle hHal, eCsrBand eBand) |
| 8536 | { |
| 8537 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8538 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8539 | |
| 8540 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8541 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8542 | { |
| 8543 | status = csrSetBand(hHal, eBand); |
| 8544 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8545 | } |
| 8546 | return status; |
| 8547 | } |
| 8548 | |
| 8549 | /* --------------------------------------------------------------------------- |
| 8550 | \fn sme_GetFreqBand |
| 8551 | \brief Used to get the current band settings. |
| 8552 | \param hHal |
| 8553 | \pBand pointer to hold band value |
| 8554 | \- return eHalStatus |
| 8555 | -------------------------------------------------------------------------*/ |
| 8556 | eHalStatus sme_GetFreqBand(tHalHandle hHal, eCsrBand *pBand) |
| 8557 | { |
| 8558 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8559 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8560 | |
| 8561 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8562 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8563 | { |
| 8564 | *pBand = csrGetCurrentBand( hHal ); |
| 8565 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8566 | } |
| 8567 | return status; |
| 8568 | } |
| 8569 | |
| 8570 | #ifdef WLAN_WAKEUP_EVENTS |
| 8571 | /****************************************************************************** |
| 8572 | \fn sme_WakeReasonIndCallback |
| 8573 | |
| 8574 | \brief |
| 8575 | a callback function called when SME received eWNI_SME_WAKE_REASON_IND event from WDA |
| 8576 | |
| 8577 | \param hHal - HAL handle for device |
| 8578 | \param pMsg - Message body passed from WDA; includes Wake Reason Indication parameter |
| 8579 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8580 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8581 | ******************************************************************************/ |
| 8582 | eHalStatus sme_WakeReasonIndCallback (tHalHandle hHal, void* pMsg) |
| 8583 | { |
| 8584 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8585 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8586 | tSirWakeReasonInd *pWakeReasonInd = (tSirWakeReasonInd *)pMsg; |
| 8587 | |
| 8588 | if (NULL == pMsg) |
| 8589 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8590 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8591 | status = eHAL_STATUS_FAILURE; |
| 8592 | } |
| 8593 | else |
| 8594 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8595 | smsLog(pMac, LOG2, "SME: entering sme_WakeReasonIndCallback"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8596 | |
| 8597 | /* Call Wake Reason Indication callback routine. */ |
| 8598 | if (pMac->pmc.wakeReasonIndCB != NULL) |
| 8599 | pMac->pmc.wakeReasonIndCB(pMac->pmc.wakeReasonIndCBContext, pWakeReasonInd); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8600 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8601 | 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] | 8602 | } |
| 8603 | |
| 8604 | return(status); |
| 8605 | } |
| 8606 | #endif // WLAN_WAKEUP_EVENTS |
| 8607 | |
| 8608 | |
| 8609 | /* --------------------------------------------------------------------------- |
| 8610 | |
| 8611 | \fn sme_SetMaxTxPower |
| 8612 | |
| 8613 | \brief Set the Maximum Transmit Power dynamically. Note: this setting will |
| 8614 | not persist over reboots. |
| 8615 | |
| 8616 | \param hHal |
| 8617 | \param pBssid BSSID to set the power cap for |
| 8618 | \param pBssid pSelfMacAddress self MAC Address |
| 8619 | \param pBssid power to set in dB |
| 8620 | \- return eHalStatus |
| 8621 | |
| 8622 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8623 | eHalStatus sme_SetMaxTxPower(tHalHandle hHal, tSirMacAddr pBssid, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8624 | tSirMacAddr pSelfMacAddress, v_S7_t dB) |
| 8625 | { |
| 8626 | vos_msg_t msg; |
| 8627 | tpMaxTxPowerParams pMaxTxParams = NULL; |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8628 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8629 | TRACE_CODE_SME_RX_HDD_SET_MAXTXPOW, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8630 | pMaxTxParams = vos_mem_malloc(sizeof(tMaxTxPowerParams)); |
| 8631 | if (NULL == pMaxTxParams) |
| 8632 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8633 | 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] | 8634 | return eHAL_STATUS_FAILURE; |
| 8635 | } |
| 8636 | |
| 8637 | vos_mem_copy(pMaxTxParams->bssId, pBssid, SIR_MAC_ADDR_LENGTH); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8638 | vos_mem_copy(pMaxTxParams->selfStaMacAddr, pSelfMacAddress, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8639 | SIR_MAC_ADDR_LENGTH); |
| 8640 | pMaxTxParams->power = dB; |
| 8641 | |
| 8642 | msg.type = WDA_SET_MAX_TX_POWER_REQ; |
| 8643 | msg.reserved = 0; |
| 8644 | msg.bodyptr = pMaxTxParams; |
| 8645 | |
| 8646 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8647 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8648 | 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] | 8649 | vos_mem_free(pMaxTxParams); |
| 8650 | return eHAL_STATUS_FAILURE; |
| 8651 | } |
| 8652 | |
| 8653 | return eHAL_STATUS_SUCCESS; |
| 8654 | } |
| 8655 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8656 | /* --------------------------------------------------------------------------- |
| 8657 | |
Arif Hussain | a5ebce0 | 2013-08-09 15:09:58 -0700 | [diff] [blame] | 8658 | \fn sme_SetMaxTxPowerPerBand |
| 8659 | |
| 8660 | \brief Set the Maximum Transmit Power specific to band dynamically. |
| 8661 | Note: this setting will not persist over reboots. |
| 8662 | |
| 8663 | \param band |
| 8664 | \param power to set in dB |
| 8665 | \- return eHalStatus |
| 8666 | |
| 8667 | ----------------------------------------------------------------------------*/ |
| 8668 | eHalStatus sme_SetMaxTxPowerPerBand(eCsrBand band, v_S7_t dB) |
| 8669 | { |
| 8670 | vos_msg_t msg; |
| 8671 | tpMaxTxPowerPerBandParams pMaxTxPowerPerBandParams = NULL; |
| 8672 | |
| 8673 | pMaxTxPowerPerBandParams = vos_mem_malloc(sizeof(tMaxTxPowerPerBandParams)); |
| 8674 | if (NULL == pMaxTxPowerPerBandParams) |
| 8675 | { |
| 8676 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8677 | "%s:Not able to allocate memory for pMaxTxPowerPerBandParams", |
| 8678 | __func__); |
| 8679 | return eHAL_STATUS_FAILURE; |
| 8680 | } |
| 8681 | |
| 8682 | pMaxTxPowerPerBandParams->power = dB; |
| 8683 | pMaxTxPowerPerBandParams->bandInfo = band; |
| 8684 | |
| 8685 | msg.type = WDA_SET_MAX_TX_POWER_PER_BAND_REQ; |
| 8686 | msg.reserved = 0; |
| 8687 | msg.bodyptr = pMaxTxPowerPerBandParams; |
| 8688 | |
| 8689 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8690 | { |
| 8691 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8692 | "%s:Not able to post WDA_SET_MAX_TX_POWER_PER_BAND_REQ", |
| 8693 | __func__); |
| 8694 | vos_mem_free(pMaxTxPowerPerBandParams); |
| 8695 | return eHAL_STATUS_FAILURE; |
| 8696 | } |
| 8697 | |
| 8698 | return eHAL_STATUS_SUCCESS; |
| 8699 | } |
| 8700 | |
| 8701 | /* --------------------------------------------------------------------------- |
| 8702 | |
schang | 86c22c4 | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 8703 | \fn sme_SetTxPower |
| 8704 | |
| 8705 | \brief Set Transmit Power dynamically. Note: this setting will |
| 8706 | not persist over reboots. |
| 8707 | |
| 8708 | \param hHal |
| 8709 | \param sessionId Target Session ID |
| 8710 | \param mW power to set in mW |
| 8711 | \- return eHalStatus |
| 8712 | |
| 8713 | -------------------------------------------------------------------------------*/ |
| 8714 | eHalStatus sme_SetTxPower(tHalHandle hHal, v_U8_t sessionId, v_U8_t mW) |
| 8715 | { |
| 8716 | |
| 8717 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8718 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8719 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8720 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8721 | TRACE_CODE_SME_RX_HDD_SET_TXPOW, NO_SESSION, 0)); |
schang | 86c22c4 | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 8722 | smsLog(pMac, LOG1, FL("set tx power %dmW"), mW); |
| 8723 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 8724 | if (HAL_STATUS_SUCCESS(status)) |
| 8725 | { |
| 8726 | status = csrSetTxPower(pMac, sessionId, mW); |
| 8727 | sme_ReleaseGlobalLock(&pMac->sme); |
| 8728 | } |
| 8729 | return status; |
| 8730 | } |
| 8731 | |
| 8732 | /* --------------------------------------------------------------------------- |
| 8733 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8734 | \fn sme_HideSSID |
| 8735 | |
| 8736 | \brief hide/show SSID dynamically. Note: this setting will |
| 8737 | not persist over reboots. |
| 8738 | |
| 8739 | \param hHal |
| 8740 | \param sessionId |
| 8741 | \param ssidHidden 0 - Broadcast SSID, 1 - Disable broadcast SSID |
| 8742 | \- return eHalStatus |
| 8743 | |
| 8744 | -------------------------------------------------------------------------------*/ |
| 8745 | eHalStatus sme_HideSSID(tHalHandle hHal, v_U8_t sessionId, v_U8_t ssidHidden) |
| 8746 | { |
| 8747 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8748 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8749 | tANI_U16 len; |
| 8750 | |
| 8751 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8752 | { |
| 8753 | tpSirUpdateParams pMsg; |
| 8754 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 8755 | |
| 8756 | if(!pSession) |
| 8757 | { |
| 8758 | 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] | 8759 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 8760 | return eHAL_STATUS_FAILURE; |
| 8761 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8762 | |
| 8763 | if( !pSession->sessionActive ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8764 | VOS_ASSERT(0); |
| 8765 | |
| 8766 | /* Create the message and send to lim */ |
| 8767 | len = sizeof(tSirUpdateParams); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8768 | pMsg = vos_mem_malloc(len); |
| 8769 | if ( NULL == pMsg ) |
| 8770 | status = eHAL_STATUS_FAILURE; |
| 8771 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8772 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8773 | vos_mem_set(pMsg, sizeof(tSirUpdateParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8774 | pMsg->messageType = eWNI_SME_HIDE_SSID_REQ; |
| 8775 | pMsg->length = len; |
| 8776 | /* Data starts from here */ |
| 8777 | pMsg->sessionId = sessionId; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8778 | pMsg->ssidHidden = ssidHidden; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8779 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 8780 | } |
| 8781 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8782 | } |
| 8783 | return status; |
| 8784 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8785 | |
| 8786 | /* --------------------------------------------------------------------------- |
| 8787 | |
| 8788 | \fn sme_SetTmLevel |
| 8789 | \brief Set Thermal Mitigation Level to RIVA |
| 8790 | \param hHal - The handle returned by macOpen. |
| 8791 | \param newTMLevel - new Thermal Mitigation Level |
| 8792 | \param tmMode - Thermal Mitigation handle mode, default 0 |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8793 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8794 | ---------------------------------------------------------------------------*/ |
| 8795 | eHalStatus sme_SetTmLevel(tHalHandle hHal, v_U16_t newTMLevel, v_U16_t tmMode) |
| 8796 | { |
| 8797 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8798 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 8799 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8800 | vos_msg_t vosMessage; |
| 8801 | tAniSetTmLevelReq *setTmLevelReq = NULL; |
| 8802 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8803 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8804 | TRACE_CODE_SME_RX_HDD_SET_TMLEVEL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8805 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8806 | { |
| 8807 | setTmLevelReq = (tAniSetTmLevelReq *)vos_mem_malloc(sizeof(tAniSetTmLevelReq)); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8808 | if (NULL == setTmLevelReq) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8809 | { |
| 8810 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8811 | "%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] | 8812 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8813 | return eHAL_STATUS_FAILURE; |
| 8814 | } |
| 8815 | |
| 8816 | setTmLevelReq->tmMode = tmMode; |
| 8817 | setTmLevelReq->newTmLevel = newTMLevel; |
| 8818 | |
| 8819 | /* serialize the req through MC thread */ |
| 8820 | vosMessage.bodyptr = setTmLevelReq; |
| 8821 | vosMessage.type = WDA_SET_TM_LEVEL_REQ; |
| 8822 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 8823 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 8824 | { |
| 8825 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8826 | "%s: Post Set TM Level MSG fail", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8827 | vos_mem_free(setTmLevelReq); |
| 8828 | status = eHAL_STATUS_FAILURE; |
| 8829 | } |
| 8830 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8831 | } |
| 8832 | return(status); |
| 8833 | } |
| 8834 | |
| 8835 | /*--------------------------------------------------------------------------- |
| 8836 | |
| 8837 | \brief sme_featureCapsExchange() - SME interface to exchange capabilities between |
| 8838 | Host and FW. |
| 8839 | |
| 8840 | \param hHal - HAL handle for device |
| 8841 | |
| 8842 | \return NONE |
| 8843 | |
| 8844 | ---------------------------------------------------------------------------*/ |
| 8845 | void sme_featureCapsExchange( tHalHandle hHal) |
| 8846 | { |
| 8847 | 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] | 8848 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8849 | TRACE_CODE_SME_RX_HDD_CAPS_EXCH, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8850 | WDA_featureCapsExchange(vosContext); |
| 8851 | } |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8852 | |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 8853 | /*--------------------------------------------------------------------------- |
| 8854 | |
| 8855 | \brief sme_disableFeatureCapablity() - SME interface to disable Active mode offload capablity |
| 8856 | in Host. |
| 8857 | |
| 8858 | \param hHal - HAL handle for device |
| 8859 | |
| 8860 | \return NONE |
| 8861 | |
| 8862 | ---------------------------------------------------------------------------*/ |
| 8863 | void sme_disableFeatureCapablity(tANI_U8 feature_index) |
| 8864 | { |
| 8865 | WDA_disableCapablityFeature(feature_index); |
| 8866 | } |
| 8867 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8868 | /* --------------------------------------------------------------------------- |
| 8869 | |
| 8870 | \fn sme_GetDefaultCountryCode |
| 8871 | |
| 8872 | \brief Get the default country code from NV |
| 8873 | |
| 8874 | \param hHal |
| 8875 | \param pCountry |
| 8876 | \- return eHalStatus |
| 8877 | |
| 8878 | -------------------------------------------------------------------------------*/ |
| 8879 | eHalStatus sme_GetDefaultCountryCodeFrmNv(tHalHandle hHal, tANI_U8 *pCountry) |
| 8880 | { |
| 8881 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8882 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8883 | TRACE_CODE_SME_RX_HDD_GET_DEFCCNV, NO_SESSION, 0)); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8884 | return csrGetDefaultCountryCodeFrmNv(pMac, pCountry); |
| 8885 | } |
| 8886 | |
| 8887 | /* --------------------------------------------------------------------------- |
| 8888 | |
| 8889 | \fn sme_GetCurrentCountryCode |
| 8890 | |
| 8891 | \brief Get the current country code |
| 8892 | |
| 8893 | \param hHal |
| 8894 | \param pCountry |
| 8895 | \- return eHalStatus |
| 8896 | |
| 8897 | -------------------------------------------------------------------------------*/ |
| 8898 | eHalStatus sme_GetCurrentCountryCode(tHalHandle hHal, tANI_U8 *pCountry) |
| 8899 | { |
| 8900 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8901 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8902 | TRACE_CODE_SME_RX_HDD_GET_CURCC, NO_SESSION, 0)); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8903 | return csrGetCurrentCountryCode(pMac, pCountry); |
| 8904 | } |
| 8905 | |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 8906 | /* --------------------------------------------------------------------------- |
| 8907 | \fn sme_transportDebug |
| 8908 | \brief Dynamically monitoring Transport channels |
| 8909 | Private IOCTL will querry transport channel status if driver loaded |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8910 | \param hHal Upper MAC context |
Jeff Johnson | b88db98 | 2012-12-10 13:34:59 -0800 | [diff] [blame] | 8911 | \param displaySnapshot Display transport channel snapshot option |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 8912 | \param toggleStallDetect Enable stall detect feature |
| 8913 | This feature will take effect to data performance |
| 8914 | Not integrate till fully verification |
| 8915 | \- return NONE |
| 8916 | -------------------------------------------------------------------------*/ |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8917 | 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] | 8918 | { |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8919 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8920 | |
| 8921 | if (NULL == pMac) |
| 8922 | { |
| 8923 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8924 | "%s: invalid context", __func__); |
| 8925 | return; |
| 8926 | } |
| 8927 | WDA_TransportChannelDebug(pMac, displaySnapshot, toggleStallDetect); |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 8928 | } |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 8929 | |
Kiran | 4a17ebe | 2013-01-31 10:43:43 -0800 | [diff] [blame] | 8930 | /* --------------------------------------------------------------------------- |
| 8931 | \fn sme_ResetPowerValuesFor5G |
| 8932 | \brief Reset the power values for 5G band with NV power values. |
| 8933 | \param hHal - HAL handle for device |
| 8934 | \- return NONE |
| 8935 | -------------------------------------------------------------------------*/ |
| 8936 | void sme_ResetPowerValuesFor5G (tHalHandle hHal) |
| 8937 | { |
| 8938 | tpAniSirGlobal pMac = PMAC_STRUCT (hHal); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8939 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8940 | TRACE_CODE_SME_RX_HDD_RESET_PW5G, NO_SESSION, 0)); |
Kiran | 4a17ebe | 2013-01-31 10:43:43 -0800 | [diff] [blame] | 8941 | csrSaveChannelPowerForBand(pMac, eANI_BOOLEAN_TRUE); |
| 8942 | csrApplyPower2Current(pMac); // Store the channel+power info in the global place: Cfg |
| 8943 | } |
| 8944 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 8945 | #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] | 8946 | /* --------------------------------------------------------------------------- |
| 8947 | \fn sme_UpdateRoamPrefer5GHz |
| 8948 | \brief enable/disable Roam prefer 5G runtime option |
| 8949 | This function is called through dynamic setConfig callback function |
| 8950 | to configure the Roam prefer 5G runtime option |
| 8951 | \param hHal - HAL handle for device |
| 8952 | \param nRoamPrefer5GHz Enable/Disable Roam prefer 5G runtime option |
| 8953 | \- return Success or failure |
| 8954 | -------------------------------------------------------------------------*/ |
| 8955 | |
| 8956 | eHalStatus sme_UpdateRoamPrefer5GHz(tHalHandle hHal, v_BOOL_t nRoamPrefer5GHz) |
| 8957 | { |
| 8958 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8959 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8960 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8961 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8962 | TRACE_CODE_SME_RX_HDD_UPDATE_RP5G, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8963 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8964 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8965 | { |
| 8966 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8967 | "%s: gRoamPrefer5GHz is changed from %d to %d", __func__, |
| 8968 | pMac->roam.configParam.nRoamPrefer5GHz, |
| 8969 | nRoamPrefer5GHz); |
| 8970 | pMac->roam.configParam.nRoamPrefer5GHz = nRoamPrefer5GHz; |
| 8971 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8972 | } |
| 8973 | |
| 8974 | return status ; |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 8975 | } |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8976 | |
| 8977 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8978 | \fn sme_setRoamIntraBand |
| 8979 | \brief enable/disable Intra band roaming |
| 8980 | This function is called through dynamic setConfig callback function |
| 8981 | to configure the intra band roaming |
| 8982 | \param hHal - HAL handle for device |
| 8983 | \param nRoamIntraBand Enable/Disable Intra band roaming |
| 8984 | \- return Success or failure |
| 8985 | -------------------------------------------------------------------------*/ |
| 8986 | eHalStatus sme_setRoamIntraBand(tHalHandle hHal, const v_BOOL_t nRoamIntraBand) |
| 8987 | { |
| 8988 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8989 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8990 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8991 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8992 | TRACE_CODE_SME_RX_HDD_SET_ROAMIBAND, NO_SESSION, 0)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8993 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8994 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8995 | { |
| 8996 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8997 | "%s: gRoamIntraBand is changed from %d to %d", __func__, |
| 8998 | pMac->roam.configParam.nRoamIntraBand, |
| 8999 | nRoamIntraBand); |
| 9000 | pMac->roam.configParam.nRoamIntraBand = nRoamIntraBand; |
| 9001 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9002 | } |
| 9003 | |
| 9004 | return status ; |
| 9005 | } |
| 9006 | |
| 9007 | /* --------------------------------------------------------------------------- |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 9008 | \fn sme_UpdateRoamScanNProbes |
| 9009 | \brief function to update roam scan N probes |
| 9010 | This function is called through dynamic setConfig callback function |
| 9011 | to update roam scan N probes |
| 9012 | \param hHal - HAL handle for device |
| 9013 | \param nProbes number of probe requests to be sent out |
| 9014 | \- return Success or failure |
| 9015 | -------------------------------------------------------------------------*/ |
| 9016 | eHalStatus sme_UpdateRoamScanNProbes(tHalHandle hHal, const v_U8_t nProbes) |
| 9017 | { |
| 9018 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9019 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9020 | |
| 9021 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9022 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9023 | { |
| 9024 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9025 | "%s: gRoamScanNProbes is changed from %d to %d", __func__, |
| 9026 | pMac->roam.configParam.nProbes, |
| 9027 | nProbes); |
| 9028 | pMac->roam.configParam.nProbes = nProbes; |
| 9029 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9030 | } |
| 9031 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9032 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9033 | { |
| 9034 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9035 | REASON_NPROBES_CHANGED); |
| 9036 | } |
| 9037 | #endif |
| 9038 | return status ; |
| 9039 | } |
| 9040 | |
| 9041 | /* --------------------------------------------------------------------------- |
| 9042 | \fn sme_UpdateRoamScanHomeAwayTime |
| 9043 | \brief function to update roam scan Home away time |
| 9044 | This function is called through dynamic setConfig callback function |
| 9045 | to update roam scan home away time |
| 9046 | \param hHal - HAL handle for device |
| 9047 | \param nRoamScanAwayTime Scan home away time |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 9048 | \param bSendOffloadCmd If TRUE then send offload command to firmware |
| 9049 | If FALSE then command is not sent to firmware |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 9050 | \- return Success or failure |
| 9051 | -------------------------------------------------------------------------*/ |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 9052 | eHalStatus sme_UpdateRoamScanHomeAwayTime(tHalHandle hHal, const v_U16_t nRoamScanHomeAwayTime, |
| 9053 | const eAniBoolean bSendOffloadCmd) |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 9054 | { |
| 9055 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9056 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9057 | |
| 9058 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9059 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9060 | { |
| 9061 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9062 | "%s: gRoamScanHomeAwayTime is changed from %d to %d", __func__, |
| 9063 | pMac->roam.configParam.nRoamScanHomeAwayTime, |
| 9064 | nRoamScanHomeAwayTime); |
| 9065 | pMac->roam.configParam.nRoamScanHomeAwayTime = nRoamScanHomeAwayTime; |
| 9066 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9067 | } |
| 9068 | |
| 9069 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 9070 | if (pMac->roam.configParam.isRoamOffloadScanEnabled && bSendOffloadCmd) |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 9071 | { |
| 9072 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9073 | REASON_HOME_AWAY_TIME_CHANGED); |
| 9074 | } |
| 9075 | #endif |
| 9076 | return status; |
| 9077 | } |
| 9078 | |
| 9079 | |
| 9080 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9081 | \fn sme_getRoamIntraBand |
| 9082 | \brief get Intra band roaming |
| 9083 | \param hHal - HAL handle for device |
| 9084 | \- return Success or failure |
| 9085 | -------------------------------------------------------------------------*/ |
| 9086 | v_BOOL_t sme_getRoamIntraBand(tHalHandle hHal) |
| 9087 | { |
| 9088 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 9089 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 9090 | TRACE_CODE_SME_RX_HDD_GET_ROAMIBAND, NO_SESSION, 0)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9091 | return pMac->roam.configParam.nRoamIntraBand; |
| 9092 | } |
| 9093 | |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 9094 | /* --------------------------------------------------------------------------- |
| 9095 | \fn sme_getRoamScanNProbes |
| 9096 | \brief get N Probes |
| 9097 | \param hHal - HAL handle for device |
| 9098 | \- return Success or failure |
| 9099 | -------------------------------------------------------------------------*/ |
| 9100 | v_U8_t sme_getRoamScanNProbes(tHalHandle hHal) |
| 9101 | { |
| 9102 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9103 | return pMac->roam.configParam.nProbes; |
| 9104 | } |
| 9105 | |
| 9106 | /* --------------------------------------------------------------------------- |
| 9107 | \fn sme_getRoamScanHomeAwayTime |
| 9108 | \brief get Roam scan home away time |
| 9109 | \param hHal - HAL handle for device |
| 9110 | \- return Success or failure |
| 9111 | -------------------------------------------------------------------------*/ |
| 9112 | v_U16_t sme_getRoamScanHomeAwayTime(tHalHandle hHal) |
| 9113 | { |
| 9114 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9115 | return pMac->roam.configParam.nRoamScanHomeAwayTime; |
| 9116 | } |
| 9117 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9118 | |
| 9119 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 9120 | \fn sme_UpdateImmediateRoamRssiDiff |
| 9121 | \brief Update nImmediateRoamRssiDiff |
| 9122 | This function is called through dynamic setConfig callback function |
| 9123 | to configure nImmediateRoamRssiDiff |
| 9124 | Usage: adb shell iwpriv wlan0 setConfig gImmediateRoamRssiDiff=[0 .. 125] |
| 9125 | \param hHal - HAL handle for device |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9126 | \param nImmediateRoamRssiDiff - minimum rssi difference between potential |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 9127 | candidate and current AP. |
| 9128 | \- return Success or failure |
| 9129 | -------------------------------------------------------------------------*/ |
| 9130 | |
| 9131 | eHalStatus sme_UpdateImmediateRoamRssiDiff(tHalHandle hHal, v_U8_t nImmediateRoamRssiDiff) |
| 9132 | { |
| 9133 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9134 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9135 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 9136 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 9137 | TRACE_CODE_SME_RX_HDD_UPDATE_IMMRSSIDIFF, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9138 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9139 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9140 | { |
| 9141 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9142 | "LFR runtime successfully set immediate roam rssi diff to" |
| 9143 | "%d - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9144 | nImmediateRoamRssiDiff, |
| 9145 | pMac->roam.configParam.nImmediateRoamRssiDiff, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9146 | macTraceGetNeighbourRoamState( |
| 9147 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9148 | pMac->roam.configParam.nImmediateRoamRssiDiff = nImmediateRoamRssiDiff; |
| 9149 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9150 | } |
| 9151 | |
| 9152 | return status ; |
| 9153 | } |
| 9154 | |
| 9155 | /* --------------------------------------------------------------------------- |
| 9156 | \fn sme_UpdateRoamRssiDiff |
| 9157 | \brief Update RoamRssiDiff |
| 9158 | This function is called through dynamic setConfig callback function |
| 9159 | to configure RoamRssiDiff |
| 9160 | Usage: adb shell iwpriv wlan0 setConfig RoamRssiDiff=[0 .. 125] |
| 9161 | \param hHal - HAL handle for device |
| 9162 | \param RoamRssiDiff - minimum rssi difference between potential |
| 9163 | candidate and current AP. |
| 9164 | \- return Success or failure |
| 9165 | -------------------------------------------------------------------------*/ |
| 9166 | |
| 9167 | eHalStatus sme_UpdateRoamRssiDiff(tHalHandle hHal, v_U8_t RoamRssiDiff) |
| 9168 | { |
| 9169 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9170 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9171 | |
| 9172 | status = sme_AcquireGlobalLock( &pMac->sme ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 9173 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 9174 | TRACE_CODE_SME_RX_HDD_UPDATE_RSSIDIFF, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9175 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9176 | { |
| 9177 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9178 | "LFR runtime successfully set roam rssi diff to %d" |
| 9179 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9180 | RoamRssiDiff, |
| 9181 | pMac->roam.configParam.RoamRssiDiff, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9182 | macTraceGetNeighbourRoamState( |
| 9183 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9184 | pMac->roam.configParam.RoamRssiDiff = RoamRssiDiff; |
| 9185 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9186 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9187 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9188 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9189 | { |
| 9190 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_RSSI_DIFF_CHANGED); |
| 9191 | } |
| 9192 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9193 | return status ; |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 9194 | } |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9195 | |
| 9196 | /*-------------------------------------------------------------------------- |
| 9197 | \brief sme_UpdateFastTransitionEnabled() - enable/disable Fast Transition support at runtime |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9198 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9199 | isFastTransitionEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9200 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9201 | \param hHal - The handle returned by macOpen. |
| 9202 | \return eHAL_STATUS_SUCCESS - SME update isFastTransitionEnabled config successfully. |
| 9203 | Other status means SME is failed to update isFastTransitionEnabled. |
| 9204 | \sa |
| 9205 | --------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9206 | eHalStatus sme_UpdateFastTransitionEnabled(tHalHandle hHal, |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9207 | v_BOOL_t isFastTransitionEnabled) |
| 9208 | { |
| 9209 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9210 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9211 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 9212 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 9213 | TRACE_CODE_SME_RX_HDD_UPDATE_FTENABLED, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9214 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9215 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9216 | { |
| 9217 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9218 | "%s: FastTransitionEnabled is changed from %d to %d", __func__, |
| 9219 | pMac->roam.configParam.isFastTransitionEnabled, |
| 9220 | isFastTransitionEnabled); |
| 9221 | pMac->roam.configParam.isFastTransitionEnabled = isFastTransitionEnabled; |
| 9222 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9223 | } |
| 9224 | |
| 9225 | return status ; |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9226 | } |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9227 | |
| 9228 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 9229 | \fn sme_UpdateWESMode |
| 9230 | \brief Update WES Mode |
| 9231 | This function is called through dynamic setConfig callback function |
| 9232 | to configure isWESModeEnabled |
| 9233 | \param hHal - HAL handle for device |
| 9234 | \return eHAL_STATUS_SUCCESS - SME update isWESModeEnabled config successfully. |
| 9235 | Other status means SME is failed to update isWESModeEnabled. |
| 9236 | -------------------------------------------------------------------------*/ |
| 9237 | |
| 9238 | eHalStatus sme_UpdateWESMode(tHalHandle hHal, v_BOOL_t isWESModeEnabled) |
| 9239 | { |
| 9240 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9241 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9242 | |
| 9243 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9244 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9245 | { |
| 9246 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9247 | "LFR runtime successfully set WES Mode to %d" |
| 9248 | "- old value is %d - roam state is %s", |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 9249 | isWESModeEnabled, |
| 9250 | pMac->roam.configParam.isWESModeEnabled, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9251 | macTraceGetNeighbourRoamState( |
| 9252 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 9253 | pMac->roam.configParam.isWESModeEnabled = isWESModeEnabled; |
| 9254 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9255 | } |
| 9256 | |
| 9257 | return status ; |
| 9258 | } |
| 9259 | |
| 9260 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9261 | \fn sme_SetRoamScanControl |
| 9262 | \brief Set roam scan control |
| 9263 | This function is called to set roam scan control |
| 9264 | if roam scan control is set to 0, roaming scan cache is cleared |
| 9265 | any value other than 0 is treated as invalid value |
| 9266 | \param hHal - HAL handle for device |
| 9267 | \return eHAL_STATUS_SUCCESS - SME update config successfully. |
| 9268 | Other status means SME failure to update |
| 9269 | -------------------------------------------------------------------------*/ |
| 9270 | eHalStatus sme_SetRoamScanControl(tHalHandle hHal, v_BOOL_t roamScanControl) |
| 9271 | { |
| 9272 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9273 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9274 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 9275 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 9276 | TRACE_CODE_SME_RX_HDD_SET_SCANCTRL, NO_SESSION, 0)); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9277 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9278 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9279 | { |
| 9280 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9281 | "LFR runtime successfully set roam scan control to %d" |
| 9282 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9283 | roamScanControl, |
| 9284 | pMac->roam.configParam.nRoamScanControl, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9285 | macTraceGetNeighbourRoamState( |
| 9286 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9287 | pMac->roam.configParam.nRoamScanControl = roamScanControl; |
| 9288 | if ( 0 == roamScanControl) |
| 9289 | { |
| 9290 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 9291 | "LFR runtime successfully cleared roam scan cache"); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9292 | csrFlushCfgBgScanRoamChannelList(pMac); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9293 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9294 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9295 | { |
| 9296 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_FLUSH_CHANNEL_LIST); |
| 9297 | } |
| 9298 | #endif |
| 9299 | } |
| 9300 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9301 | } |
| 9302 | return status ; |
| 9303 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9304 | #endif /* (WLAN_FEATURE_VOWIFI_11R) || (FEATURE_WLAN_ESE) || (FEATURE_WLAN_LFR) */ |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9305 | |
| 9306 | #ifdef FEATURE_WLAN_LFR |
| 9307 | /*-------------------------------------------------------------------------- |
| 9308 | \brief sme_UpdateIsFastRoamIniFeatureEnabled() - enable/disable LFR support at runtime |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9309 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9310 | isFastRoamIniFeatureEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9311 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9312 | \param hHal - The handle returned by macOpen. |
| 9313 | \return eHAL_STATUS_SUCCESS - SME update isFastRoamIniFeatureEnabled config successfully. |
| 9314 | Other status means SME is failed to update isFastRoamIniFeatureEnabled. |
| 9315 | \sa |
| 9316 | --------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9317 | eHalStatus sme_UpdateIsFastRoamIniFeatureEnabled(tHalHandle hHal, |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9318 | const v_BOOL_t isFastRoamIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9319 | { |
| 9320 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9321 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9322 | if (pMac->roam.configParam.isFastRoamIniFeatureEnabled == isFastRoamIniFeatureEnabled) |
| 9323 | { |
| 9324 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9325 | "%s: FastRoam is already enabled or disabled, nothing to do (returning) old(%d) new(%d)", __func__, |
| 9326 | pMac->roam.configParam.isFastRoamIniFeatureEnabled, |
| 9327 | isFastRoamIniFeatureEnabled); |
| 9328 | return eHAL_STATUS_SUCCESS; |
| 9329 | } |
| 9330 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9331 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9332 | "%s: FastRoamEnabled is changed from %d to %d", __func__, |
| 9333 | pMac->roam.configParam.isFastRoamIniFeatureEnabled, |
| 9334 | isFastRoamIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9335 | pMac->roam.configParam.isFastRoamIniFeatureEnabled = isFastRoamIniFeatureEnabled; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9336 | csrNeighborRoamUpdateFastRoamingEnabled(pMac, isFastRoamIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9337 | |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9338 | return eHAL_STATUS_SUCCESS; |
| 9339 | } |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 9340 | |
Sameer Thalappil | 4ae66ec | 2013-11-05 14:17:35 -0800 | [diff] [blame] | 9341 | /*-------------------------------------------------------------------------- |
Mukul Sharma | 2a27163 | 2014-10-13 14:59:01 +0530 | [diff] [blame] | 9342 | \brief sme_ConfigFwrRoaming() - enable/disable LFR support at runtime |
| 9343 | When Supplicant issue enabled / disable fwr based roaming on the basis |
| 9344 | of the Bssid modification in network block ( e.g. AutoJoin mody N/W block) |
| 9345 | |
| 9346 | This is a synchronous call |
| 9347 | \param hHal - The handle returned by macOpen. |
| 9348 | \return eHAL_STATUS_SUCCESS - SME (enabled/disabled) offload scan successfully. |
| 9349 | Other status means SME is failed to (enabled/disabled) offload scan. |
| 9350 | \sa |
| 9351 | --------------------------------------------------------------------------*/ |
| 9352 | |
| 9353 | eHalStatus sme_ConfigFwrRoaming(tHalHandle hHal, |
| 9354 | const v_BOOL_t isFastRoamEnabled) |
| 9355 | { |
| 9356 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9357 | if (!pMac->roam.configParam.isFastRoamIniFeatureEnabled) |
| 9358 | { |
| 9359 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9360 | "%s: FastRoam is disabled through ini", __func__); |
| 9361 | return eHAL_STATUS_FAILURE; |
| 9362 | } |
| 9363 | csrNeighborRoamUpdateFastRoamingEnabled(pMac, isFastRoamEnabled); |
| 9364 | return eHAL_STATUS_SUCCESS; |
| 9365 | } |
| 9366 | |
| 9367 | /*-------------------------------------------------------------------------- |
Sameer Thalappil | 4ae66ec | 2013-11-05 14:17:35 -0800 | [diff] [blame] | 9368 | \brief sme_UpdateIsMAWCIniFeatureEnabled() - |
| 9369 | Enable/disable LFR MAWC support at runtime |
| 9370 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 9371 | isMAWCIniFeatureEnabled. |
| 9372 | This is a synchronous call |
| 9373 | \param hHal - The handle returned by macOpen. |
| 9374 | \return eHAL_STATUS_SUCCESS - SME update MAWCEnabled config successfully. |
| 9375 | Other status means SME is failed to update MAWCEnabled. |
| 9376 | \sa |
| 9377 | --------------------------------------------------------------------------*/ |
| 9378 | eHalStatus sme_UpdateIsMAWCIniFeatureEnabled(tHalHandle hHal, |
| 9379 | const v_BOOL_t MAWCEnabled) |
| 9380 | { |
| 9381 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9382 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9383 | |
| 9384 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9385 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9386 | { |
| 9387 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9388 | "%s: MAWCEnabled is changed from %d to %d", __func__, |
| 9389 | pMac->roam.configParam.MAWCEnabled, |
| 9390 | MAWCEnabled); |
| 9391 | pMac->roam.configParam.MAWCEnabled = MAWCEnabled; |
| 9392 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9393 | } |
| 9394 | |
| 9395 | return status ; |
| 9396 | |
| 9397 | } |
| 9398 | |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 9399 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9400 | /*-------------------------------------------------------------------------- |
| 9401 | \brief sme_UpdateEnableFastRoamInConcurrency() - enable/disable LFR if Concurrent session exists |
| 9402 | This is a synchronuous call |
| 9403 | \param hHal - The handle returned by macOpen. |
| 9404 | \return eHAL_STATUS_SUCCESS |
| 9405 | Other status means SME is failed |
| 9406 | \sa |
| 9407 | --------------------------------------------------------------------------*/ |
| 9408 | |
| 9409 | eHalStatus sme_UpdateEnableFastRoamInConcurrency(tHalHandle hHal, |
| 9410 | v_BOOL_t bFastRoamInConIniFeatureEnabled) |
| 9411 | { |
| 9412 | |
| 9413 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9414 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9415 | |
| 9416 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9417 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9418 | { |
| 9419 | pMac->roam.configParam.bFastRoamInConIniFeatureEnabled = bFastRoamInConIniFeatureEnabled; |
| 9420 | if (0 == pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9421 | { |
| 9422 | pMac->roam.configParam.bFastRoamInConIniFeatureEnabled = 0; |
| 9423 | } |
| 9424 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9425 | } |
| 9426 | |
| 9427 | return status; |
| 9428 | } |
| 9429 | #endif |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9430 | #endif /* FEATURE_WLAN_LFR */ |
| 9431 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9432 | #ifdef FEATURE_WLAN_ESE |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9433 | /*-------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9434 | \brief sme_UpdateIsEseFeatureEnabled() - enable/disable Ese support at runtime |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9435 | 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] | 9436 | isEseIniFeatureEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9437 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9438 | \param hHal - The handle returned by macOpen. |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9439 | \return eHAL_STATUS_SUCCESS - SME update isEseIniFeatureEnabled config successfully. |
| 9440 | Other status means SME is failed to update isEseIniFeatureEnabled. |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9441 | \sa |
| 9442 | --------------------------------------------------------------------------*/ |
| 9443 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9444 | eHalStatus sme_UpdateIsEseFeatureEnabled(tHalHandle hHal, |
| 9445 | const v_BOOL_t isEseIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9446 | { |
| 9447 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9448 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9449 | if (pMac->roam.configParam.isEseIniFeatureEnabled == isEseIniFeatureEnabled) |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9450 | { |
| 9451 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9452 | "%s: Ese Mode is already enabled or disabled, nothing to do (returning) old(%d) new(%d)", __func__, |
| 9453 | pMac->roam.configParam.isEseIniFeatureEnabled, |
| 9454 | isEseIniFeatureEnabled); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9455 | return eHAL_STATUS_SUCCESS; |
| 9456 | } |
| 9457 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9458 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9459 | "%s: EseEnabled is changed from %d to %d", __func__, |
| 9460 | pMac->roam.configParam.isEseIniFeatureEnabled, |
| 9461 | isEseIniFeatureEnabled); |
| 9462 | pMac->roam.configParam.isEseIniFeatureEnabled = isEseIniFeatureEnabled; |
| 9463 | csrNeighborRoamUpdateEseModeEnabled(pMac, isEseIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9464 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9465 | if(TRUE == isEseIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9466 | { |
| 9467 | sme_UpdateFastTransitionEnabled(hHal, TRUE); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9468 | } |
Srinivas Girigowda | ba17369 | 2013-08-07 11:55:38 -0700 | [diff] [blame] | 9469 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9470 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9471 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9472 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9473 | 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] | 9474 | } |
| 9475 | #endif |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9476 | return eHAL_STATUS_SUCCESS; |
| 9477 | } |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9478 | #endif /* FEATURE_WLAN_ESE */ |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9479 | |
| 9480 | /*-------------------------------------------------------------------------- |
| 9481 | \brief sme_UpdateConfigFwRssiMonitoring() - enable/disable firmware RSSI Monitoring at runtime |
| 9482 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 9483 | fEnableFwRssiMonitoring. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9484 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9485 | \param hHal - The handle returned by macOpen. |
| 9486 | \return eHAL_STATUS_SUCCESS - SME update fEnableFwRssiMonitoring. config successfully. |
| 9487 | Other status means SME is failed to update fEnableFwRssiMonitoring. |
| 9488 | \sa |
| 9489 | --------------------------------------------------------------------------*/ |
| 9490 | |
| 9491 | eHalStatus sme_UpdateConfigFwRssiMonitoring(tHalHandle hHal, |
| 9492 | v_BOOL_t fEnableFwRssiMonitoring) |
| 9493 | { |
| 9494 | eHalStatus halStatus = eHAL_STATUS_SUCCESS; |
| 9495 | |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 9496 | if (ccmCfgSetInt(hHal, WNI_CFG_PS_ENABLE_RSSI_MONITOR, fEnableFwRssiMonitoring, |
| 9497 | NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE) |
| 9498 | { |
| 9499 | halStatus = eHAL_STATUS_FAILURE; |
| 9500 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 9501 | "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] | 9502 | } |
| 9503 | |
| 9504 | return (halStatus); |
| 9505 | } |
| 9506 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9507 | #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9508 | /*-------------------------------------------------------------------------- |
| 9509 | \brief sme_setNeighborLookupRssiThreshold() - update neighbor lookup rssi threshold |
| 9510 | This is a synchronous call |
| 9511 | \param hHal - The handle returned by macOpen. |
| 9512 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9513 | Other status means SME is failed to update |
| 9514 | \sa |
| 9515 | --------------------------------------------------------------------------*/ |
| 9516 | eHalStatus sme_setNeighborLookupRssiThreshold(tHalHandle hHal, |
| 9517 | v_U8_t neighborLookupRssiThreshold) |
| 9518 | { |
| 9519 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9520 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9521 | |
| 9522 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9523 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9524 | { |
| 9525 | status = csrNeighborRoamSetLookupRssiThreshold(pMac, neighborLookupRssiThreshold); |
| 9526 | if (HAL_STATUS_SUCCESS(status)) |
| 9527 | { |
| 9528 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9529 | "LFR runtime successfully set Lookup threshold to %d" |
| 9530 | " - old value is %d - roam state is %s", |
| 9531 | neighborLookupRssiThreshold, |
| 9532 | pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold, |
| 9533 | macTraceGetNeighbourRoamState( |
| 9534 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9535 | pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold = |
| 9536 | neighborLookupRssiThreshold; |
| 9537 | } |
| 9538 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9539 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9540 | return status; |
| 9541 | } |
| 9542 | |
| 9543 | /*-------------------------------------------------------------------------- |
| 9544 | \brief sme_setNeighborReassocRssiThreshold() - update neighbor reassoc rssi threshold |
| 9545 | This is a synchronous call |
| 9546 | \param hHal - The handle returned by macOpen. |
| 9547 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9548 | Other status means SME is failed to update |
| 9549 | \sa |
| 9550 | --------------------------------------------------------------------------*/ |
| 9551 | eHalStatus sme_setNeighborReassocRssiThreshold(tHalHandle hHal, |
| 9552 | v_U8_t neighborReassocRssiThreshold) |
| 9553 | { |
| 9554 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9555 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9556 | |
| 9557 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9558 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9559 | { |
| 9560 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9561 | "LFR runtime successfully set Reassoc threshold to %d" |
| 9562 | "- old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9563 | neighborReassocRssiThreshold, |
| 9564 | pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9565 | macTraceGetNeighbourRoamState( |
| 9566 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9567 | pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold = |
| 9568 | neighborReassocRssiThreshold; |
| 9569 | pMac->roam.neighborRoamInfo.cfgParams.neighborReassocThreshold = |
| 9570 | neighborReassocRssiThreshold; |
| 9571 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9572 | } |
| 9573 | |
| 9574 | return status ; |
| 9575 | } |
| 9576 | |
| 9577 | |
| 9578 | /*-------------------------------------------------------------------------- |
| 9579 | \brief sme_getNeighborLookupRssiThreshold() - get neighbor lookup rssi threshold |
| 9580 | This is a synchronous call |
| 9581 | \param hHal - The handle returned by macOpen. |
| 9582 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9583 | Other status means SME is failed to update |
| 9584 | \sa |
| 9585 | --------------------------------------------------------------------------*/ |
| 9586 | v_U8_t sme_getNeighborLookupRssiThreshold(tHalHandle hHal) |
| 9587 | { |
| 9588 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9589 | return pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold; |
| 9590 | } |
| 9591 | |
| 9592 | /*-------------------------------------------------------------------------- |
| 9593 | \brief sme_setNeighborScanRefreshPeriod() - set neighbor scan results refresh period |
| 9594 | This is a synchronous call |
| 9595 | \param hHal - The handle returned by macOpen. |
| 9596 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9597 | Other status means SME is failed to update |
| 9598 | \sa |
| 9599 | --------------------------------------------------------------------------*/ |
| 9600 | eHalStatus sme_setNeighborScanRefreshPeriod(tHalHandle hHal, |
| 9601 | v_U16_t neighborScanResultsRefreshPeriod) |
| 9602 | { |
| 9603 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9604 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9605 | |
| 9606 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9607 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9608 | { |
| 9609 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9610 | "LFR runtime successfully set roam scan refresh period to %d" |
| 9611 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9612 | neighborScanResultsRefreshPeriod, |
| 9613 | pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9614 | macTraceGetNeighbourRoamState( |
| 9615 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9616 | pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod = |
| 9617 | neighborScanResultsRefreshPeriod; |
| 9618 | pMac->roam.neighborRoamInfo.cfgParams.neighborResultsRefreshPeriod = |
| 9619 | neighborScanResultsRefreshPeriod; |
| 9620 | |
| 9621 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9622 | } |
| 9623 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9624 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9625 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9626 | { |
| 9627 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9628 | REASON_NEIGHBOR_SCAN_REFRESH_PERIOD_CHANGED); |
| 9629 | } |
| 9630 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9631 | return status ; |
| 9632 | } |
| 9633 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9634 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9635 | /*-------------------------------------------------------------------------- |
| 9636 | \brief sme_UpdateRoamScanOffloadEnabled() - enable/disable roam scan offload feaure |
| 9637 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 9638 | gRoamScanOffloadEnabled. |
| 9639 | This is a synchronous call |
| 9640 | \param hHal - The handle returned by macOpen. |
| 9641 | \return eHAL_STATUS_SUCCESS - SME update config successfully. |
| 9642 | Other status means SME is failed to update. |
| 9643 | \sa |
| 9644 | --------------------------------------------------------------------------*/ |
| 9645 | |
| 9646 | eHalStatus sme_UpdateRoamScanOffloadEnabled(tHalHandle hHal, |
| 9647 | v_BOOL_t nRoamScanOffloadEnabled) |
| 9648 | { |
| 9649 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9650 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9651 | |
| 9652 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9653 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9654 | { |
| 9655 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9656 | "%s: gRoamScanOffloadEnabled is changed from %d to %d", __func__, |
| 9657 | pMac->roam.configParam.isRoamOffloadScanEnabled, |
| 9658 | nRoamScanOffloadEnabled); |
| 9659 | pMac->roam.configParam.isRoamOffloadScanEnabled = nRoamScanOffloadEnabled; |
| 9660 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9661 | } |
| 9662 | |
| 9663 | return status ; |
| 9664 | } |
| 9665 | #endif |
| 9666 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9667 | /*-------------------------------------------------------------------------- |
| 9668 | \brief sme_getNeighborScanRefreshPeriod() - get neighbor scan results refresh period |
| 9669 | This is a synchronous call |
| 9670 | \param hHal - The handle returned by macOpen. |
| 9671 | \return v_U16_t - Neighbor scan results refresh period value |
| 9672 | \sa |
| 9673 | --------------------------------------------------------------------------*/ |
| 9674 | v_U16_t sme_getNeighborScanRefreshPeriod(tHalHandle hHal) |
| 9675 | { |
| 9676 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9677 | return pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod; |
| 9678 | } |
| 9679 | |
| 9680 | /*-------------------------------------------------------------------------- |
| 9681 | \brief sme_getEmptyScanRefreshPeriod() - get empty scan refresh period |
| 9682 | This is a synchronuous call |
| 9683 | \param hHal - The handle returned by macOpen. |
| 9684 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9685 | Other status means SME is failed to update |
| 9686 | \sa |
| 9687 | --------------------------------------------------------------------------*/ |
| 9688 | v_U16_t sme_getEmptyScanRefreshPeriod(tHalHandle hHal) |
| 9689 | { |
| 9690 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9691 | return pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod; |
| 9692 | } |
| 9693 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9694 | /* --------------------------------------------------------------------------- |
| 9695 | \fn sme_UpdateEmptyScanRefreshPeriod |
| 9696 | \brief Update nEmptyScanRefreshPeriod |
| 9697 | This function is called through dynamic setConfig callback function |
| 9698 | to configure nEmptyScanRefreshPeriod |
| 9699 | Usage: adb shell iwpriv wlan0 setConfig nEmptyScanRefreshPeriod=[0 .. 60] |
| 9700 | \param hHal - HAL handle for device |
| 9701 | \param nEmptyScanRefreshPeriod - scan period following empty scan results. |
| 9702 | \- return Success or failure |
| 9703 | -------------------------------------------------------------------------*/ |
| 9704 | |
| 9705 | eHalStatus sme_UpdateEmptyScanRefreshPeriod(tHalHandle hHal, v_U16_t nEmptyScanRefreshPeriod) |
| 9706 | { |
| 9707 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9708 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9709 | |
| 9710 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9711 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9712 | { |
| 9713 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9714 | "LFR runtime successfully set roam scan period to %d -" |
| 9715 | "old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9716 | nEmptyScanRefreshPeriod, |
| 9717 | pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9718 | macTraceGetNeighbourRoamState( |
| 9719 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9720 | pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod = nEmptyScanRefreshPeriod; |
| 9721 | pMac->roam.neighborRoamInfo.cfgParams.emptyScanRefreshPeriod = nEmptyScanRefreshPeriod; |
| 9722 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9723 | } |
| 9724 | |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9725 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9726 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9727 | { |
| 9728 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9729 | REASON_EMPTY_SCAN_REF_PERIOD_CHANGED); |
| 9730 | } |
| 9731 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9732 | return status ; |
| 9733 | } |
| 9734 | |
| 9735 | /* --------------------------------------------------------------------------- |
| 9736 | \fn sme_setNeighborScanMinChanTime |
| 9737 | \brief Update nNeighborScanMinChanTime |
| 9738 | This function is called through dynamic setConfig callback function |
| 9739 | to configure gNeighborScanChannelMinTime |
| 9740 | Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMinTime=[0 .. 60] |
| 9741 | \param hHal - HAL handle for device |
| 9742 | \param nNeighborScanMinChanTime - Channel minimum dwell time |
| 9743 | \- return Success or failure |
| 9744 | -------------------------------------------------------------------------*/ |
| 9745 | eHalStatus sme_setNeighborScanMinChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMinChanTime) |
| 9746 | { |
| 9747 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9748 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9749 | |
| 9750 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9751 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9752 | { |
| 9753 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9754 | "LFR runtime successfully set channel min dwell time to %d" |
| 9755 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9756 | nNeighborScanMinChanTime, |
| 9757 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9758 | macTraceGetNeighbourRoamState( |
| 9759 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9760 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime = nNeighborScanMinChanTime; |
| 9761 | pMac->roam.neighborRoamInfo.cfgParams.minChannelScanTime = nNeighborScanMinChanTime; |
| 9762 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9763 | } |
| 9764 | |
| 9765 | return status ; |
| 9766 | } |
| 9767 | |
| 9768 | /* --------------------------------------------------------------------------- |
| 9769 | \fn sme_setNeighborScanMaxChanTime |
| 9770 | \brief Update nNeighborScanMaxChanTime |
| 9771 | This function is called through dynamic setConfig callback function |
| 9772 | to configure gNeighborScanChannelMaxTime |
| 9773 | Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMaxTime=[0 .. 60] |
| 9774 | \param hHal - HAL handle for device |
| 9775 | \param nNeighborScanMinChanTime - Channel maximum dwell time |
| 9776 | \- return Success or failure |
| 9777 | -------------------------------------------------------------------------*/ |
| 9778 | eHalStatus sme_setNeighborScanMaxChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMaxChanTime) |
| 9779 | { |
| 9780 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9781 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9782 | |
| 9783 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9784 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9785 | { |
| 9786 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9787 | "LFR runtime successfully set channel max dwell time to %d" |
| 9788 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9789 | nNeighborScanMaxChanTime, |
| 9790 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9791 | macTraceGetNeighbourRoamState( |
| 9792 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9793 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime = nNeighborScanMaxChanTime; |
| 9794 | pMac->roam.neighborRoamInfo.cfgParams.maxChannelScanTime = nNeighborScanMaxChanTime; |
| 9795 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9796 | } |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9797 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9798 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9799 | { |
| 9800 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9801 | REASON_SCAN_CH_TIME_CHANGED); |
| 9802 | } |
| 9803 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9804 | |
| 9805 | return status ; |
| 9806 | } |
| 9807 | |
| 9808 | /* --------------------------------------------------------------------------- |
| 9809 | \fn sme_getNeighborScanMinChanTime |
| 9810 | \brief get neighbor scan min channel time |
| 9811 | \param hHal - The handle returned by macOpen. |
| 9812 | \return v_U16_t - channel min time value |
| 9813 | -------------------------------------------------------------------------*/ |
| 9814 | v_U16_t sme_getNeighborScanMinChanTime(tHalHandle hHal) |
| 9815 | { |
| 9816 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9817 | return pMac->roam.neighborRoamInfo.cfgParams.minChannelScanTime; |
| 9818 | } |
| 9819 | |
| 9820 | /* --------------------------------------------------------------------------- |
| 9821 | \fn sme_getNeighborScanMaxChanTime |
| 9822 | \brief get neighbor scan max channel time |
| 9823 | \param hHal - The handle returned by macOpen. |
| 9824 | \return v_U16_t - channel max time value |
| 9825 | -------------------------------------------------------------------------*/ |
| 9826 | v_U16_t sme_getNeighborScanMaxChanTime(tHalHandle hHal) |
| 9827 | { |
| 9828 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9829 | return pMac->roam.neighborRoamInfo.cfgParams.maxChannelScanTime; |
| 9830 | } |
| 9831 | |
| 9832 | /* --------------------------------------------------------------------------- |
| 9833 | \fn sme_setNeighborScanPeriod |
| 9834 | \brief Update nNeighborScanPeriod |
| 9835 | This function is called through dynamic setConfig callback function |
| 9836 | to configure nNeighborScanPeriod |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9837 | Usage: adb shell iwpriv wlan0 setConfig nNeighborScanPeriod=[0 .. 1000] |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9838 | \param hHal - HAL handle for device |
| 9839 | \param nNeighborScanPeriod - neighbor scan period |
| 9840 | \- return Success or failure |
| 9841 | -------------------------------------------------------------------------*/ |
| 9842 | eHalStatus sme_setNeighborScanPeriod(tHalHandle hHal, const v_U16_t nNeighborScanPeriod) |
| 9843 | { |
| 9844 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9845 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9846 | |
| 9847 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9848 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9849 | { |
| 9850 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9851 | "LFR runtime successfully set neighbor scan period to %d" |
| 9852 | " - old value is %d - roam state is %s", |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9853 | nNeighborScanPeriod, |
| 9854 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9855 | macTraceGetNeighbourRoamState( |
| 9856 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9857 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod = nNeighborScanPeriod; |
| 9858 | pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod = nNeighborScanPeriod; |
| 9859 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9860 | } |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9861 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9862 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9863 | { |
| 9864 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9865 | REASON_SCAN_HOME_TIME_CHANGED); |
| 9866 | } |
| 9867 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9868 | |
| 9869 | return status ; |
| 9870 | } |
| 9871 | |
| 9872 | /* --------------------------------------------------------------------------- |
| 9873 | \fn sme_getNeighborScanPeriod |
| 9874 | \brief get neighbor scan period |
| 9875 | \param hHal - The handle returned by macOpen. |
| 9876 | \return v_U16_t - neighbor scan period |
| 9877 | -------------------------------------------------------------------------*/ |
| 9878 | v_U16_t sme_getNeighborScanPeriod(tHalHandle hHal) |
| 9879 | { |
| 9880 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9881 | return pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod; |
| 9882 | } |
| 9883 | |
| 9884 | #endif |
| 9885 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9886 | #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] | 9887 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9888 | /*-------------------------------------------------------------------------- |
| 9889 | \brief sme_getRoamRssiDiff() - get Roam rssi diff |
| 9890 | This is a synchronous call |
| 9891 | \param hHal - The handle returned by macOpen. |
| 9892 | \return v_U16_t - Rssi diff value |
| 9893 | \sa |
| 9894 | --------------------------------------------------------------------------*/ |
| 9895 | v_U8_t sme_getRoamRssiDiff(tHalHandle hHal) |
| 9896 | { |
| 9897 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9898 | return pMac->roam.configParam.RoamRssiDiff; |
| 9899 | } |
| 9900 | |
| 9901 | /*-------------------------------------------------------------------------- |
| 9902 | \brief sme_ChangeRoamScanChannelList() - Change roam scan channel list |
| 9903 | This is a synchronous call |
| 9904 | \param hHal - The handle returned by macOpen. |
| 9905 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9906 | Other status means SME is failed to update |
| 9907 | \sa |
| 9908 | --------------------------------------------------------------------------*/ |
| 9909 | eHalStatus sme_ChangeRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, |
| 9910 | tANI_U8 numChannels) |
| 9911 | { |
| 9912 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9913 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9914 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9915 | tANI_U8 oldChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
Kiet Lam | 600d3ca | 2013-08-31 16:33:32 +0530 | [diff] [blame] | 9916 | tANI_U8 newChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9917 | tANI_U8 i = 0, j = 0; |
| 9918 | |
| 9919 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9920 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9921 | { |
| 9922 | if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
| 9923 | { |
| 9924 | for (i = 0; i < pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; i++) |
| 9925 | { |
Kaushik, Sushant | d39915b | 2014-04-23 15:12:28 +0530 | [diff] [blame] | 9926 | if (j < sizeof(oldChannelList)) |
| 9927 | { |
| 9928 | j += snprintf(oldChannelList + j, sizeof(oldChannelList) - j," %d", |
| 9929 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]); |
| 9930 | } |
| 9931 | else |
| 9932 | { |
| 9933 | break; |
| 9934 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9935 | } |
| 9936 | } |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9937 | csrFlushCfgBgScanRoamChannelList(pMac); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9938 | csrCreateBgScanRoamChannelList(pMac, pChannelList, numChannels); |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9939 | sme_SetRoamScanControl(hHal, 1); |
| 9940 | if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9941 | { |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9942 | j = 0; |
| 9943 | for (i = 0; i < pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; i++) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9944 | { |
Kaushik, Sushant | d39915b | 2014-04-23 15:12:28 +0530 | [diff] [blame] | 9945 | if (j < sizeof(oldChannelList)) |
| 9946 | { |
| 9947 | j += snprintf(newChannelList + j, sizeof(newChannelList) - j," %d", |
| 9948 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]); |
| 9949 | } |
| 9950 | else |
| 9951 | { |
| 9952 | break; |
| 9953 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9954 | } |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9955 | } |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9956 | |
| 9957 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Mahesh A Saptasagar | 0616f58 | 2014-01-13 21:17:53 +0530 | [diff] [blame] | 9958 | "LFR runtime successfully set roam scan channels to %s" |
| 9959 | "- old value is %s - roam state is %s", |
| 9960 | newChannelList, oldChannelList, |
| 9961 | macTraceGetNeighbourRoamState( |
| 9962 | pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9963 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9964 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9965 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9966 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9967 | { |
| 9968 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); |
| 9969 | } |
| 9970 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9971 | |
| 9972 | return status ; |
| 9973 | } |
| 9974 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9975 | |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9976 | #ifdef FEATURE_WLAN_ESE_UPLOAD |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9977 | /*-------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9978 | \brief sme_SetEseRoamScanChannelList() - set ese roam scan channel list |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9979 | This is a synchronuous call |
| 9980 | \param hHal - The handle returned by macOpen. |
| 9981 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9982 | Other status means SME is failed to update |
| 9983 | \sa |
| 9984 | --------------------------------------------------------------------------*/ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 9985 | eHalStatus sme_SetEseRoamScanChannelList(tHalHandle hHal, |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9986 | tANI_U8 *pChannelList, |
| 9987 | tANI_U8 numChannels) |
| 9988 | { |
| 9989 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9990 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9991 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 9992 | tpCsrChannelInfo currChannelListInfo = &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo; |
| 9993 | tANI_U8 oldChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
| 9994 | tANI_U8 newChannelList[128] = {0}; |
| 9995 | tANI_U8 i = 0, j = 0; |
| 9996 | |
| 9997 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9998 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9999 | { |
| 10000 | if (NULL != currChannelListInfo->ChannelList) |
| 10001 | { |
| 10002 | for (i = 0; i < currChannelListInfo->numOfChannels; i++) |
| 10003 | { |
| 10004 | j += snprintf(oldChannelList + j, sizeof(oldChannelList) - j," %d", |
| 10005 | currChannelListInfo->ChannelList[i]); |
| 10006 | } |
| 10007 | } |
| 10008 | status = csrCreateRoamScanChannelList(pMac, pChannelList, numChannels, csrGetCurrentBand(hHal)); |
| 10009 | |
| 10010 | if ( HAL_STATUS_SUCCESS( status )) |
| 10011 | { |
| 10012 | if (NULL != currChannelListInfo->ChannelList) |
| 10013 | { |
| 10014 | j = 0; |
| 10015 | for (i = 0; i < currChannelListInfo->numOfChannels; i++) |
| 10016 | { |
| 10017 | j += snprintf(newChannelList + j, sizeof(newChannelList) - j," %d", |
| 10018 | currChannelListInfo->ChannelList[i]); |
| 10019 | } |
| 10020 | } |
| 10021 | |
| 10022 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10023 | "ESE roam scan channel list successfully set to %s - old value is %s - roam state is %s", |
| 10024 | newChannelList, oldChannelList, |
| 10025 | macTraceGetNeighbourRoamState(pMac->roam.neighborRoamInfo.neighborRoamState)); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 10026 | } |
| 10027 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10028 | } |
| 10029 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 10030 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 10031 | { |
| 10032 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); |
| 10033 | } |
| 10034 | #endif |
| 10035 | |
| 10036 | return status ; |
| 10037 | } |
| 10038 | #endif |
| 10039 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10040 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10041 | \brief sme_getRoamScanChannelList() - get roam scan channel list |
| 10042 | This is a synchronous call |
| 10043 | \param hHal - The handle returned by macOpen. |
| 10044 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 10045 | Other status means SME is failed to update |
| 10046 | \sa |
| 10047 | --------------------------------------------------------------------------*/ |
| 10048 | eHalStatus sme_getRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, |
| 10049 | tANI_U8 *pNumChannels) |
| 10050 | { |
| 10051 | int i = 0; |
| 10052 | tANI_U8 *pOutPtr = pChannelList; |
| 10053 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10054 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 10055 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10056 | |
| 10057 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10058 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10059 | { |
| 10060 | if (NULL == pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
| 10061 | { |
| 10062 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, |
| 10063 | "Roam Scan channel list is NOT yet initialized"); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 10064 | *pNumChannels = 0; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10065 | sme_ReleaseGlobalLock( &pMac->sme ); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 10066 | return status; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10067 | } |
| 10068 | |
| 10069 | *pNumChannels = pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; |
| 10070 | for (i = 0; i < (*pNumChannels); i++) |
| 10071 | { |
| 10072 | pOutPtr[i] = pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]; |
| 10073 | } |
| 10074 | pOutPtr[i] = '\0'; |
| 10075 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10076 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10077 | return status ; |
| 10078 | } |
| 10079 | |
| 10080 | /*-------------------------------------------------------------------------- |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10081 | \brief sme_getIsEseFeatureEnabled() - get Ese feature enabled or not |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10082 | This is a synchronuous call |
| 10083 | \param hHal - The handle returned by macOpen. |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10084 | \return TRUE (1) - if the Ese feature is enabled |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10085 | FALSE (0) - if feature is disabled (compile or runtime) |
| 10086 | \sa |
| 10087 | --------------------------------------------------------------------------*/ |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10088 | tANI_BOOLEAN sme_getIsEseFeatureEnabled(tHalHandle hHal) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10089 | { |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10090 | #ifdef FEATURE_WLAN_ESE |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10091 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Varun Reddy Yeturu | 5d5e2c6 | 2014-02-27 13:31:29 -0800 | [diff] [blame] | 10092 | return csrRoamIsEseIniFeatureEnabled(pMac); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10093 | #else |
| 10094 | return eANI_BOOLEAN_FALSE; |
| 10095 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 10096 | } |
| 10097 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10098 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 10099 | \brief sme_GetWESMode() - get WES Mode |
| 10100 | This is a synchronous call |
| 10101 | \param hHal - The handle returned by macOpen |
| 10102 | \return v_U8_t - WES Mode Enabled(1)/Disabled(0) |
| 10103 | \sa |
| 10104 | --------------------------------------------------------------------------*/ |
| 10105 | v_BOOL_t sme_GetWESMode(tHalHandle hHal) |
| 10106 | { |
| 10107 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10108 | return pMac->roam.configParam.isWESModeEnabled; |
| 10109 | } |
| 10110 | |
| 10111 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 10112 | \brief sme_GetRoamScanControl() - get scan control |
| 10113 | This is a synchronous call |
| 10114 | \param hHal - The handle returned by macOpen. |
| 10115 | \return v_BOOL_t - Enabled(1)/Disabled(0) |
| 10116 | \sa |
| 10117 | --------------------------------------------------------------------------*/ |
| 10118 | v_BOOL_t sme_GetRoamScanControl(tHalHandle hHal) |
| 10119 | { |
| 10120 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10121 | return pMac->roam.configParam.nRoamScanControl; |
| 10122 | } |
| 10123 | #endif |
| 10124 | |
| 10125 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10126 | \brief sme_getIsLfrFeatureEnabled() - get LFR feature enabled or not |
| 10127 | This is a synchronuous call |
| 10128 | \param hHal - The handle returned by macOpen. |
| 10129 | \return TRUE (1) - if the feature is enabled |
| 10130 | FALSE (0) - if feature is disabled (compile or runtime) |
| 10131 | \sa |
| 10132 | --------------------------------------------------------------------------*/ |
| 10133 | tANI_BOOLEAN sme_getIsLfrFeatureEnabled(tHalHandle hHal) |
| 10134 | { |
| 10135 | #ifdef FEATURE_WLAN_LFR |
| 10136 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10137 | return pMac->roam.configParam.isFastRoamIniFeatureEnabled; |
| 10138 | #else |
| 10139 | return eANI_BOOLEAN_FALSE; |
| 10140 | #endif |
| 10141 | } |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 10142 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 10143 | /*-------------------------------------------------------------------------- |
| 10144 | \brief sme_getIsFtFeatureEnabled() - get FT feature enabled or not |
| 10145 | This is a synchronuous call |
| 10146 | \param hHal - The handle returned by macOpen. |
| 10147 | \return TRUE (1) - if the feature is enabled |
| 10148 | FALSE (0) - if feature is disabled (compile or runtime) |
| 10149 | \sa |
| 10150 | --------------------------------------------------------------------------*/ |
| 10151 | tANI_BOOLEAN sme_getIsFtFeatureEnabled(tHalHandle hHal) |
| 10152 | { |
| 10153 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 10154 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10155 | return pMac->roam.configParam.isFastTransitionEnabled; |
| 10156 | #else |
| 10157 | return eANI_BOOLEAN_FALSE; |
| 10158 | #endif |
| 10159 | } |
| 10160 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10161 | /* --------------------------------------------------------------------------- |
| 10162 | \fn sme_IsFeatureSupportedByFW |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10163 | |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 10164 | \brief Check if a feature is enabled by FW |
| 10165 | |
| 10166 | \param featEnumValue - Enumeration value from placeHolderInCapBitmap |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10167 | |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 10168 | \- return 1/0 (TRUE/FALSE) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10169 | -------------------------------------------------------------------------*/ |
| 10170 | tANI_U8 sme_IsFeatureSupportedByFW(tANI_U8 featEnumValue) |
| 10171 | { |
| 10172 | return IS_FEATURE_SUPPORTED_BY_FW(featEnumValue); |
| 10173 | } |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 10174 | |
| 10175 | /* --------------------------------------------------------------------------- |
| 10176 | \fn sme_IsFeatureSupportedByDriver |
| 10177 | \brief Check if a feature is enabled by Driver |
| 10178 | |
| 10179 | \param featEnumValue - Enumeration value from placeHolderInCapBitmap |
| 10180 | \- return 1/0 (TRUE/FALSE) |
| 10181 | -------------------------------------------------------------------------*/ |
| 10182 | |
| 10183 | tANI_U8 sme_IsFeatureSupportedByDriver(tANI_U8 featEnumValue) |
| 10184 | { |
| 10185 | return IS_FEATURE_SUPPORTED_BY_DRIVER(featEnumValue); |
| 10186 | } |
| 10187 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10188 | #ifdef FEATURE_WLAN_TDLS |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 10189 | |
| 10190 | /* --------------------------------------------------------------------------- |
| 10191 | \fn sme_SendTdlsMgmtFrame |
| 10192 | \brief API to send TDLS management frames. |
| 10193 | |
| 10194 | \param peerMac - peer's Mac Adress. |
| 10195 | \param tdlsLinkEstablishParams - TDLS Peer Link Establishment Parameters |
| 10196 | \- return VOS_STATUS_SUCCES |
| 10197 | -------------------------------------------------------------------------*/ |
| 10198 | VOS_STATUS sme_SendTdlsLinkEstablishParams(tHalHandle hHal, |
| 10199 | tANI_U8 sessionId, |
| 10200 | tSirMacAddr peerMac, |
| 10201 | tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams) |
| 10202 | { |
| 10203 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10204 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10205 | |
| 10206 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10207 | |
| 10208 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10209 | { |
| 10210 | status = csrTdlsSendLinkEstablishParams(hHal, sessionId, peerMac, tdlsLinkEstablishParams) ; |
| 10211 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10212 | } |
| 10213 | return status ; |
| 10214 | } |
| 10215 | |
Atul Mittal | c0f739f | 2014-07-31 13:47:47 +0530 | [diff] [blame] | 10216 | // tdlsoffchan |
| 10217 | |
| 10218 | /* --------------------------------------------------------------------------- |
| 10219 | \fn sme_SendTdlsChanSwitchReq |
| 10220 | \brief API to send TDLS management frames. |
| 10221 | |
| 10222 | \param peerMac - peer's Mac Adress. |
| 10223 | \param tdlsLinkEstablishParams - TDLS Peer Link Establishment Parameters |
| 10224 | \- return VOS_STATUS_SUCCES |
| 10225 | -------------------------------------------------------------------------*/ |
| 10226 | VOS_STATUS sme_SendTdlsChanSwitchReq(tHalHandle hHal, |
| 10227 | tANI_U8 sessionId, |
| 10228 | tSirMacAddr peerMac, |
| 10229 | tANI_S32 tdlsOffCh, |
| 10230 | tANI_S32 tdlsOffChBwOffset, |
| 10231 | tANI_U8 tdlsSwMode) |
| 10232 | { |
| 10233 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10234 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10235 | |
| 10236 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10237 | |
| 10238 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10239 | { |
| 10240 | status = csrTdlsSendChanSwitchReq(hHal, sessionId, peerMac, |
| 10241 | tdlsOffCh, tdlsOffChBwOffset, |
| 10242 | tdlsSwMode); |
| 10243 | } |
| 10244 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10245 | return status ; |
| 10246 | } |
| 10247 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10248 | /* --------------------------------------------------------------------------- |
| 10249 | \fn sme_SendTdlsMgmtFrame |
| 10250 | \brief API to send TDLS management frames. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10251 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10252 | \param peerMac - peer's Mac Adress. |
| 10253 | \param frame_type - Type of TDLS mgmt frame to be sent. |
| 10254 | \param dialog - dialog token used in the frame. |
| 10255 | \param status - status to be incuded in the frame. |
Pradeep Reddy POTTETI | ca171f8 | 2014-03-21 14:17:35 +0530 | [diff] [blame] | 10256 | \param peerCapability - peer cpabilities |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10257 | \param buf - additional IEs to be included |
| 10258 | \param len - lenght of additional Ies |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 10259 | \param responder - Tdls request type |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10260 | \- return VOS_STATUS_SUCCES |
| 10261 | -------------------------------------------------------------------------*/ |
| 10262 | VOS_STATUS sme_SendTdlsMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, |
Pradeep Reddy POTTETI | ca171f8 | 2014-03-21 14:17:35 +0530 | [diff] [blame] | 10263 | 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] | 10264 | { |
| 10265 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10266 | tCsrTdlsSendMgmt sendTdlsReq = {{0}} ; |
| 10267 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10268 | |
| 10269 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10270 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10271 | { |
| 10272 | vos_mem_copy(sendTdlsReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 10273 | sendTdlsReq.frameType = frame_type; |
| 10274 | sendTdlsReq.buf = buf; |
| 10275 | sendTdlsReq.len = len; |
| 10276 | sendTdlsReq.dialog = dialog; |
| 10277 | sendTdlsReq.statusCode = statusCode; |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 10278 | sendTdlsReq.responder = responder; |
Pradeep Reddy POTTETI | ca171f8 | 2014-03-21 14:17:35 +0530 | [diff] [blame] | 10279 | sendTdlsReq.peerCapability = peerCapability; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10280 | |
| 10281 | status = csrTdlsSendMgmtReq(hHal, sessionId, &sendTdlsReq) ; |
| 10282 | |
| 10283 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10284 | } |
| 10285 | |
| 10286 | return status ; |
| 10287 | |
| 10288 | } |
| 10289 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 10290 | \fn sme_ChangeTdlsPeerSta |
| 10291 | \brief API to Update TDLS peer sta parameters. |
| 10292 | |
| 10293 | \param peerMac - peer's Mac Adress. |
| 10294 | \param staParams - Peer Station Parameters |
| 10295 | \- return VOS_STATUS_SUCCES |
| 10296 | -------------------------------------------------------------------------*/ |
| 10297 | VOS_STATUS sme_ChangeTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, |
| 10298 | tCsrStaParams *pstaParams) |
| 10299 | { |
| 10300 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10301 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10302 | |
Sushant Kaushik | d62d978 | 2014-02-19 15:39:40 +0530 | [diff] [blame] | 10303 | if (NULL == pstaParams) |
| 10304 | { |
| 10305 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10306 | "%s :pstaParams is NULL",__func__); |
| 10307 | return eHAL_STATUS_FAILURE; |
| 10308 | } |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 10309 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10310 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10311 | { |
| 10312 | status = csrTdlsChangePeerSta(hHal, sessionId, peerMac,pstaParams); |
| 10313 | |
| 10314 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10315 | } |
| 10316 | |
| 10317 | return status ; |
| 10318 | |
| 10319 | } |
| 10320 | |
| 10321 | /* --------------------------------------------------------------------------- |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10322 | \fn sme_AddTdlsPeerSta |
| 10323 | \brief API to Add TDLS peer sta entry. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10324 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10325 | \param peerMac - peer's Mac Adress. |
| 10326 | \- return VOS_STATUS_SUCCES |
| 10327 | -------------------------------------------------------------------------*/ |
| 10328 | VOS_STATUS sme_AddTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 10329 | { |
| 10330 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10331 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10332 | |
| 10333 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10334 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10335 | { |
| 10336 | status = csrTdlsAddPeerSta(hHal, sessionId, peerMac); |
| 10337 | |
| 10338 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10339 | } |
| 10340 | |
| 10341 | return status ; |
| 10342 | |
| 10343 | } |
| 10344 | /* --------------------------------------------------------------------------- |
| 10345 | \fn sme_DeleteTdlsPeerSta |
| 10346 | \brief API to Delete TDLS peer sta entry. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10347 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10348 | \param peerMac - peer's Mac Adress. |
| 10349 | \- return VOS_STATUS_SUCCES |
| 10350 | -------------------------------------------------------------------------*/ |
| 10351 | VOS_STATUS sme_DeleteTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 10352 | { |
| 10353 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10354 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10355 | |
| 10356 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10357 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10358 | { |
| 10359 | status = csrTdlsDelPeerSta(hHal, sessionId, peerMac) ; |
| 10360 | |
| 10361 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10362 | } |
| 10363 | |
| 10364 | return status ; |
| 10365 | |
| 10366 | } |
Gopichand Nakkala | 75e7b28 | 2013-03-15 18:37:13 -0700 | [diff] [blame] | 10367 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | ccd3a38 | 2013-03-19 13:56:10 -0700 | [diff] [blame] | 10368 | \fn sme_SetTdlsPowerSaveProhibited |
| 10369 | \API to set/reset the isTdlsPowerSaveProhibited. |
| 10370 | |
| 10371 | \- return void |
| 10372 | -------------------------------------------------------------------------*/ |
| 10373 | void sme_SetTdlsPowerSaveProhibited(tHalHandle hHal, v_BOOL_t val) |
| 10374 | { |
| 10375 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10376 | |
| 10377 | pMac->isTdlsPowerSaveProhibited = val; |
| 10378 | return; |
| 10379 | } |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10380 | #endif |
Gopichand Nakkala | fe7246d | 2013-06-10 17:43:37 +0530 | [diff] [blame] | 10381 | /* --------------------------------------------------------------------------- |
| 10382 | \fn sme_IsPmcBmps |
| 10383 | \API to Check if PMC state is BMPS. |
| 10384 | |
| 10385 | \- return v_BOOL_t |
| 10386 | -------------------------------------------------------------------------*/ |
| 10387 | v_BOOL_t sme_IsPmcBmps(tHalHandle hHal) |
| 10388 | { |
| 10389 | return (BMPS == pmcGetPmcState(hHal)); |
| 10390 | } |
| 10391 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10392 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 10393 | /* |
| 10394 | * SME API to start TDLS discovery Procedure |
| 10395 | */ |
| 10396 | VOS_STATUS sme_StartTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 10397 | { |
| 10398 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 10399 | tCsrTdlsDisRequest disReq = {{0}} ; |
| 10400 | vos_mem_copy(disReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 10401 | status = csrTdlsDiscoveryReq(hHal, sessionId, &disReq) ; |
| 10402 | |
| 10403 | return status ; |
| 10404 | |
| 10405 | } |
| 10406 | |
| 10407 | /* |
| 10408 | * Process TDLS discovery results |
| 10409 | */ |
| 10410 | v_U8_t sme_GetTdlsDiscoveryResult(tHalHandle hHal, |
| 10411 | tSmeTdlsDisResult *disResult, v_U8_t listType) |
| 10412 | { |
| 10413 | tCsrTdlsPeerLinkinfo *peerLinkInfo = NULL ; |
| 10414 | tSirTdlsPeerInfo *peerInfo = NULL ; |
| 10415 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10416 | tCsrTdlsCtxStruct *disInfo = &pMac->tdlsCtx ; |
| 10417 | tDblLinkList *peerList = &disInfo->tdlsPotentialPeerList ; |
| 10418 | tListElem *pEntry = NULL ; |
| 10419 | v_U8_t peerCnt = 0 ; |
| 10420 | |
| 10421 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 10422 | ("TDLS peer count = %d"),disInfo->tdlsPeerCount ) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10423 | pEntry = csrLLPeekHead( peerList, LL_ACCESS_LOCK ); |
| 10424 | while(pEntry) |
| 10425 | { |
| 10426 | peerLinkInfo = GET_BASE_ADDR( pEntry, tCsrTdlsPeerLinkinfo, |
| 10427 | tdlsPeerStaLink) ; |
| 10428 | peerInfo = &peerLinkInfo->tdlsDisPeerInfo ; |
| 10429 | |
| 10430 | switch(listType) |
| 10431 | { |
| 10432 | case TDLS_SETUP_LIST: |
| 10433 | { |
| 10434 | if(TDLS_LINK_SETUP_STATE == peerInfo->tdlsPeerState) |
| 10435 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 10436 | vos_mem_copy(disResult[peerCnt].tdlsPeerMac, |
| 10437 | peerInfo->peerMac, sizeof(tSirMacAddr)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10438 | disResult[peerCnt].tdlsPeerRssi = peerInfo->tdlsPeerRssi ; |
| 10439 | peerCnt++ ; |
| 10440 | } |
| 10441 | break ; |
| 10442 | } |
| 10443 | case TDLS_DIS_LIST: |
| 10444 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 10445 | vos_mem_copy(disResult[peerCnt].tdlsPeerMac, |
| 10446 | peerInfo->peerMac, sizeof(tSirMacAddr)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10447 | disResult[peerCnt].tdlsPeerRssi = peerInfo->tdlsPeerRssi ; |
| 10448 | peerCnt++ ; |
| 10449 | break ; |
| 10450 | } |
| 10451 | default: |
| 10452 | { |
| 10453 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 10454 | ("unknown list type ")) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 10455 | break ; |
| 10456 | } |
| 10457 | } |
| 10458 | |
| 10459 | pEntry = csrLLNext( peerList, pEntry, LL_ACCESS_LOCK) ; |
| 10460 | } |
| 10461 | |
| 10462 | return peerCnt ; |
| 10463 | |
| 10464 | } |
| 10465 | |
| 10466 | /* |
| 10467 | * SME API to start TDLS link setup Procedure. |
| 10468 | */ |
| 10469 | VOS_STATUS sme_StartTdlsLinkSetupReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 10470 | { |
| 10471 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 10472 | tCsrTdlsSetupRequest setupReq = {{0}} ; |
| 10473 | vos_mem_copy(setupReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 10474 | status = csrTdlsSetupReq(hHal, sessionId, &setupReq) ; |
| 10475 | return status ; |
| 10476 | |
| 10477 | } |
| 10478 | |
| 10479 | /* |
| 10480 | * SME API to start TDLS link Teardown Procedure. |
| 10481 | */ |
| 10482 | VOS_STATUS sme_StartTdlsLinkTeardownReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 10483 | { |
| 10484 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 10485 | tCsrTdlsTeardownRequest teardownReq = {{0}} ; |
| 10486 | vos_mem_copy(teardownReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 10487 | status = csrTdlsTeardownReq(hHal, sessionId, &teardownReq) ; |
| 10488 | return status ; |
| 10489 | |
| 10490 | } |
| 10491 | |
| 10492 | #endif /* FEATURE_WLAN_TDLS */ |
| 10493 | |
Tushnim Bhattacharyya | 9cdf608 | 2013-04-21 16:33:30 -0700 | [diff] [blame] | 10494 | eHalStatus sme_UpdateDfsSetting(tHalHandle hHal, tANI_U8 fUpdateEnableDFSChnlScan) |
| 10495 | { |
| 10496 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 10497 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10498 | |
| 10499 | smsLog(pMac, LOG2, FL("enter")); |
| 10500 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10501 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10502 | { |
| 10503 | pMac->scan.fEnableDFSChnlScan = fUpdateEnableDFSChnlScan; |
| 10504 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10505 | } |
| 10506 | smsLog(pMac, LOG2, FL("exit status %d"), status); |
| 10507 | |
| 10508 | return (status); |
| 10509 | } |
| 10510 | |
Gopichand Nakkala | e620d5a | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 10511 | /* |
| 10512 | * SME API to enable/disable WLAN driver initiated SSR |
| 10513 | */ |
| 10514 | void sme_UpdateEnableSSR(tHalHandle hHal, tANI_BOOLEAN enableSSR) |
| 10515 | { |
| 10516 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10517 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10518 | |
| 10519 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 10520 | if (HAL_STATUS_SUCCESS(status)) |
| 10521 | { |
| 10522 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 10523 | "SSR level is changed %d", enableSSR); |
| 10524 | /* not serializing this messsage, as this is only going |
| 10525 | * to set a variable in WDA/WDI |
| 10526 | */ |
| 10527 | WDA_SetEnableSSR(enableSSR); |
| 10528 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10529 | } |
| 10530 | return; |
| 10531 | } |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10532 | |
| 10533 | /* |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10534 | * SME API to stringify bonding mode. (hostapd convention) |
| 10535 | */ |
| 10536 | |
| 10537 | static const char* sme_CBMode2String( tANI_U32 mode) |
| 10538 | { |
| 10539 | switch (mode) |
| 10540 | { |
| 10541 | case eCSR_INI_SINGLE_CHANNEL_CENTERED: |
| 10542 | return "HT20"; |
| 10543 | case eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY: |
| 10544 | return "HT40-"; /* lower secondary channel */ |
| 10545 | case eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY: |
| 10546 | return "HT40+"; /* upper secondary channel */ |
| 10547 | #ifdef WLAN_FEATURE_11AC |
| 10548 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW: |
| 10549 | return "VHT80+40+"; /* upper secondary channels */ |
| 10550 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW: |
| 10551 | return "VHT80+40-"; /* 1 lower and 2 upper secondary channels */ |
| 10552 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH: |
| 10553 | return "VHT80-40+"; /* 2 lower and 1 upper secondary channels */ |
| 10554 | case eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH: |
| 10555 | return "VHT80-40-"; /* lower secondary channels */ |
| 10556 | #endif |
| 10557 | default: |
| 10558 | VOS_ASSERT(0); |
| 10559 | return "Unknown"; |
| 10560 | } |
| 10561 | } |
| 10562 | |
| 10563 | /* |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10564 | * SME API to determine the channel bonding mode |
| 10565 | */ |
| 10566 | VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 channel) |
| 10567 | { |
| 10568 | tSmeConfigParams smeConfig; |
| 10569 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10570 | |
| 10571 | if ( |
| 10572 | #ifdef WLAN_FEATURE_11AC |
| 10573 | eCSR_DOT11_MODE_11ac != eCsrPhyMode && |
| 10574 | eCSR_DOT11_MODE_11ac_ONLY != eCsrPhyMode && |
| 10575 | #endif |
| 10576 | eCSR_DOT11_MODE_11n != eCsrPhyMode && |
krunal soni | 634aba3 | 2014-03-06 17:46:50 -0800 | [diff] [blame] | 10577 | eCSR_DOT11_MODE_11n_ONLY != eCsrPhyMode && |
| 10578 | |
| 10579 | eCSR_DOT11_MODE_11a != eCsrPhyMode && |
| 10580 | eCSR_DOT11_MODE_11a_ONLY != eCsrPhyMode && |
| 10581 | |
| 10582 | eCSR_DOT11_MODE_abg != eCsrPhyMode |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10583 | ) |
| 10584 | { |
| 10585 | return VOS_STATUS_SUCCESS; |
| 10586 | } |
| 10587 | |
Kaushik, Sushant | 553a06c | 2014-11-26 15:29:40 +0530 | [diff] [blame] | 10588 | vos_mem_zero(&smeConfig, sizeof (tSmeConfigParams)); |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10589 | sme_GetConfigParam(pMac, &smeConfig); |
| 10590 | |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10591 | /* If channel bonding mode is not required */ |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10592 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 10593 | if ( !pMac->roam.configParam.channelBondingMode5GHz |
| 10594 | && !smeConfig.csrConfig.apHT40_24GEnabled ) { |
| 10595 | #else |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10596 | if ( !pMac->roam.configParam.channelBondingMode5GHz ) { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10597 | #endif |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10598 | return VOS_STATUS_SUCCESS; |
| 10599 | } |
| 10600 | |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10601 | |
| 10602 | #ifdef WLAN_FEATURE_11AC |
| 10603 | if ( eCSR_DOT11_MODE_11ac == eCsrPhyMode || |
| 10604 | eCSR_DOT11_MODE_11ac_ONLY == eCsrPhyMode ) |
| 10605 | { |
| 10606 | if ( channel== 36 || channel == 52 || channel == 100 || |
| 10607 | channel == 116 || channel == 149 ) |
| 10608 | { |
| 10609 | smeConfig.csrConfig.channelBondingMode5GHz = |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10610 | eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10611 | } |
| 10612 | else if ( channel == 40 || channel == 56 || channel == 104 || |
| 10613 | channel == 120 || channel == 153 ) |
| 10614 | { |
| 10615 | smeConfig.csrConfig.channelBondingMode5GHz = |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10616 | eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10617 | } |
| 10618 | else if ( channel == 44 || channel == 60 || channel == 108 || |
| 10619 | channel == 124 || channel == 157 ) |
| 10620 | { |
| 10621 | smeConfig.csrConfig.channelBondingMode5GHz = |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10622 | eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10623 | } |
| 10624 | else if ( channel == 48 || channel == 64 || channel == 112 || |
Leo Chang | d0a4984 | 2013-12-30 11:41:04 -0800 | [diff] [blame] | 10625 | channel == 128 || channel == 144 || channel == 161 ) |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10626 | { |
| 10627 | smeConfig.csrConfig.channelBondingMode5GHz = |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10628 | eCSR_INI_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10629 | } |
| 10630 | else if ( channel == 165 ) |
| 10631 | { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10632 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 10633 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10634 | } |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10635 | |
| 10636 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 10637 | if (smeConfig.csrConfig.apHT40_24GEnabled) |
| 10638 | { |
| 10639 | if (channel >= 1 && channel <= 7) |
| 10640 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 10641 | eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 10642 | else if (channel >= 8 && channel <= 13) |
| 10643 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 10644 | eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 10645 | else if (channel ==14) |
| 10646 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 10647 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
| 10648 | } |
| 10649 | #endif |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10650 | } |
| 10651 | #endif |
| 10652 | |
| 10653 | if ( eCSR_DOT11_MODE_11n == eCsrPhyMode || |
| 10654 | eCSR_DOT11_MODE_11n_ONLY == eCsrPhyMode ) |
| 10655 | { |
| 10656 | if ( channel== 40 || channel == 48 || channel == 56 || |
| 10657 | channel == 64 || channel == 104 || channel == 112 || |
| 10658 | channel == 120 || channel == 128 || channel == 136 || |
| 10659 | channel == 144 || channel == 153 || channel == 161 ) |
| 10660 | { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10661 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 10662 | eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10663 | } |
| 10664 | else if ( channel== 36 || channel == 44 || channel == 52 || |
| 10665 | channel == 60 || channel == 100 || channel == 108 || |
| 10666 | channel == 116 || channel == 124 || channel == 132 || |
| 10667 | channel == 140 || channel == 149 || channel == 157 ) |
| 10668 | { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10669 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 10670 | eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10671 | } |
| 10672 | else if ( channel == 165 ) |
| 10673 | { |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10674 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 10675 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10676 | } |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10677 | |
| 10678 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 10679 | if (smeConfig.csrConfig.apHT40_24GEnabled) |
| 10680 | { |
| 10681 | if (channel >= 1 && channel <= 7) |
| 10682 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 10683 | eCSR_INI_DOUBLE_CHANNEL_LOW_PRIMARY; |
| 10684 | else if (channel >= 8 && channel <= 13) |
| 10685 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 10686 | eCSR_INI_DOUBLE_CHANNEL_HIGH_PRIMARY; |
| 10687 | else if (channel ==14) |
| 10688 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 10689 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
| 10690 | } |
| 10691 | #endif |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10692 | } |
krunal soni | 634aba3 | 2014-03-06 17:46:50 -0800 | [diff] [blame] | 10693 | |
| 10694 | /* |
| 10695 | for 802.11a phy mode, channel bonding should be zero. |
| 10696 | From default config, it is set as PHY_DOUBLE_CHANNEL_HIGH_PRIMARY = 3 |
| 10697 | through csrChangeDefaultConfigParam function. We will override this |
| 10698 | value here. |
| 10699 | */ |
| 10700 | if ( eCSR_DOT11_MODE_11a == eCsrPhyMode || |
| 10701 | eCSR_DOT11_MODE_11a_ONLY == eCsrPhyMode || |
| 10702 | eCSR_DOT11_MODE_abg == eCsrPhyMode) |
| 10703 | { |
| 10704 | smeConfig.csrConfig.channelBondingMode5GHz = 0; |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10705 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 10706 | } else if ( eCSR_DOT11_MODE_11g_ONLY == eCsrPhyMode) |
| 10707 | smeConfig.csrConfig.channelBondingAPMode24GHz = |
| 10708 | eCSR_INI_SINGLE_CHANNEL_CENTERED; |
| 10709 | #else |
krunal soni | 634aba3 | 2014-03-06 17:46:50 -0800 | [diff] [blame] | 10710 | } |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10711 | #endif |
krunal soni | 634aba3 | 2014-03-06 17:46:50 -0800 | [diff] [blame] | 10712 | |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10713 | #ifdef WLAN_FEATURE_AP_HT40_24G |
| 10714 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10715 | FL("%s cbmode selected=%d bonding mode:%s"), |
| 10716 | (channel <= 14) ? "2G" : "5G", |
| 10717 | (channel <= 14) ? smeConfig.csrConfig.channelBondingAPMode24GHz : |
| 10718 | smeConfig.csrConfig.channelBondingMode5GHz, |
| 10719 | (channel <= 14) ? |
| 10720 | sme_CBMode2String(smeConfig.csrConfig.channelBondingAPMode24GHz) : |
| 10721 | sme_CBMode2String(smeConfig.csrConfig.channelBondingMode5GHz)); |
| 10722 | #else |
Agarwal Ashish | bf98caf | 2014-03-25 13:29:11 +0530 | [diff] [blame] | 10723 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, |
Hardik Kantilal Patel | dd10795 | 2014-11-20 15:24:52 +0530 | [diff] [blame] | 10724 | "cbmode selected=%d", smeConfig.csrConfig.channelBondingMode5GHz); |
| 10725 | #endif |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 10726 | |
| 10727 | sme_UpdateConfig (pMac, &smeConfig); |
| 10728 | return VOS_STATUS_SUCCESS; |
| 10729 | } |
| 10730 | |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 10731 | /*-------------------------------------------------------------------------- |
| 10732 | |
| 10733 | \brief sme_SetCurrDeviceMode() - Sets the current operating device mode. |
| 10734 | \param hHal - The handle returned by macOpen. |
| 10735 | \param currDeviceMode - Current operating device mode. |
| 10736 | --------------------------------------------------------------------------*/ |
| 10737 | |
| 10738 | void sme_SetCurrDeviceMode (tHalHandle hHal, tVOS_CON_MODE currDeviceMode) |
| 10739 | { |
| 10740 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10741 | pMac->sme.currDeviceMode = currDeviceMode; |
| 10742 | return; |
| 10743 | } |
| 10744 | |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 10745 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 10746 | /*-------------------------------------------------------------------------- |
| 10747 | \brief sme_HandoffRequest() - a wrapper function to Request a handoff |
| 10748 | from CSR. |
| 10749 | This is a synchronous call |
| 10750 | \param hHal - The handle returned by macOpen |
| 10751 | \param pHandoffInfo - info provided by HDD with the handoff request (namely: |
| 10752 | BSSID, channel etc.) |
| 10753 | \return eHAL_STATUS_SUCCESS - SME passed the request to CSR successfully. |
| 10754 | Other status means SME is failed to send the request. |
| 10755 | \sa |
| 10756 | --------------------------------------------------------------------------*/ |
| 10757 | |
| 10758 | eHalStatus sme_HandoffRequest(tHalHandle hHal, |
| 10759 | tCsrHandoffRequest *pHandoffInfo) |
| 10760 | { |
| 10761 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10762 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10763 | |
| 10764 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 10765 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 10766 | { |
| 10767 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10768 | "%s: invoked", __func__); |
| 10769 | status = csrHandoffRequest(pMac, pHandoffInfo); |
| 10770 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10771 | } |
| 10772 | |
| 10773 | return status ; |
| 10774 | } |
| 10775 | #endif |
| 10776 | |
Sudhir Sattayappa Kohalli | b1d8c3a | 2013-06-18 14:47:20 -0700 | [diff] [blame] | 10777 | /* |
| 10778 | * SME API to check if there is any infra station or |
| 10779 | * P2P client is connected |
| 10780 | */ |
| 10781 | VOS_STATUS sme_isSta_p2p_clientConnected(tHalHandle hHal) |
| 10782 | { |
| 10783 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10784 | if(csrIsInfraConnected(pMac)) |
| 10785 | { |
| 10786 | return VOS_STATUS_SUCCESS; |
| 10787 | } |
| 10788 | return VOS_STATUS_E_FAILURE; |
| 10789 | } |
| 10790 | |
Agarwal Ashish | 57e8437 | 2014-12-05 18:26:53 +0530 | [diff] [blame] | 10791 | /* |
| 10792 | * SME API to check if any sessoion connected. |
| 10793 | */ |
| 10794 | VOS_STATUS sme_is_any_session_connected(tHalHandle hHal) |
| 10795 | { |
| 10796 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10797 | if(csrIsAnySessionConnected(pMac)) |
| 10798 | { |
| 10799 | |
| 10800 | return VOS_STATUS_SUCCESS; |
| 10801 | } |
| 10802 | return VOS_STATUS_E_FAILURE; |
| 10803 | } |
| 10804 | |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10805 | |
| 10806 | #ifdef FEATURE_WLAN_LPHB |
| 10807 | /* --------------------------------------------------------------------------- |
| 10808 | \fn sme_LPHBConfigReq |
| 10809 | \API to make configuration LPHB within FW. |
| 10810 | \param hHal - The handle returned by macOpen |
| 10811 | \param lphdReq - LPHB request argument by client |
| 10812 | \param pCallbackfn - LPHB timeout notification callback function pointer |
| 10813 | \- return Configuration message posting status, SUCCESS or Fail |
| 10814 | -------------------------------------------------------------------------*/ |
| 10815 | eHalStatus sme_LPHBConfigReq |
| 10816 | ( |
| 10817 | tHalHandle hHal, |
| 10818 | tSirLPHBReq *lphdReq, |
| 10819 | void (*pCallbackfn)(void *pAdapter, void *indParam) |
| 10820 | ) |
| 10821 | { |
| 10822 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10823 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 10824 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10825 | vos_msg_t vosMessage; |
| 10826 | |
| 10827 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 10828 | if (eHAL_STATUS_SUCCESS == status) |
| 10829 | { |
| 10830 | if ((LPHB_SET_EN_PARAMS_INDID == lphdReq->cmd) && |
| 10831 | (NULL == pCallbackfn) && |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 10832 | (NULL == pMac->sme.pLphbIndCb)) |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10833 | { |
| 10834 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10835 | "%s: Indication Call back did not registered", __func__); |
| 10836 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10837 | return eHAL_STATUS_FAILURE; |
| 10838 | } |
| 10839 | else if (NULL != pCallbackfn) |
| 10840 | { |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 10841 | pMac->sme.pLphbIndCb = pCallbackfn; |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10842 | } |
| 10843 | |
| 10844 | /* serialize the req through MC thread */ |
| 10845 | vosMessage.bodyptr = lphdReq; |
| 10846 | vosMessage.type = WDA_LPHB_CONF_REQ; |
| 10847 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 10848 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 10849 | { |
| 10850 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10851 | "%s: Post Config LPHB MSG fail", __func__); |
| 10852 | status = eHAL_STATUS_FAILURE; |
| 10853 | } |
| 10854 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10855 | } |
| 10856 | |
| 10857 | return(status); |
| 10858 | } |
| 10859 | #endif /* FEATURE_WLAN_LPHB */ |
Sudhir Sattayappa Kohalli | 3762069 | 2013-08-05 14:02:26 -0700 | [diff] [blame] | 10860 | /*-------------------------------------------------------------------------- |
| 10861 | \brief sme_enable_disable_split_scan() - a wrapper function to set the split |
| 10862 | scan parameter. |
| 10863 | This is a synchronous call |
| 10864 | \param hHal - The handle returned by macOpen |
| 10865 | \return NONE. |
| 10866 | \sa |
| 10867 | --------------------------------------------------------------------------*/ |
| 10868 | void sme_enable_disable_split_scan (tHalHandle hHal, tANI_U8 nNumStaChan, |
| 10869 | tANI_U8 nNumP2PChan) |
| 10870 | { |
| 10871 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10872 | |
| 10873 | pMac->roam.configParam.nNumStaChanCombinedConc = nNumStaChan; |
| 10874 | pMac->roam.configParam.nNumP2PChanCombinedConc = nNumP2PChan; |
| 10875 | |
| 10876 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10877 | "%s: SCAN nNumStaChanCombinedConc : %d," |
| 10878 | "nNumP2PChanCombinedConc : %d ", |
| 10879 | __func__, nNumStaChan, nNumP2PChan); |
| 10880 | |
| 10881 | return; |
| 10882 | |
| 10883 | } |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10884 | |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 10885 | /* --------------------------------------------------------------------------- |
| 10886 | \fn sme_AddPeriodicTxPtrn |
| 10887 | \brief API to Periodic TX Pattern Offload feature |
| 10888 | \param hHal - The handle returned by macOpen |
| 10889 | \param addPeriodicTxPtrnParams - Pointer to the add pattern structure |
| 10890 | \return eHalStatus |
| 10891 | ---------------------------------------------------------------------------*/ |
| 10892 | eHalStatus sme_AddPeriodicTxPtrn(tHalHandle hHal, tSirAddPeriodicTxPtrn |
| 10893 | *addPeriodicTxPtrnParams) |
| 10894 | { |
| 10895 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10896 | eHalStatus status; |
| 10897 | vos_msg_t msg; |
| 10898 | |
| 10899 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 10900 | { |
| 10901 | msg.type = WDA_ADD_PERIODIC_TX_PTRN_IND; |
| 10902 | msg.bodyptr = addPeriodicTxPtrnParams; |
| 10903 | |
| 10904 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 10905 | { |
| 10906 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 10907 | "to post WDA_ADD_PERIODIC_TX_PTRN_IND to WDA!", |
| 10908 | __func__); |
| 10909 | |
| 10910 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10911 | return eHAL_STATUS_FAILURE; |
| 10912 | } |
| 10913 | |
| 10914 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10915 | return eHAL_STATUS_SUCCESS; |
| 10916 | } |
| 10917 | |
| 10918 | return status; |
| 10919 | } |
| 10920 | |
| 10921 | /* --------------------------------------------------------------------------- |
| 10922 | \fn sme_DelPeriodicTxPtrn |
| 10923 | \brief API to Periodic TX Pattern Offload feature |
| 10924 | \param hHal - The handle returned by macOpen |
| 10925 | \param delPeriodicTxPtrnParams - Pointer to the delete pattern structure |
| 10926 | \return eHalStatus |
| 10927 | ---------------------------------------------------------------------------*/ |
| 10928 | eHalStatus sme_DelPeriodicTxPtrn(tHalHandle hHal, tSirDelPeriodicTxPtrn |
| 10929 | *delPeriodicTxPtrnParams) |
| 10930 | { |
| 10931 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10932 | eHalStatus status; |
| 10933 | vos_msg_t msg; |
| 10934 | |
| 10935 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 10936 | { |
| 10937 | msg.type = WDA_DEL_PERIODIC_TX_PTRN_IND; |
| 10938 | msg.bodyptr = delPeriodicTxPtrnParams; |
| 10939 | |
| 10940 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 10941 | { |
| 10942 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 10943 | "to post WDA_DEL_PERIODIC_TX_PTRN_IND to WDA!", |
| 10944 | __func__); |
| 10945 | |
| 10946 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10947 | return eHAL_STATUS_FAILURE; |
| 10948 | } |
| 10949 | |
| 10950 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10951 | return eHAL_STATUS_SUCCESS; |
| 10952 | } |
| 10953 | |
| 10954 | return status; |
| 10955 | } |
| 10956 | |
Tushnim Bhattacharyya | ad37df1 | 2013-10-02 12:01:33 -0700 | [diff] [blame] | 10957 | void smeGetCommandQStatus( tHalHandle hHal ) |
| 10958 | { |
| 10959 | tSmeCmd *pTempCmd = NULL; |
| 10960 | tListElem *pEntry; |
| 10961 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10962 | |
| 10963 | if (NULL == pMac) |
| 10964 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 10965 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 10966 | "%s: pMac is null", __func__); |
Tushnim Bhattacharyya | ad37df1 | 2013-10-02 12:01:33 -0700 | [diff] [blame] | 10967 | return; |
| 10968 | } |
| 10969 | |
| 10970 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK ); |
| 10971 | if( pEntry ) |
| 10972 | { |
| 10973 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 10974 | } |
| 10975 | smsLog( pMac, LOGE, "Currently smeCmdActiveList has command (0x%X)", |
| 10976 | (pTempCmd) ? pTempCmd->command : eSmeNoCommand ); |
| 10977 | if(pTempCmd) |
| 10978 | { |
| 10979 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 10980 | { |
| 10981 | //CSR command is stuck. See what the reason code is for that command |
| 10982 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 10983 | } |
| 10984 | } //if(pTempCmd) |
| 10985 | |
| 10986 | smsLog( pMac, LOGE, "Currently smeCmdPendingList has %d commands", |
| 10987 | csrLLCount(&pMac->sme.smeCmdPendingList)); |
| 10988 | |
| 10989 | smsLog( pMac, LOGE, "Currently roamCmdPendingList has %d commands", |
| 10990 | csrLLCount(&pMac->roam.roamCmdPendingList)); |
| 10991 | |
| 10992 | return; |
| 10993 | } |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 10994 | |
| 10995 | #ifdef FEATURE_WLAN_BATCH_SCAN |
| 10996 | /* --------------------------------------------------------------------------- |
| 10997 | \fn sme_SetBatchScanReq |
| 10998 | \brief API to set batch scan request in FW |
| 10999 | \param hHal - The handle returned by macOpen. |
| 11000 | \param pRequest - Pointer to the batch request. |
| 11001 | \param sessionId - session ID |
| 11002 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 11003 | getting set batch scan response from FW |
| 11004 | \param callbackContext - pAdapter context |
| 11005 | \return eHalStatus |
| 11006 | ---------------------------------------------------------------------------*/ |
| 11007 | eHalStatus sme_SetBatchScanReq |
| 11008 | ( |
| 11009 | tHalHandle hHal, tSirSetBatchScanReq *pRequest, tANI_U8 sessionId, |
| 11010 | void (*callbackRoutine) (void *callbackCtx, tSirSetBatchScanRsp *pRsp), |
| 11011 | void *callbackContext |
| 11012 | ) |
| 11013 | { |
| 11014 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11015 | eHalStatus status; |
| 11016 | |
Yue Ma | e36e355 | 2014-03-05 17:06:20 -0800 | [diff] [blame] | 11017 | if (!pMac) |
| 11018 | { |
| 11019 | return eHAL_STATUS_FAILURE; |
| 11020 | } |
| 11021 | |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 11022 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 11023 | { |
| 11024 | status = pmcSetBatchScanReq(hHal, pRequest, sessionId, callbackRoutine, |
| 11025 | callbackContext); |
| 11026 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11027 | } |
| 11028 | |
| 11029 | return status; |
| 11030 | } |
| 11031 | |
| 11032 | /* --------------------------------------------------------------------------- |
Chittajit Mitra | f5413a4 | 2013-10-18 14:20:08 -0700 | [diff] [blame] | 11033 | \fn sme_SendRateUpdateInd |
| 11034 | \brief API to Update rate |
| 11035 | \param hHal - The handle returned by macOpen |
| 11036 | \param rateUpdateParams - Pointer to rate update params |
| 11037 | \return eHalStatus |
| 11038 | ---------------------------------------------------------------------------*/ |
| 11039 | eHalStatus sme_SendRateUpdateInd(tHalHandle hHal, tSirRateUpdateInd *rateUpdateParams) |
| 11040 | { |
| 11041 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11042 | eHalStatus status; |
| 11043 | vos_msg_t msg; |
| 11044 | |
| 11045 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 11046 | { |
| 11047 | msg.type = WDA_RATE_UPDATE_IND; |
| 11048 | msg.bodyptr = rateUpdateParams; |
| 11049 | |
| 11050 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 11051 | { |
| 11052 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 11053 | "to post WDA_SET_RMC_RATE_IND to WDA!", |
| 11054 | __func__); |
| 11055 | |
| 11056 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11057 | return eHAL_STATUS_FAILURE; |
| 11058 | } |
| 11059 | |
| 11060 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11061 | return eHAL_STATUS_SUCCESS; |
| 11062 | } |
| 11063 | |
| 11064 | return status; |
| 11065 | } |
| 11066 | |
| 11067 | /* --------------------------------------------------------------------------- |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 11068 | \fn sme_TriggerBatchScanResultInd |
| 11069 | \brief API to trigger batch scan result indications from FW |
| 11070 | \param hHal - The handle returned by macOpen. |
| 11071 | \param pRequest - Pointer to get batch request. |
| 11072 | \param sessionId - session ID |
| 11073 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 11074 | getting batch scan result indication from FW |
| 11075 | \param callbackContext - pAdapter context |
| 11076 | \return eHalStatus |
| 11077 | ---------------------------------------------------------------------------*/ |
| 11078 | eHalStatus sme_TriggerBatchScanResultInd |
| 11079 | ( |
| 11080 | tHalHandle hHal, tSirTriggerBatchScanResultInd *pRequest, tANI_U8 sessionId, |
| 11081 | void (*callbackRoutine) (void *callbackCtx, void *pRsp), |
| 11082 | void *callbackContext |
| 11083 | ) |
| 11084 | { |
| 11085 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11086 | eHalStatus status; |
| 11087 | |
| 11088 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 11089 | { |
| 11090 | status = pmcTriggerBatchScanResultInd(hHal, pRequest, sessionId, |
| 11091 | callbackRoutine, callbackContext); |
| 11092 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11093 | } |
| 11094 | |
| 11095 | return status; |
| 11096 | } |
| 11097 | |
| 11098 | |
| 11099 | /* --------------------------------------------------------------------------- |
| 11100 | \fn sme_StopBatchScanInd |
| 11101 | \brief API to stop batch scan request in FW |
| 11102 | \param hHal - The handle returned by macOpen. |
| 11103 | \param pRequest - Pointer to the batch request. |
| 11104 | \param sessionId - session ID |
| 11105 | \return eHalStatus |
| 11106 | ---------------------------------------------------------------------------*/ |
| 11107 | eHalStatus sme_StopBatchScanInd |
| 11108 | ( |
| 11109 | tHalHandle hHal, tSirStopBatchScanInd *pRequest, tANI_U8 sessionId |
| 11110 | ) |
| 11111 | { |
| 11112 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11113 | eHalStatus status; |
| 11114 | |
| 11115 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 11116 | { |
| 11117 | status = pmcStopBatchScanInd(hHal, pRequest, sessionId); |
| 11118 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11119 | } |
| 11120 | |
| 11121 | return status; |
| 11122 | } |
| 11123 | |
| 11124 | #endif |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 11125 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 11126 | |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 11127 | #ifdef FEATURE_WLAN_CH_AVOID |
| 11128 | /* --------------------------------------------------------------------------- |
| 11129 | \fn sme_AddChAvoidCallback |
| 11130 | \brief Used to plug in callback function |
| 11131 | Which notify channel may not be used with SAP or P2PGO mode. |
| 11132 | Notification come from FW. |
| 11133 | \param hHal |
| 11134 | \param pCallbackfn : callback function pointer should be plugged in |
| 11135 | \- return eHalStatus |
| 11136 | -------------------------------------------------------------------------*/ |
| 11137 | eHalStatus sme_AddChAvoidCallback |
| 11138 | ( |
| 11139 | tHalHandle hHal, |
| 11140 | void (*pCallbackfn)(void *pAdapter, void *indParam) |
| 11141 | ) |
| 11142 | { |
| 11143 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11144 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11145 | |
| 11146 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 11147 | "%s: Plug in CH AVOID CB", __func__); |
| 11148 | |
| 11149 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 11150 | if (eHAL_STATUS_SUCCESS == status) |
| 11151 | { |
| 11152 | if (NULL != pCallbackfn) |
| 11153 | { |
| 11154 | pMac->sme.pChAvoidNotificationCb = pCallbackfn; |
| 11155 | } |
| 11156 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11157 | } |
| 11158 | |
| 11159 | return(status); |
| 11160 | } |
| 11161 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 11162 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 11163 | void activeListCmdTimeoutHandle(void *userData) |
| 11164 | { |
| 11165 | if (NULL == userData) |
| 11166 | return; |
| 11167 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11168 | "%s: Active List command timeout Cmd List Count %d", __func__, |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 11169 | csrLLCount(&((tpAniSirGlobal) userData)->sme.smeCmdActiveList) ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 11170 | smeGetCommandQStatus((tHalHandle) userData); |
| 11171 | } |
| 11172 | |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11173 | #ifdef WLAN_FEATURE_LINK_LAYER_STATS |
| 11174 | |
| 11175 | /* --------------------------------------------------------------------------- |
| 11176 | \fn sme_LLStatsSetReq |
| 11177 | \brief API to set link layer stats request to FW |
| 11178 | \param hHal - The handle returned by macOpen. |
| 11179 | |
| 11180 | \Param pStatsReq - a pointer to a caller allocated object of |
| 11181 | typedef struct tSirLLStatsSetReq, signifying the parameters to link layer |
| 11182 | stats set. |
| 11183 | |
| 11184 | \return eHalStatus |
| 11185 | ---------------------------------------------------------------------------*/ |
| 11186 | eHalStatus sme_LLStatsSetReq(tHalHandle hHal, |
| 11187 | tSirLLStatsSetReq *pLinkLayerStatsSetReq) |
| 11188 | { |
| 11189 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11190 | vos_msg_t msg; |
| 11191 | eHalStatus status = eHAL_STATUS_FAILURE; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11192 | tSirLLStatsSetReq *plinkLayerSetReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11193 | |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11194 | plinkLayerSetReq = vos_mem_malloc(sizeof(*plinkLayerSetReq)); |
| 11195 | if ( !plinkLayerSetReq) |
| 11196 | { |
| 11197 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11198 | "%s: Not able to allocate memory for " |
| 11199 | "WDA_LINK_LAYER_STATS_SET_REQ", |
| 11200 | __func__); |
| 11201 | return eHAL_STATUS_FAILURE; |
| 11202 | } |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11203 | |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11204 | *plinkLayerSetReq = *pLinkLayerStatsSetReq; |
| 11205 | |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11206 | |
| 11207 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 11208 | { |
| 11209 | msg.type = WDA_LINK_LAYER_STATS_SET_REQ; |
| 11210 | msg.reserved = 0; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11211 | msg.bodyptr = plinkLayerSetReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11212 | |
| 11213 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 11214 | { |
| 11215 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 11216 | "Not able to post SIR_HAL_LL_STATS_SET message to HAL", __func__); |
| 11217 | status = eHAL_STATUS_FAILURE; |
| 11218 | } |
| 11219 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11220 | } |
| 11221 | else |
| 11222 | { |
| 11223 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 11224 | "sme_AcquireGlobalLock error", __func__); |
| 11225 | } |
| 11226 | return status; |
| 11227 | } |
| 11228 | |
| 11229 | /* --------------------------------------------------------------------------- |
| 11230 | \fn sme_LLStatsGetReq |
| 11231 | \brief API to get link layer stats request to FW |
| 11232 | \param hHal - The handle returned by macOpen. |
| 11233 | |
| 11234 | \Param pStatsReq - a pointer to a caller allocated object of |
| 11235 | typedef struct tSirLLStatsGetReq, signifying the parameters to link layer |
| 11236 | stats get. |
| 11237 | |
| 11238 | \return eHalStatus |
| 11239 | ---------------------------------------------------------------------------*/ |
| 11240 | eHalStatus sme_LLStatsGetReq(tHalHandle hHal, |
| 11241 | tSirLLStatsGetReq *pLinkLayerStatsGetReq) |
| 11242 | { |
| 11243 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11244 | vos_msg_t msg; |
| 11245 | eHalStatus status = eHAL_STATUS_FAILURE; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11246 | tSirLLStatsGetReq *pGetStatsReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11247 | |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11248 | pGetStatsReq = vos_mem_malloc(sizeof(*pGetStatsReq)); |
| 11249 | if ( !pGetStatsReq) |
| 11250 | { |
| 11251 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11252 | "%s: Not able to allocate memory for " |
| 11253 | "WDA_LINK_LAYER_STATS_GET_REQ", |
| 11254 | __func__); |
| 11255 | return eHAL_STATUS_FAILURE; |
| 11256 | } |
| 11257 | *pGetStatsReq = *pLinkLayerStatsGetReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11258 | |
| 11259 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 11260 | { |
| 11261 | msg.type = WDA_LINK_LAYER_STATS_GET_REQ; |
| 11262 | msg.reserved = 0; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11263 | msg.bodyptr = pGetStatsReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11264 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 11265 | { |
| 11266 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 11267 | "Not able to post SIR_HAL_LL_STATS_GET message to HAL", __func__); |
| 11268 | status = eHAL_STATUS_FAILURE; |
| 11269 | } |
| 11270 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11271 | } |
| 11272 | else |
| 11273 | { |
| 11274 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 11275 | "sme_AcquireGlobalLock error", __func__); |
| 11276 | } |
| 11277 | return status; |
| 11278 | } |
| 11279 | |
| 11280 | /* --------------------------------------------------------------------------- |
| 11281 | \fn sme_LLStatsClearReq |
| 11282 | \brief API to clear link layer stats request to FW |
| 11283 | \param hHal - The handle returned by macOpen. |
| 11284 | |
| 11285 | \Param pStatsReq - a pointer to a caller allocated object of |
| 11286 | typedef struct tSirLLStatsClearReq, signifying the parameters to link layer |
| 11287 | stats clear. |
| 11288 | |
| 11289 | \return eHalStatus |
| 11290 | ---------------------------------------------------------------------------*/ |
| 11291 | eHalStatus sme_LLStatsClearReq(tHalHandle hHal, |
| 11292 | tSirLLStatsClearReq *pLinkLayerStatsClear) |
| 11293 | { |
| 11294 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11295 | vos_msg_t msg; |
| 11296 | eHalStatus status = eHAL_STATUS_FAILURE; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11297 | tSirLLStatsClearReq *pClearStatsReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11298 | |
| 11299 | |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11300 | |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11301 | pClearStatsReq = vos_mem_malloc(sizeof(*pClearStatsReq)); |
| 11302 | if ( !pClearStatsReq) |
| 11303 | { |
| 11304 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11305 | "%s: Not able to allocate memory for " |
| 11306 | "WDA_LINK_LAYER_STATS_CLEAR_REQ", |
| 11307 | __func__); |
| 11308 | return eHAL_STATUS_FAILURE; |
| 11309 | } |
| 11310 | |
| 11311 | *pClearStatsReq = *pLinkLayerStatsClear; |
| 11312 | |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11313 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 11314 | { |
| 11315 | msg.type = WDA_LINK_LAYER_STATS_CLEAR_REQ; |
| 11316 | msg.reserved = 0; |
Dino Mycle | df0a5d9 | 2014-07-04 09:41:55 +0530 | [diff] [blame] | 11317 | msg.bodyptr = pClearStatsReq; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11318 | |
| 11319 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 11320 | { |
| 11321 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 11322 | "Not able to post SIR_HAL_LL_STATS_CLEAR message to HAL", __func__); |
| 11323 | status = eHAL_STATUS_FAILURE; |
| 11324 | } |
| 11325 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11326 | } |
| 11327 | else |
| 11328 | { |
| 11329 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
| 11330 | "sme_AcquireGlobalLock error", __func__); |
| 11331 | } |
| 11332 | |
| 11333 | return status; |
| 11334 | } |
| 11335 | |
| 11336 | /* --------------------------------------------------------------------------- |
| 11337 | \fn sme_SetLinkLayerStatsIndCB |
| 11338 | \brief API to trigger Link Layer Statistic indications from FW |
| 11339 | \param hHal - The handle returned by macOpen. |
| 11340 | \param sessionId - session ID |
| 11341 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 11342 | getting Link Layer Statistics from FW |
| 11343 | \param callbackContext - pAdapter context |
| 11344 | \return eHalStatus |
| 11345 | ---------------------------------------------------------------------------*/ |
| 11346 | eHalStatus sme_SetLinkLayerStatsIndCB |
| 11347 | ( |
Dino Mycle | d3d5002 | 2014-07-07 12:58:25 +0530 | [diff] [blame] | 11348 | tHalHandle hHal, |
| 11349 | void (*callbackRoutine) (void *callbackCtx, int indType, void *pRsp, |
| 11350 | tANI_U8 *macAddr) |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11351 | ) |
| 11352 | { |
| 11353 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11354 | eHalStatus status; |
| 11355 | |
| 11356 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 11357 | { |
| 11358 | if (NULL != callbackRoutine) |
| 11359 | { |
| 11360 | pMac->sme.pLinkLayerStatsIndCallback = callbackRoutine; |
Sunil Dutt | c69bccb | 2014-05-26 21:30:20 +0530 | [diff] [blame] | 11361 | } |
| 11362 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 11363 | } |
| 11364 | |
| 11365 | return status; |
| 11366 | } |
| 11367 | #endif /* WLAN_FEATURE_LINK_LAYER_STATS */ |
| 11368 | |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 11369 | eHalStatus sme_UpdateConnectDebug(tHalHandle hHal, tANI_U32 set_value) |
| 11370 | { |
| 11371 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11372 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11373 | pMac->fEnableDebugLog = set_value; |
| 11374 | return (status); |
| 11375 | } |
| 11376 | |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11377 | VOS_STATUS sme_UpdateDSCPtoUPMapping( tHalHandle hHal, |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11378 | sme_QosWmmUpType *dscpmapping, |
| 11379 | v_U8_t sessionId ) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11380 | { |
| 11381 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11382 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11383 | v_U8_t i, j, peSessionId; |
| 11384 | tCsrRoamSession *pCsrSession = NULL; |
| 11385 | tpPESession pSession = NULL; |
| 11386 | |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11387 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 11388 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 11389 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11390 | if (!CSR_IS_SESSION_VALID( pMac, sessionId )) |
| 11391 | { |
| 11392 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11393 | "%s: Invalid session Id %u", __func__, sessionId); |
| 11394 | sme_ReleaseGlobalLock( &pMac->sme); |
| 11395 | return eHAL_STATUS_FAILURE; |
| 11396 | } |
| 11397 | pCsrSession = CSR_GET_SESSION( pMac, sessionId ); |
| 11398 | |
| 11399 | if (pCsrSession == NULL) |
| 11400 | { |
| 11401 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11402 | "%s: CSR Session lookup fails %u", __func__, sessionId); |
| 11403 | sme_ReleaseGlobalLock( &pMac->sme); |
| 11404 | return eHAL_STATUS_FAILURE; |
| 11405 | } |
| 11406 | |
| 11407 | pSession = peFindSessionByBssid( pMac, |
| 11408 | pCsrSession->connectedProfile.bssid, &peSessionId ); |
| 11409 | |
| 11410 | if (pSession == NULL) |
| 11411 | { |
| 11412 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11413 | "%s: Session lookup fails for BSSID", __func__); |
| 11414 | sme_ReleaseGlobalLock( &pMac->sme); |
| 11415 | return eHAL_STATUS_FAILURE; |
| 11416 | } |
| 11417 | |
| 11418 | if ( !pSession->QosMapSet.present ) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11419 | { |
| 11420 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11421 | "%s: QOS Mapping IE not present", __func__); |
| 11422 | sme_ReleaseGlobalLock( &pMac->sme); |
| 11423 | return eHAL_STATUS_FAILURE; |
| 11424 | } |
| 11425 | else |
| 11426 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11427 | 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] | 11428 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11429 | for (j = pSession->QosMapSet.dscp_range[i][0]; |
| 11430 | j <= pSession->QosMapSet.dscp_range[i][1]; j++) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11431 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11432 | if ((pSession->QosMapSet.dscp_range[i][0] == 255) && |
| 11433 | (pSession->QosMapSet.dscp_range[i][1] == 255)) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11434 | { |
| 11435 | dscpmapping[j]= 0; |
| 11436 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11437 | "%s: User Priority %d is not used in mapping", |
| 11438 | __func__, i); |
| 11439 | break; |
| 11440 | } |
| 11441 | else |
| 11442 | { |
| 11443 | dscpmapping[j]= i; |
| 11444 | } |
| 11445 | } |
| 11446 | } |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11447 | 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] | 11448 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11449 | if (pSession->QosMapSet.dscp_exceptions[i][0] != 255) |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11450 | { |
Kumar Anand | 82c009f | 2014-05-29 00:29:42 -0700 | [diff] [blame] | 11451 | dscpmapping[pSession->QosMapSet.dscp_exceptions[i][0] ] = |
| 11452 | pSession->QosMapSet.dscp_exceptions[i][1]; |
Leela Venkata Kiran Kumar Reddy Chirala | 8e69fbc | 2013-10-30 18:51:13 -0700 | [diff] [blame] | 11453 | } |
| 11454 | } |
| 11455 | } |
| 11456 | } |
| 11457 | sme_ReleaseGlobalLock( &pMac->sme); |
| 11458 | return status; |
| 11459 | } |
Agarwal Ashish | 5e41479 | 2014-06-08 15:25:23 +0530 | [diff] [blame] | 11460 | |
Agarwal Ashish | 5e41479 | 2014-06-08 15:25:23 +0530 | [diff] [blame] | 11461 | tANI_BOOLEAN sme_Is11dCountrycode(tHalHandle hHal) |
| 11462 | { |
| 11463 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 11464 | |
| 11465 | if (VOS_TRUE == vos_mem_compare(pMac->scan.countryCodeCurrent, |
| 11466 | pMac->scan.countryCode11d, 2)) |
| 11467 | { |
| 11468 | return eANI_BOOLEAN_TRUE; |
| 11469 | } |
| 11470 | else |
| 11471 | { |
| 11472 | return eANI_BOOLEAN_FALSE; |
| 11473 | } |
| 11474 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11475 | |
Siddharth Bhal | d8a95e8 | 2015-02-12 20:14:52 +0530 | [diff] [blame^] | 11476 | eHalStatus sme_SpoofMacAddrReq(tHalHandle hHal, v_MACADDR_t *macaddr) |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 11477 | { |
Siddharth Bhal | d8a95e8 | 2015-02-12 20:14:52 +0530 | [diff] [blame^] | 11478 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11479 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11480 | tSmeCmd *pMacSpoofCmd; |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 11481 | |
Siddharth Bhal | d8a95e8 | 2015-02-12 20:14:52 +0530 | [diff] [blame^] | 11482 | pMacSpoofCmd = csrGetCommandBuffer(pMac); |
| 11483 | if (pMacSpoofCmd) |
| 11484 | { |
| 11485 | pMacSpoofCmd->command = eSmeCommandMacSpoofRequest; |
| 11486 | vos_mem_set(&pMacSpoofCmd->u.macAddrSpoofCmd, |
| 11487 | sizeof(tSirSpoofMacAddrReq), 0); |
| 11488 | vos_mem_copy(pMacSpoofCmd->u.macAddrSpoofCmd.macAddr, |
| 11489 | macaddr->bytes, VOS_MAC_ADDRESS_LEN); |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 11490 | |
Siddharth Bhal | d8a95e8 | 2015-02-12 20:14:52 +0530 | [diff] [blame^] | 11491 | status = csrQueueSmeCommand(pMac, pMacSpoofCmd, eANI_BOOLEAN_TRUE); |
| 11492 | if ( !HAL_STATUS_SUCCESS( status ) ) |
| 11493 | { |
| 11494 | smsLog( pMac, LOGE, FL("fail to send msg status = %d\n"), status ); |
| 11495 | csrReleaseCommandScan(pMac, pMacSpoofCmd); |
| 11496 | } |
| 11497 | } |
| 11498 | else |
| 11499 | { |
| 11500 | //log error |
| 11501 | smsLog(pMac, LOGE, FL("can not obtain a common buffer\n")); |
| 11502 | status = eHAL_STATUS_RESOURCES; |
| 11503 | } |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 11504 | |
Siddharth Bhal | d8a95e8 | 2015-02-12 20:14:52 +0530 | [diff] [blame^] | 11505 | return (status); |
Siddharth Bhal | 6af5d4e | 2014-09-29 21:11:16 +0530 | [diff] [blame] | 11506 | } |
| 11507 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11508 | #ifdef WLAN_FEATURE_EXTSCAN |
| 11509 | /* --------------------------------------------------------------------------- |
| 11510 | \fn sme_GetValidChannelsByBand |
| 11511 | \brief SME API to fetch all valid channel filtered by band |
| 11512 | \param hHal |
| 11513 | \param wifiBand: RF band information |
| 11514 | \param aValidChannels: Array to store channel info |
| 11515 | \param len: number of channels |
| 11516 | \- return eHalStatus |
| 11517 | -------------------------------------------------------------------------*/ |
| 11518 | eHalStatus sme_GetValidChannelsByBand (tHalHandle hHal, tANI_U8 wifiBand, |
| 11519 | tANI_U32 *aValidChannels, tANI_U8 *pNumChannels) |
| 11520 | { |
| 11521 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11522 | tANI_U8 chanList[WNI_CFG_VALID_CHANNEL_LIST_LEN] = {0}; |
| 11523 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11524 | tANI_U8 numChannels = 0; |
| 11525 | tANI_U8 i = 0; |
| 11526 | tANI_U32 totValidChannels = WNI_CFG_VALID_CHANNEL_LIST_LEN; |
| 11527 | |
| 11528 | if (!aValidChannels || !pNumChannels) { |
| 11529 | smsLog(pMac, VOS_TRACE_LEVEL_ERROR, |
| 11530 | FL("Output channel list/NumChannels is NULL")); |
| 11531 | return eHAL_STATUS_INVALID_PARAMETER; |
| 11532 | } |
| 11533 | |
| 11534 | if ((wifiBand < WIFI_BAND_UNSPECIFIED) || (wifiBand >= WIFI_BAND_MAX)) { |
| 11535 | smsLog(pMac, VOS_TRACE_LEVEL_ERROR, |
| 11536 | FL("Invalid wifiBand (%d)"), wifiBand); |
| 11537 | return eHAL_STATUS_INVALID_PARAMETER; |
| 11538 | } |
| 11539 | |
| 11540 | status = sme_GetCfgValidChannels(hHal, &chanList[0], |
| 11541 | &totValidChannels); |
| 11542 | if (!HAL_STATUS_SUCCESS(status)) { |
| 11543 | smsLog(pMac, VOS_TRACE_LEVEL_ERROR, |
| 11544 | FL("Failed to get valid channel list (err=%d)"), status); |
| 11545 | return status; |
| 11546 | } |
| 11547 | |
| 11548 | switch (wifiBand) { |
| 11549 | case WIFI_BAND_UNSPECIFIED: |
| 11550 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, FL("Unspecified wifiBand, " |
| 11551 | "return all (%d) valid channels"), totValidChannels); |
| 11552 | numChannels = totValidChannels; |
| 11553 | for (i = 0; i < numChannels; i++) |
| 11554 | aValidChannels[i] = vos_chan_to_freq(chanList[i]); |
| 11555 | break; |
| 11556 | |
| 11557 | case WIFI_BAND_BG: |
| 11558 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, FL("WIFI_BAND_BG (2.4 GHz)")); |
| 11559 | for (i = 0; i < totValidChannels; i++) |
| 11560 | if (CSR_IS_CHANNEL_24GHZ(chanList[i])) |
| 11561 | aValidChannels[numChannels++] = |
| 11562 | vos_chan_to_freq(chanList[i]); |
| 11563 | break; |
| 11564 | |
| 11565 | case WIFI_BAND_A: |
| 11566 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 11567 | FL("WIFI_BAND_A (5 GHz without DFS)")); |
| 11568 | for (i = 0; i < totValidChannels; i++) |
| 11569 | if (CSR_IS_CHANNEL_5GHZ(chanList[i]) && |
| 11570 | !CSR_IS_CHANNEL_DFS(chanList[i])) |
| 11571 | aValidChannels[numChannels++] = |
| 11572 | vos_chan_to_freq(chanList[i]); |
| 11573 | break; |
| 11574 | |
| 11575 | case WIFI_BAND_ABG: |
| 11576 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 11577 | FL("WIFI_BAND_ABG (2.4 GHz + 5 GHz; no DFS)")); |
| 11578 | for (i = 0; i < totValidChannels; i++) |
| 11579 | if ((CSR_IS_CHANNEL_24GHZ(chanList[i]) || |
| 11580 | CSR_IS_CHANNEL_5GHZ(chanList[i])) && |
| 11581 | !CSR_IS_CHANNEL_DFS(chanList[i])) |
| 11582 | aValidChannels[numChannels++] = |
| 11583 | vos_chan_to_freq(chanList[i]); |
| 11584 | break; |
| 11585 | |
| 11586 | case WIFI_BAND_A_DFS_ONLY: |
| 11587 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 11588 | FL("WIFI_BAND_A_DFS (5 GHz DFS only)")); |
| 11589 | for (i = 0; i < totValidChannels; i++) |
| 11590 | if (CSR_IS_CHANNEL_5GHZ(chanList[i]) && |
| 11591 | CSR_IS_CHANNEL_DFS(chanList[i])) |
| 11592 | aValidChannels[numChannels++] = |
| 11593 | vos_chan_to_freq(chanList[i]); |
| 11594 | break; |
| 11595 | |
| 11596 | case WIFI_BAND_A_WITH_DFS: |
| 11597 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 11598 | FL("WIFI_BAND_A_WITH_DFS (5 GHz with DFS)")); |
| 11599 | for (i = 0; i < totValidChannels; i++) |
| 11600 | if (CSR_IS_CHANNEL_5GHZ(chanList[i])) |
| 11601 | aValidChannels[numChannels++] = |
| 11602 | vos_chan_to_freq(chanList[i]); |
| 11603 | break; |
| 11604 | |
| 11605 | case WIFI_BAND_ABG_WITH_DFS: |
| 11606 | smsLog(pMac, VOS_TRACE_LEVEL_INFO, |
| 11607 | FL("WIFI_BAND_ABG_WITH_DFS (2.4 GHz + 5 GHz with DFS)")); |
| 11608 | for (i = 0; i < totValidChannels; i++) |
| 11609 | if (CSR_IS_CHANNEL_24GHZ(chanList[i]) || |
| 11610 | CSR_IS_CHANNEL_5GHZ(chanList[i])) |
| 11611 | aValidChannels[numChannels++] = |
| 11612 | vos_chan_to_freq(chanList[i]); |
| 11613 | break; |
| 11614 | |
| 11615 | default: |
| 11616 | smsLog(pMac, VOS_TRACE_LEVEL_ERROR, |
| 11617 | FL("Unknown wifiBand (%d))"), wifiBand); |
| 11618 | return eHAL_STATUS_INVALID_PARAMETER; |
| 11619 | break; |
| 11620 | } |
| 11621 | *pNumChannels = numChannels; |
| 11622 | |
| 11623 | return status; |
| 11624 | } |
| 11625 | /* --------------------------------------------------------------------------- |
| 11626 | \fn sme_EXTScanGetCapabilities |
| 11627 | \brief SME API to fetch Extended Scan capabilities |
| 11628 | \param hHal |
| 11629 | \param pReq: Extended Scan capabilities structure |
| 11630 | \- return eHalStatus |
| 11631 | -------------------------------------------------------------------------*/ |
| 11632 | eHalStatus sme_EXTScanGetCapabilities (tHalHandle hHal, |
| 11633 | tSirGetEXTScanCapabilitiesReqParams *pReq) |
| 11634 | { |
| 11635 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11636 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11637 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11638 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11639 | tSirGetEXTScanCapabilitiesReqParams *pGetEXTScanCapabilitiesReq; |
| 11640 | |
| 11641 | pGetEXTScanCapabilitiesReq = |
| 11642 | vos_mem_malloc(sizeof(*pGetEXTScanCapabilitiesReq)); |
| 11643 | if ( !pGetEXTScanCapabilitiesReq) |
| 11644 | { |
| 11645 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11646 | "%s: Not able to allocate memory for " |
| 11647 | "WDA_EXTSCAN_GET_CAPABILITIES_REQ", |
| 11648 | __func__); |
| 11649 | return eHAL_STATUS_FAILURE; |
| 11650 | } |
| 11651 | |
| 11652 | *pGetEXTScanCapabilitiesReq = *pReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11653 | |
| 11654 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11655 | TRACE_CODE_SME_RX_HDD_EXTSCAN_GET_CAPABILITIES, NO_SESSION, 0)); |
| 11656 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11657 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11658 | vosMessage.bodyptr = pGetEXTScanCapabilitiesReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11659 | vosMessage.type = WDA_EXTSCAN_GET_CAPABILITIES_REQ; |
| 11660 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11661 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11662 | status = eHAL_STATUS_FAILURE; |
| 11663 | |
| 11664 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11665 | } |
| 11666 | return(status); |
| 11667 | } |
| 11668 | |
| 11669 | /* --------------------------------------------------------------------------- |
| 11670 | \fn sme_EXTScanStart |
| 11671 | \brief SME API to issue Extended Scan start |
| 11672 | \param hHal |
| 11673 | \param pStartCmd: Extended Scan start structure |
| 11674 | \- return eHalStatus |
| 11675 | -------------------------------------------------------------------------*/ |
| 11676 | eHalStatus sme_EXTScanStart (tHalHandle hHal, |
| 11677 | tSirEXTScanStartReqParams *pStartCmd) |
| 11678 | { |
| 11679 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11680 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11681 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11682 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11683 | tSirEXTScanStartReqParams *pextScanStartReq; |
| 11684 | |
| 11685 | pextScanStartReq = vos_mem_malloc(sizeof(*pextScanStartReq)); |
| 11686 | if ( !pextScanStartReq) |
| 11687 | { |
| 11688 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11689 | "%s: Not able to allocate memory for " |
| 11690 | "WDA_EXTSCAN_START_REQ", |
| 11691 | __func__); |
| 11692 | return eHAL_STATUS_FAILURE; |
| 11693 | } |
| 11694 | |
| 11695 | *pextScanStartReq = *pStartCmd; |
| 11696 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11697 | |
| 11698 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11699 | TRACE_CODE_SME_RX_HDD_EXTSCAN_START, NO_SESSION, 0)); |
| 11700 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11701 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11702 | vosMessage.bodyptr = pextScanStartReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11703 | vosMessage.type = WDA_EXTSCAN_START_REQ; |
| 11704 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11705 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11706 | status = eHAL_STATUS_FAILURE; |
| 11707 | |
| 11708 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11709 | } |
| 11710 | return(status); |
| 11711 | } |
| 11712 | |
| 11713 | /* --------------------------------------------------------------------------- |
| 11714 | \fn sme_EXTScanStop |
| 11715 | \brief SME API to issue Extended Scan stop |
| 11716 | \param hHal |
| 11717 | \param pStopReq: Extended Scan stop structure |
| 11718 | \- return eHalStatus |
| 11719 | -------------------------------------------------------------------------*/ |
| 11720 | eHalStatus sme_EXTScanStop(tHalHandle hHal, tSirEXTScanStopReqParams *pStopReq) |
| 11721 | { |
| 11722 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11723 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11724 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11725 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11726 | tSirEXTScanStopReqParams *pEXTScanStopReq; |
| 11727 | |
| 11728 | pEXTScanStopReq = vos_mem_malloc(sizeof(*pEXTScanStopReq)); |
| 11729 | if ( !pEXTScanStopReq) |
| 11730 | { |
| 11731 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11732 | "%s: Not able to allocate memory for " |
| 11733 | "WDA_EXTSCAN_STOP_REQ", |
| 11734 | __func__); |
| 11735 | return eHAL_STATUS_FAILURE; |
| 11736 | } |
| 11737 | |
| 11738 | *pEXTScanStopReq = *pStopReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11739 | |
| 11740 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11741 | TRACE_CODE_SME_RX_HDD_EXTSCAN_STOP, NO_SESSION, 0)); |
| 11742 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 11743 | { |
| 11744 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11745 | vosMessage.bodyptr = pEXTScanStopReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11746 | vosMessage.type = WDA_EXTSCAN_STOP_REQ; |
| 11747 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11748 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11749 | { |
| 11750 | status = eHAL_STATUS_FAILURE; |
| 11751 | } |
| 11752 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11753 | } |
| 11754 | return(status); |
| 11755 | } |
| 11756 | |
| 11757 | /* --------------------------------------------------------------------------- |
| 11758 | \fn sme_SetBssHotlist |
| 11759 | \brief SME API to set BSSID hotlist |
| 11760 | \param hHal |
| 11761 | \param pSetHotListReq: Extended Scan set hotlist structure |
| 11762 | \- return eHalStatus |
| 11763 | -------------------------------------------------------------------------*/ |
| 11764 | eHalStatus sme_SetBssHotlist (tHalHandle hHal, |
| 11765 | tSirEXTScanSetBssidHotListReqParams *pSetHotListReq) |
| 11766 | { |
| 11767 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11768 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11769 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11770 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11771 | tSirEXTScanSetBssidHotListReqParams *pEXTScanSetBssidHotlistReq; |
| 11772 | |
| 11773 | pEXTScanSetBssidHotlistReq = |
| 11774 | vos_mem_malloc(sizeof(*pEXTScanSetBssidHotlistReq)); |
| 11775 | if ( !pEXTScanSetBssidHotlistReq) |
| 11776 | { |
| 11777 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11778 | "%s: Not able to allocate memory for " |
| 11779 | "WDA_EXTSCAN_SET_BSSID_HOTLIST_REQ", |
| 11780 | __func__); |
| 11781 | return eHAL_STATUS_FAILURE; |
| 11782 | } |
| 11783 | |
| 11784 | *pEXTScanSetBssidHotlistReq = *pSetHotListReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11785 | |
| 11786 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11787 | TRACE_CODE_SME_RX_HDD_EXTSCAN_SET_BSS_HOTLIST, NO_SESSION, 0)); |
| 11788 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11789 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11790 | vosMessage.bodyptr = pEXTScanSetBssidHotlistReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11791 | vosMessage.type = WDA_EXTSCAN_SET_BSSID_HOTLIST_REQ; |
| 11792 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11793 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11794 | status = eHAL_STATUS_FAILURE; |
| 11795 | |
| 11796 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11797 | } |
| 11798 | |
| 11799 | return(status); |
| 11800 | } |
| 11801 | |
| 11802 | /* --------------------------------------------------------------------------- |
| 11803 | \fn sme_ResetBssHotlist |
| 11804 | \brief SME API to reset BSSID hotlist |
| 11805 | \param hHal |
| 11806 | \param pSetHotListReq: Extended Scan set hotlist structure |
| 11807 | \- return eHalStatus |
| 11808 | -------------------------------------------------------------------------*/ |
| 11809 | eHalStatus sme_ResetBssHotlist (tHalHandle hHal, |
| 11810 | tSirEXTScanResetBssidHotlistReqParams *pResetReq) |
| 11811 | { |
| 11812 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11813 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11814 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11815 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11816 | tSirEXTScanResetBssidHotlistReqParams *pEXTScanHotlistResetReq; |
| 11817 | |
| 11818 | pEXTScanHotlistResetReq = vos_mem_malloc(sizeof(*pEXTScanHotlistResetReq)); |
| 11819 | if ( !pEXTScanHotlistResetReq) |
| 11820 | { |
| 11821 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11822 | "%s: Not able to allocate memory for " |
| 11823 | "WDA_EXTSCAN_RESET_BSSID_HOTLIST_REQ", |
| 11824 | __func__); |
| 11825 | return eHAL_STATUS_FAILURE; |
| 11826 | } |
| 11827 | |
| 11828 | *pEXTScanHotlistResetReq = *pResetReq; |
| 11829 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11830 | |
| 11831 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11832 | TRACE_CODE_SME_RX_HDD_EXTSCAN_RESET_BSS_HOTLIST, NO_SESSION, 0)); |
| 11833 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11834 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11835 | vosMessage.bodyptr = pEXTScanHotlistResetReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11836 | vosMessage.type = WDA_EXTSCAN_RESET_BSSID_HOTLIST_REQ; |
| 11837 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11838 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11839 | status = eHAL_STATUS_FAILURE; |
| 11840 | |
| 11841 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11842 | } |
| 11843 | return(status); |
| 11844 | } |
| 11845 | |
| 11846 | /* --------------------------------------------------------------------------- |
| 11847 | \fn sme_SetSignificantChange |
| 11848 | \brief SME API to set significant change |
| 11849 | \param hHal |
| 11850 | \param pSetSignificantChangeReq: Extended Scan set significant change structure |
| 11851 | \- return eHalStatus |
| 11852 | -------------------------------------------------------------------------*/ |
| 11853 | eHalStatus sme_SetSignificantChange (tHalHandle hHal, |
| 11854 | tSirEXTScanSetSignificantChangeReqParams *pSetSignificantChangeReq) |
| 11855 | { |
| 11856 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11857 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11858 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11859 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11860 | tSirEXTScanSetSignificantChangeReqParams *pEXTScanSetSignificantReq; |
| 11861 | |
| 11862 | pEXTScanSetSignificantReq = vos_mem_malloc(sizeof(*pEXTScanSetSignificantReq)); |
| 11863 | if ( !pEXTScanSetSignificantReq) |
| 11864 | { |
| 11865 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11866 | "%s: Not able to allocate memory for " |
| 11867 | "WDA_EXTSCAN_SET_SIGNF_RSSI_CHANGE_REQ", |
| 11868 | __func__); |
| 11869 | return eHAL_STATUS_FAILURE; |
| 11870 | } |
| 11871 | |
| 11872 | *pEXTScanSetSignificantReq = *pSetSignificantChangeReq; |
| 11873 | |
| 11874 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11875 | |
| 11876 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11877 | TRACE_CODE_SME_RX_HDD_EXTSCAN_SET_SIGNF_CHANGE, NO_SESSION, 0)); |
| 11878 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11879 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11880 | vosMessage.bodyptr = pEXTScanSetSignificantReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11881 | vosMessage.type = WDA_EXTSCAN_SET_SIGNF_RSSI_CHANGE_REQ; |
| 11882 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11883 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11884 | status = eHAL_STATUS_FAILURE; |
| 11885 | |
| 11886 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11887 | } |
| 11888 | return(status); |
| 11889 | } |
| 11890 | |
| 11891 | /* --------------------------------------------------------------------------- |
| 11892 | \fn sme_ResetSignificantChange |
| 11893 | \brief SME API to reset significant change |
| 11894 | \param hHal |
| 11895 | \param pResetReq: Extended Scan reset significant change structure |
| 11896 | \- return eHalStatus |
| 11897 | -------------------------------------------------------------------------*/ |
| 11898 | eHalStatus sme_ResetSignificantChange (tHalHandle hHal, |
| 11899 | tSirEXTScanResetSignificantChangeReqParams *pResetReq) |
| 11900 | { |
| 11901 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11902 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11903 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11904 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11905 | tSirEXTScanResetSignificantChangeReqParams *pEXTScanResetSignificantReq; |
| 11906 | |
| 11907 | pEXTScanResetSignificantReq = |
| 11908 | vos_mem_malloc(sizeof(*pEXTScanResetSignificantReq)); |
| 11909 | if ( !pEXTScanResetSignificantReq) |
| 11910 | { |
| 11911 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11912 | "%s: Not able to allocate memory for " |
| 11913 | "WDA_EXTSCAN_RESET_SIGNF_RSSI_CHANGE_REQ", |
| 11914 | __func__); |
| 11915 | return eHAL_STATUS_FAILURE; |
| 11916 | } |
| 11917 | |
| 11918 | *pEXTScanResetSignificantReq = *pResetReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11919 | |
| 11920 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11921 | TRACE_CODE_SME_RX_HDD_EXTSCAN_RESET_SIGNF_CHANGE, NO_SESSION, 0)); |
| 11922 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11923 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11924 | vosMessage.bodyptr = pEXTScanResetSignificantReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11925 | vosMessage.type = WDA_EXTSCAN_RESET_SIGNF_RSSI_CHANGE_REQ; |
| 11926 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11927 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11928 | status = eHAL_STATUS_FAILURE; |
| 11929 | |
| 11930 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11931 | } |
| 11932 | return(status); |
| 11933 | } |
| 11934 | |
| 11935 | /* --------------------------------------------------------------------------- |
| 11936 | \fn sme_getCachedResults |
| 11937 | \brief SME API to get cached results |
| 11938 | \param hHal |
| 11939 | \param pCachedResultsReq: Extended Scan get cached results structure |
| 11940 | \- return eHalStatus |
| 11941 | -------------------------------------------------------------------------*/ |
| 11942 | eHalStatus sme_getCachedResults (tHalHandle hHal, |
| 11943 | tSirEXTScanGetCachedResultsReqParams *pCachedResultsReq) |
| 11944 | { |
| 11945 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11946 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 11947 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11948 | vos_msg_t vosMessage; |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11949 | tSirEXTScanGetCachedResultsReqParams *pEXTScanCachedResultsReq; |
| 11950 | |
| 11951 | pEXTScanCachedResultsReq = |
| 11952 | vos_mem_malloc(sizeof(*pEXTScanCachedResultsReq)); |
| 11953 | if ( !pEXTScanCachedResultsReq) |
| 11954 | { |
| 11955 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 11956 | "%s: Not able to allocate memory for " |
| 11957 | "WDA_EXTSCAN_GET_CACHED_RESULTS_REQ", |
| 11958 | __func__); |
| 11959 | return eHAL_STATUS_FAILURE; |
| 11960 | } |
| 11961 | |
| 11962 | *pEXTScanCachedResultsReq = *pCachedResultsReq; |
| 11963 | |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11964 | |
| 11965 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
| 11966 | TRACE_CODE_SME_RX_HDD_EXTSCAN_GET_CACHED_RESULTS, NO_SESSION, 0)); |
| 11967 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11968 | /* Serialize the req through MC thread */ |
Dino Mycle | e8843b3 | 2014-07-04 14:21:45 +0530 | [diff] [blame] | 11969 | vosMessage.bodyptr = pEXTScanCachedResultsReq; |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 11970 | vosMessage.type = WDA_EXTSCAN_GET_CACHED_RESULTS_REQ; |
| 11971 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 11972 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 11973 | status = eHAL_STATUS_FAILURE; |
| 11974 | |
| 11975 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11976 | } |
| 11977 | return(status); |
| 11978 | } |
| 11979 | |
| 11980 | eHalStatus sme_EXTScanRegisterCallback (tHalHandle hHal, |
| 11981 | void (*pEXTScanIndCb)(void *, const tANI_U16, void *), |
| 11982 | void *callbackContext) |
| 11983 | { |
| 11984 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 11985 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11986 | |
| 11987 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 11988 | pMac->sme.pEXTScanIndCb = pEXTScanIndCb; |
| 11989 | pMac->sme.pEXTScanCallbackContext = callbackContext; |
| 11990 | sme_ReleaseGlobalLock(&pMac->sme); |
| 11991 | } |
| 11992 | return(status); |
| 11993 | } |
| 11994 | |
Ganesh Kondabattini | 8f6e3b3 | 2014-08-25 16:07:54 +0530 | [diff] [blame] | 11995 | void sme_SetMiracastMode (tHalHandle hHal,tANI_U8 mode) |
| 11996 | { |
| 11997 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 11998 | |
| 11999 | pMac->miracast_mode = mode; |
| 12000 | } |
Dino Mycle | 2c19807 | 2014-06-10 10:15:52 +0530 | [diff] [blame] | 12001 | #endif /* WLAN_FEATURE_EXTSCAN */ |
c_hpothu | ef45bc3 | 2014-09-11 10:10:18 +0530 | [diff] [blame] | 12002 | |
| 12003 | void sme_resetCoexEevent(tHalHandle hHal) |
| 12004 | { |
| 12005 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 12006 | |
| 12007 | if (pMac == NULL) |
| 12008 | { |
| 12009 | printk("btc: %s pMac is NULL \n",__func__); |
| 12010 | return; |
| 12011 | } |
| 12012 | |
| 12013 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 12014 | FL("isCoexScoIndSet: %d"), pMac->isCoexScoIndSet); |
| 12015 | |
| 12016 | if (pMac->isCoexScoIndSet) |
| 12017 | { |
| 12018 | pMac->isCoexScoIndSet = 0; |
| 12019 | ccmCfgSetInt(pMac, WNI_CFG_DEL_ALL_RX_TX_BA_SESSIONS_2_4_G_BTC, 0, |
| 12020 | NULL, eANI_BOOLEAN_FALSE); |
| 12021 | } |
| 12022 | |
| 12023 | return; |
| 12024 | } |
Agarwal Ashish | 738843c | 2014-09-25 12:27:56 +0530 | [diff] [blame] | 12025 | |
| 12026 | void sme_disable_dfs_channel(tHalHandle hHal, bool disbale_dfs) |
| 12027 | { |
| 12028 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 12029 | pMac->scan.fEnableDFSChnlScan = !disbale_dfs; |
| 12030 | csrDisableDfsChannel(pMac); |
| 12031 | |
| 12032 | } |
Srinivas Dasari | b8fdd42 | 2014-11-27 10:44:20 +0530 | [diff] [blame] | 12033 | |
| 12034 | /* --------------------------------------------------------------------------- |
| 12035 | \fn sme_Encryptmsgsend |
| 12036 | \brief SME API to issue encrypt message request |
| 12037 | \param hHal |
| 12038 | \param pCmd: Data to be encrypted |
| 12039 | \- return eHalStatus |
| 12040 | -------------------------------------------------------------------------*/ |
| 12041 | eHalStatus sme_Encryptmsgsend (tHalHandle hHal, |
| 12042 | u8 *pCmd, |
| 12043 | int length, |
| 12044 | pEncryptMsgRSPCb encMsgCbk) |
| 12045 | { |
| 12046 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 12047 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 12048 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 12049 | vos_msg_t vosMessage; |
| 12050 | u8 *pEncryptMsg; |
| 12051 | |
| 12052 | pEncryptMsg = vos_mem_malloc(length); |
| 12053 | if ( !pEncryptMsg) |
| 12054 | { |
| 12055 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 12056 | "%s: Not able to allocate memory for " |
| 12057 | "SIR_HAL_ENCRYPT_MSG_REQ", |
| 12058 | __func__); |
| 12059 | return eHAL_STATUS_FAILURE; |
| 12060 | } |
| 12061 | |
| 12062 | vos_mem_copy(pEncryptMsg, pCmd, length); |
| 12063 | |
| 12064 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) { |
| 12065 | |
| 12066 | pMac->sme.pEncMsgInfoParams.pEncMsgCbk = encMsgCbk; |
| 12067 | pMac->sme.pEncMsgInfoParams.pUserData = hHal; |
| 12068 | /* Serialize the req through MC thread */ |
| 12069 | vosMessage.bodyptr = pEncryptMsg; |
| 12070 | vosMessage.type = SIR_HAL_ENCRYPT_MSG_REQ; |
| 12071 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 12072 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 12073 | status = eHAL_STATUS_FAILURE; |
| 12074 | |
| 12075 | sme_ReleaseGlobalLock(&pMac->sme); |
| 12076 | } |
| 12077 | return(status); |
| 12078 | } |
Pradeep Reddy POTTETI | f0569d7 | 2014-12-13 16:54:03 +0530 | [diff] [blame] | 12079 | |
| 12080 | /* --------------------------------------------------------------------------- |
| 12081 | \fn sme_RegisterBtCoexTDLSCallback |
| 12082 | \brief Used to plug in callback function |
| 12083 | Which notify btcoex on or off. |
| 12084 | Notification come from FW. |
| 12085 | \param hHal |
| 12086 | \param pCallbackfn : callback function pointer should be plugged in |
| 12087 | \- return eHalStatus |
| 12088 | -------------------------------------------------------------------------*/ |
| 12089 | eHalStatus sme_RegisterBtCoexTDLSCallback |
| 12090 | ( |
| 12091 | tHalHandle hHal, |
| 12092 | void (*pCallbackfn)(void *pAdapter, int ) |
| 12093 | ) |
| 12094 | { |
| 12095 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 12096 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 12097 | |
| 12098 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 12099 | "%s: Plug in BtCoex TDLS CB", __func__); |
| 12100 | |
| 12101 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 12102 | if (eHAL_STATUS_SUCCESS == status) |
| 12103 | { |
| 12104 | if (NULL != pCallbackfn) |
| 12105 | { |
| 12106 | pMac->sme.pBtCoexTDLSNotification = pCallbackfn; |
| 12107 | } |
| 12108 | sme_ReleaseGlobalLock(&pMac->sme); |
| 12109 | } |
| 12110 | return(status); |
| 12111 | } |
Padma, Santhosh Kumar | 98f271d | 2014-12-31 17:23:31 +0530 | [diff] [blame] | 12112 | |
| 12113 | /* --------------------------------------------------------------------------- |
Padma, Santhosh Kumar | 3b9657d | 2015-02-04 19:37:32 +0530 | [diff] [blame] | 12114 | \fn smeNeighborMiddleOfRoaming |
Padma, Santhosh Kumar | 98f271d | 2014-12-31 17:23:31 +0530 | [diff] [blame] | 12115 | |
Padma, Santhosh Kumar | 3b9657d | 2015-02-04 19:37:32 +0530 | [diff] [blame] | 12116 | \brief This function is a wrapper to call csrNeighborMiddleOfRoaming |
Padma, Santhosh Kumar | 98f271d | 2014-12-31 17:23:31 +0530 | [diff] [blame] | 12117 | |
| 12118 | \param hHal - The handle returned by macOpen. |
| 12119 | |
Padma, Santhosh Kumar | 3b9657d | 2015-02-04 19:37:32 +0530 | [diff] [blame] | 12120 | \return eANI_BOOLEAN_TRUE if reassoc in progress, |
| 12121 | eANI_BOOLEAN_FALSE otherwise |
Padma, Santhosh Kumar | 98f271d | 2014-12-31 17:23:31 +0530 | [diff] [blame] | 12122 | ---------------------------------------------------------------------------*/ |
Padma, Santhosh Kumar | 3b9657d | 2015-02-04 19:37:32 +0530 | [diff] [blame] | 12123 | |
| 12124 | tANI_BOOLEAN smeNeighborMiddleOfRoaming(tHalHandle hHal) |
Padma, Santhosh Kumar | 98f271d | 2014-12-31 17:23:31 +0530 | [diff] [blame] | 12125 | { |
Padma, Santhosh Kumar | 3b9657d | 2015-02-04 19:37:32 +0530 | [diff] [blame] | 12126 | return (csrNeighborMiddleOfRoaming(PMAC_STRUCT(hHal))); |
Padma, Santhosh Kumar | 98f271d | 2014-12-31 17:23:31 +0530 | [diff] [blame] | 12127 | } |
Pradeep Reddy POTTETI | e8bd41a | 2015-01-29 14:52:43 +0530 | [diff] [blame] | 12128 | |
| 12129 | /* --------------------------------------------------------------------------- |
| 12130 | |
| 12131 | \fn sme_IsTdlsOffChannelValid |
| 12132 | |
| 12133 | \brief To check if the channel is valid for currently established domain |
| 12134 | This is a synchronous API. |
| 12135 | |
| 12136 | \param hHal - The handle returned by macOpen. |
| 12137 | \param channel - channel to verify |
| 12138 | |
| 12139 | \return TRUE/FALSE, TRUE if channel is valid |
| 12140 | |
| 12141 | -------------------------------------------------------------------------------*/ |
| 12142 | tANI_BOOLEAN sme_IsTdlsOffChannelValid(tHalHandle hHal, tANI_U8 channel) |
| 12143 | { |
| 12144 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 12145 | tANI_BOOLEAN valid = FALSE; |
| 12146 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 12147 | |
| 12148 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 12149 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 12150 | { |
| 12151 | /* check whether off channel is valid and non DFS */ |
| 12152 | if (csrRoamIsChannelValid(pMac, channel) && |
| 12153 | (!CSR_IS_CHANNEL_DFS(channel))) |
| 12154 | { |
| 12155 | valid = TRUE; |
| 12156 | } |
| 12157 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 12158 | } |
| 12159 | return (valid); |
| 12160 | } |