Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1 | /* |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame^] | 2 | * Copyright (c) 2012-2014 Qualcomm Atheros, Inc. |
| 3 | * All Rights Reserved. |
| 4 | * Qualcomm Atheros Confidential and Proprietary. |
Gopichand Nakkala | 92f07d8 | 2013-01-08 21:16:34 -0800 | [diff] [blame] | 5 | */ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6 | /**========================================================================= |
| 7 | |
| 8 | \file smeApi.c |
| 9 | |
| 10 | \brief Definitions for SME APIs |
| 11 | |
Kiet Lam | aa8e15a | 2014-02-11 23:30:06 -0800 | [diff] [blame^] | 12 | Copyright 2008 (c) Qualcomm, Incorporated. All Rights Reserved. |
| 13 | |
| 14 | Qualcomm Confidential and Proprietary. |
| 15 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 16 | ========================================================================*/ |
| 17 | |
| 18 | /*=========================================================================== |
| 19 | |
| 20 | EDIT HISTORY FOR FILE |
| 21 | |
| 22 | |
| 23 | This section contains comments describing changes made to the module. |
| 24 | Notice that changes are listed in reverse chronological order. |
| 25 | |
| 26 | |
| 27 | |
| 28 | when who what, where, why |
| 29 | ---------- --- -------------------------------------------------------- |
| 30 | 06/03/10 js Added support to hostapd driven |
| 31 | * deauth/disassoc/mic failure |
| 32 | |
| 33 | ===========================================================================*/ |
| 34 | |
| 35 | /*-------------------------------------------------------------------------- |
| 36 | Include Files |
| 37 | ------------------------------------------------------------------------*/ |
| 38 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 39 | |
| 40 | #include "smsDebug.h" |
| 41 | #include "sme_Api.h" |
| 42 | #include "csrInsideApi.h" |
| 43 | #include "smeInside.h" |
| 44 | #include "csrInternal.h" |
| 45 | #include "wlan_qct_wda.h" |
| 46 | #include "halMsgApi.h" |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 47 | #include "vos_trace.h" |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 48 | #include "sme_Trace.h" |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 49 | #include "vos_types.h" |
| 50 | #include "vos_trace.h" |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 51 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 52 | #include "sapApi.h" |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 53 | |
| 54 | |
| 55 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 56 | extern tSirRetStatus uMacPostCtrlMsg(void* pSirGlobal, tSirMbMsg* pMb); |
| 57 | |
| 58 | #include <wlan_qct_pal_api.h> |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 59 | #define LOG_SIZE 256 |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 60 | #define READ_MEMORY_DUMP_CMD 9 |
Madan Mohan Koyyalamudi | 8af9b40 | 2013-07-11 14:59:10 +0530 | [diff] [blame] | 61 | #define TL_INIT_STATE 0 |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 62 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 63 | |
| 64 | #define CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE 1000*30 //30s |
| 65 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 66 | // TxMB Functions |
| 67 | extern eHalStatus pmcPrepareCommand( tpAniSirGlobal pMac, eSmeCommandType cmdType, void *pvParam, |
| 68 | tANI_U32 size, tSmeCmd **ppCmd ); |
| 69 | extern void pmcReleaseCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
| 70 | extern void qosReleaseCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 71 | extern eHalStatus p2pProcessRemainOnChannelCmd(tpAniSirGlobal pMac, tSmeCmd *p2pRemainonChn); |
| 72 | extern eHalStatus sme_remainOnChnRsp( tpAniSirGlobal pMac, tANI_U8 *pMsg); |
| 73 | extern eHalStatus sme_mgmtFrmInd( tHalHandle hHal, tpSirSmeMgmtFrameInd pSmeMgmtFrm); |
| 74 | extern eHalStatus sme_remainOnChnReady( tHalHandle hHal, tANI_U8* pMsg); |
| 75 | extern eHalStatus sme_sendActionCnf( tHalHandle hHal, tANI_U8* pMsg); |
| 76 | extern eHalStatus p2pProcessNoAReq(tpAniSirGlobal pMac, tSmeCmd *pNoACmd); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 77 | |
| 78 | static eHalStatus initSmeCmdList(tpAniSirGlobal pMac); |
| 79 | static void smeAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ); |
| 80 | |
| 81 | eCsrPhyMode sme_GetPhyMode(tHalHandle hHal); |
| 82 | |
| 83 | eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf); |
| 84 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 85 | eHalStatus sme_HandleGenericChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf); |
| 86 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 87 | eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal); |
| 88 | |
| 89 | eHalStatus sme_HandlePostChannelSwitchInd(tHalHandle hHal); |
| 90 | |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 91 | #ifdef FEATURE_WLAN_LFR |
| 92 | tANI_BOOLEAN csrIsScanAllowed(tpAniSirGlobal pMac); |
| 93 | #endif |
| 94 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 95 | #ifdef WLAN_FEATURE_11W |
| 96 | eHalStatus sme_UnprotectedMgmtFrmInd( tHalHandle hHal, |
| 97 | tpSirSmeUnprotMgmtFrameInd pSmeMgmtFrm ); |
| 98 | #endif |
| 99 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 100 | //Internal SME APIs |
| 101 | eHalStatus sme_AcquireGlobalLock( tSmeStruct *psSme) |
| 102 | { |
| 103 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 104 | |
| 105 | if(psSme) |
| 106 | { |
| 107 | if( VOS_IS_STATUS_SUCCESS( vos_lock_acquire( &psSme->lkSmeGlobalLock) ) ) |
| 108 | { |
| 109 | status = eHAL_STATUS_SUCCESS; |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | return (status); |
| 114 | } |
| 115 | |
| 116 | |
| 117 | eHalStatus sme_ReleaseGlobalLock( tSmeStruct *psSme) |
| 118 | { |
| 119 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 120 | |
| 121 | if(psSme) |
| 122 | { |
| 123 | if( VOS_IS_STATUS_SUCCESS( vos_lock_release( &psSme->lkSmeGlobalLock) ) ) |
| 124 | { |
| 125 | status = eHAL_STATUS_SUCCESS; |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | return (status); |
| 130 | } |
| 131 | |
| 132 | |
| 133 | |
| 134 | static eHalStatus initSmeCmdList(tpAniSirGlobal pMac) |
| 135 | { |
| 136 | eHalStatus status; |
| 137 | tSmeCmd *pCmd; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 138 | tANI_U32 cmd_idx; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 139 | VOS_STATUS vosStatus; |
| 140 | vos_timer_t* cmdTimeoutTimer = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 141 | |
| 142 | pMac->sme.totalSmeCmd = SME_TOTAL_COMMAND; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 143 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 144 | &pMac->sme.smeCmdActiveList))) |
| 145 | goto end; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 146 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 147 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 148 | &pMac->sme.smeCmdPendingList))) |
| 149 | goto end; |
| 150 | |
| 151 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 152 | &pMac->sme.smeScanCmdActiveList))) |
| 153 | goto end; |
| 154 | |
| 155 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 156 | &pMac->sme.smeScanCmdPendingList))) |
| 157 | goto end; |
| 158 | |
| 159 | if (!HAL_STATUS_SUCCESS(status = csrLLOpen(pMac->hHdd, |
| 160 | &pMac->sme.smeCmdFreeList))) |
| 161 | goto end; |
| 162 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 163 | pCmd = vos_mem_malloc(sizeof(tSmeCmd) * pMac->sme.totalSmeCmd); |
| 164 | if ( NULL == pCmd ) |
| 165 | status = eHAL_STATUS_FAILURE; |
| 166 | else |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 167 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 168 | status = eHAL_STATUS_SUCCESS; |
| 169 | |
| 170 | vos_mem_set(pCmd, sizeof(tSmeCmd) * pMac->sme.totalSmeCmd, 0); |
| 171 | pMac->sme.pSmeCmdBufAddr = pCmd; |
| 172 | |
| 173 | for (cmd_idx = 0; cmd_idx < pMac->sme.totalSmeCmd; cmd_idx++) |
| 174 | { |
| 175 | csrLLInsertTail(&pMac->sme.smeCmdFreeList, |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 176 | &pCmd[cmd_idx].Link, LL_ACCESS_LOCK); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 177 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 178 | } |
| 179 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 180 | /* This timer is only to debug the active list command timeout */ |
| 181 | |
| 182 | cmdTimeoutTimer = (vos_timer_t*)vos_mem_malloc(sizeof(vos_timer_t)); |
| 183 | if (cmdTimeoutTimer) |
| 184 | { |
| 185 | pMac->sme.smeCmdActiveList.cmdTimeoutTimer = cmdTimeoutTimer; |
| 186 | vosStatus = |
| 187 | vos_timer_init( pMac->sme.smeCmdActiveList.cmdTimeoutTimer, |
| 188 | VOS_TIMER_TYPE_SW, |
| 189 | activeListCmdTimeoutHandle, |
| 190 | (void*) pMac); |
| 191 | |
| 192 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 193 | { |
| 194 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 195 | "Init Timer fail for active list command process time out"); |
| 196 | vos_mem_free(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 197 | } |
| 198 | else |
| 199 | { |
| 200 | pMac->sme.smeCmdActiveList.cmdTimeoutDuration = |
| 201 | CSR_ACTIVE_LIST_CMD_TIMEOUT_VALUE; |
| 202 | } |
| 203 | } |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 204 | end: |
| 205 | if (!HAL_STATUS_SUCCESS(status)) |
| 206 | smsLog(pMac, LOGE, "failed to initialize sme command list:%d\n", |
| 207 | status); |
| 208 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 209 | return (status); |
| 210 | } |
| 211 | |
| 212 | |
| 213 | void smeReleaseCommand(tpAniSirGlobal pMac, tSmeCmd *pCmd) |
| 214 | { |
| 215 | pCmd->command = eSmeNoCommand; |
| 216 | csrLLInsertTail(&pMac->sme.smeCmdFreeList, &pCmd->Link, LL_ACCESS_LOCK); |
| 217 | } |
| 218 | |
| 219 | |
| 220 | |
| 221 | static void smeReleaseCmdList(tpAniSirGlobal pMac, tDblLinkList *pList) |
| 222 | { |
| 223 | tListElem *pEntry; |
| 224 | tSmeCmd *pCommand; |
| 225 | |
| 226 | while((pEntry = csrLLRemoveHead(pList, LL_ACCESS_LOCK)) != NULL) |
| 227 | { |
| 228 | //TODO: base on command type to call release functions |
| 229 | //reinitialize different command types so they can be reused |
| 230 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 231 | smeAbortCommand(pMac, pCommand, eANI_BOOLEAN_TRUE); |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | static void purgeSmeCmdList(tpAniSirGlobal pMac) |
| 236 | { |
| 237 | //release any out standing commands back to free command list |
| 238 | smeReleaseCmdList(pMac, &pMac->sme.smeCmdPendingList); |
| 239 | smeReleaseCmdList(pMac, &pMac->sme.smeCmdActiveList); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 240 | smeReleaseCmdList(pMac, &pMac->sme.smeScanCmdPendingList); |
| 241 | smeReleaseCmdList(pMac, &pMac->sme.smeScanCmdActiveList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 242 | } |
| 243 | |
Madan Mohan Koyyalamudi | 2125599 | 2013-08-01 18:00:25 +0530 | [diff] [blame] | 244 | void purgeSmeSessionCmdList(tpAniSirGlobal pMac, tANI_U32 sessionId, |
| 245 | tDblLinkList *pList) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 246 | { |
| 247 | //release any out standing commands back to free command list |
| 248 | tListElem *pEntry, *pNext; |
| 249 | tSmeCmd *pCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 250 | tDblLinkList localList; |
| 251 | |
| 252 | vos_mem_zero(&localList, sizeof(tDblLinkList)); |
| 253 | if(!HAL_STATUS_SUCCESS(csrLLOpen(pMac->hHdd, &localList))) |
| 254 | { |
| 255 | smsLog(pMac, LOGE, FL(" failed to open list")); |
| 256 | return; |
| 257 | } |
| 258 | |
| 259 | csrLLLock(pList); |
| 260 | pEntry = csrLLPeekHead(pList, LL_ACCESS_NOLOCK); |
| 261 | while(pEntry != NULL) |
| 262 | { |
| 263 | pNext = csrLLNext(pList, pEntry, LL_ACCESS_NOLOCK); |
| 264 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 265 | if(pCommand->sessionId == sessionId) |
| 266 | { |
| 267 | if(csrLLRemoveEntry(pList, pEntry, LL_ACCESS_NOLOCK)) |
| 268 | { |
| 269 | csrLLInsertTail(&localList, pEntry, LL_ACCESS_NOLOCK); |
| 270 | } |
| 271 | } |
| 272 | pEntry = pNext; |
| 273 | } |
| 274 | csrLLUnlock(pList); |
| 275 | |
| 276 | while( (pEntry = csrLLRemoveHead(&localList, LL_ACCESS_NOLOCK)) ) |
| 277 | { |
| 278 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 279 | smeAbortCommand(pMac, pCommand, eANI_BOOLEAN_TRUE); |
| 280 | } |
| 281 | csrLLClose(&localList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 282 | } |
| 283 | |
| 284 | |
| 285 | static eHalStatus freeSmeCmdList(tpAniSirGlobal pMac) |
| 286 | { |
| 287 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 288 | |
| 289 | purgeSmeCmdList(pMac); |
| 290 | csrLLClose(&pMac->sme.smeCmdPendingList); |
| 291 | csrLLClose(&pMac->sme.smeCmdActiveList); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 292 | csrLLClose(&pMac->sme.smeScanCmdPendingList); |
| 293 | csrLLClose(&pMac->sme.smeScanCmdActiveList); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 294 | csrLLClose(&pMac->sme.smeCmdFreeList); |
| 295 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 296 | /*destroy active list command time out timer */ |
| 297 | vos_timer_destroy(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 298 | vos_mem_free(pMac->sme.smeCmdActiveList.cmdTimeoutTimer); |
| 299 | pMac->sme.smeCmdActiveList.cmdTimeoutTimer = NULL; |
| 300 | |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 301 | status = vos_lock_acquire(&pMac->sme.lkSmeGlobalLock); |
| 302 | if(status != eHAL_STATUS_SUCCESS) |
| 303 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 304 | smsLog(pMac, LOGE, |
| 305 | FL("Failed to acquire the lock status = %d"), status); |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 306 | goto done; |
| 307 | } |
| 308 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 309 | if(NULL != pMac->sme.pSmeCmdBufAddr) |
| 310 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 311 | vos_mem_free(pMac->sme.pSmeCmdBufAddr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 312 | pMac->sme.pSmeCmdBufAddr = NULL; |
| 313 | } |
| 314 | |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 315 | status = vos_lock_release(&pMac->sme.lkSmeGlobalLock); |
| 316 | if(status != eHAL_STATUS_SUCCESS) |
| 317 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 318 | smsLog(pMac, LOGE, |
| 319 | FL("Failed to release the lock status = %d"), status); |
Madan Mohan Koyyalamudi | 7a5fb7e | 2012-12-06 13:05:42 -0800 | [diff] [blame] | 320 | } |
| 321 | done: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 322 | return (status); |
| 323 | } |
| 324 | |
| 325 | |
| 326 | void dumpCsrCommandInfo(tpAniSirGlobal pMac, tSmeCmd *pCmd) |
| 327 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 328 | switch( pCmd->command ) |
| 329 | { |
| 330 | case eSmeCommandScan: |
| 331 | smsLog( pMac, LOGE, " scan command reason is %d", pCmd->u.scanCmd.reason ); |
| 332 | break; |
| 333 | |
| 334 | case eSmeCommandRoam: |
| 335 | smsLog( pMac, LOGE, " roam command reason is %d", pCmd->u.roamCmd.roamReason ); |
| 336 | break; |
| 337 | |
| 338 | case eSmeCommandWmStatusChange: |
| 339 | smsLog( pMac, LOGE, " WMStatusChange command type is %d", pCmd->u.wmStatusChangeCmd.Type ); |
| 340 | break; |
| 341 | |
| 342 | case eSmeCommandSetKey: |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 343 | smsLog( pMac, LOGE, " setKey command auth(%d) enc(%d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 344 | pCmd->u.setKeyCmd.authType, pCmd->u.setKeyCmd.encType ); |
| 345 | break; |
| 346 | |
| 347 | case eSmeCommandRemoveKey: |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 348 | smsLog( pMac, LOGE, " removeKey command auth(%d) enc(%d)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 349 | pCmd->u.removeKeyCmd.authType, pCmd->u.removeKeyCmd.encType ); |
| 350 | break; |
| 351 | |
| 352 | default: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 353 | smsLog( pMac, LOGE, " default: Unhandled command %d", |
| 354 | pCmd->command); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 355 | break; |
| 356 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 357 | } |
| 358 | |
| 359 | tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac ) |
| 360 | { |
| 361 | tSmeCmd *pRetCmd = NULL, *pTempCmd = NULL; |
| 362 | tListElem *pEntry; |
| 363 | |
| 364 | pEntry = csrLLRemoveHead( &pMac->sme.smeCmdFreeList, LL_ACCESS_LOCK ); |
| 365 | |
| 366 | // If we can get another MS Msg buffer, then we are ok. Just link |
| 367 | // the entry onto the linked list. (We are using the linked list |
| 368 | // to keep track of tfhe message buffers). |
| 369 | if ( pEntry ) |
| 370 | { |
| 371 | pRetCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 372 | } |
| 373 | else { |
| 374 | int idx = 1; |
| 375 | |
| 376 | //Cannot change pRetCmd here since it needs to return later. |
| 377 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK ); |
| 378 | if( pEntry ) |
| 379 | { |
| 380 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 381 | } |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 382 | smsLog( pMac, LOGE, "Out of command buffer.... command (0x%X) stuck", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 383 | (pTempCmd) ? pTempCmd->command : eSmeNoCommand ); |
| 384 | if(pTempCmd) |
| 385 | { |
| 386 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 387 | { |
| 388 | //CSR command is stuck. See what the reason code is for that command |
| 389 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 390 | } |
| 391 | } //if(pTempCmd) |
| 392 | |
| 393 | //dump what is in the pending queue |
| 394 | csrLLLock(&pMac->sme.smeCmdPendingList); |
| 395 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK ); |
| 396 | while(pEntry) |
| 397 | { |
| 398 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 399 | smsLog( pMac, LOGE, "Out of command buffer.... SME pending command #%d (0x%X)", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 400 | idx++, pTempCmd->command ); |
| 401 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 402 | { |
| 403 | //CSR command is stuck. See what the reason code is for that command |
| 404 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 405 | } |
| 406 | pEntry = csrLLNext( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); |
| 407 | } |
| 408 | csrLLUnlock(&pMac->sme.smeCmdPendingList); |
| 409 | |
| 410 | //There may be some more command in CSR's own pending queue |
| 411 | csrLLLock(&pMac->roam.roamCmdPendingList); |
| 412 | pEntry = csrLLPeekHead( &pMac->roam.roamCmdPendingList, LL_ACCESS_NOLOCK ); |
| 413 | while(pEntry) |
| 414 | { |
| 415 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 416 | 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] | 417 | idx++, pTempCmd->command ); |
| 418 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 419 | pEntry = csrLLNext( &pMac->roam.roamCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); |
| 420 | } |
| 421 | csrLLUnlock(&pMac->roam.roamCmdPendingList); |
| 422 | } |
| 423 | |
| 424 | return( pRetCmd ); |
| 425 | } |
| 426 | |
| 427 | |
| 428 | void smePushCommand( tpAniSirGlobal pMac, tSmeCmd *pCmd, tANI_BOOLEAN fHighPriority ) |
| 429 | { |
| 430 | if ( fHighPriority ) |
| 431 | { |
| 432 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pCmd->Link, LL_ACCESS_LOCK ); |
| 433 | } |
| 434 | else |
| 435 | { |
| 436 | csrLLInsertTail( &pMac->sme.smeCmdPendingList, &pCmd->Link, LL_ACCESS_LOCK ); |
| 437 | } |
| 438 | |
| 439 | // process the command queue... |
| 440 | smeProcessPendingQueue( pMac ); |
| 441 | |
| 442 | return; |
| 443 | } |
| 444 | |
| 445 | |
| 446 | static eSmeCommandType smeIsFullPowerNeeded( tpAniSirGlobal pMac, tSmeCmd *pCommand ) |
| 447 | { |
| 448 | eSmeCommandType pmcCommand = eSmeNoCommand; |
| 449 | tANI_BOOLEAN fFullPowerNeeded = eANI_BOOLEAN_FALSE; |
| 450 | tPmcState pmcState; |
| 451 | eHalStatus status; |
| 452 | |
| 453 | do |
| 454 | { |
| 455 | pmcState = pmcGetPmcState(pMac); |
| 456 | |
| 457 | status = csrIsFullPowerNeeded( pMac, pCommand, NULL, &fFullPowerNeeded ); |
| 458 | if( !HAL_STATUS_SUCCESS(status) ) |
| 459 | { |
| 460 | //PMC state is not right for the command, drop it |
| 461 | return ( eSmeDropCommand ); |
| 462 | } |
| 463 | if( fFullPowerNeeded ) break; |
| 464 | fFullPowerNeeded = ( ( eSmeCommandAddTs == pCommand->command ) || |
| 465 | ( eSmeCommandDelTs == pCommand->command ) ); |
| 466 | if( fFullPowerNeeded ) break; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 467 | #ifdef FEATURE_OEM_DATA_SUPPORT |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 468 | fFullPowerNeeded = (pmcState == IMPS && |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 469 | eSmeCommandOemDataReq == pCommand->command); |
| 470 | if(fFullPowerNeeded) break; |
| 471 | #endif |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 472 | fFullPowerNeeded = (pmcState == IMPS && |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 473 | eSmeCommandRemainOnChannel == pCommand->command); |
| 474 | if(fFullPowerNeeded) break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 475 | } while(0); |
| 476 | |
| 477 | if( fFullPowerNeeded ) |
| 478 | { |
| 479 | switch( pmcState ) |
| 480 | { |
| 481 | case IMPS: |
| 482 | case STANDBY: |
| 483 | pmcCommand = eSmeCommandExitImps; |
| 484 | break; |
| 485 | |
| 486 | case BMPS: |
| 487 | pmcCommand = eSmeCommandExitBmps; |
| 488 | break; |
| 489 | |
| 490 | case UAPSD: |
| 491 | pmcCommand = eSmeCommandExitUapsd; |
| 492 | break; |
| 493 | |
| 494 | case WOWL: |
| 495 | pmcCommand = eSmeCommandExitWowl; |
| 496 | break; |
| 497 | |
| 498 | default: |
| 499 | break; |
| 500 | } |
| 501 | } |
| 502 | |
| 503 | return ( pmcCommand ); |
| 504 | } |
| 505 | |
| 506 | |
| 507 | //For commands that need to do extra cleanup. |
| 508 | static void smeAbortCommand( tpAniSirGlobal pMac, tSmeCmd *pCommand, tANI_BOOLEAN fStopping ) |
| 509 | { |
| 510 | if( eSmePmcCommandMask & pCommand->command ) |
| 511 | { |
| 512 | pmcAbortCommand( pMac, pCommand, fStopping ); |
| 513 | } |
| 514 | else if ( eSmeCsrCommandMask & pCommand->command ) |
| 515 | { |
| 516 | csrAbortCommand( pMac, pCommand, fStopping ); |
| 517 | } |
| 518 | else |
| 519 | { |
| 520 | switch( pCommand->command ) |
| 521 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 522 | case eSmeCommandRemainOnChannel: |
| 523 | if (NULL != pCommand->u.remainChlCmd.callback) |
| 524 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 525 | remainOnChanCallback callback = |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 526 | pCommand->u.remainChlCmd.callback; |
| 527 | /* process the msg */ |
| 528 | if( callback ) |
| 529 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 530 | callback(pMac, pCommand->u.remainChlCmd.callbackCtx, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 531 | eCSR_SCAN_ABORT ); |
| 532 | } |
| 533 | } |
| 534 | smeReleaseCommand( pMac, pCommand ); |
| 535 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 536 | default: |
| 537 | smeReleaseCommand( pMac, pCommand ); |
| 538 | break; |
| 539 | } |
| 540 | } |
| 541 | } |
| 542 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 543 | tListElem *csrGetCmdToProcess(tpAniSirGlobal pMac, tDblLinkList *pList, |
| 544 | tANI_U8 sessionId, tANI_BOOLEAN fInterlocked) |
| 545 | { |
| 546 | tListElem *pCurEntry = NULL; |
| 547 | tSmeCmd *pCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 548 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 549 | /* Go through the list and return the command whose session id is not |
| 550 | * matching with the current ongoing scan cmd sessionId */ |
| 551 | pCurEntry = csrLLPeekHead( pList, LL_ACCESS_LOCK ); |
| 552 | while (pCurEntry) |
| 553 | { |
| 554 | pCommand = GET_BASE_ADDR(pCurEntry, tSmeCmd, Link); |
| 555 | if (pCommand->sessionId != sessionId) |
| 556 | { |
| 557 | smsLog(pMac, LOG1, "selected the command with different sessionId"); |
| 558 | return pCurEntry; |
| 559 | } |
| 560 | |
| 561 | pCurEntry = csrLLNext(pList, pCurEntry, fInterlocked); |
| 562 | } |
| 563 | |
| 564 | smsLog(pMac, LOG1, "No command pending with different sessionId"); |
| 565 | return NULL; |
| 566 | } |
| 567 | |
| 568 | tANI_BOOLEAN smeProcessScanQueue(tpAniSirGlobal pMac) |
| 569 | { |
| 570 | tListElem *pEntry; |
| 571 | tSmeCmd *pCommand; |
| 572 | tListElem *pSmeEntry; |
| 573 | tSmeCmd *pSmeCommand; |
| 574 | tANI_BOOLEAN status = eANI_BOOLEAN_TRUE; |
| 575 | |
| 576 | csrLLLock( &pMac->sme.smeScanCmdActiveList ); |
| 577 | if (csrLLIsListEmpty( &pMac->sme.smeScanCmdActiveList, |
| 578 | LL_ACCESS_NOLOCK )) |
| 579 | { |
| 580 | if (!csrLLIsListEmpty(&pMac->sme.smeScanCmdPendingList, |
| 581 | LL_ACCESS_LOCK)) |
| 582 | { |
| 583 | pEntry = csrLLPeekHead( &pMac->sme.smeScanCmdPendingList, |
| 584 | LL_ACCESS_LOCK ); |
| 585 | if (pEntry) |
| 586 | { |
| 587 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 588 | //We cannot execute any command in wait-for-key state until setKey is through. |
| 589 | if (CSR_IS_WAIT_FOR_KEY( pMac, pCommand->sessionId)) |
| 590 | { |
| 591 | if (!CSR_IS_SET_KEY_COMMAND(pCommand)) |
| 592 | { |
| 593 | smsLog(pMac, LOGE, |
| 594 | " Cannot process command(%d) while waiting for key", |
| 595 | pCommand->command); |
| 596 | status = eANI_BOOLEAN_FALSE; |
| 597 | goto end; |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | if ((!csrLLIsListEmpty(&pMac->sme.smeCmdActiveList, |
| 602 | LL_ACCESS_LOCK ))) |
| 603 | { |
| 604 | pSmeEntry = csrLLPeekHead(&pMac->sme.smeCmdActiveList, |
| 605 | LL_ACCESS_LOCK); |
| 606 | if (pEntry) |
| 607 | { |
| 608 | pSmeCommand = GET_BASE_ADDR(pEntry, tSmeCmd, |
| 609 | Link) ; |
| 610 | |
| 611 | /* if scan is running on one interface and SME recei |
| 612 | ves the next command on the same interface then |
| 613 | dont the allow the command to be queued to |
| 614 | smeCmdPendingList. If next scan is allowed on |
| 615 | the same interface the CSR state machine will |
| 616 | get screwed up. */ |
| 617 | if (pSmeCommand->sessionId == pCommand->sessionId) |
| 618 | { |
| 619 | status = eANI_BOOLEAN_FALSE; |
| 620 | goto end; |
| 621 | } |
| 622 | } |
| 623 | } |
| 624 | if ( csrLLRemoveEntry( &pMac->sme.smeScanCmdPendingList, |
| 625 | pEntry, LL_ACCESS_LOCK ) ) |
| 626 | { |
| 627 | csrLLInsertHead( &pMac->sme.smeScanCmdActiveList, |
| 628 | &pCommand->Link, LL_ACCESS_NOLOCK ); |
| 629 | |
| 630 | switch (pCommand->command) |
| 631 | { |
| 632 | case eSmeCommandScan: |
| 633 | smsLog(pMac, LOG1, |
| 634 | " Processing scan offload command "); |
| 635 | csrProcessScanCommand( pMac, pCommand ); |
| 636 | break; |
| 637 | default: |
| 638 | smsLog(pMac, LOGE, |
| 639 | " Something wrong, wrong command enqueued" |
| 640 | " to smeScanCmdPendingList"); |
| 641 | pEntry = csrLLRemoveHead( |
| 642 | &pMac->sme.smeScanCmdActiveList, |
| 643 | LL_ACCESS_NOLOCK ); |
| 644 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 645 | smeReleaseCommand( pMac, pCommand ); |
| 646 | break; |
| 647 | } |
| 648 | } |
| 649 | } |
| 650 | } |
| 651 | } |
| 652 | end: |
| 653 | csrLLUnlock(&pMac->sme.smeScanCmdActiveList); |
| 654 | return status; |
| 655 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 656 | |
| 657 | tANI_BOOLEAN smeProcessCommand( tpAniSirGlobal pMac ) |
| 658 | { |
| 659 | tANI_BOOLEAN fContinue = eANI_BOOLEAN_FALSE; |
| 660 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 661 | tListElem *pEntry; |
| 662 | tSmeCmd *pCommand; |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 663 | tListElem *pSmeEntry; |
| 664 | tSmeCmd *pSmeCommand; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 665 | eSmeCommandType pmcCommand = eSmeNoCommand; |
| 666 | |
| 667 | // if the ActiveList is empty, then nothing is active so we can process a |
| 668 | // pending command... |
| 669 | //alwasy lock active list before locking pending list |
| 670 | csrLLLock( &pMac->sme.smeCmdActiveList ); |
| 671 | if ( csrLLIsListEmpty( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ) ) |
| 672 | { |
| 673 | if(!csrLLIsListEmpty(&pMac->sme.smeCmdPendingList, LL_ACCESS_LOCK)) |
| 674 | { |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 675 | /* If scan command is pending in the smeScanCmdActive list |
| 676 | * then pick the command from smeCmdPendingList which is |
| 677 | * not matching with the scan command session id. |
| 678 | * At any point of time only one command will be allowed |
| 679 | * on a single session. */ |
| 680 | if ((pMac->fScanOffload) && |
| 681 | (!csrLLIsListEmpty(&pMac->sme.smeScanCmdActiveList, |
| 682 | LL_ACCESS_LOCK))) |
| 683 | { |
| 684 | pSmeEntry = csrLLPeekHead(&pMac->sme.smeScanCmdActiveList, |
| 685 | LL_ACCESS_LOCK); |
| 686 | if (pSmeEntry) |
| 687 | { |
| 688 | pSmeCommand = GET_BASE_ADDR(pSmeEntry, tSmeCmd, Link); |
| 689 | |
| 690 | pEntry = csrGetCmdToProcess(pMac, |
| 691 | &pMac->sme.smeCmdPendingList, |
| 692 | pSmeCommand->sessionId, |
| 693 | LL_ACCESS_LOCK); |
| 694 | goto sme_process_cmd; |
| 695 | } |
| 696 | } |
| 697 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 698 | //Peek the command |
| 699 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdPendingList, LL_ACCESS_LOCK ); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 700 | sme_process_cmd: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 701 | if( pEntry ) |
| 702 | { |
| 703 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 704 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 705 | //We cannot execute any command in wait-for-key state until setKey is through. |
| 706 | if( CSR_IS_WAIT_FOR_KEY( pMac, pCommand->sessionId ) ) |
| 707 | { |
| 708 | if( !CSR_IS_SET_KEY_COMMAND( pCommand ) ) |
| 709 | { |
| 710 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 711 | smsLog(pMac, LOGE, " Cannot process command(%d) while waiting for key", pCommand->command); |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 712 | fContinue = eANI_BOOLEAN_FALSE; |
| 713 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 714 | } |
| 715 | } |
| 716 | pmcCommand = smeIsFullPowerNeeded( pMac, pCommand ); |
| 717 | if( eSmeDropCommand == pmcCommand ) |
| 718 | { |
| 719 | //This command is not ok for current PMC state |
| 720 | if( csrLLRemoveEntry( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_LOCK ) ) |
| 721 | { |
| 722 | smeAbortCommand( pMac, pCommand, eANI_BOOLEAN_FALSE ); |
| 723 | } |
| 724 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 725 | //tell caller to continue |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 726 | fContinue = eANI_BOOLEAN_TRUE; |
| 727 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 728 | } |
| 729 | else if( eSmeNoCommand != pmcCommand ) |
| 730 | { |
| 731 | tExitBmpsInfo exitBmpsInfo; |
| 732 | void *pv = NULL; |
| 733 | tANI_U32 size = 0; |
| 734 | tSmeCmd *pPmcCmd = NULL; |
| 735 | |
| 736 | if( eSmeCommandExitBmps == pmcCommand ) |
| 737 | { |
| 738 | exitBmpsInfo.exitBmpsReason = eSME_REASON_OTHER; |
| 739 | pv = (void *)&exitBmpsInfo; |
| 740 | size = sizeof(tExitBmpsInfo); |
| 741 | } |
| 742 | //pmcCommand has to be one of the exit power save command |
| 743 | status = pmcPrepareCommand( pMac, pmcCommand, pv, size, &pPmcCmd ); |
| 744 | if( HAL_STATUS_SUCCESS( status ) && pPmcCmd ) |
| 745 | { |
| 746 | //Force this command to wake up the chip |
| 747 | csrLLInsertHead( &pMac->sme.smeCmdActiveList, &pPmcCmd->Link, LL_ACCESS_NOLOCK ); |
| 748 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 749 | fContinue = pmcProcessCommand( pMac, pPmcCmd ); |
| 750 | if( fContinue ) |
| 751 | { |
| 752 | //The command failed, remove it |
| 753 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, &pPmcCmd->Link, LL_ACCESS_NOLOCK ) ) |
| 754 | { |
| 755 | pmcReleaseCommand( pMac, pPmcCmd ); |
| 756 | } |
| 757 | } |
| 758 | } |
| 759 | else |
| 760 | { |
| 761 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 762 | 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] | 763 | //Let it retry |
| 764 | fContinue = eANI_BOOLEAN_TRUE; |
| 765 | } |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 766 | goto sme_process_scan_queue; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 767 | } |
| 768 | if ( csrLLRemoveEntry( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_LOCK ) ) |
| 769 | { |
| 770 | // we can reuse the pCommand |
| 771 | |
| 772 | // Insert the command onto the ActiveList... |
| 773 | csrLLInsertHead( &pMac->sme.smeCmdActiveList, &pCommand->Link, LL_ACCESS_NOLOCK ); |
| 774 | |
| 775 | // .... and process the command. |
| 776 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 777 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 778 | TRACE_CODE_SME_COMMAND, pCommand->sessionId, pCommand->command)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 779 | switch ( pCommand->command ) |
| 780 | { |
| 781 | |
| 782 | case eSmeCommandScan: |
| 783 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 784 | status = csrProcessScanCommand( pMac, pCommand ); |
| 785 | break; |
| 786 | |
| 787 | case eSmeCommandRoam: |
| 788 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 789 | status = csrRoamProcessCommand( pMac, pCommand ); |
Madan Mohan Koyyalamudi | 59efbe0 | 2013-01-10 15:38:42 -0800 | [diff] [blame] | 790 | if(!HAL_STATUS_SUCCESS(status)) |
| 791 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 792 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Madan Mohan Koyyalamudi | 59efbe0 | 2013-01-10 15:38:42 -0800 | [diff] [blame] | 793 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 794 | { |
| 795 | csrReleaseCommandRoam( pMac, pCommand ); |
| 796 | } |
| 797 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 798 | break; |
| 799 | |
| 800 | case eSmeCommandWmStatusChange: |
| 801 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 802 | csrRoamProcessWmStatusChangeCommand(pMac, pCommand); |
| 803 | break; |
| 804 | |
| 805 | case eSmeCommandSetKey: |
| 806 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 807 | status = csrRoamProcessSetKeyCommand( pMac, pCommand ); |
| 808 | if(!HAL_STATUS_SUCCESS(status)) |
| 809 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 810 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 811 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 812 | { |
| 813 | csrReleaseCommandSetKey( pMac, pCommand ); |
| 814 | } |
| 815 | } |
| 816 | break; |
| 817 | |
| 818 | case eSmeCommandRemoveKey: |
| 819 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 820 | status = csrRoamProcessRemoveKeyCommand( pMac, pCommand ); |
| 821 | if(!HAL_STATUS_SUCCESS(status)) |
| 822 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 823 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 824 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 825 | { |
| 826 | csrReleaseCommandRemoveKey( pMac, pCommand ); |
| 827 | } |
| 828 | } |
| 829 | break; |
| 830 | |
| 831 | case eSmeCommandAddStaSession: |
| 832 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 833 | csrProcessAddStaSessionCommand( pMac, pCommand ); |
| 834 | break; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 835 | case eSmeCommandDelStaSession: |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 836 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 837 | csrProcessDelStaSessionCommand( pMac, pCommand ); |
| 838 | break; |
| 839 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 840 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 841 | case eSmeCommandOemDataReq: |
| 842 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 843 | oemData_ProcessOemDataReqCommand(pMac, pCommand); |
| 844 | break; |
| 845 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 846 | case eSmeCommandRemainOnChannel: |
| 847 | csrLLUnlock(&pMac->sme.smeCmdActiveList); |
| 848 | p2pProcessRemainOnChannelCmd(pMac, pCommand); |
| 849 | break; |
| 850 | case eSmeCommandNoAUpdate: |
| 851 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 852 | p2pProcessNoAReq(pMac,pCommand); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 853 | case eSmeCommandEnterImps: |
| 854 | case eSmeCommandExitImps: |
| 855 | case eSmeCommandEnterBmps: |
| 856 | case eSmeCommandExitBmps: |
| 857 | case eSmeCommandEnterUapsd: |
| 858 | case eSmeCommandExitUapsd: |
| 859 | case eSmeCommandEnterWowl: |
| 860 | case eSmeCommandExitWowl: |
| 861 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 862 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 863 | if( fContinue ) |
| 864 | { |
| 865 | //The command failed, remove it |
| 866 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 867 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 868 | { |
| 869 | pmcReleaseCommand( pMac, pCommand ); |
| 870 | } |
| 871 | } |
| 872 | break; |
| 873 | |
| 874 | //Treat standby differently here because caller may not be able to handle |
| 875 | //the failure so we do our best here |
| 876 | case eSmeCommandEnterStandby: |
| 877 | if( csrIsConnStateDisconnected( pMac, pCommand->sessionId ) ) |
| 878 | { |
| 879 | //It can continue |
| 880 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 881 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 882 | if( fContinue ) |
| 883 | { |
| 884 | //The command failed, remove it |
| 885 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 886 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 887 | { |
| 888 | pmcReleaseCommand( pMac, pCommand ); |
| 889 | } |
| 890 | } |
| 891 | } |
| 892 | else |
| 893 | { |
| 894 | //Need to issue a disconnect first before processing this command |
| 895 | tSmeCmd *pNewCmd; |
| 896 | |
| 897 | //We need to re-run the command |
| 898 | fContinue = eANI_BOOLEAN_TRUE; |
| 899 | //Pull off the standby command first |
| 900 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 901 | &pCommand->Link, LL_ACCESS_NOLOCK ) ) |
| 902 | { |
| 903 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 904 | //Need to call CSR function here because the disconnect command |
| 905 | //is handled by CSR |
| 906 | pNewCmd = csrGetCommandBuffer( pMac ); |
| 907 | if( NULL != pNewCmd ) |
| 908 | { |
| 909 | //Put the standby command to the head of the pending list first |
| 910 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pCommand->Link, |
| 911 | LL_ACCESS_LOCK ); |
| 912 | pNewCmd->command = eSmeCommandRoam; |
| 913 | pNewCmd->u.roamCmd.roamReason = eCsrForcedDisassoc; |
| 914 | //Put the disassoc command before the standby command |
| 915 | csrLLInsertHead( &pMac->sme.smeCmdPendingList, &pNewCmd->Link, |
| 916 | LL_ACCESS_LOCK ); |
| 917 | } |
| 918 | else |
| 919 | { |
| 920 | //Continue the command here |
| 921 | fContinue = pmcProcessCommand( pMac, pCommand ); |
| 922 | if( fContinue ) |
| 923 | { |
| 924 | //The command failed, remove it |
| 925 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 926 | &pCommand->Link, LL_ACCESS_LOCK ) ) |
| 927 | { |
| 928 | pmcReleaseCommand( pMac, pCommand ); |
| 929 | } |
| 930 | } |
| 931 | } |
| 932 | } |
| 933 | else |
| 934 | { |
| 935 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 936 | smsLog( pMac, LOGE, FL(" failed to remove standby command") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 937 | VOS_ASSERT(0); |
| 938 | } |
| 939 | } |
| 940 | break; |
| 941 | |
| 942 | case eSmeCommandAddTs: |
| 943 | case eSmeCommandDelTs: |
| 944 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 945 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 946 | fContinue = qosProcessCommand( pMac, pCommand ); |
| 947 | if( fContinue ) |
| 948 | { |
| 949 | //The command failed, remove it |
| 950 | if( csrLLRemoveEntry( &pMac->sme.smeCmdActiveList, |
| 951 | &pCommand->Link, LL_ACCESS_NOLOCK ) ) |
| 952 | { |
| 953 | //#ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 954 | qosReleaseCommand( pMac, pCommand ); |
| 955 | //#endif /* WLAN_MDM_CODE_REDUCTION_OPT*/ |
| 956 | } |
| 957 | } |
| 958 | #endif |
| 959 | break; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 960 | #ifdef FEATURE_WLAN_TDLS |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 961 | case eSmeCommandTdlsSendMgmt: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 962 | case eSmeCommandTdlsAddPeer: |
| 963 | case eSmeCommandTdlsDelPeer: |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 964 | case eSmeCommandTdlsLinkEstablish: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 965 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 966 | case eSmeCommandTdlsDiscovery: |
| 967 | case eSmeCommandTdlsLinkSetup: |
| 968 | case eSmeCommandTdlsLinkTear: |
| 969 | case eSmeCommandTdlsEnterUapsd: |
| 970 | case eSmeCommandTdlsExitUapsd: |
| 971 | #endif |
| 972 | { |
Hoonki Lee | 1090c6a | 2013-01-16 17:40:54 -0800 | [diff] [blame] | 973 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 974 | "sending TDLS Command 0x%x to PE", pCommand->command); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 975 | |
| 976 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 977 | status = csrTdlsProcessCmd( pMac, pCommand ); |
| 978 | } |
| 979 | break ; |
| 980 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 981 | |
| 982 | default: |
| 983 | //something is wrong |
| 984 | //remove it from the active list |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 985 | smsLog(pMac, LOGE, " csrProcessCommand processes an unknown command %d", pCommand->command); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 986 | pEntry = csrLLRemoveHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ); |
| 987 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 988 | pCommand = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 989 | smeReleaseCommand( pMac, pCommand ); |
| 990 | status = eHAL_STATUS_FAILURE; |
| 991 | break; |
| 992 | } |
| 993 | if(!HAL_STATUS_SUCCESS(status)) |
| 994 | { |
| 995 | fContinue = eANI_BOOLEAN_TRUE; |
| 996 | } |
| 997 | }//if(pEntry) |
| 998 | else |
| 999 | { |
| 1000 | //This is odd. Some one else pull off the command. |
| 1001 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1002 | } |
| 1003 | } |
| 1004 | else |
| 1005 | { |
| 1006 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1007 | } |
| 1008 | } |
| 1009 | else |
| 1010 | { |
| 1011 | //No command waiting |
| 1012 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1013 | //This is only used to restart an idle mode scan, it means at least one other idle scan has finished. |
| 1014 | if(pMac->scan.fRestartIdleScan && eANI_BOOLEAN_FALSE == pMac->scan.fCancelIdleScan) |
| 1015 | { |
| 1016 | tANI_U32 nTime = 0; |
| 1017 | |
| 1018 | pMac->scan.fRestartIdleScan = eANI_BOOLEAN_FALSE; |
| 1019 | if(!HAL_STATUS_SUCCESS(csrScanTriggerIdleScan(pMac, &nTime))) |
| 1020 | { |
| 1021 | csrScanStartIdleScanTimer(pMac, nTime); |
| 1022 | } |
| 1023 | } |
| 1024 | } |
| 1025 | } |
| 1026 | else { |
| 1027 | csrLLUnlock( &pMac->sme.smeCmdActiveList ); |
| 1028 | } |
| 1029 | |
Madan Mohan Koyyalamudi | e1a64b4 | 2013-06-19 16:34:44 +0530 | [diff] [blame] | 1030 | sme_process_scan_queue: |
| 1031 | if (pMac->fScanOffload && !(smeProcessScanQueue(pMac))) |
| 1032 | fContinue = eANI_BOOLEAN_FALSE; |
| 1033 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1034 | return ( fContinue ); |
| 1035 | } |
| 1036 | |
| 1037 | void smeProcessPendingQueue( tpAniSirGlobal pMac ) |
| 1038 | { |
| 1039 | while( smeProcessCommand( pMac ) ); |
| 1040 | } |
| 1041 | |
| 1042 | |
| 1043 | tANI_BOOLEAN smeCommandPending(tpAniSirGlobal pMac) |
| 1044 | { |
| 1045 | return ( !csrLLIsListEmpty( &pMac->sme.smeCmdActiveList, LL_ACCESS_NOLOCK ) || |
| 1046 | !csrLLIsListEmpty(&pMac->sme.smeCmdPendingList, LL_ACCESS_NOLOCK) ); |
| 1047 | } |
| 1048 | |
| 1049 | |
| 1050 | |
| 1051 | //Global APIs |
| 1052 | |
| 1053 | /*-------------------------------------------------------------------------- |
| 1054 | |
| 1055 | \brief sme_Open() - Initialze all SME modules and put them at idle state |
| 1056 | |
| 1057 | The function initializes each module inside SME, PMC, CCM, CSR, etc. . Upon |
| 1058 | successfully return, all modules are at idle state ready to start. |
| 1059 | |
| 1060 | smeOpen must be called before any other SME APIs can be involved. |
| 1061 | smeOpen must be called after macOpen. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1062 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1063 | \param hHal - The handle returned by macOpen. |
| 1064 | |
| 1065 | \return eHAL_STATUS_SUCCESS - SME is successfully initialized. |
| 1066 | |
| 1067 | Other status means SME is failed to be initialized |
| 1068 | \sa |
| 1069 | |
| 1070 | --------------------------------------------------------------------------*/ |
| 1071 | eHalStatus sme_Open(tHalHandle hHal) |
| 1072 | { |
| 1073 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1074 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1075 | |
| 1076 | do { |
| 1077 | pMac->sme.state = SME_STATE_STOP; |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 1078 | pMac->sme.currDeviceMode = VOS_STA_MODE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1079 | if( !VOS_IS_STATUS_SUCCESS( vos_lock_init( &pMac->sme.lkSmeGlobalLock ) ) ) |
| 1080 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1081 | smsLog( pMac, LOGE, "sme_Open failed init lock" ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1082 | status = eHAL_STATUS_FAILURE; |
| 1083 | break; |
| 1084 | } |
| 1085 | |
| 1086 | status = ccmOpen(hHal); |
| 1087 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1088 | smsLog( pMac, LOGE, |
| 1089 | "ccmOpen failed during initialization with status=%d", status ); |
| 1090 | break; |
| 1091 | } |
| 1092 | |
| 1093 | status = csrOpen(pMac); |
| 1094 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1095 | smsLog( pMac, LOGE, |
| 1096 | "csrOpen failed during initialization with status=%d", status ); |
| 1097 | break; |
| 1098 | } |
| 1099 | |
| 1100 | status = pmcOpen(hHal); |
| 1101 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1102 | smsLog( pMac, LOGE, |
| 1103 | "pmcOpen failed during initialization with status=%d", status ); |
| 1104 | break; |
| 1105 | } |
| 1106 | |
Gopichand Nakkala | 34d1b06 | 2013-03-19 15:28:33 -0700 | [diff] [blame] | 1107 | #ifdef FEATURE_WLAN_TDLS |
| 1108 | pMac->isTdlsPowerSaveProhibited = 0; |
| 1109 | #endif |
| 1110 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1111 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1112 | status = sme_QosOpen(pMac); |
| 1113 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1114 | smsLog( pMac, LOGE, |
| 1115 | "Qos open failed during initialization with status=%d", status ); |
| 1116 | break; |
| 1117 | } |
| 1118 | |
| 1119 | status = btcOpen(pMac); |
| 1120 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1121 | smsLog( pMac, LOGE, |
| 1122 | "btcOpen open failed during initialization with status=%d", status ); |
| 1123 | break; |
| 1124 | } |
| 1125 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1126 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1127 | status = oemData_OemDataReqOpen(pMac); |
| 1128 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1129 | smsLog(pMac, LOGE, |
| 1130 | "oemData_OemDataReqOpen failed during initialization with status=%d", status ); |
| 1131 | break; |
| 1132 | } |
| 1133 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1134 | |
| 1135 | if(!HAL_STATUS_SUCCESS((status = initSmeCmdList(pMac)))) |
| 1136 | break; |
| 1137 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1138 | { |
| 1139 | v_PVOID_t pvosGCtx = vos_get_global_context(VOS_MODULE_ID_SAP, NULL); |
| 1140 | if ( NULL == pvosGCtx ){ |
| 1141 | smsLog( pMac, LOGE, "WLANSAP_Open open failed during initialization"); |
| 1142 | status = eHAL_STATUS_FAILURE; |
| 1143 | break; |
| 1144 | } |
| 1145 | |
| 1146 | status = WLANSAP_Open( pvosGCtx ); |
| 1147 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1148 | smsLog( pMac, LOGE, |
| 1149 | "WLANSAP_Open open failed during initialization with status=%d", status ); |
| 1150 | break; |
| 1151 | } |
| 1152 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1153 | #if defined WLAN_FEATURE_VOWIFI |
| 1154 | status = rrmOpen(pMac); |
| 1155 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 1156 | smsLog( pMac, LOGE, |
| 1157 | "rrmOpen open failed during initialization with status=%d", status ); |
| 1158 | break; |
| 1159 | } |
| 1160 | #endif |
| 1161 | |
| 1162 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 1163 | sme_FTOpen(pMac); |
| 1164 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1165 | sme_p2pOpen(pMac); |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1166 | smeTraceInit(pMac); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1167 | |
| 1168 | }while (0); |
| 1169 | |
| 1170 | return status; |
| 1171 | } |
| 1172 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1173 | /*-------------------------------------------------------------------------- |
| 1174 | |
| 1175 | \brief sme_set11dinfo() - Set the 11d information about valid channels |
| 1176 | and there power using information from nvRAM |
| 1177 | This function is called only for AP. |
| 1178 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1179 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1180 | |
| 1181 | \param hHal - The handle returned by macOpen. |
| 1182 | \Param pSmeConfigParams - a pointer to a caller allocated object of |
| 1183 | typedef struct _smeConfigParams. |
| 1184 | |
| 1185 | \return eHAL_STATUS_SUCCESS - SME update the config parameters successfully. |
| 1186 | |
| 1187 | Other status means SME is failed to update the config parameters. |
| 1188 | \sa |
| 1189 | --------------------------------------------------------------------------*/ |
| 1190 | |
| 1191 | eHalStatus sme_set11dinfo(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) |
| 1192 | { |
| 1193 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1194 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1195 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1196 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1197 | TRACE_CODE_SME_RX_HDD_MSG_SET_11DINFO, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1198 | if (NULL == pSmeConfigParams ) { |
| 1199 | smsLog( pMac, LOGE, |
| 1200 | "Empty config param structure for SME, nothing to update"); |
| 1201 | return status; |
| 1202 | } |
| 1203 | |
| 1204 | status = csrSetChannels(hHal, &pSmeConfigParams->csrConfig ); |
| 1205 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1206 | smsLog( pMac, LOGE, "csrChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1207 | status ); |
| 1208 | } |
| 1209 | return status; |
| 1210 | } |
| 1211 | |
| 1212 | /*-------------------------------------------------------------------------- |
| 1213 | |
| 1214 | \brief sme_getSoftApDomain() - Get the current regulatory domain of softAp. |
| 1215 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1216 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1217 | |
| 1218 | \param hHal - The handle returned by HostapdAdapter. |
| 1219 | \Param v_REGDOMAIN_t - The current Regulatory Domain requested for SoftAp. |
| 1220 | |
| 1221 | \return eHAL_STATUS_SUCCESS - SME successfully completed the request. |
| 1222 | |
| 1223 | Other status means, failed to get the current regulatory domain. |
| 1224 | \sa |
| 1225 | --------------------------------------------------------------------------*/ |
| 1226 | |
| 1227 | eHalStatus sme_getSoftApDomain(tHalHandle hHal, v_REGDOMAIN_t *domainIdSoftAp) |
| 1228 | { |
| 1229 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1230 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1231 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1232 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1233 | TRACE_CODE_SME_RX_HDD_MSG_GET_SOFTAP_DOMAIN, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1234 | if (NULL == domainIdSoftAp ) { |
| 1235 | smsLog( pMac, LOGE, "Uninitialized domain Id"); |
| 1236 | return status; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1237 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1238 | |
| 1239 | *domainIdSoftAp = pMac->scan.domainIdCurrent; |
| 1240 | status = eHAL_STATUS_SUCCESS; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1241 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1242 | return status; |
| 1243 | } |
| 1244 | |
| 1245 | |
| 1246 | eHalStatus sme_setRegInfo(tHalHandle hHal, tANI_U8 *apCntryCode) |
| 1247 | { |
| 1248 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1249 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1250 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1251 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1252 | TRACE_CODE_SME_RX_HDD_MSG_SET_REGINFO, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1253 | if (NULL == apCntryCode ) { |
| 1254 | smsLog( pMac, LOGE, "Empty Country Code, nothing to update"); |
| 1255 | return status; |
| 1256 | } |
| 1257 | |
| 1258 | status = csrSetRegInfo(hHal, apCntryCode ); |
| 1259 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1260 | smsLog( pMac, LOGE, "csrSetRegInfo failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1261 | status ); |
| 1262 | } |
| 1263 | return status; |
| 1264 | } |
| 1265 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1266 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 1267 | /*-------------------------------------------------------------------------- |
| 1268 | |
| 1269 | \brief sme_UpdateChannelConfig() - Update channel configuration in RIVA. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1270 | |
| 1271 | It is used at driver start up to inform RIVA of the default channel |
| 1272 | configuration. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1273 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1274 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1275 | |
| 1276 | \param hHal - The handle returned by macOpen. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1277 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1278 | \return eHAL_STATUS_SUCCESS - SME update the channel config successfully. |
| 1279 | |
| 1280 | Other status means SME is failed to update the channel config. |
| 1281 | \sa |
| 1282 | |
| 1283 | --------------------------------------------------------------------------*/ |
| 1284 | eHalStatus sme_UpdateChannelConfig(tHalHandle hHal) |
| 1285 | { |
| 1286 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1287 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1288 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1289 | TRACE_CODE_SME_RX_HDD_MSG_UPDATE_CHANNEL_CONFIG, NO_SESSION, 0)); |
| 1290 | pmcUpdateScanParams( pMac, &(pMac->roam.configParam), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1291 | &pMac->scan.base20MHzChannels, FALSE); |
| 1292 | return eHAL_STATUS_SUCCESS; |
| 1293 | } |
| 1294 | #endif // FEATURE_WLAN_SCAN_PNLO |
| 1295 | |
| 1296 | /*-------------------------------------------------------------------------- |
| 1297 | |
| 1298 | \brief sme_UpdateConfig() - Change configurations for all SME moduels |
| 1299 | |
| 1300 | The function updates some configuration for modules in SME, CCM, CSR, etc |
| 1301 | during SMEs close open sequence. |
| 1302 | |
| 1303 | Modules inside SME apply the new configuration at the next transaction. |
| 1304 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1305 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1306 | |
| 1307 | \param hHal - The handle returned by macOpen. |
| 1308 | \Param pSmeConfigParams - a pointer to a caller allocated object of |
| 1309 | typedef struct _smeConfigParams. |
| 1310 | |
| 1311 | \return eHAL_STATUS_SUCCESS - SME update the config parameters successfully. |
| 1312 | |
| 1313 | Other status means SME is failed to update the config parameters. |
| 1314 | \sa |
| 1315 | |
| 1316 | --------------------------------------------------------------------------*/ |
| 1317 | eHalStatus sme_UpdateConfig(tHalHandle hHal, tpSmeConfigParams pSmeConfigParams) |
| 1318 | { |
| 1319 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1320 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1321 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1322 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1323 | TRACE_CODE_SME_RX_HDD_MSG_UPDATE_CONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1324 | if (NULL == pSmeConfigParams ) { |
| 1325 | smsLog( pMac, LOGE, |
| 1326 | "Empty config param structure for SME, nothing to update"); |
| 1327 | return status; |
| 1328 | } |
| 1329 | |
| 1330 | status = csrChangeDefaultConfigParam(pMac, &pSmeConfigParams->csrConfig); |
| 1331 | |
| 1332 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1333 | smsLog( pMac, LOGE, "csrChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1334 | status ); |
| 1335 | } |
| 1336 | #if defined WLAN_FEATURE_P2P_INTERNAL |
| 1337 | status = p2pChangeDefaultConfigParam(pMac, &pSmeConfigParams->p2pConfig); |
| 1338 | |
| 1339 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1340 | smsLog( pMac, LOGE, "p2pChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1341 | status ); |
| 1342 | } |
| 1343 | #endif |
| 1344 | #if defined WLAN_FEATURE_VOWIFI |
| 1345 | status = rrmChangeDefaultConfigParam(hHal, &pSmeConfigParams->rrmConfig); |
| 1346 | |
| 1347 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1348 | smsLog( pMac, LOGE, "rrmChangeDefaultConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1349 | status ); |
| 1350 | } |
| 1351 | #endif |
| 1352 | //For SOC, CFG is set before start |
| 1353 | //We don't want to apply global CFG in connect state because that may cause some side affect |
| 1354 | if( |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1355 | csrIsAllSessionDisconnected( pMac) ) |
| 1356 | { |
| 1357 | csrSetGlobalCfgs(pMac); |
| 1358 | } |
| 1359 | |
Gopichand Nakkala | 86e4266 | 2013-06-11 17:44:11 +0530 | [diff] [blame] | 1360 | /* update the directed scan offload setting */ |
| 1361 | pMac->fScanOffload = pSmeConfigParams->fScanOffload; |
| 1362 | |
Sandeep Puligilla | 6034276 | 2014-01-30 21:05:37 +0530 | [diff] [blame] | 1363 | /* Enable channel bonding mode in 2.4GHz */ |
| 1364 | if ((pSmeConfigParams->csrConfig.channelBondingMode24GHz == TRUE) && |
| 1365 | (IS_HT40_OBSS_SCAN_FEATURE_ENABLE)) |
| 1366 | { |
| 1367 | ccmCfgSetInt(hHal,WNI_CFG_CHANNEL_BONDING_24G, |
| 1368 | eANI_BOOLEAN_TRUE, NULL,eANI_BOOLEAN_FALSE); |
| 1369 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO_HIGH, |
| 1370 | "Setting channelBondingMode24GHz:%d " , |
| 1371 | pSmeConfigParams->csrConfig.channelBondingMode24GHz); |
| 1372 | } |
Madan Mohan Koyyalamudi | d89feb7 | 2013-07-31 15:47:12 +0530 | [diff] [blame] | 1373 | if (pMac->fScanOffload) |
| 1374 | { |
| 1375 | /* If scan offload is enabled then lim has allow the sending of |
| 1376 | scan request to firmware even in powersave mode. The firmware has |
| 1377 | to take care of exiting from power save mode */ |
| 1378 | status = ccmCfgSetInt(hHal, WNI_CFG_SCAN_IN_POWERSAVE, |
| 1379 | eANI_BOOLEAN_TRUE, NULL, eANI_BOOLEAN_FALSE); |
| 1380 | |
| 1381 | if (eHAL_STATUS_SUCCESS != status) |
| 1382 | { |
| 1383 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1384 | "Could not pass on WNI_CFG_SCAN_IN_POWERSAVE to CCM"); |
| 1385 | } |
| 1386 | } |
krunal soni | e9002db | 2013-11-25 14:24:17 -0800 | [diff] [blame] | 1387 | pMac->isCoalesingInIBSSAllowed = |
| 1388 | pSmeConfigParams->csrConfig.isCoalesingInIBSSAllowed; |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 1389 | pMac->fEnableDebugLog = pSmeConfigParams->fEnableDebugLog; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1390 | return status; |
| 1391 | } |
| 1392 | |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 1393 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 1394 | void sme_ProcessGetGtkInfoRsp( tHalHandle hHal, |
| 1395 | tpSirGtkOffloadGetInfoRspParams pGtkOffloadGetInfoRsp) |
| 1396 | { |
| 1397 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1398 | |
| 1399 | if (NULL == pMac) |
| 1400 | { |
| 1401 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 1402 | "%s: pMac is null", __func__); |
| 1403 | return ; |
| 1404 | } |
| 1405 | if (pMac->pmc.GtkOffloadGetInfoCB == NULL) |
| 1406 | { |
| 1407 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 1408 | "%s: HDD callback is null", __func__); |
| 1409 | return ; |
| 1410 | } |
| 1411 | pMac->pmc.GtkOffloadGetInfoCB(pMac->pmc.GtkOffloadGetInfoCBContext, |
| 1412 | pGtkOffloadGetInfoRsp); |
| 1413 | } |
| 1414 | #endif |
| 1415 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1416 | /* --------------------------------------------------------------------------- |
| 1417 | \fn sme_ChangeConfigParams |
| 1418 | \brief The SME API exposed for HDD to provide config params to SME during |
| 1419 | SMEs stop -> start sequence. |
| 1420 | |
| 1421 | If HDD changed the domain that will cause a reset. This function will |
| 1422 | provide the new set of 11d information for the new domain. Currrently this |
| 1423 | API provides info regarding 11d only at reset but we can extend this for |
| 1424 | other params (PMC, QoS) which needs to be initialized again at reset. |
| 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 | |
| 1430 | \Param |
| 1431 | pUpdateConfigParam - a pointer to a structure (tCsrUpdateConfigParam) that |
| 1432 | currently provides 11d related information like Country code, |
| 1433 | Regulatory domain, valid channel list, Tx power per channel, a |
| 1434 | list with active/passive scan allowed per valid channel. |
| 1435 | |
| 1436 | \return eHalStatus |
| 1437 | ---------------------------------------------------------------------------*/ |
| 1438 | eHalStatus sme_ChangeConfigParams(tHalHandle hHal, |
| 1439 | tCsrUpdateConfigParam *pUpdateConfigParam) |
| 1440 | { |
| 1441 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1442 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1443 | |
| 1444 | if (NULL == pUpdateConfigParam ) { |
| 1445 | smsLog( pMac, LOGE, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1446 | "Empty config param structure for SME, nothing to reset"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1447 | return status; |
| 1448 | } |
| 1449 | |
| 1450 | status = csrChangeConfigParams(pMac, pUpdateConfigParam); |
| 1451 | |
| 1452 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1453 | smsLog( pMac, LOGE, "csrUpdateConfigParam failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1454 | status ); |
| 1455 | } |
| 1456 | |
| 1457 | return status; |
| 1458 | |
| 1459 | } |
| 1460 | |
| 1461 | /*-------------------------------------------------------------------------- |
| 1462 | |
| 1463 | \brief sme_HDDReadyInd() - SME sends eWNI_SME_SYS_READY_IND to PE to inform |
| 1464 | that the NIC is ready tio run. |
| 1465 | |
| 1466 | The function is called by HDD at the end of initialization stage so PE/HAL can |
| 1467 | enable the NIC to running state. |
| 1468 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1469 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1470 | \param hHal - The handle returned by macOpen. |
| 1471 | |
| 1472 | \return eHAL_STATUS_SUCCESS - eWNI_SME_SYS_READY_IND is sent to PE |
| 1473 | successfully. |
| 1474 | |
| 1475 | Other status means SME failed to send the message to PE. |
| 1476 | \sa |
| 1477 | |
| 1478 | --------------------------------------------------------------------------*/ |
| 1479 | eHalStatus sme_HDDReadyInd(tHalHandle hHal) |
| 1480 | { |
| 1481 | tSirSmeReadyReq Msg; |
| 1482 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1483 | tPmcPowerState powerState; |
| 1484 | tPmcSwitchState hwWlanSwitchState; |
| 1485 | tPmcSwitchState swWlanSwitchState; |
| 1486 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1487 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 1488 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 1489 | TRACE_CODE_SME_RX_HDD_MSG_HDDREADYIND, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1490 | do |
| 1491 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1492 | |
| 1493 | Msg.messageType = eWNI_SME_SYS_READY_IND; |
| 1494 | Msg.length = sizeof( tSirSmeReadyReq ); |
| 1495 | |
| 1496 | if (eSIR_FAILURE != uMacPostCtrlMsg( hHal, (tSirMbMsg*)&Msg )) |
| 1497 | { |
| 1498 | status = eHAL_STATUS_SUCCESS; |
| 1499 | } |
| 1500 | else |
| 1501 | { |
| 1502 | smsLog( pMac, LOGE, |
| 1503 | "uMacPostCtrlMsg failed to send eWNI_SME_SYS_READY_IND"); |
| 1504 | break; |
| 1505 | } |
| 1506 | |
| 1507 | status = pmcQueryPowerState( hHal, &powerState, |
| 1508 | &hwWlanSwitchState, &swWlanSwitchState ); |
| 1509 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1510 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1511 | smsLog( pMac, LOGE, "pmcQueryPowerState failed with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1512 | status ); |
| 1513 | break; |
| 1514 | } |
| 1515 | |
| 1516 | if ( (ePMC_SWITCH_OFF != hwWlanSwitchState) && |
| 1517 | (ePMC_SWITCH_OFF != swWlanSwitchState) ) |
| 1518 | { |
| 1519 | status = csrReady(pMac); |
| 1520 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1521 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1522 | smsLog( pMac, LOGE, "csrReady failed with status=%d", status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1523 | break; |
| 1524 | } |
| 1525 | status = pmcReady(hHal); |
| 1526 | if ( ! HAL_STATUS_SUCCESS( status ) ) |
| 1527 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1528 | smsLog( pMac, LOGE, "pmcReady failed with status=%d", status ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1529 | break; |
| 1530 | } |
| 1531 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1532 | if(VOS_STATUS_SUCCESS != btcReady(hHal)) |
| 1533 | { |
| 1534 | status = eHAL_STATUS_FAILURE; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1535 | smsLog( pMac, LOGE, "btcReady failed"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1536 | break; |
| 1537 | } |
| 1538 | #endif |
| 1539 | |
| 1540 | #if defined WLAN_FEATURE_VOWIFI |
| 1541 | if(VOS_STATUS_SUCCESS != rrmReady(hHal)) |
| 1542 | { |
| 1543 | status = eHAL_STATUS_FAILURE; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1544 | smsLog( pMac, LOGE, "rrmReady failed"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1545 | break; |
| 1546 | } |
| 1547 | #endif |
| 1548 | } |
| 1549 | pMac->sme.state = SME_STATE_READY; |
| 1550 | } while( 0 ); |
| 1551 | |
| 1552 | return status; |
| 1553 | } |
| 1554 | |
| 1555 | /*-------------------------------------------------------------------------- |
| 1556 | |
| 1557 | \brief sme_Start() - Put all SME modules at ready state. |
| 1558 | |
| 1559 | The function starts each module in SME, PMC, CCM, CSR, etc. . Upon |
| 1560 | successfully return, all modules are ready to run. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1561 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1562 | \param hHal - The handle returned by macOpen. |
| 1563 | |
| 1564 | \return eHAL_STATUS_SUCCESS - SME is ready. |
| 1565 | |
| 1566 | Other status means SME is failed to start |
| 1567 | \sa |
| 1568 | |
| 1569 | --------------------------------------------------------------------------*/ |
| 1570 | eHalStatus sme_Start(tHalHandle hHal) |
| 1571 | { |
| 1572 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1573 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1574 | |
| 1575 | do |
| 1576 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1577 | status = csrStart(pMac); |
| 1578 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1579 | smsLog( pMac, LOGE, "csrStart failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1580 | status ); |
| 1581 | break; |
| 1582 | } |
| 1583 | |
| 1584 | status = pmcStart(hHal); |
| 1585 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1586 | smsLog( pMac, LOGE, "pmcStart failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1587 | status ); |
| 1588 | break; |
| 1589 | } |
| 1590 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1591 | status = WLANSAP_Start(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 1592 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1593 | smsLog( pMac, LOGE, "WLANSAP_Start failed during smeStart with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1594 | status ); |
| 1595 | break; |
| 1596 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1597 | pMac->sme.state = SME_STATE_START; |
| 1598 | }while (0); |
| 1599 | |
| 1600 | return status; |
| 1601 | } |
| 1602 | |
| 1603 | |
| 1604 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 1605 | /****************************************************************************** |
| 1606 | * |
| 1607 | * Name: sme_PCFilterMatchCountResponseHandler |
| 1608 | * |
| 1609 | * Description: |
| 1610 | * Invoke Packet Coalescing Filter Match Count callback routine |
| 1611 | * |
| 1612 | * Parameters: |
| 1613 | * hHal - HAL handle for device |
| 1614 | * pMsg - Pointer to tRcvFltPktMatchRsp structure |
| 1615 | * |
| 1616 | * Returns: eHalStatus |
| 1617 | * |
| 1618 | ******************************************************************************/ |
| 1619 | eHalStatus sme_PCFilterMatchCountResponseHandler(tHalHandle hHal, void* pMsg) |
| 1620 | { |
| 1621 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 1622 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1623 | tpSirRcvFltPktMatchRsp pRcvFltPktMatchRsp = (tpSirRcvFltPktMatchRsp)pMsg; |
| 1624 | |
| 1625 | if (NULL == pMsg) |
| 1626 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1627 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1628 | status = eHAL_STATUS_FAILURE; |
| 1629 | } |
| 1630 | else |
| 1631 | { |
| 1632 | smsLog(pMac, LOG2, "SME: entering " |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1633 | "sme_FilterMatchCountResponseHandler"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1634 | |
| 1635 | /* Call Packet Coalescing Filter Match Count callback routine. */ |
| 1636 | if (pMac->pmc.FilterMatchCountCB != NULL) |
| 1637 | pMac->pmc.FilterMatchCountCB(pMac->pmc.FilterMatchCountCBContext, |
| 1638 | pRcvFltPktMatchRsp); |
| 1639 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 1640 | smsLog(pMac, LOG1, "%s: status=0x%x", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1641 | pRcvFltPktMatchRsp->status); |
| 1642 | |
| 1643 | pMac->pmc.FilterMatchCountCB = NULL; |
| 1644 | pMac->pmc.FilterMatchCountCBContext = NULL; |
| 1645 | } |
| 1646 | |
| 1647 | return(status); |
| 1648 | } |
| 1649 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 1650 | |
| 1651 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1652 | #ifdef WLAN_FEATURE_11W |
| 1653 | /*------------------------------------------------------------------ |
| 1654 | * |
| 1655 | * Handle the unprotected management frame indication from LIM and |
| 1656 | * forward it to HDD. |
| 1657 | * |
| 1658 | *------------------------------------------------------------------*/ |
| 1659 | |
| 1660 | eHalStatus sme_UnprotectedMgmtFrmInd( tHalHandle hHal, |
| 1661 | tpSirSmeUnprotMgmtFrameInd pSmeMgmtFrm) |
| 1662 | { |
| 1663 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1664 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1665 | tCsrRoamInfo pRoamInfo = {0}; |
| 1666 | tANI_U32 SessionId = pSmeMgmtFrm->sessionId; |
| 1667 | |
| 1668 | pRoamInfo.nFrameLength = pSmeMgmtFrm->frameLen; |
| 1669 | pRoamInfo.pbFrames = pSmeMgmtFrm->frameBuf; |
| 1670 | pRoamInfo.frameType = pSmeMgmtFrm->frameType; |
| 1671 | |
| 1672 | /* forward the mgmt frame to HDD */ |
| 1673 | csrRoamCallCallback(pMac, SessionId, &pRoamInfo, 0, eCSR_ROAM_UNPROT_MGMT_FRAME_IND, 0); |
| 1674 | |
| 1675 | return status; |
| 1676 | } |
| 1677 | #endif |
| 1678 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1679 | #if defined(FEATURE_WLAN_CCX) && defined(FEATURE_WLAN_CCX_UPLOAD) |
| 1680 | /*------------------------------------------------------------------ |
| 1681 | * |
| 1682 | * Handle the tsm ie indication from LIM and forward it to HDD. |
| 1683 | * |
| 1684 | *------------------------------------------------------------------*/ |
| 1685 | |
| 1686 | eHalStatus sme_TsmIeInd(tHalHandle hHal, tSirSmeTsmIEInd *pSmeTsmIeInd) |
| 1687 | { |
| 1688 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1689 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1690 | tCsrRoamInfo pRoamInfo = {0}; |
| 1691 | tANI_U32 SessionId = pSmeTsmIeInd->sessionId; |
| 1692 | |
| 1693 | pRoamInfo.tsmIe.tsid= pSmeTsmIeInd->tsmIe.tsid; |
| 1694 | pRoamInfo.tsmIe.state= pSmeTsmIeInd->tsmIe.state; |
| 1695 | pRoamInfo.tsmIe.msmt_interval= pSmeTsmIeInd->tsmIe.msmt_interval; |
| 1696 | |
| 1697 | /* forward the tsm ie information to HDD */ |
| 1698 | csrRoamCallCallback(pMac, SessionId, &pRoamInfo, 0, eCSR_ROAM_TSM_IE_IND, 0); |
| 1699 | |
| 1700 | return status; |
| 1701 | } |
| 1702 | |
| 1703 | /* --------------------------------------------------------------------------- |
| 1704 | \fn sme_SetCCKMIe |
| 1705 | \brief function to store the CCKM IE passed from supplicant and use it while packing |
| 1706 | reassociation request |
| 1707 | \param hHal - HAL handle for device |
| 1708 | \param pCckmIe - pointer to CCKM IE data |
| 1709 | \param pCckmIeLen - length of the CCKM IE |
| 1710 | \- return Success or failure |
| 1711 | -------------------------------------------------------------------------*/ |
| 1712 | eHalStatus sme_SetCCKMIe(tHalHandle hHal, tANI_U8 sessionId, |
| 1713 | tANI_U8 *pCckmIe, tANI_U8 cckmIeLen) |
| 1714 | { |
| 1715 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1716 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 1717 | |
| 1718 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 1719 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 1720 | { |
| 1721 | csrSetCCKMIe(pMac, sessionId, pCckmIe, cckmIeLen); |
| 1722 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 1723 | } |
| 1724 | return status; |
| 1725 | } |
| 1726 | |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1727 | /* --------------------------------------------------------------------------- |
| 1728 | \fn sme_SetCcxBeaconRequest |
| 1729 | \brief function to set CCX beacon request parameters |
| 1730 | \param hHal - HAL handle for device |
| 1731 | \param sessionId - Session id |
| 1732 | \param pCcxBcnReq - pointer to CCX beacon request |
| 1733 | \- return Success or failure |
| 1734 | -------------------------------------------------------------------------*/ |
| 1735 | eHalStatus sme_SetCcxBeaconRequest(tHalHandle hHal, const tANI_U8 sessionId, |
| 1736 | const tCsrCcxBeaconReq* pCcxBcnReq) |
| 1737 | { |
| 1738 | eHalStatus status = eSIR_SUCCESS; |
| 1739 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1740 | tpSirBeaconReportReqInd pSmeBcnReportReq = NULL; |
| 1741 | tCsrCcxBeaconReqParams *pBeaconReq = NULL; |
| 1742 | tANI_U8 counter = 0; |
| 1743 | tCsrRoamSession *pSession = CSR_GET_SESSION(pMac, sessionId); |
| 1744 | tpRrmSMEContext pSmeRrmContext = &pMac->rrm.rrmSmeContext; |
| 1745 | |
| 1746 | /* Store the info in RRM context */ |
| 1747 | vos_mem_copy(&pSmeRrmContext->ccxBcnReqInfo, pCcxBcnReq, sizeof(tCsrCcxBeaconReq)); |
| 1748 | |
| 1749 | //Prepare the request to send to SME. |
| 1750 | pSmeBcnReportReq = vos_mem_malloc(sizeof( tSirBeaconReportReqInd )); |
| 1751 | if(NULL == pSmeBcnReportReq) |
| 1752 | { |
| 1753 | smsLog(pMac, LOGP, "Memory Allocation Failure!!! CCX BcnReq Ind to SME"); |
| 1754 | return eSIR_FAILURE; |
| 1755 | } |
| 1756 | |
| 1757 | smsLog(pMac, LOGE, "Sending Beacon Report Req to SME"); |
| 1758 | vos_mem_zero( pSmeBcnReportReq, sizeof( tSirBeaconReportReqInd )); |
| 1759 | |
| 1760 | pSmeBcnReportReq->messageType = eWNI_SME_BEACON_REPORT_REQ_IND; |
| 1761 | pSmeBcnReportReq->length = sizeof( tSirBeaconReportReqInd ); |
| 1762 | vos_mem_copy( pSmeBcnReportReq->bssId, pSession->connectedProfile.bssid, sizeof(tSirMacAddr) ); |
| 1763 | pSmeBcnReportReq->channelInfo.channelNum = 255; |
| 1764 | pSmeBcnReportReq->channelList.numChannels = pCcxBcnReq->numBcnReqIe; |
Srinivas Girigowda | 6d1f906 | 2014-02-03 18:15:54 -0800 | [diff] [blame] | 1765 | pSmeBcnReportReq->msgSource = eRRM_MSG_SOURCE_CCX_UPLOAD; |
Srinivas Girigowda | 91ccbe8 | 2013-11-10 16:37:38 -0800 | [diff] [blame] | 1766 | |
| 1767 | for (counter = 0; counter < pCcxBcnReq->numBcnReqIe; counter++) |
| 1768 | { |
| 1769 | pBeaconReq = (tCsrCcxBeaconReqParams *)&pCcxBcnReq->bcnReq[counter]; |
| 1770 | pSmeBcnReportReq->fMeasurementtype[counter] = pBeaconReq->scanMode; |
| 1771 | pSmeBcnReportReq->measurementDuration[counter] = SYS_TU_TO_MS(pBeaconReq->measurementDuration); |
| 1772 | pSmeBcnReportReq->channelList.channelNumber[counter] = pBeaconReq->channel; |
| 1773 | } |
| 1774 | |
| 1775 | sme_RrmProcessBeaconReportReqInd(pMac, pSmeBcnReportReq); |
| 1776 | return status; |
| 1777 | } |
| 1778 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 1779 | #endif /* FEATURE_WLAN_CCX && FEATURE_WLAN_CCX_UPLOAD */ |
| 1780 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 1781 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1782 | /*-------------------------------------------------------------------------- |
| 1783 | |
| 1784 | \brief sme_ProcessMsg() - The main message processor for SME. |
| 1785 | |
| 1786 | The function is called by a message dispatcher when to process a message |
| 1787 | targeted for SME. |
| 1788 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 1789 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1790 | \param hHal - The handle returned by macOpen. |
| 1791 | \param pMsg - A pointer to a caller allocated object of tSirMsgQ. |
| 1792 | |
| 1793 | \return eHAL_STATUS_SUCCESS - SME successfully process the message. |
| 1794 | |
| 1795 | Other status means SME failed to process the message to HAL. |
| 1796 | \sa |
| 1797 | |
| 1798 | --------------------------------------------------------------------------*/ |
| 1799 | eHalStatus sme_ProcessMsg(tHalHandle hHal, vos_msg_t* pMsg) |
| 1800 | { |
| 1801 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 1802 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 1803 | |
| 1804 | if (pMsg == NULL) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1805 | smsLog( pMac, LOGE, "Empty message for SME, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1806 | return status; |
| 1807 | } |
| 1808 | |
| 1809 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 1810 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 1811 | { |
| 1812 | if( SME_IS_START(pMac) ) |
| 1813 | { |
| 1814 | switch (pMsg->type) { // TODO: Will be modified to do a range check for msgs instead of having cases for each msgs |
| 1815 | case eWNI_PMC_ENTER_BMPS_RSP: |
| 1816 | case eWNI_PMC_EXIT_BMPS_RSP: |
| 1817 | case eWNI_PMC_EXIT_BMPS_IND: |
| 1818 | case eWNI_PMC_ENTER_IMPS_RSP: |
| 1819 | case eWNI_PMC_EXIT_IMPS_RSP: |
| 1820 | case eWNI_PMC_SMPS_STATE_IND: |
| 1821 | case eWNI_PMC_ENTER_UAPSD_RSP: |
| 1822 | case eWNI_PMC_EXIT_UAPSD_RSP: |
| 1823 | case eWNI_PMC_ENTER_WOWL_RSP: |
| 1824 | case eWNI_PMC_EXIT_WOWL_RSP: |
| 1825 | //PMC |
| 1826 | if (pMsg->bodyptr) |
| 1827 | { |
| 1828 | pmcMessageProcessor(hHal, pMsg->bodyptr); |
| 1829 | status = eHAL_STATUS_SUCCESS; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 1830 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1831 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1832 | smsLog( pMac, LOGE, "Empty rsp message for PMC, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1833 | } |
| 1834 | break; |
| 1835 | |
| 1836 | case WNI_CFG_SET_CNF: |
| 1837 | case WNI_CFG_DNLD_CNF: |
| 1838 | case WNI_CFG_GET_RSP: |
| 1839 | case WNI_CFG_ADD_GRP_ADDR_CNF: |
| 1840 | case WNI_CFG_DEL_GRP_ADDR_CNF: |
| 1841 | //CCM |
| 1842 | if (pMsg->bodyptr) |
| 1843 | { |
| 1844 | ccmCfgCnfMsgHandler(hHal, pMsg->bodyptr); |
| 1845 | status = eHAL_STATUS_SUCCESS; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 1846 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1847 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1848 | smsLog( pMac, LOGE, "Empty rsp message for CCM, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1849 | } |
| 1850 | break; |
| 1851 | |
| 1852 | case eWNI_SME_ADDTS_RSP: |
| 1853 | case eWNI_SME_DELTS_RSP: |
| 1854 | case eWNI_SME_DELTS_IND: |
| 1855 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 1856 | case eWNI_SME_FT_AGGR_QOS_RSP: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1857 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1858 | //QoS |
| 1859 | if (pMsg->bodyptr) |
| 1860 | { |
| 1861 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 1862 | status = sme_QosMsgProcessor(pMac, pMsg->type, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 1863 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1864 | #endif |
| 1865 | } else { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1866 | smsLog( pMac, LOGE, "Empty rsp message for QoS, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1867 | } |
| 1868 | break; |
| 1869 | #if defined WLAN_FEATURE_VOWIFI |
| 1870 | case eWNI_SME_NEIGHBOR_REPORT_IND: |
| 1871 | case eWNI_SME_BEACON_REPORT_REQ_IND: |
| 1872 | #if defined WLAN_VOWIFI_DEBUG |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1873 | smsLog( pMac, LOGE, "Received RRM message. Message Id = %d", pMsg->type ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1874 | #endif |
| 1875 | if ( pMsg->bodyptr ) |
| 1876 | { |
| 1877 | status = sme_RrmMsgProcessor( pMac, pMsg->type, pMsg->bodyptr ); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 1878 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1879 | } |
| 1880 | else |
| 1881 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1882 | smsLog( pMac, LOGE, "Empty message for RRM, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1883 | } |
| 1884 | break; |
| 1885 | #endif |
| 1886 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 1887 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 1888 | //Handle the eWNI_SME_OEM_DATA_RSP: |
| 1889 | case eWNI_SME_OEM_DATA_RSP: |
| 1890 | if(pMsg->bodyptr) |
| 1891 | { |
| 1892 | status = sme_HandleOemDataRsp(pMac, pMsg->bodyptr); |
| 1893 | vos_mem_free(pMsg->bodyptr); |
| 1894 | } |
| 1895 | else |
| 1896 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1897 | 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] | 1898 | } |
| 1899 | smeProcessPendingQueue( pMac ); |
| 1900 | break; |
| 1901 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1902 | |
| 1903 | case eWNI_SME_ADD_STA_SELF_RSP: |
| 1904 | if(pMsg->bodyptr) |
| 1905 | { |
| 1906 | status = csrProcessAddStaSessionRsp(pMac, pMsg->bodyptr); |
| 1907 | vos_mem_free(pMsg->bodyptr); |
| 1908 | } |
| 1909 | else |
| 1910 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1911 | 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] | 1912 | } |
| 1913 | break; |
| 1914 | case eWNI_SME_DEL_STA_SELF_RSP: |
| 1915 | if(pMsg->bodyptr) |
| 1916 | { |
| 1917 | status = csrProcessDelStaSessionRsp(pMac, pMsg->bodyptr); |
| 1918 | vos_mem_free(pMsg->bodyptr); |
| 1919 | } |
| 1920 | else |
| 1921 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1922 | 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] | 1923 | } |
| 1924 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1925 | case eWNI_SME_REMAIN_ON_CHN_RSP: |
| 1926 | if(pMsg->bodyptr) |
| 1927 | { |
| 1928 | status = sme_remainOnChnRsp(pMac, pMsg->bodyptr); |
| 1929 | vos_mem_free(pMsg->bodyptr); |
| 1930 | } |
| 1931 | else |
| 1932 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1933 | 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] | 1934 | } |
| 1935 | break; |
| 1936 | case eWNI_SME_REMAIN_ON_CHN_RDY_IND: |
| 1937 | if(pMsg->bodyptr) |
| 1938 | { |
| 1939 | status = sme_remainOnChnReady(pMac, pMsg->bodyptr); |
| 1940 | vos_mem_free(pMsg->bodyptr); |
| 1941 | } |
| 1942 | else |
| 1943 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1944 | 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] | 1945 | } |
| 1946 | break; |
| 1947 | case eWNI_SME_MGMT_FRM_IND: |
| 1948 | if(pMsg->bodyptr) |
| 1949 | { |
| 1950 | sme_mgmtFrmInd(pMac, pMsg->bodyptr); |
| 1951 | vos_mem_free(pMsg->bodyptr); |
| 1952 | } |
| 1953 | else |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1954 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1955 | 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] | 1956 | } |
| 1957 | break; |
| 1958 | case eWNI_SME_ACTION_FRAME_SEND_CNF: |
| 1959 | if(pMsg->bodyptr) |
| 1960 | { |
| 1961 | status = sme_sendActionCnf(pMac, pMsg->bodyptr); |
| 1962 | vos_mem_free(pMsg->bodyptr); |
| 1963 | } |
| 1964 | else |
| 1965 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1966 | 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] | 1967 | } |
| 1968 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1969 | case eWNI_SME_COEX_IND: |
| 1970 | if(pMsg->bodyptr) |
| 1971 | { |
| 1972 | status = btcHandleCoexInd((void *)pMac, pMsg->bodyptr); |
| 1973 | vos_mem_free(pMsg->bodyptr); |
| 1974 | } |
| 1975 | else |
| 1976 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1977 | 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] | 1978 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1979 | break; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1980 | |
| 1981 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 1982 | case eWNI_SME_PREF_NETWORK_FOUND_IND: |
| 1983 | if(pMsg->bodyptr) |
| 1984 | { |
| 1985 | status = sme_PreferredNetworkFoundInd((void *)pMac, pMsg->bodyptr); |
| 1986 | vos_mem_free(pMsg->bodyptr); |
| 1987 | } |
| 1988 | else |
| 1989 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 1990 | smsLog(pMac, LOGE, "Empty rsp message for meas (eWNI_SME_PREF_NETWORK_FOUND_IND), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1991 | } |
| 1992 | break; |
| 1993 | #endif // FEATURE_WLAN_SCAN_PNO |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 1994 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 1995 | case eWNI_SME_TX_PER_HIT_IND: |
| 1996 | if (pMac->sme.pTxPerHitCallback) |
| 1997 | { |
| 1998 | pMac->sme.pTxPerHitCallback(pMac->sme.pTxPerHitCbContext); |
| 1999 | } |
| 2000 | break; |
| 2001 | |
| 2002 | case eWNI_SME_CHANGE_COUNTRY_CODE: |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 2003 | if(pMsg->bodyptr) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2004 | { |
| 2005 | status = sme_HandleChangeCountryCode((void *)pMac, pMsg->bodyptr); |
| 2006 | vos_mem_free(pMsg->bodyptr); |
| 2007 | } |
| 2008 | else |
| 2009 | { |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 2010 | smsLog(pMac, LOGE, "Empty rsp message for message (eWNI_SME_CHANGE_COUNTRY_CODE), nothing to process"); |
| 2011 | } |
| 2012 | break; |
| 2013 | |
| 2014 | case eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE: |
| 2015 | if (pMsg->bodyptr) |
| 2016 | { |
| 2017 | status = sme_HandleGenericChangeCountryCode((void *)pMac, pMsg->bodyptr); |
| 2018 | vos_mem_free(pMsg->bodyptr); |
| 2019 | } |
| 2020 | else |
| 2021 | { |
| 2022 | 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] | 2023 | } |
| 2024 | break; |
| 2025 | |
| 2026 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
| 2027 | case eWNI_PMC_PACKET_COALESCING_FILTER_MATCH_COUNT_RSP: |
| 2028 | if(pMsg->bodyptr) |
| 2029 | { |
| 2030 | status = sme_PCFilterMatchCountResponseHandler((void *)pMac, pMsg->bodyptr); |
| 2031 | vos_mem_free(pMsg->bodyptr); |
| 2032 | } |
| 2033 | else |
| 2034 | { |
| 2035 | smsLog(pMac, LOGE, "Empty rsp message for meas " |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2036 | "(PACKET_COALESCING_FILTER_MATCH_COUNT_RSP), nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2037 | } |
| 2038 | break; |
| 2039 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 2040 | case eWNI_SME_PRE_SWITCH_CHL_IND: |
| 2041 | { |
| 2042 | status = sme_HandlePreChannelSwitchInd(pMac); |
| 2043 | break; |
| 2044 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2045 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2046 | case eWNI_SME_POST_SWITCH_CHL_IND: |
| 2047 | { |
| 2048 | status = sme_HandlePostChannelSwitchInd(pMac); |
| 2049 | break; |
| 2050 | } |
| 2051 | |
| 2052 | #ifdef WLAN_WAKEUP_EVENTS |
| 2053 | case eWNI_SME_WAKE_REASON_IND: |
| 2054 | if(pMsg->bodyptr) |
| 2055 | { |
| 2056 | status = sme_WakeReasonIndCallback((void *)pMac, pMsg->bodyptr); |
| 2057 | vos_mem_free(pMsg->bodyptr); |
| 2058 | } |
| 2059 | else |
| 2060 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2061 | 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] | 2062 | } |
| 2063 | break; |
| 2064 | #endif // WLAN_WAKEUP_EVENTS |
| 2065 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2066 | #ifdef FEATURE_WLAN_TDLS |
| 2067 | /* |
| 2068 | * command rescived from PE, SME tdls msg processor shall be called |
| 2069 | * to process commands recieved from PE |
| 2070 | */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2071 | case eWNI_SME_TDLS_SEND_MGMT_RSP: |
| 2072 | case eWNI_SME_TDLS_ADD_STA_RSP: |
Hoonki Lee | e6bfe94 | 2013-02-05 15:01:19 -0800 | [diff] [blame] | 2073 | case eWNI_SME_TDLS_DEL_STA_RSP: |
| 2074 | case eWNI_SME_TDLS_DEL_STA_IND: |
Gopichand Nakkala | 2a0a157 | 2013-02-10 21:39:16 -0800 | [diff] [blame] | 2075 | case eWNI_SME_TDLS_DEL_ALL_PEER_IND: |
Gopichand Nakkala | b977a97 | 2013-02-18 19:15:09 -0800 | [diff] [blame] | 2076 | case eWNI_SME_MGMT_FRM_TX_COMPLETION_IND: |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 2077 | case eWNI_SME_TDLS_LINK_ESTABLISH_RSP: |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2078 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 2079 | case eWNI_SME_TDLS_DISCOVERY_START_RSP: |
| 2080 | case eWNI_SME_TDLS_DISCOVERY_START_IND: |
| 2081 | case eWNI_SME_TDLS_LINK_START_RSP: |
| 2082 | case eWNI_SME_TDLS_LINK_START_IND: |
| 2083 | case eWNI_SME_TDLS_TEARDOWN_RSP: |
| 2084 | case eWNI_SME_TDLS_TEARDOWN_IND: |
| 2085 | case eWNI_SME_ADD_TDLS_PEER_IND: |
| 2086 | case eWNI_SME_DELETE_TDLS_PEER_IND: |
| 2087 | #endif |
| 2088 | { |
| 2089 | if (pMsg->bodyptr) |
| 2090 | { |
| 2091 | status = tdlsMsgProcessor(pMac, pMsg->type, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2092 | vos_mem_free(pMsg->bodyptr); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2093 | } |
| 2094 | else |
| 2095 | { |
| 2096 | smsLog( pMac, LOGE, "Empty rsp message for TDLS, \ |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2097 | nothing to process"); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 2098 | } |
| 2099 | break; |
| 2100 | } |
| 2101 | #endif |
| 2102 | |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2103 | #ifdef WLAN_FEATURE_11W |
| 2104 | case eWNI_SME_UNPROT_MGMT_FRM_IND: |
| 2105 | if (pMsg->bodyptr) |
| 2106 | { |
| 2107 | sme_UnprotectedMgmtFrmInd(pMac, pMsg->bodyptr); |
| 2108 | vos_mem_free(pMsg->bodyptr); |
| 2109 | } |
| 2110 | else |
| 2111 | { |
| 2112 | smsLog(pMac, LOGE, "Empty rsp message for meas (eWNI_SME_UNPROT_MGMT_FRM_IND), nothing to process"); |
| 2113 | } |
| 2114 | break; |
| 2115 | #endif |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 2116 | #if defined(FEATURE_WLAN_CCX) && defined(FEATURE_WLAN_CCX_UPLOAD) |
| 2117 | case eWNI_SME_TSM_IE_IND: |
| 2118 | { |
| 2119 | if (pMsg->bodyptr) |
| 2120 | { |
| 2121 | sme_TsmIeInd(pMac, pMsg->bodyptr); |
| 2122 | vos_mem_free(pMsg->bodyptr); |
| 2123 | } |
| 2124 | else |
| 2125 | { |
| 2126 | smsLog(pMac, LOGE, "Empty rsp message for (eWNI_SME_TSM_IE_IND), nothing to process"); |
| 2127 | } |
| 2128 | break; |
| 2129 | } |
| 2130 | #endif /* FEATURE_WLAN_CCX && FEATURE_WLAN_CCX_UPLOAD */ |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 2131 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 2132 | case eWNI_SME_ROAM_SCAN_OFFLOAD_RSP: |
| 2133 | status = csrRoamOffloadScanRspHdlr((void *)pMac, pMsg->bodyval); |
| 2134 | break; |
| 2135 | #endif // WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Chet Lanctot | 186b573 | 2013-03-18 10:26:30 -0700 | [diff] [blame] | 2136 | |
Gopichand Nakkala | d36ee62 | 2013-05-07 14:13:27 +0530 | [diff] [blame] | 2137 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 2138 | case eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP: |
| 2139 | if (pMsg->bodyptr) |
| 2140 | { |
| 2141 | sme_ProcessGetGtkInfoRsp(pMac, pMsg->bodyptr); |
| 2142 | vos_mem_free(pMsg->bodyptr); |
| 2143 | } |
| 2144 | else |
| 2145 | { |
| 2146 | smsLog(pMac, LOGE, "Empty rsp message for (eWNI_PMC_GTK_OFFLOAD_GETINFO_RSP), nothing to process"); |
| 2147 | } |
| 2148 | break ; |
| 2149 | #endif |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2150 | |
| 2151 | #ifdef FEATURE_WLAN_LPHB |
| 2152 | /* LPHB timeout indication arrived, send IND to client */ |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 2153 | case eWNI_SME_LPHB_IND: |
| 2154 | if (pMac->sme.pLphbIndCb) |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2155 | { |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 2156 | pMac->sme.pLphbIndCb(pMac->pAdapter, pMsg->bodyptr); |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 2157 | } |
| 2158 | vos_mem_free(pMsg->bodyptr); |
| 2159 | |
| 2160 | break; |
| 2161 | #endif /* FEATURE_WLAN_LPHB */ |
| 2162 | |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 2163 | #ifdef FEATURE_WLAN_CH_AVOID |
| 2164 | /* LPHB timeout indication arrived, send IND to client */ |
| 2165 | case eWNI_SME_CH_AVOID_IND: |
| 2166 | if (pMac->sme.pChAvoidNotificationCb) |
| 2167 | { |
| 2168 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 2169 | "%s: CH avoid notification", __func__); |
| 2170 | pMac->sme.pChAvoidNotificationCb(pMac->pAdapter, pMsg->bodyptr); |
| 2171 | } |
| 2172 | vos_mem_free(pMsg->bodyptr); |
| 2173 | |
| 2174 | break; |
| 2175 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 2176 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2177 | default: |
| 2178 | |
| 2179 | if ( ( pMsg->type >= eWNI_SME_MSG_TYPES_BEGIN ) |
| 2180 | && ( pMsg->type <= eWNI_SME_MSG_TYPES_END ) ) |
| 2181 | { |
| 2182 | //CSR |
| 2183 | if (pMsg->bodyptr) |
| 2184 | { |
| 2185 | status = csrMsgProcessor(hHal, pMsg->bodyptr); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2186 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 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 CSR, nothing to process"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2191 | } |
| 2192 | } |
| 2193 | else |
| 2194 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2195 | smsLog( pMac, LOGW, "Unknown message type %d, nothing to process", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2196 | pMsg->type); |
| 2197 | if (pMsg->bodyptr) |
| 2198 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2199 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2200 | } |
| 2201 | } |
| 2202 | }//switch |
| 2203 | } //SME_IS_START |
| 2204 | else |
| 2205 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2206 | smsLog( pMac, LOGW, "message type %d in stop state ignored", pMsg->type); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2207 | if (pMsg->bodyptr) |
| 2208 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2209 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2210 | } |
| 2211 | } |
| 2212 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2213 | } |
| 2214 | else |
| 2215 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2216 | smsLog( pMac, LOGW, "Locking failed, bailing out"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2217 | if (pMsg->bodyptr) |
| 2218 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2219 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2220 | } |
| 2221 | } |
| 2222 | |
| 2223 | return status; |
| 2224 | } |
| 2225 | |
| 2226 | |
| 2227 | //No need to hold the global lock here because this function can only be called |
| 2228 | //after sme_Stop. |
| 2229 | v_VOID_t sme_FreeMsg( tHalHandle hHal, vos_msg_t* pMsg ) |
| 2230 | { |
| 2231 | if( pMsg ) |
| 2232 | { |
| 2233 | if (pMsg->bodyptr) |
| 2234 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 2235 | vos_mem_free(pMsg->bodyptr); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2236 | } |
| 2237 | } |
| 2238 | |
| 2239 | } |
| 2240 | |
| 2241 | |
| 2242 | /*-------------------------------------------------------------------------- |
| 2243 | |
| 2244 | \brief sme_Stop() - Stop all SME modules and put them at idle state |
| 2245 | |
| 2246 | The function stops each module in SME, PMC, CCM, CSR, etc. . Upon |
| 2247 | return, all modules are at idle state ready to start. |
| 2248 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2249 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2250 | \param hHal - The handle returned by macOpen |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2251 | \param tHalStopType - reason for stopping |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2252 | |
| 2253 | \return eHAL_STATUS_SUCCESS - SME is stopped. |
| 2254 | |
| 2255 | Other status means SME is failed to stop but caller should still |
| 2256 | consider SME is stopped. |
| 2257 | \sa |
| 2258 | |
| 2259 | --------------------------------------------------------------------------*/ |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2260 | eHalStatus sme_Stop(tHalHandle hHal, tHalStopType stopType) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2261 | { |
| 2262 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2263 | eHalStatus fail_status = eHAL_STATUS_SUCCESS; |
| 2264 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2265 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2266 | status = WLANSAP_Stop(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 2267 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2268 | smsLog( pMac, LOGE, "WLANSAP_Stop failed during smeStop with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2269 | status ); |
| 2270 | fail_status = status; |
| 2271 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2272 | |
| 2273 | p2pStop(hHal); |
| 2274 | |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2275 | status = pmcStop(hHal); |
| 2276 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
| 2277 | smsLog( pMac, LOGE, "pmcStop failed during smeStop with status=%d", |
| 2278 | status ); |
| 2279 | fail_status = status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2280 | } |
| 2281 | |
Kiet Lam | a72a232 | 2013-11-15 11:18:11 +0530 | [diff] [blame] | 2282 | status = csrStop(pMac, stopType); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2283 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2284 | smsLog( pMac, LOGE, "csrStop failed during smeStop with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2285 | status ); |
| 2286 | fail_status = status; |
| 2287 | } |
| 2288 | |
| 2289 | ccmStop(hHal); |
| 2290 | |
| 2291 | purgeSmeCmdList(pMac); |
| 2292 | |
| 2293 | if (!HAL_STATUS_SUCCESS( fail_status )) { |
| 2294 | status = fail_status; |
| 2295 | } |
| 2296 | |
| 2297 | pMac->sme.state = SME_STATE_STOP; |
| 2298 | |
| 2299 | return status; |
| 2300 | } |
| 2301 | |
| 2302 | /*-------------------------------------------------------------------------- |
| 2303 | |
| 2304 | \brief sme_Close() - Release all SME modules and their resources. |
| 2305 | |
| 2306 | The function release each module in SME, PMC, CCM, CSR, etc. . Upon |
| 2307 | return, all modules are at closed state. |
| 2308 | |
| 2309 | No SME APIs can be involved after smeClose except smeOpen. |
| 2310 | smeClose must be called before macClose. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2311 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2312 | \param hHal - The handle returned by macOpen |
| 2313 | |
| 2314 | \return eHAL_STATUS_SUCCESS - SME is successfully close. |
| 2315 | |
| 2316 | Other status means SME is failed to be closed but caller still cannot |
| 2317 | call any other SME functions except smeOpen. |
| 2318 | \sa |
| 2319 | |
| 2320 | --------------------------------------------------------------------------*/ |
| 2321 | eHalStatus sme_Close(tHalHandle hHal) |
| 2322 | { |
| 2323 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2324 | eHalStatus fail_status = eHAL_STATUS_SUCCESS; |
| 2325 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2326 | |
| 2327 | status = csrClose(pMac); |
| 2328 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2329 | smsLog( pMac, LOGE, "csrClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2330 | status ); |
| 2331 | fail_status = status; |
| 2332 | } |
| 2333 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2334 | status = WLANSAP_Close(vos_get_global_context(VOS_MODULE_ID_SAP, NULL)); |
| 2335 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2336 | smsLog( pMac, LOGE, "WLANSAP_close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2337 | status ); |
| 2338 | fail_status = status; |
| 2339 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2340 | |
| 2341 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 2342 | status = btcClose(hHal); |
| 2343 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2344 | smsLog( pMac, LOGE, "BTC close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2345 | status ); |
| 2346 | fail_status = status; |
| 2347 | } |
| 2348 | |
| 2349 | status = sme_QosClose(pMac); |
| 2350 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2351 | smsLog( pMac, LOGE, "Qos close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2352 | status ); |
| 2353 | fail_status = status; |
| 2354 | } |
| 2355 | #endif |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 2356 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 2357 | status = oemData_OemDataReqClose(hHal); |
| 2358 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2359 | 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] | 2360 | status ); |
| 2361 | fail_status = status; |
| 2362 | } |
| 2363 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2364 | |
| 2365 | status = ccmClose(hHal); |
| 2366 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2367 | smsLog( pMac, LOGE, "ccmClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2368 | status ); |
| 2369 | fail_status = status; |
| 2370 | } |
| 2371 | |
| 2372 | status = pmcClose(hHal); |
| 2373 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2374 | smsLog( pMac, LOGE, "pmcClose failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2375 | status ); |
| 2376 | fail_status = status; |
| 2377 | } |
| 2378 | #if defined WLAN_FEATURE_VOWIFI |
| 2379 | status = rrmClose(hHal); |
| 2380 | if ( ! HAL_STATUS_SUCCESS( status ) ) { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 2381 | smsLog( pMac, LOGE, "RRM close failed during sme close with status=%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2382 | status ); |
| 2383 | fail_status = status; |
| 2384 | } |
| 2385 | #endif |
| 2386 | |
| 2387 | #if defined WLAN_FEATURE_VOWIFI_11R |
| 2388 | sme_FTClose(hHal); |
| 2389 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2390 | sme_p2pClose(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2391 | |
| 2392 | freeSmeCmdList(pMac); |
| 2393 | |
| 2394 | if( !VOS_IS_STATUS_SUCCESS( vos_lock_destroy( &pMac->sme.lkSmeGlobalLock ) ) ) |
| 2395 | { |
| 2396 | fail_status = eHAL_STATUS_FAILURE; |
| 2397 | } |
| 2398 | |
| 2399 | if (!HAL_STATUS_SUCCESS( fail_status )) { |
| 2400 | status = fail_status; |
| 2401 | } |
| 2402 | |
| 2403 | pMac->sme.state = SME_STATE_STOP; |
| 2404 | |
| 2405 | return status; |
| 2406 | } |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2407 | #ifdef FEATURE_WLAN_LFR |
| 2408 | tANI_BOOLEAN csrIsScanAllowed(tpAniSirGlobal pMac) |
| 2409 | { |
Madan Mohan Koyyalamudi | fb534bb | 2012-10-24 14:35:45 -0700 | [diff] [blame] | 2410 | #if 0 |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2411 | switch(pMac->roam.neighborRoamInfo.neighborRoamState) { |
| 2412 | case eCSR_NEIGHBOR_ROAM_STATE_REPORT_SCAN: |
| 2413 | case eCSR_NEIGHBOR_ROAM_STATE_PREAUTHENTICATING: |
| 2414 | case eCSR_NEIGHBOR_ROAM_STATE_PREAUTH_DONE: |
| 2415 | case eCSR_NEIGHBOR_ROAM_STATE_REASSOCIATING: |
| 2416 | return eANI_BOOLEAN_FALSE; |
| 2417 | default: |
| 2418 | return eANI_BOOLEAN_TRUE; |
| 2419 | } |
Madan Mohan Koyyalamudi | fb534bb | 2012-10-24 14:35:45 -0700 | [diff] [blame] | 2420 | #else |
| 2421 | /* |
| 2422 | * TODO: always return TRUE for now until |
| 2423 | * we figure out why we could be stuck in |
| 2424 | * one of the roaming states forever. |
| 2425 | */ |
| 2426 | return eANI_BOOLEAN_TRUE; |
| 2427 | #endif |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2428 | } |
| 2429 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2430 | /* --------------------------------------------------------------------------- |
| 2431 | \fn sme_ScanRequest |
| 2432 | \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] | 2433 | This is an asynchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2434 | \param pScanRequestID - pointer to an object to get back the request ID |
| 2435 | \param callback - a callback function that scan calls upon finish, will not |
| 2436 | be called if csrScanRequest returns error |
| 2437 | \param pContext - a pointer passed in for the callback |
| 2438 | \return eHalStatus |
| 2439 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2440 | eHalStatus sme_ScanRequest(tHalHandle hHal, tANI_U8 sessionId, tCsrScanRequest *pscanReq, |
| 2441 | tANI_U32 *pScanRequestID, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2442 | csrScanCompleteCallback callback, void *pContext) |
| 2443 | { |
| 2444 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2445 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2446 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2447 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_REQ, sessionId, pscanReq->scanType)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2448 | smsLog(pMac, LOG2, FL("enter")); |
| 2449 | do |
| 2450 | { |
| 2451 | if(pMac->scan.fScanEnable) |
| 2452 | { |
| 2453 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2454 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2455 | { |
| 2456 | { |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2457 | #ifdef FEATURE_WLAN_LFR |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2458 | if(csrIsScanAllowed(pMac)) |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2459 | { |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2460 | #endif |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2461 | status = csrScanRequest( hHal, sessionId, pscanReq, |
| 2462 | pScanRequestID, callback, pContext ); |
Vinay Krishna Eranna | 636b7bc | 2013-12-18 20:49:08 +0530 | [diff] [blame] | 2463 | if ( !HAL_STATUS_SUCCESS( status ) ) |
| 2464 | { |
| 2465 | smsLog(pMac, LOGE, FL("csrScanRequest failed" |
| 2466 | " SId=%d"), sessionId); |
| 2467 | } |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2468 | #ifdef FEATURE_WLAN_LFR |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2469 | } |
| 2470 | else |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2471 | { |
Madan Mohan Koyyalamudi | ab4ab0d | 2012-10-24 14:26:50 -0700 | [diff] [blame] | 2472 | smsLog(pMac, LOGE, FL("Scan denied in state %d (sub-state %d)"), |
| 2473 | pMac->roam.neighborRoamInfo.neighborRoamState, |
| 2474 | pMac->roam.curSubState[sessionId]); |
| 2475 | /*HandOff is in progress. So schedule this scan later*/ |
| 2476 | status = eHAL_STATUS_RESOURCES; |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 2477 | } |
| 2478 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2479 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2480 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2481 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2482 | } //sme_AcquireGlobalLock success |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2483 | else |
| 2484 | { |
| 2485 | smsLog(pMac, LOGE, FL("sme_AcquireGlobalLock failed")); |
| 2486 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2487 | } //if(pMac->scan.fScanEnable) |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2488 | else |
| 2489 | { |
| 2490 | smsLog(pMac, LOGE, FL("fScanEnable FALSE")); |
| 2491 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2492 | } while( 0 ); |
| 2493 | |
| 2494 | return (status); |
| 2495 | |
| 2496 | |
| 2497 | } |
| 2498 | |
| 2499 | /* --------------------------------------------------------------------------- |
| 2500 | \fn sme_ScanGetResult |
| 2501 | \brief a wrapper function to request scan results from CSR. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2502 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2503 | \param pFilter - If pFilter is NULL, all cached results are returned |
| 2504 | \param phResult - an object for the result. |
| 2505 | \return eHalStatus |
| 2506 | ---------------------------------------------------------------------------*/ |
| 2507 | eHalStatus sme_ScanGetResult(tHalHandle hHal, tANI_U8 sessionId, tCsrScanResultFilter *pFilter, |
| 2508 | tScanResultHandle *phResult) |
| 2509 | { |
| 2510 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2511 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2512 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2513 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2514 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_GET_RESULTS, sessionId,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2515 | smsLog(pMac, LOG2, FL("enter")); |
| 2516 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2517 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2518 | { |
Madan Mohan Koyyalamudi | ca43cdf | 2012-09-24 13:15:49 -0700 | [diff] [blame] | 2519 | status = csrScanGetResult( hHal, pFilter, phResult ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2520 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2521 | } |
| 2522 | smsLog(pMac, LOG2, FL("exit status %d"), status); |
| 2523 | |
| 2524 | return (status); |
| 2525 | } |
| 2526 | |
| 2527 | |
| 2528 | /* --------------------------------------------------------------------------- |
| 2529 | \fn sme_ScanFlushResult |
| 2530 | \brief a wrapper function to request CSR to clear scan results. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2531 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2532 | \return eHalStatus |
| 2533 | ---------------------------------------------------------------------------*/ |
| 2534 | eHalStatus sme_ScanFlushResult(tHalHandle hHal, tANI_U8 sessionId) |
| 2535 | { |
| 2536 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2537 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2538 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2539 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2540 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_RESULTS, sessionId,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2541 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2542 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2543 | { |
Madan Mohan Koyyalamudi | ca43cdf | 2012-09-24 13:15:49 -0700 | [diff] [blame] | 2544 | status = csrScanFlushResult( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2545 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2546 | } |
| 2547 | |
| 2548 | return (status); |
| 2549 | } |
| 2550 | |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 2551 | /* --------------------------------------------------------------------------- |
| 2552 | \fn sme_FilterScanResults |
| 2553 | \brief a wrapper function to request CSR to clear scan results. |
| 2554 | This is a synchronous call |
| 2555 | \return eHalStatus |
| 2556 | ---------------------------------------------------------------------------*/ |
| 2557 | eHalStatus sme_FilterScanResults(tHalHandle hHal, tANI_U8 sessionId) |
| 2558 | { |
| 2559 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 2560 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2561 | |
| 2562 | MTRACE(macTraceNew(pMac, VOS_MODULE_ID_SME, |
| 2563 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_RESULTS, sessionId,0 )); |
| 2564 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2565 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2566 | { |
| 2567 | csrScanFilterResults(pMac); |
| 2568 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2569 | } |
| 2570 | |
| 2571 | return (status); |
| 2572 | } |
| 2573 | |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2574 | eHalStatus sme_ScanFlushP2PResult(tHalHandle hHal, tANI_U8 sessionId) |
| 2575 | { |
| 2576 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2577 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2578 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2579 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2580 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_FLUSH_P2PRESULTS, sessionId,0 )); |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2581 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2582 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2583 | { |
Madan Mohan Koyyalamudi | 5850f31 | 2012-11-27 19:00:25 +0530 | [diff] [blame] | 2584 | status = csrScanFlushSelectiveResult( hHal, VOS_TRUE ); |
Madan Mohan Koyyalamudi | a3fcf14 | 2012-10-18 15:01:20 -0700 | [diff] [blame] | 2585 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2586 | } |
| 2587 | |
| 2588 | return (status); |
| 2589 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2590 | |
| 2591 | /* --------------------------------------------------------------------------- |
| 2592 | \fn sme_ScanResultGetFirst |
| 2593 | \brief a wrapper function to request CSR to returns the first element of |
| 2594 | scan result. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2595 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2596 | \param hScanResult - returned from csrScanGetResult |
| 2597 | \return tCsrScanResultInfo * - NULL if no result |
| 2598 | ---------------------------------------------------------------------------*/ |
| 2599 | tCsrScanResultInfo *sme_ScanResultGetFirst(tHalHandle hHal, |
| 2600 | tScanResultHandle hScanResult) |
| 2601 | { |
| 2602 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2603 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2604 | tCsrScanResultInfo *pRet = NULL; |
| 2605 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2606 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2607 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_GETFIRST, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2608 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2609 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2610 | { |
| 2611 | pRet = csrScanResultGetFirst( pMac, hScanResult ); |
| 2612 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2613 | } |
| 2614 | |
| 2615 | return (pRet); |
| 2616 | } |
| 2617 | |
| 2618 | |
| 2619 | /* --------------------------------------------------------------------------- |
| 2620 | \fn sme_ScanResultGetNext |
| 2621 | \brief a wrapper function to request CSR to returns the next element of |
| 2622 | scan result. It can be called without calling csrScanResultGetFirst |
| 2623 | first |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2624 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2625 | \param hScanResult - returned from csrScanGetResult |
| 2626 | \return Null if no result or reach the end |
| 2627 | ---------------------------------------------------------------------------*/ |
| 2628 | tCsrScanResultInfo *sme_ScanResultGetNext(tHalHandle hHal, |
| 2629 | tScanResultHandle hScanResult) |
| 2630 | { |
| 2631 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2632 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2633 | tCsrScanResultInfo *pRet = NULL; |
| 2634 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2635 | MTRACE(vos_trace(VOS_MODULE_ID_SME , |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2636 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_GETNEXT, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2637 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2638 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2639 | { |
| 2640 | pRet = csrScanResultGetNext( pMac, hScanResult ); |
| 2641 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2642 | } |
| 2643 | |
| 2644 | return (pRet); |
| 2645 | } |
| 2646 | |
| 2647 | |
| 2648 | /* --------------------------------------------------------------------------- |
| 2649 | \fn sme_ScanSetBGScanparams |
| 2650 | \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] | 2651 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2652 | \param pScanReq - BG scan request structure |
| 2653 | \return eHalStatus |
| 2654 | ---------------------------------------------------------------------------*/ |
| 2655 | eHalStatus sme_ScanSetBGScanparams(tHalHandle hHal, tANI_U8 sessionId, tCsrBGScanRequest *pScanReq) |
| 2656 | { |
| 2657 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2658 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2659 | |
| 2660 | if( NULL != pScanReq ) |
| 2661 | { |
| 2662 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2663 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2664 | { |
| 2665 | status = csrScanSetBGScanparams( hHal, pScanReq ); |
| 2666 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2667 | } |
| 2668 | } |
| 2669 | |
| 2670 | return (status); |
| 2671 | } |
| 2672 | |
| 2673 | |
| 2674 | /* --------------------------------------------------------------------------- |
| 2675 | \fn sme_ScanResultPurge |
| 2676 | \brief a wrapper function to request CSR to remove all items(tCsrScanResult) |
| 2677 | in the list and free memory for each item |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2678 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2679 | \param hScanResult - returned from csrScanGetResult. hScanResult is |
| 2680 | considered gone by |
| 2681 | calling this function and even before this function reutrns. |
| 2682 | \return eHalStatus |
| 2683 | ---------------------------------------------------------------------------*/ |
| 2684 | eHalStatus sme_ScanResultPurge(tHalHandle hHal, tScanResultHandle hScanResult) |
| 2685 | { |
| 2686 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2687 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2688 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2689 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2690 | TRACE_CODE_SME_RX_HDD_MSG_SCAN_RESULT_PURGE, NO_SESSION,0 )); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2691 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2692 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2693 | { |
| 2694 | status = csrScanResultPurge( hHal, hScanResult ); |
| 2695 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2696 | } |
| 2697 | |
| 2698 | return (status); |
| 2699 | } |
| 2700 | |
| 2701 | /* --------------------------------------------------------------------------- |
| 2702 | \fn sme_ScanGetPMKIDCandidateList |
| 2703 | \brief a wrapper function to return the PMKID candidate list |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2704 | This is a synchronous call |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2705 | \param pPmkidList - caller allocated buffer point to an array of |
| 2706 | tPmkidCandidateInfo |
| 2707 | \param pNumItems - pointer to a variable that has the number of |
| 2708 | tPmkidCandidateInfo allocated when retruning, this is |
| 2709 | either the number needed or number of items put into |
| 2710 | pPmkidList |
| 2711 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 2712 | big enough and pNumItems |
| 2713 | has the number of tPmkidCandidateInfo. |
| 2714 | \Note: pNumItems is a number of tPmkidCandidateInfo, |
| 2715 | not sizeof(tPmkidCandidateInfo) * something |
| 2716 | ---------------------------------------------------------------------------*/ |
| 2717 | eHalStatus sme_ScanGetPMKIDCandidateList(tHalHandle hHal, tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2718 | tPmkidCandidateInfo *pPmkidList, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2719 | tANI_U32 *pNumItems ) |
| 2720 | { |
| 2721 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2722 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2723 | |
| 2724 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2725 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2726 | { |
| 2727 | status = csrScanGetPMKIDCandidateList( pMac, sessionId, pPmkidList, pNumItems ); |
| 2728 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2729 | } |
| 2730 | |
| 2731 | return (status); |
| 2732 | } |
| 2733 | |
| 2734 | /*---------------------------------------------------------------------------- |
| 2735 | \fn sme_RoamRegisterLinkQualityIndCallback |
| 2736 | |
| 2737 | \brief |
| 2738 | a wrapper function to allow HDD to register a callback handler with CSR for |
| 2739 | link quality indications. |
| 2740 | |
| 2741 | Only one callback may be registered at any time. |
| 2742 | In order to deregister the callback, a NULL cback may be provided. |
| 2743 | |
| 2744 | Registration happens in the task context of the caller. |
| 2745 | |
| 2746 | \param callback - Call back being registered |
| 2747 | \param pContext - user data |
| 2748 | |
| 2749 | DEPENDENCIES: After CSR open |
| 2750 | |
| 2751 | \return eHalStatus |
| 2752 | -----------------------------------------------------------------------------*/ |
| 2753 | eHalStatus sme_RoamRegisterLinkQualityIndCallback(tHalHandle hHal, tANI_U8 sessionId, |
| 2754 | csrRoamLinkQualityIndCallback callback, |
| 2755 | void *pContext) |
| 2756 | { |
| 2757 | return(csrRoamRegisterLinkQualityIndCallback((tpAniSirGlobal)hHal, callback, pContext)); |
| 2758 | } |
| 2759 | |
| 2760 | /* --------------------------------------------------------------------------- |
| 2761 | \fn sme_RoamRegisterCallback |
| 2762 | \brief a wrapper function to allow HDD to register a callback with CSR. |
| 2763 | Unlike scan, roam has one callback for all the roam requests |
| 2764 | \param callback - a callback function that roam calls upon when state changes |
| 2765 | \param pContext - a pointer passed in for the callback |
| 2766 | \return eHalStatus |
| 2767 | ---------------------------------------------------------------------------*/ |
| 2768 | eHalStatus sme_RoamRegisterCallback(tHalHandle hHal, |
| 2769 | csrRoamCompleteCallback callback, |
| 2770 | void *pContext) |
| 2771 | { |
| 2772 | return(csrRoamRegisterCallback((tpAniSirGlobal)hHal, callback, pContext)); |
| 2773 | } |
| 2774 | |
| 2775 | eCsrPhyMode sme_GetPhyMode(tHalHandle hHal) |
| 2776 | { |
| 2777 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 2778 | return pMac->roam.configParam.phyMode; |
| 2779 | } |
| 2780 | |
| 2781 | /* --------------------------------------------------------------------------- |
| 2782 | \fn sme_RoamConnect |
| 2783 | \brief a wrapper function to request CSR to inititiate an association |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2784 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2785 | \param sessionId - the sessionId returned by sme_OpenSession. |
| 2786 | \param pProfile - description of the network to which to connect |
| 2787 | \param hBssListIn - a list of BSS descriptor to roam to. It is returned |
| 2788 | from csrScanGetResult |
| 2789 | \param pRoamId - to get back the request ID |
| 2790 | \return eHalStatus |
| 2791 | ---------------------------------------------------------------------------*/ |
| 2792 | eHalStatus sme_RoamConnect(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamProfile *pProfile, |
| 2793 | tANI_U32 *pRoamId) |
| 2794 | { |
| 2795 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2796 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2797 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2798 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2799 | TRACE_CODE_SME_RX_HDD_MSG_CONNECT, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2800 | smsLog(pMac, LOG2, FL("enter")); |
| 2801 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2802 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2803 | { |
| 2804 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 2805 | { |
| 2806 | status = csrRoamConnect( pMac, sessionId, pProfile, NULL, pRoamId ); |
| 2807 | } |
| 2808 | else |
| 2809 | { |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2810 | smsLog(pMac, LOGE, FL("invalid sessionID %d"), sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2811 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 2812 | } |
| 2813 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2814 | } |
Gopichand Nakkala | 9b89a73 | 2012-12-31 16:31:46 -0800 | [diff] [blame] | 2815 | else |
| 2816 | { |
| 2817 | smsLog(pMac, LOGE, FL("sme_AcquireGlobalLock failed")); |
| 2818 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2819 | |
| 2820 | return (status); |
| 2821 | } |
| 2822 | |
| 2823 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | dacbcb5 | 2013-04-18 16:41:54 +0530 | [diff] [blame] | 2824 | |
| 2825 | \fn sme_SetPhyMode |
| 2826 | |
| 2827 | \brief Changes the PhyMode. |
| 2828 | |
| 2829 | \param hHal - The handle returned by macOpen. |
| 2830 | |
| 2831 | \param phyMode new phyMode which is to set |
| 2832 | |
| 2833 | \return eHalStatus SUCCESS. |
| 2834 | |
| 2835 | -------------------------------------------------------------------------------*/ |
| 2836 | eHalStatus sme_SetPhyMode(tHalHandle hHal, eCsrPhyMode phyMode) |
| 2837 | { |
| 2838 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2839 | |
| 2840 | if (NULL == pMac) |
| 2841 | { |
| 2842 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 2843 | "%s: invalid context", __func__); |
| 2844 | return eHAL_STATUS_FAILURE; |
| 2845 | } |
| 2846 | |
| 2847 | pMac->roam.configParam.phyMode = phyMode; |
| 2848 | pMac->roam.configParam.uCfgDot11Mode = csrGetCfgDot11ModeFromCsrPhyMode(NULL, |
| 2849 | pMac->roam.configParam.phyMode, |
| 2850 | pMac->roam.configParam.ProprietaryRatesEnabled); |
| 2851 | |
| 2852 | return eHAL_STATUS_SUCCESS; |
| 2853 | } |
| 2854 | |
| 2855 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2856 | \fn sme_RoamReassoc |
| 2857 | \brief a wrapper function to request CSR to inititiate a re-association |
| 2858 | \param pProfile - can be NULL to join the currently connected AP. In that |
| 2859 | case modProfileFields should carry the modified field(s) which could trigger |
| 2860 | reassoc |
| 2861 | \param modProfileFields - fields which are part of tCsrRoamConnectedProfile |
| 2862 | that might need modification dynamically once STA is up & running and this |
| 2863 | could trigger a reassoc |
| 2864 | \param pRoamId - to get back the request ID |
| 2865 | \return eHalStatus |
| 2866 | -------------------------------------------------------------------------------*/ |
| 2867 | eHalStatus sme_RoamReassoc(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamProfile *pProfile, |
| 2868 | tCsrRoamModifyProfileFields modProfileFields, |
Madan Mohan Koyyalamudi | ea22cdc | 2012-10-18 21:02:23 -0700 | [diff] [blame] | 2869 | tANI_U32 *pRoamId, v_BOOL_t fForce) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2870 | { |
| 2871 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2872 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2873 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2874 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2875 | TRACE_CODE_SME_RX_HDD_ROAM_REASSOC, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2876 | smsLog(pMac, LOG2, FL("enter")); |
| 2877 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2878 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2879 | { |
| 2880 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 2881 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2882 | if((NULL == pProfile) && (fForce == 1)) |
| 2883 | { |
Madan Mohan Koyyalamudi | 0d0e171 | 2012-10-21 12:02:45 -0700 | [diff] [blame] | 2884 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 2885 | /* to force the AP initiate fresh 802.1x authentication need to clear |
| 2886 | * the PMKID cache for that set the following boolean. this is needed |
| 2887 | * by the HS 2.0 passpoint certification 5.2.a and b testcases */ |
| 2888 | pSession->fIgnorePMKIDCache = TRUE; |
Madan Mohan Koyyalamudi | ea22cdc | 2012-10-18 21:02:23 -0700 | [diff] [blame] | 2889 | status = csrReassoc( pMac, sessionId, &modProfileFields, pRoamId , fForce); |
| 2890 | } |
| 2891 | else |
| 2892 | { |
| 2893 | status = csrRoamReassoc( pMac, sessionId, pProfile, modProfileFields, pRoamId ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 2894 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2895 | } |
| 2896 | else |
| 2897 | { |
| 2898 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 2899 | } |
| 2900 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2901 | } |
| 2902 | |
| 2903 | return (status); |
| 2904 | } |
| 2905 | |
| 2906 | /* --------------------------------------------------------------------------- |
| 2907 | \fn sme_RoamConnectToLastProfile |
| 2908 | \brief a wrapper function to request CSR to disconnect and reconnect with |
| 2909 | the same profile |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2910 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2911 | \return eHalStatus. It returns fail if currently connected |
| 2912 | ---------------------------------------------------------------------------*/ |
| 2913 | eHalStatus sme_RoamConnectToLastProfile(tHalHandle hHal, tANI_U8 sessionId) |
| 2914 | { |
| 2915 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2916 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2917 | |
| 2918 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2919 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2920 | { |
| 2921 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 2922 | { |
| 2923 | status = csrRoamConnectToLastProfile( pMac, sessionId ); |
| 2924 | } |
| 2925 | else |
| 2926 | { |
| 2927 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 2928 | } |
| 2929 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2930 | } |
| 2931 | |
| 2932 | return (status); |
| 2933 | } |
| 2934 | |
| 2935 | /* --------------------------------------------------------------------------- |
| 2936 | \fn sme_RoamDisconnect |
| 2937 | \brief a wrapper function to request CSR to disconnect from a network |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 2938 | This is an asynchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2939 | \param reason -- To indicate the reason for disconnecting. Currently, only |
| 2940 | eCSR_DISCONNECT_REASON_MIC_ERROR is meanful. |
| 2941 | \return eHalStatus |
| 2942 | ---------------------------------------------------------------------------*/ |
| 2943 | eHalStatus sme_RoamDisconnect(tHalHandle hHal, tANI_U8 sessionId, eCsrRoamDisconnectReason reason) |
| 2944 | { |
| 2945 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2946 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2947 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 2948 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 2949 | TRACE_CODE_SME_RX_HDD_ROAM_DISCONNECT, sessionId, reason)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2950 | smsLog(pMac, LOG2, FL("enter")); |
| 2951 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2952 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2953 | { |
| 2954 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 2955 | { |
| 2956 | status = csrRoamDisconnect( pMac, sessionId, reason ); |
| 2957 | } |
| 2958 | else |
| 2959 | { |
| 2960 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 2961 | } |
| 2962 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2963 | } |
| 2964 | |
| 2965 | return (status); |
| 2966 | } |
| 2967 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2968 | /* --------------------------------------------------------------------------- |
| 2969 | \fn sme_RoamStopBss |
| 2970 | \brief To stop BSS for Soft AP. This is an asynchronous API. |
| 2971 | \param hHal - Global structure |
| 2972 | \param sessionId - sessionId of SoftAP |
| 2973 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 2974 | -------------------------------------------------------------------------------*/ |
| 2975 | eHalStatus sme_RoamStopBss(tHalHandle hHal, tANI_U8 sessionId) |
| 2976 | { |
| 2977 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 2978 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 2979 | |
| 2980 | smsLog(pMac, LOG2, FL("enter")); |
| 2981 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 2982 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 2983 | { |
| 2984 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 2985 | { |
Gopichand Nakkala | f44bdc5 | 2013-02-16 00:54:45 +0530 | [diff] [blame] | 2986 | status = csrRoamIssueStopBssCmd( pMac, sessionId, eANI_BOOLEAN_FALSE ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 2987 | } |
| 2988 | else |
| 2989 | { |
| 2990 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 2991 | } |
| 2992 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 2993 | } |
| 2994 | |
| 2995 | return (status); |
| 2996 | } |
| 2997 | |
| 2998 | /* --------------------------------------------------------------------------- |
| 2999 | \fn sme_RoamDisconnectSta |
| 3000 | \brief To disassociate a station. This is an asynchronous API. |
| 3001 | \param hHal - Global structure |
| 3002 | \param sessionId - sessionId of SoftAP |
| 3003 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3004 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3005 | -------------------------------------------------------------------------------*/ |
| 3006 | eHalStatus sme_RoamDisconnectSta(tHalHandle hHal, tANI_U8 sessionId, |
| 3007 | tANI_U8 *pPeerMacAddr) |
| 3008 | { |
| 3009 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3010 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3011 | |
| 3012 | if ( NULL == pMac ) |
| 3013 | { |
| 3014 | VOS_ASSERT(0); |
| 3015 | return status; |
| 3016 | } |
| 3017 | |
| 3018 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3019 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3020 | { |
| 3021 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3022 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3023 | status = csrRoamIssueDisassociateStaCmd( pMac, sessionId, pPeerMacAddr, |
Madan Mohan Koyyalamudi | 299b486 | 2013-01-30 19:59:23 +0530 | [diff] [blame] | 3024 | eSIR_MAC_DEAUTH_LEAVING_BSS_REASON); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3025 | } |
| 3026 | else |
| 3027 | { |
| 3028 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3029 | } |
| 3030 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3031 | } |
| 3032 | |
| 3033 | return (status); |
| 3034 | } |
| 3035 | |
| 3036 | /* --------------------------------------------------------------------------- |
| 3037 | \fn sme_RoamDeauthSta |
| 3038 | \brief To disassociate a station. This is an asynchronous API. |
| 3039 | \param hHal - Global structure |
| 3040 | \param sessionId - sessionId of SoftAP |
| 3041 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3042 | \return eHalStatus SUCCESS Roam callback will be called to indicate actual results |
| 3043 | -------------------------------------------------------------------------------*/ |
| 3044 | eHalStatus sme_RoamDeauthSta(tHalHandle hHal, tANI_U8 sessionId, |
| 3045 | tANI_U8 *pPeerMacAddr) |
| 3046 | { |
| 3047 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3048 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3049 | |
| 3050 | if ( NULL == pMac ) |
| 3051 | { |
| 3052 | VOS_ASSERT(0); |
| 3053 | return status; |
| 3054 | } |
| 3055 | |
| 3056 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3057 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3058 | { |
| 3059 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3060 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3061 | status = csrRoamIssueDeauthStaCmd( pMac, sessionId, pPeerMacAddr, |
Madan Mohan Koyyalamudi | 299b486 | 2013-01-30 19:59:23 +0530 | [diff] [blame] | 3062 | eSIR_MAC_DEAUTH_LEAVING_BSS_REASON); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3063 | } |
| 3064 | else |
| 3065 | { |
| 3066 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3067 | } |
| 3068 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3069 | } |
| 3070 | |
| 3071 | return (status); |
| 3072 | } |
| 3073 | |
| 3074 | /* --------------------------------------------------------------------------- |
| 3075 | \fn sme_RoamTKIPCounterMeasures |
| 3076 | \brief To start or stop TKIP counter measures. This is an asynchronous API. |
| 3077 | \param sessionId - sessionId of SoftAP |
| 3078 | \param pPeerMacAddr - Caller allocated memory filled with peer MAC address (6 bytes) |
| 3079 | \return eHalStatus |
| 3080 | -------------------------------------------------------------------------------*/ |
| 3081 | eHalStatus sme_RoamTKIPCounterMeasures(tHalHandle hHal, tANI_U8 sessionId, |
| 3082 | tANI_BOOLEAN bEnable) |
| 3083 | { |
| 3084 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3085 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3086 | |
| 3087 | if ( NULL == pMac ) |
| 3088 | { |
| 3089 | VOS_ASSERT(0); |
| 3090 | return status; |
| 3091 | } |
| 3092 | |
| 3093 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3094 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3095 | { |
| 3096 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3097 | { |
| 3098 | status = csrRoamIssueTkipCounterMeasures( pMac, sessionId, bEnable); |
| 3099 | } |
| 3100 | else |
| 3101 | { |
| 3102 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3103 | } |
| 3104 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3105 | } |
| 3106 | |
| 3107 | return (status); |
| 3108 | } |
| 3109 | |
| 3110 | /* --------------------------------------------------------------------------- |
| 3111 | \fn sme_RoamGetAssociatedStas |
| 3112 | \brief To probe the list of associated stations from various modules of CORE stack. |
| 3113 | \This is an asynchronous API. |
| 3114 | \param sessionId - sessionId of SoftAP |
| 3115 | \param modId - Module from whom list of associtated stations is to be probed. |
| 3116 | If an invalid module is passed then by default VOS_MODULE_ID_PE will be probed |
| 3117 | \param pUsrContext - Opaque HDD context |
| 3118 | \param pfnSapEventCallback - Sap event callback in HDD |
| 3119 | \param pAssocBuf - Caller allocated memory to be filled with associatd stations info |
| 3120 | \return eHalStatus |
| 3121 | -------------------------------------------------------------------------------*/ |
| 3122 | eHalStatus sme_RoamGetAssociatedStas(tHalHandle hHal, tANI_U8 sessionId, |
| 3123 | VOS_MODULE_ID modId, void *pUsrContext, |
| 3124 | void *pfnSapEventCallback, tANI_U8 *pAssocStasBuf) |
| 3125 | { |
| 3126 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3127 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3128 | |
| 3129 | if ( NULL == pMac ) |
| 3130 | { |
| 3131 | VOS_ASSERT(0); |
| 3132 | return status; |
| 3133 | } |
| 3134 | |
| 3135 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3136 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3137 | { |
| 3138 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3139 | { |
| 3140 | status = csrRoamGetAssociatedStas( pMac, sessionId, modId, pUsrContext, pfnSapEventCallback, pAssocStasBuf ); |
| 3141 | } |
| 3142 | else |
| 3143 | { |
| 3144 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3145 | } |
| 3146 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3147 | } |
| 3148 | |
| 3149 | return (status); |
| 3150 | } |
| 3151 | |
| 3152 | /* --------------------------------------------------------------------------- |
| 3153 | \fn sme_RoamGetWpsSessionOverlap |
| 3154 | \brief To get the WPS PBC session overlap information. |
| 3155 | \This is an asynchronous API. |
| 3156 | \param sessionId - sessionId of SoftAP |
| 3157 | \param pUsrContext - Opaque HDD context |
| 3158 | \param pfnSapEventCallback - Sap event callback in HDD |
| 3159 | \pRemoveMac - pointer to Mac address which needs to be removed from session |
| 3160 | \return eHalStatus |
| 3161 | -------------------------------------------------------------------------------*/ |
| 3162 | eHalStatus sme_RoamGetWpsSessionOverlap(tHalHandle hHal, tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3163 | void *pUsrContext, void |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3164 | *pfnSapEventCallback, v_MACADDR_t pRemoveMac) |
| 3165 | { |
| 3166 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3167 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3168 | |
| 3169 | if ( NULL == pMac ) |
| 3170 | { |
| 3171 | VOS_ASSERT(0); |
| 3172 | return status; |
| 3173 | } |
| 3174 | |
| 3175 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3176 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3177 | { |
| 3178 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3179 | { |
| 3180 | status = csrRoamGetWpsSessionOverlap( pMac, sessionId, pUsrContext, pfnSapEventCallback, pRemoveMac); |
| 3181 | } |
| 3182 | else |
| 3183 | { |
| 3184 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3185 | } |
| 3186 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3187 | } |
| 3188 | |
| 3189 | return (status); |
| 3190 | } |
| 3191 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3192 | |
| 3193 | /* --------------------------------------------------------------------------- |
| 3194 | \fn sme_RoamGetConnectState |
| 3195 | \brief a wrapper function to request CSR to return the current connect state |
| 3196 | of Roaming |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3197 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3198 | \return eHalStatus |
| 3199 | ---------------------------------------------------------------------------*/ |
| 3200 | eHalStatus sme_RoamGetConnectState(tHalHandle hHal, tANI_U8 sessionId, eCsrConnectState *pState) |
| 3201 | { |
| 3202 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3203 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3204 | |
| 3205 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3206 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3207 | { |
| 3208 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3209 | { |
| 3210 | status = csrRoamGetConnectState( pMac, sessionId, pState ); |
| 3211 | } |
| 3212 | else |
| 3213 | { |
| 3214 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3215 | } |
| 3216 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3217 | } |
| 3218 | |
| 3219 | return (status); |
| 3220 | } |
| 3221 | |
| 3222 | /* --------------------------------------------------------------------------- |
| 3223 | \fn sme_RoamGetConnectProfile |
| 3224 | \brief a wrapper function to request CSR to return the current connect |
| 3225 | profile. Caller must call csrRoamFreeConnectProfile after it is done |
| 3226 | and before reuse for another csrRoamGetConnectProfile call. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3227 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3228 | \param pProfile - pointer to a caller allocated structure |
| 3229 | tCsrRoamConnectedProfile |
| 3230 | \return eHalStatus. Failure if not connected |
| 3231 | ---------------------------------------------------------------------------*/ |
| 3232 | eHalStatus sme_RoamGetConnectProfile(tHalHandle hHal, tANI_U8 sessionId, |
| 3233 | tCsrRoamConnectedProfile *pProfile) |
| 3234 | { |
| 3235 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3236 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3237 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3238 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3239 | TRACE_CODE_SME_RX_HDD_ROAM_GET_CONNECTPROFILE, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3240 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3241 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3242 | { |
| 3243 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3244 | { |
| 3245 | status = csrRoamGetConnectProfile( pMac, sessionId, pProfile ); |
| 3246 | } |
| 3247 | else |
| 3248 | { |
| 3249 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3250 | } |
| 3251 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3252 | } |
| 3253 | |
| 3254 | return (status); |
| 3255 | } |
| 3256 | |
| 3257 | /* --------------------------------------------------------------------------- |
| 3258 | \fn sme_RoamFreeConnectProfile |
| 3259 | \brief a wrapper function to request CSR to free and reinitialize the |
| 3260 | profile returned previously by csrRoamGetConnectProfile. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3261 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3262 | \param pProfile - pointer to a caller allocated structure |
| 3263 | tCsrRoamConnectedProfile |
| 3264 | \return eHalStatus. |
| 3265 | ---------------------------------------------------------------------------*/ |
| 3266 | eHalStatus sme_RoamFreeConnectProfile(tHalHandle hHal, |
| 3267 | tCsrRoamConnectedProfile *pProfile) |
| 3268 | { |
| 3269 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3270 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3271 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3272 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3273 | TRACE_CODE_SME_RX_HDD_ROAM_FREE_CONNECTPROFILE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3274 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3275 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3276 | { |
| 3277 | status = csrRoamFreeConnectProfile( pMac, pProfile ); |
| 3278 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3279 | } |
| 3280 | |
| 3281 | return (status); |
| 3282 | } |
| 3283 | |
| 3284 | /* --------------------------------------------------------------------------- |
| 3285 | \fn sme_RoamSetPMKIDCache |
| 3286 | \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] | 3287 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3288 | \param pPMKIDCache - caller allocated buffer point to an array of |
| 3289 | tPmkidCacheInfo |
| 3290 | \param numItems - a variable that has the number of tPmkidCacheInfo |
| 3291 | allocated when retruning, this is either the number needed |
| 3292 | or number of items put into pPMKIDCache |
| 3293 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3294 | big enough and pNumItems has the number of |
| 3295 | tPmkidCacheInfo. |
| 3296 | \Note: pNumItems is a number of tPmkidCacheInfo, |
| 3297 | not sizeof(tPmkidCacheInfo) * something |
| 3298 | ---------------------------------------------------------------------------*/ |
| 3299 | eHalStatus sme_RoamSetPMKIDCache( tHalHandle hHal, tANI_U8 sessionId, tPmkidCacheInfo *pPMKIDCache, |
| 3300 | tANI_U32 numItems ) |
| 3301 | { |
| 3302 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3303 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3304 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3305 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3306 | TRACE_CODE_SME_RX_HDD_ROAM_SET_PMKIDCACHE, sessionId, numItems)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3307 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3308 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3309 | { |
| 3310 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3311 | { |
| 3312 | status = csrRoamSetPMKIDCache( pMac, sessionId, pPMKIDCache, numItems ); |
| 3313 | } |
| 3314 | else |
| 3315 | { |
| 3316 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3317 | } |
| 3318 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3319 | } |
| 3320 | |
| 3321 | return (status); |
| 3322 | } |
| 3323 | |
Leela Venkata Kiran Kumar Reddy Chirala | ede1065 | 2013-09-11 18:48:46 -0700 | [diff] [blame] | 3324 | eHalStatus sme_RoamDelPMKIDfromCache( tHalHandle hHal, tANI_U8 sessionId, tANI_U8 *pBSSId ) |
| 3325 | { |
| 3326 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3327 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3328 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3329 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3330 | { |
| 3331 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3332 | { |
| 3333 | status = csrRoamDelPMKIDfromCache( pMac, sessionId, pBSSId ); |
| 3334 | } |
| 3335 | else |
| 3336 | { |
| 3337 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3338 | } |
| 3339 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3340 | } |
| 3341 | return (status); |
| 3342 | } |
Wilson Yang | 47b5819 | 2013-12-11 11:40:19 -0800 | [diff] [blame] | 3343 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3344 | /* --------------------------------------------------------------------------- |
| 3345 | \fn sme_RoamGetSecurityReqIE |
| 3346 | \brief a wrapper function to request CSR to return the WPA or RSN or WAPI IE CSR |
| 3347 | passes to PE to JOIN request or START_BSS request |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3348 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3349 | \param pLen - caller allocated memory that has the length of pBuf as input. |
| 3350 | Upon returned, *pLen has the needed or IE length in pBuf. |
| 3351 | \param pBuf - Caller allocated memory that contain the IE field, if any, |
| 3352 | upon return |
| 3353 | \param secType - Specifies whether looking for WPA/WPA2/WAPI IE |
| 3354 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3355 | big enough |
| 3356 | ---------------------------------------------------------------------------*/ |
| 3357 | eHalStatus sme_RoamGetSecurityReqIE(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pLen, |
| 3358 | tANI_U8 *pBuf, eCsrSecurityType secType) |
| 3359 | { |
| 3360 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3361 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3362 | |
| 3363 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3364 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3365 | { |
| 3366 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3367 | { |
| 3368 | status = csrRoamGetWpaRsnReqIE( hHal, sessionId, pLen, pBuf ); |
| 3369 | } |
| 3370 | else |
| 3371 | { |
| 3372 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3373 | } |
| 3374 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3375 | } |
| 3376 | |
| 3377 | return (status); |
| 3378 | } |
| 3379 | |
| 3380 | /* --------------------------------------------------------------------------- |
| 3381 | \fn sme_RoamGetSecurityRspIE |
| 3382 | \brief a wrapper function to request CSR to return the WPA or RSN or WAPI IE from |
| 3383 | the beacon or probe rsp if connected |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3384 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3385 | \param pLen - caller allocated memory that has the length of pBuf as input. |
| 3386 | Upon returned, *pLen has the needed or IE length in pBuf. |
| 3387 | \param pBuf - Caller allocated memory that contain the IE field, if any, |
| 3388 | upon return |
| 3389 | \param secType - Specifies whether looking for WPA/WPA2/WAPI IE |
| 3390 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3391 | big enough |
| 3392 | ---------------------------------------------------------------------------*/ |
| 3393 | eHalStatus sme_RoamGetSecurityRspIE(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pLen, |
| 3394 | tANI_U8 *pBuf, eCsrSecurityType secType) |
| 3395 | { |
| 3396 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3397 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3398 | |
| 3399 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3400 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3401 | { |
| 3402 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3403 | { |
| 3404 | status = csrRoamGetWpaRsnRspIE( pMac, sessionId, pLen, pBuf ); |
| 3405 | } |
| 3406 | else |
| 3407 | { |
| 3408 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3409 | } |
| 3410 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3411 | } |
| 3412 | |
| 3413 | return (status); |
| 3414 | |
| 3415 | } |
| 3416 | |
| 3417 | |
| 3418 | /* --------------------------------------------------------------------------- |
| 3419 | \fn sme_RoamGetNumPMKIDCache |
| 3420 | \brief a wrapper function to request CSR to return number of PMKID cache |
| 3421 | entries |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3422 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3423 | \return tANI_U32 - the number of PMKID cache entries |
| 3424 | ---------------------------------------------------------------------------*/ |
| 3425 | tANI_U32 sme_RoamGetNumPMKIDCache(tHalHandle hHal, tANI_U8 sessionId) |
| 3426 | { |
| 3427 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3428 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3429 | tANI_U32 numPmkidCache = 0; |
| 3430 | |
| 3431 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3432 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3433 | { |
| 3434 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3435 | { |
| 3436 | numPmkidCache = csrRoamGetNumPMKIDCache( pMac, sessionId ); |
| 3437 | status = eHAL_STATUS_SUCCESS; |
| 3438 | } |
| 3439 | else |
| 3440 | { |
| 3441 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3442 | } |
| 3443 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3444 | } |
| 3445 | |
| 3446 | return (numPmkidCache); |
| 3447 | } |
| 3448 | |
| 3449 | /* --------------------------------------------------------------------------- |
| 3450 | \fn sme_RoamGetPMKIDCache |
| 3451 | \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] | 3452 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3453 | \param pNum - caller allocated memory that has the space of the number of |
| 3454 | pBuf tPmkidCacheInfo as input. Upon returned, *pNum has the |
| 3455 | needed or actually number in tPmkidCacheInfo. |
| 3456 | \param pPmkidCache - Caller allocated memory that contains PMKID cache, if |
| 3457 | any, upon return |
| 3458 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 3459 | big enough |
| 3460 | ---------------------------------------------------------------------------*/ |
| 3461 | eHalStatus sme_RoamGetPMKIDCache(tHalHandle hHal, tANI_U8 sessionId, tANI_U32 *pNum, |
| 3462 | tPmkidCacheInfo *pPmkidCache) |
| 3463 | { |
| 3464 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3465 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3466 | |
| 3467 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3468 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3469 | { |
| 3470 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3471 | { |
| 3472 | status = csrRoamGetPMKIDCache( pMac, sessionId, pNum, pPmkidCache ); |
| 3473 | } |
| 3474 | else |
| 3475 | { |
| 3476 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3477 | } |
| 3478 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3479 | } |
| 3480 | |
| 3481 | return (status); |
| 3482 | } |
| 3483 | |
| 3484 | |
| 3485 | /* --------------------------------------------------------------------------- |
| 3486 | \fn sme_GetConfigParam |
| 3487 | \brief a wrapper function that HDD calls to get the global settings |
| 3488 | currently maintained by CSR. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3489 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3490 | \param pParam - caller allocated memory |
| 3491 | \return eHalStatus |
| 3492 | ---------------------------------------------------------------------------*/ |
| 3493 | eHalStatus sme_GetConfigParam(tHalHandle hHal, tSmeConfigParams *pParam) |
| 3494 | { |
| 3495 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3496 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3497 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3498 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3499 | TRACE_CODE_SME_RX_HDD_GET_CONFIGPARAM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3500 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3501 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3502 | { |
| 3503 | status = csrGetConfigParam(pMac, &pParam->csrConfig); |
| 3504 | if (status != eHAL_STATUS_SUCCESS) |
| 3505 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3506 | smsLog( pMac, LOGE, "%s csrGetConfigParam failed", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3507 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3508 | return status; |
| 3509 | } |
| 3510 | #if defined WLAN_FEATURE_P2P_INTERNAL |
| 3511 | status = p2pGetConfigParam(pMac, &pParam->p2pConfig); |
| 3512 | if (status != eHAL_STATUS_SUCCESS) |
| 3513 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 3514 | smsLog( pMac, LOGE, "%s p2pGetConfigParam failed", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3515 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3516 | return status; |
| 3517 | } |
| 3518 | #endif |
| 3519 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3520 | } |
| 3521 | |
| 3522 | return (status); |
| 3523 | } |
| 3524 | |
| 3525 | /* --------------------------------------------------------------------------- |
| 3526 | \fn sme_CfgSetInt |
| 3527 | \brief a wrapper function that HDD calls to set parameters in CFG. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3528 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3529 | \param cfgId - Configuration Parameter ID (type) for STA. |
| 3530 | \param ccmValue - The information related to Configuration Parameter ID |
| 3531 | which needs to be saved in CFG |
| 3532 | \param callback - To be registered by CSR with CCM. Once the CFG done with |
| 3533 | saving the information in the database, it notifies CCM & |
| 3534 | then the callback will be invoked to notify. |
| 3535 | \param toBeSaved - To save the request for future reference |
| 3536 | \return eHalStatus |
| 3537 | ---------------------------------------------------------------------------*/ |
| 3538 | eHalStatus sme_CfgSetInt(tHalHandle hHal, tANI_U32 cfgId, tANI_U32 ccmValue, |
| 3539 | tCcmCfgSetCallback callback, eAniBoolean toBeSaved) |
| 3540 | { |
| 3541 | return(ccmCfgSetInt(hHal, cfgId, ccmValue, callback, toBeSaved)); |
| 3542 | } |
| 3543 | |
| 3544 | /* --------------------------------------------------------------------------- |
| 3545 | \fn sme_CfgSetStr |
| 3546 | \brief a wrapper function that HDD calls to set parameters in CFG. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 3547 | This is a synchronous call. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3548 | \param cfgId - Configuration Parameter ID (type) for STA. |
| 3549 | \param pStr - Pointer to the byte array which carries the information needs |
| 3550 | to be saved in CFG |
| 3551 | \param length - Length of the data to be saved |
| 3552 | \param callback - To be registered by CSR with CCM. Once the CFG done with |
| 3553 | saving the information in the database, it notifies CCM & |
| 3554 | then the callback will be invoked to notify. |
| 3555 | \param toBeSaved - To save the request for future reference |
| 3556 | \return eHalStatus |
| 3557 | ---------------------------------------------------------------------------*/ |
| 3558 | eHalStatus sme_CfgSetStr(tHalHandle hHal, tANI_U32 cfgId, tANI_U8 *pStr, |
| 3559 | tANI_U32 length, tCcmCfgSetCallback callback, |
| 3560 | eAniBoolean toBeSaved) |
| 3561 | { |
| 3562 | return(ccmCfgSetStr(hHal, cfgId, pStr, length, callback, toBeSaved)); |
| 3563 | } |
| 3564 | |
| 3565 | /* --------------------------------------------------------------------------- |
| 3566 | \fn sme_GetModifyProfileFields |
| 3567 | \brief HDD or SME - QOS calls this function to get the current values of |
| 3568 | connected profile fields, changing which can cause reassoc. |
| 3569 | This function must be called after CFG is downloaded and STA is in connected |
| 3570 | state. Also, make sure to call this function to get the current profile |
| 3571 | fields before calling the reassoc. So that pModifyProfileFields will have |
| 3572 | all the latest values plus the one(s) has been updated as part of reassoc |
| 3573 | request. |
| 3574 | \param pModifyProfileFields - pointer to the connected profile fields |
| 3575 | changing which can cause reassoc |
| 3576 | |
| 3577 | \return eHalStatus |
| 3578 | -------------------------------------------------------------------------------*/ |
| 3579 | eHalStatus sme_GetModifyProfileFields(tHalHandle hHal, tANI_U8 sessionId, |
| 3580 | tCsrRoamModifyProfileFields * pModifyProfileFields) |
| 3581 | { |
| 3582 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3583 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3584 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3585 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3586 | TRACE_CODE_SME_RX_HDD_GET_MODPROFFIELDS, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3587 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3588 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3589 | { |
| 3590 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3591 | { |
| 3592 | status = csrGetModifyProfileFields(pMac, sessionId, pModifyProfileFields); |
| 3593 | } |
| 3594 | else |
| 3595 | { |
| 3596 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3597 | } |
| 3598 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3599 | } |
| 3600 | |
| 3601 | return (status); |
| 3602 | } |
| 3603 | |
Sandeep Puligilla | 332ea91 | 2014-02-04 00:16:24 +0530 | [diff] [blame] | 3604 | /* --------------------------------------------------------------------------- |
| 3605 | \fn sme_HT40StopOBSSScan |
| 3606 | \brief HDD or SME - Command to stop the OBSS scan |
| 3607 | THis is implemented only for debugging purpose. |
| 3608 | As per spec while operating in 2.4GHz OBSS scan shouldnt be stopped. |
| 3609 | \param sessionId - sessionId |
| 3610 | changing which can cause reassoc |
| 3611 | |
| 3612 | \return eHalStatus |
| 3613 | -------------------------------------------------------------------------------*/ |
| 3614 | eHalStatus sme_HT40StopOBSSScan(tHalHandle hHal, tANI_U8 sessionId) |
| 3615 | { |
| 3616 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3617 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3618 | |
| 3619 | smsLog(pMac, LOG2, FL("enter")); |
| 3620 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3621 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3622 | { |
| 3623 | if( CSR_IS_SESSION_VALID( pMac, sessionId ) ) |
| 3624 | { |
| 3625 | csrHT40StopOBSSScan( pMac, sessionId ); |
| 3626 | } |
| 3627 | else |
| 3628 | { |
| 3629 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 3630 | "%s: Invalid session sessionId %d", __func__,sessionId); |
| 3631 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 3632 | } |
| 3633 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3634 | } |
| 3635 | return (status); |
| 3636 | } |
| 3637 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3638 | /*-------------------------------------------------------------------------- |
| 3639 | \fn sme_SetConfigPowerSave |
| 3640 | \brief Wrapper fn to change power save configuration in SME (PMC) module. |
| 3641 | For BMPS related configuration, this function also updates the CFG |
| 3642 | and sends a message to FW to pick up the new values. Note: Calling |
| 3643 | this function only updates the configuration and does not enable |
| 3644 | the specified power save mode. |
| 3645 | \param hHal - The handle returned by macOpen. |
| 3646 | \param psMode - Power Saving mode being modified |
| 3647 | \param pConfigParams - a pointer to a caller allocated object of type |
| 3648 | tPmcSmpsConfigParams or tPmcBmpsConfigParams or tPmcImpsConfigParams |
| 3649 | \return eHalStatus |
| 3650 | --------------------------------------------------------------------------*/ |
| 3651 | eHalStatus sme_SetConfigPowerSave(tHalHandle hHal, tPmcPowerSavingMode psMode, |
| 3652 | void *pConfigParams) |
| 3653 | { |
| 3654 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3655 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3656 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3657 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3658 | TRACE_CODE_SME_RX_HDD_SET_CONFIG_PWRSAVE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3659 | if (NULL == pConfigParams ) { |
| 3660 | smsLog( pMac, LOGE, "Empty config param structure for PMC, " |
| 3661 | "nothing to update"); |
| 3662 | return eHAL_STATUS_FAILURE; |
| 3663 | } |
| 3664 | |
| 3665 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3666 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3667 | { |
| 3668 | status = pmcSetConfigPowerSave(hHal, psMode, pConfigParams); |
| 3669 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3670 | } |
| 3671 | |
| 3672 | return (status); |
| 3673 | } |
| 3674 | |
| 3675 | /*-------------------------------------------------------------------------- |
| 3676 | \fn sme_GetConfigPowerSave |
| 3677 | \brief Wrapper fn to retrieve power save configuration in SME (PMC) module |
| 3678 | \param hHal - The handle returned by macOpen. |
| 3679 | \param psMode - Power Saving mode |
| 3680 | \param pConfigParams - a pointer to a caller allocated object of type |
| 3681 | tPmcSmpsConfigParams or tPmcBmpsConfigParams or tPmcImpsConfigParams |
| 3682 | \return eHalStatus |
| 3683 | --------------------------------------------------------------------------*/ |
| 3684 | eHalStatus sme_GetConfigPowerSave(tHalHandle hHal, tPmcPowerSavingMode psMode, |
| 3685 | void *pConfigParams) |
| 3686 | { |
| 3687 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3688 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3689 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3690 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3691 | TRACE_CODE_SME_RX_HDD_GET_CONFIG_PWRSAVE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3692 | if (NULL == pConfigParams ) { |
| 3693 | smsLog( pMac, LOGE, "Empty config param structure for PMC, " |
| 3694 | "nothing to update"); |
| 3695 | return eHAL_STATUS_FAILURE; |
| 3696 | } |
| 3697 | |
| 3698 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3699 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3700 | { |
| 3701 | status = pmcGetConfigPowerSave(hHal, psMode, pConfigParams); |
| 3702 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3703 | } |
| 3704 | |
| 3705 | return (status); |
| 3706 | } |
| 3707 | |
| 3708 | /* --------------------------------------------------------------------------- |
| 3709 | \fn sme_SignalPowerEvent |
| 3710 | \brief Signals to PMC that a power event has occurred. Used for putting |
| 3711 | the chip into deep sleep mode. |
| 3712 | \param hHal - The handle returned by macOpen. |
| 3713 | \param event - the event that has occurred |
| 3714 | \return eHalStatus |
| 3715 | ---------------------------------------------------------------------------*/ |
| 3716 | eHalStatus sme_SignalPowerEvent (tHalHandle hHal, tPmcPowerEvent event) |
| 3717 | { |
| 3718 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3719 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3720 | |
| 3721 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3722 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3723 | { |
| 3724 | status = pmcSignalPowerEvent(hHal, event); |
| 3725 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3726 | } |
| 3727 | |
| 3728 | return (status); |
| 3729 | } |
| 3730 | |
| 3731 | /* --------------------------------------------------------------------------- |
| 3732 | \fn sme_EnablePowerSave |
| 3733 | \brief Enables one of the power saving modes. |
| 3734 | \param hHal - The handle returned by macOpen. |
| 3735 | \param psMode - The power saving mode to enable. If BMPS mode is enabled |
| 3736 | while the chip is operating in Full Power, PMC will start |
| 3737 | a timer that will try to put the chip in BMPS mode after |
| 3738 | expiry. |
| 3739 | \return eHalStatus |
| 3740 | ---------------------------------------------------------------------------*/ |
| 3741 | eHalStatus sme_EnablePowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 3742 | { |
| 3743 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3744 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3745 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3746 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3747 | TRACE_CODE_SME_RX_HDD_ENABLE_PWRSAVE, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3748 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3749 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3750 | { |
| 3751 | status = pmcEnablePowerSave(hHal, psMode); |
| 3752 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3753 | } |
| 3754 | |
| 3755 | return (status); |
| 3756 | } |
| 3757 | |
| 3758 | /* --------------------------------------------------------------------------- |
| 3759 | \fn sme_DisablePowerSave |
| 3760 | \brief Disables one of the power saving modes. |
| 3761 | \param hHal - The handle returned by macOpen. |
| 3762 | \param psMode - The power saving mode to disable. Disabling does not imply |
| 3763 | that device will be brought out of the current PS mode. This |
| 3764 | is purely a configuration API. |
| 3765 | \return eHalStatus |
| 3766 | ---------------------------------------------------------------------------*/ |
| 3767 | eHalStatus sme_DisablePowerSave (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 3768 | { |
| 3769 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3770 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3771 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3772 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3773 | TRACE_CODE_SME_RX_HDD_DISABLE_PWRSAVE, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3774 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3775 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3776 | { |
| 3777 | status = pmcDisablePowerSave(hHal, psMode); |
| 3778 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3779 | } |
| 3780 | |
| 3781 | return (status); |
| 3782 | } |
| 3783 | |
| 3784 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 69b3418 | 2013-01-16 08:51:40 +0530 | [diff] [blame] | 3785 | + \fn sme_SetHostPowerSave |
| 3786 | + \brief Enables BMPS logic to be controlled by User level apps |
| 3787 | + \param hHal - The handle returned by macOpen. |
| 3788 | + \param psMode - The power saving mode to disable. Disabling does not imply |
| 3789 | + that device will be brought out of the current PS mode. This |
| 3790 | + is purely a configuration API. |
| 3791 | + \return eHalStatus |
| 3792 | + ---------------------------------------------------------------------------*/ |
| 3793 | eHalStatus sme_SetHostPowerSave (tHalHandle hHal, v_BOOL_t psMode) |
| 3794 | { |
| 3795 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3796 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3797 | |
| 3798 | pMac->pmc.isHostPsEn = psMode; |
| 3799 | |
| 3800 | return (status); |
| 3801 | } |
| 3802 | |
| 3803 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3804 | \fn sme_StartAutoBmpsTimer |
| 3805 | \brief Starts a timer that periodically polls all the registered |
| 3806 | module for entry into Bmps mode. This timer is started only if BMPS is |
| 3807 | enabled and whenever the device is in full power. |
| 3808 | \param hHal - The handle returned by macOpen. |
| 3809 | \return eHalStatus |
| 3810 | ---------------------------------------------------------------------------*/ |
| 3811 | eHalStatus sme_StartAutoBmpsTimer ( tHalHandle hHal) |
| 3812 | { |
| 3813 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3814 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3815 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3816 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3817 | TRACE_CODE_SME_RX_HDD_START_AUTO_BMPSTIMER, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3818 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3819 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3820 | { |
| 3821 | status = pmcStartAutoBmpsTimer(hHal); |
| 3822 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3823 | } |
| 3824 | |
| 3825 | return (status); |
| 3826 | } |
| 3827 | /* --------------------------------------------------------------------------- |
| 3828 | \fn sme_StopAutoBmpsTimer |
| 3829 | \brief Stops the Auto BMPS Timer that was started using sme_startAutoBmpsTimer |
| 3830 | Stopping the timer does not cause a device state change. Only the timer |
| 3831 | is stopped. If "Full Power" is desired, use the sme_RequestFullPower API |
| 3832 | \param hHal - The handle returned by macOpen. |
| 3833 | \return eHalStatus |
| 3834 | ---------------------------------------------------------------------------*/ |
| 3835 | eHalStatus sme_StopAutoBmpsTimer ( tHalHandle hHal) |
| 3836 | { |
| 3837 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3838 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3839 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3840 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3841 | TRACE_CODE_SME_RX_HDD_STOP_AUTO_BMPSTIMER, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3842 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3843 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3844 | { |
| 3845 | status = pmcStopAutoBmpsTimer(hHal); |
| 3846 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3847 | } |
| 3848 | |
| 3849 | return (status); |
| 3850 | } |
| 3851 | /* --------------------------------------------------------------------------- |
| 3852 | \fn sme_QueryPowerState |
| 3853 | \brief Returns the current power state of the device. |
| 3854 | \param hHal - The handle returned by macOpen. |
| 3855 | \param pPowerState - pointer to location to return power state (LOW or HIGH) |
| 3856 | \param pSwWlanSwitchState - ptr to location to return SW WLAN Switch state |
| 3857 | \return eHalStatus |
| 3858 | ---------------------------------------------------------------------------*/ |
| 3859 | eHalStatus sme_QueryPowerState ( |
| 3860 | tHalHandle hHal, |
| 3861 | tPmcPowerState *pPowerState, |
| 3862 | tPmcSwitchState *pSwWlanSwitchState) |
| 3863 | { |
| 3864 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3865 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3866 | |
| 3867 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3868 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3869 | { |
| 3870 | status = pmcQueryPowerState (hHal, pPowerState, NULL, pSwWlanSwitchState); |
| 3871 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3872 | } |
| 3873 | |
| 3874 | return (status); |
| 3875 | } |
| 3876 | |
| 3877 | /* --------------------------------------------------------------------------- |
| 3878 | \fn sme_IsPowerSaveEnabled |
| 3879 | \brief Checks if the device is able to enter a particular power save mode |
| 3880 | This does not imply that the device is in a particular PS mode |
| 3881 | \param hHal - The handle returned by macOpen. |
| 3882 | \param psMode - the power saving mode |
| 3883 | \return eHalStatus |
| 3884 | ---------------------------------------------------------------------------*/ |
| 3885 | tANI_BOOLEAN sme_IsPowerSaveEnabled (tHalHandle hHal, tPmcPowerSavingMode psMode) |
| 3886 | { |
| 3887 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3888 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3889 | tANI_BOOLEAN result = false; |
| 3890 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3891 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3892 | TRACE_CODE_SME_RX_HDD_IS_PWRSAVE_ENABLED, NO_SESSION, psMode)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3893 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3894 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3895 | { |
| 3896 | result = pmcIsPowerSaveEnabled(hHal, psMode); |
| 3897 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3898 | return result; |
| 3899 | } |
| 3900 | |
| 3901 | return false; |
| 3902 | } |
| 3903 | |
| 3904 | /* --------------------------------------------------------------------------- |
| 3905 | \fn sme_RequestFullPower |
| 3906 | \brief Request that the device be brought to full power state. When the |
| 3907 | device enters Full Power PMC will start a BMPS timer if BMPS PS mode |
| 3908 | is enabled. On timer expiry PMC will attempt to put the device in |
| 3909 | BMPS mode if following holds true: |
| 3910 | - BMPS mode is enabled |
| 3911 | - Polling of all modules through the Power Save Check routine passes |
| 3912 | - STA is associated to an access point |
| 3913 | \param hHal - The handle returned by macOpen. |
| 3914 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 3915 | \return eHalStatus - status |
| 3916 | eHAL_STATUS_SUCCESS - device brought to full power state |
| 3917 | eHAL_STATUS_FAILURE - device cannot be brought to full power state |
| 3918 | eHAL_STATUS_PMC_PENDING - device is being brought to full power state, |
| 3919 | ---------------------------------------------------------------------------*/ |
| 3920 | eHalStatus sme_RequestFullPower ( |
| 3921 | tHalHandle hHal, |
| 3922 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 3923 | void *callbackContext, |
| 3924 | tRequestFullPowerReason fullPowerReason) |
| 3925 | { |
| 3926 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3927 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3928 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3929 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3930 | TRACE_CODE_SME_RX_HDD_REQUEST_FULLPOWER, NO_SESSION, fullPowerReason)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3931 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3932 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3933 | { |
| 3934 | status = pmcRequestFullPower(hHal, callbackRoutine, callbackContext, fullPowerReason); |
| 3935 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3936 | } |
| 3937 | |
| 3938 | return (status); |
| 3939 | } |
| 3940 | |
| 3941 | /* --------------------------------------------------------------------------- |
| 3942 | \fn sme_RequestBmps |
| 3943 | \brief Request that the device be put in BMPS state. Request will be |
| 3944 | accepted only if BMPS mode is enabled and power save check routine |
| 3945 | passes. |
| 3946 | \param hHal - The handle returned by macOpen. |
| 3947 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 3948 | \return eHalStatus |
| 3949 | eHAL_STATUS_SUCCESS - device is in BMPS state |
| 3950 | eHAL_STATUS_FAILURE - device cannot be brought to BMPS state |
| 3951 | eHAL_STATUS_PMC_PENDING - device is being brought to BMPS state |
| 3952 | ---------------------------------------------------------------------------*/ |
| 3953 | eHalStatus sme_RequestBmps ( |
| 3954 | tHalHandle hHal, |
| 3955 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 3956 | void *callbackContext) |
| 3957 | { |
| 3958 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 3959 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3960 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3961 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3962 | TRACE_CODE_SME_RX_HDD_REQUEST_BMPS, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3963 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 3964 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 3965 | { |
| 3966 | status = pmcRequestBmps(hHal, callbackRoutine, callbackContext); |
| 3967 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 3968 | } |
| 3969 | |
| 3970 | return (status); |
| 3971 | } |
| 3972 | |
| 3973 | |
| 3974 | /* --------------------------------------------------------------------------- |
| 3975 | \fn sme_SetDHCPTillPowerActiveFlag |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 3976 | \brief Sets/Clears DHCP related flag in PMC to disable/enable auto BMPS |
| 3977 | entry by PMC |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3978 | \param hHal - The handle returned by macOpen. |
| 3979 | ---------------------------------------------------------------------------*/ |
| 3980 | void sme_SetDHCPTillPowerActiveFlag(tHalHandle hHal, tANI_U8 flag) |
| 3981 | { |
| 3982 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 3983 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 3984 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 3985 | TRACE_CODE_SME_RX_HDD_SET_DHCP_FLAG, NO_SESSION, flag)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 3986 | // Set/Clear the DHCP flag which will disable/enable auto BMPS entery by PMC |
| 3987 | pMac->pmc.remainInPowerActiveTillDHCP = flag; |
| 3988 | } |
| 3989 | |
| 3990 | |
| 3991 | /* --------------------------------------------------------------------------- |
| 3992 | \fn sme_StartUapsd |
| 3993 | \brief Request that the device be put in UAPSD state. If the device is in |
| 3994 | Full Power it will be put in BMPS mode first and then into UAPSD |
| 3995 | mode. |
| 3996 | \param hHal - The handle returned by macOpen. |
| 3997 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 3998 | eHAL_STATUS_SUCCESS - device is in UAPSD state |
| 3999 | eHAL_STATUS_FAILURE - device cannot be brought to UAPSD state |
| 4000 | eHAL_STATUS_PMC_PENDING - device is being brought to UAPSD state |
| 4001 | eHAL_STATUS_PMC_DISABLED - UAPSD is disabled or BMPS mode is disabled |
| 4002 | \return eHalStatus |
| 4003 | ---------------------------------------------------------------------------*/ |
| 4004 | eHalStatus sme_StartUapsd ( |
| 4005 | tHalHandle hHal, |
| 4006 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4007 | void *callbackContext) |
| 4008 | { |
| 4009 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4010 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4011 | |
| 4012 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4013 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4014 | { |
| 4015 | status = pmcStartUapsd(hHal, callbackRoutine, callbackContext); |
| 4016 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4017 | } |
| 4018 | |
| 4019 | return (status); |
| 4020 | } |
| 4021 | |
| 4022 | /* --------------------------------------------------------------------------- |
| 4023 | \fn sme_StopUapsd |
| 4024 | \brief Request that the device be put out of UAPSD state. Device will be |
| 4025 | put in in BMPS state after stop UAPSD completes. |
| 4026 | \param hHal - The handle returned by macOpen. |
| 4027 | \return eHalStatus |
| 4028 | eHAL_STATUS_SUCCESS - device is put out of UAPSD and back in BMPS state |
| 4029 | eHAL_STATUS_FAILURE - device cannot be brought out of UAPSD state |
| 4030 | ---------------------------------------------------------------------------*/ |
| 4031 | eHalStatus sme_StopUapsd (tHalHandle hHal) |
| 4032 | { |
| 4033 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4034 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4035 | |
| 4036 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4037 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4038 | { |
| 4039 | status = pmcStopUapsd(hHal); |
| 4040 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4041 | } |
| 4042 | |
| 4043 | return (status); |
| 4044 | } |
| 4045 | |
| 4046 | /* --------------------------------------------------------------------------- |
| 4047 | \fn sme_RequestStandby |
| 4048 | \brief Request that the device be put in standby. It is HDD's responsibility |
| 4049 | to bring the chip to full power and do a disassoc before calling |
| 4050 | this API. |
| 4051 | \param hHal - The handle returned by macOpen. |
| 4052 | \param - callbackRoutine Callback routine invoked in case of success/failure |
| 4053 | \return eHalStatus |
| 4054 | eHAL_STATUS_SUCCESS - device is in Standby mode |
| 4055 | eHAL_STATUS_FAILURE - device cannot be put in standby mode |
| 4056 | eHAL_STATUS_PMC_PENDING - device is being put in standby mode |
| 4057 | ---------------------------------------------------------------------------*/ |
| 4058 | eHalStatus sme_RequestStandby ( |
| 4059 | tHalHandle hHal, |
| 4060 | void (*callbackRoutine) (void *callbackContext, eHalStatus status), |
| 4061 | void *callbackContext) |
| 4062 | { |
| 4063 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4064 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4065 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4066 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4067 | TRACE_CODE_SME_RX_HDD_REQUEST_STANDBY, NO_SESSION, 0)); |
Agarwal Ashish | e3cca2a | 2013-07-21 03:01:48 +0530 | [diff] [blame] | 4068 | smsLog( pMac, LOG1, FL(" called") ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4069 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4070 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4071 | { |
| 4072 | status = pmcRequestStandby(hHal, callbackRoutine, callbackContext); |
| 4073 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4074 | } |
| 4075 | |
| 4076 | return (status); |
| 4077 | } |
| 4078 | |
| 4079 | /* --------------------------------------------------------------------------- |
| 4080 | \fn sme_RegisterPowerSaveCheck |
| 4081 | \brief Register a power save check routine that is called whenever |
| 4082 | the device is about to enter one of the power save modes. |
| 4083 | \param hHal - The handle returned by macOpen. |
| 4084 | \param checkRoutine - Power save check routine to be registered |
| 4085 | \return eHalStatus |
| 4086 | eHAL_STATUS_SUCCESS - successfully registered |
| 4087 | eHAL_STATUS_FAILURE - not successfully registered |
| 4088 | ---------------------------------------------------------------------------*/ |
| 4089 | eHalStatus sme_RegisterPowerSaveCheck ( |
| 4090 | tHalHandle hHal, |
| 4091 | tANI_BOOLEAN (*checkRoutine) (void *checkContext), void *checkContext) |
| 4092 | { |
| 4093 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4094 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4095 | |
| 4096 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4097 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4098 | { |
| 4099 | status = pmcRegisterPowerSaveCheck (hHal, checkRoutine, checkContext); |
| 4100 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4101 | } |
| 4102 | |
| 4103 | return (status); |
| 4104 | } |
| 4105 | |
| 4106 | /* --------------------------------------------------------------------------- |
Mihir Shete | fc7ff5b | 2014-01-27 11:30:05 +0530 | [diff] [blame] | 4107 | \fn sme_Register11dScanDoneCallback |
| 4108 | \brief Register a routine of type csrScanCompleteCallback which is |
| 4109 | called whenever an 11d scan is done |
| 4110 | \param hHal - The handle returned by macOpen. |
| 4111 | \param callback - 11d scan complete routine to be registered |
| 4112 | \return eHalStatus |
| 4113 | ---------------------------------------------------------------------------*/ |
| 4114 | eHalStatus sme_Register11dScanDoneCallback ( |
| 4115 | tHalHandle hHal, |
| 4116 | csrScanCompleteCallback callback) |
| 4117 | { |
| 4118 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 4119 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4120 | |
| 4121 | pMac->scan.callback11dScanDone = callback; |
| 4122 | |
| 4123 | return (status); |
| 4124 | } |
| 4125 | |
| 4126 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4127 | \fn sme_DeregisterPowerSaveCheck |
| 4128 | \brief Deregister a power save check routine |
| 4129 | \param hHal - The handle returned by macOpen. |
| 4130 | \param checkRoutine - Power save check routine to be deregistered |
| 4131 | \return eHalStatus |
| 4132 | eHAL_STATUS_SUCCESS - successfully deregistered |
| 4133 | eHAL_STATUS_FAILURE - not successfully deregistered |
| 4134 | ---------------------------------------------------------------------------*/ |
| 4135 | eHalStatus sme_DeregisterPowerSaveCheck ( |
| 4136 | tHalHandle hHal, |
| 4137 | tANI_BOOLEAN (*checkRoutine) (void *checkContext)) |
| 4138 | { |
| 4139 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4140 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4141 | |
| 4142 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4143 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4144 | { |
| 4145 | status = pmcDeregisterPowerSaveCheck (hHal, checkRoutine); |
| 4146 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4147 | } |
| 4148 | |
| 4149 | return (status); |
| 4150 | } |
| 4151 | |
| 4152 | /* --------------------------------------------------------------------------- |
| 4153 | \fn sme_RegisterDeviceStateUpdateInd |
| 4154 | \brief Register a callback routine that is called whenever |
| 4155 | the device enters a new device state (Full Power, BMPS, UAPSD) |
| 4156 | \param hHal - The handle returned by macOpen. |
| 4157 | \param callbackRoutine - Callback routine to be registered |
| 4158 | \param callbackContext - Cookie to be passed back during callback |
| 4159 | \return eHalStatus |
| 4160 | eHAL_STATUS_SUCCESS - successfully registered |
| 4161 | eHAL_STATUS_FAILURE - not successfully registered |
| 4162 | ---------------------------------------------------------------------------*/ |
| 4163 | eHalStatus sme_RegisterDeviceStateUpdateInd ( |
| 4164 | tHalHandle hHal, |
| 4165 | void (*callbackRoutine) (void *callbackContext, tPmcState pmcState), |
| 4166 | void *callbackContext) |
| 4167 | { |
| 4168 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4169 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4170 | |
| 4171 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4172 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4173 | { |
| 4174 | status = pmcRegisterDeviceStateUpdateInd (hHal, callbackRoutine, callbackContext); |
| 4175 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4176 | } |
| 4177 | |
| 4178 | return (status); |
| 4179 | } |
| 4180 | |
| 4181 | /* --------------------------------------------------------------------------- |
| 4182 | \fn sme_DeregisterDeviceStateUpdateInd |
| 4183 | \brief Deregister a routine that was registered for device state changes |
| 4184 | \param hHal - The handle returned by macOpen. |
| 4185 | \param callbackRoutine - Callback routine to be deregistered |
| 4186 | \return eHalStatus |
| 4187 | eHAL_STATUS_SUCCESS - successfully deregistered |
| 4188 | eHAL_STATUS_FAILURE - not successfully deregistered |
| 4189 | ---------------------------------------------------------------------------*/ |
| 4190 | eHalStatus sme_DeregisterDeviceStateUpdateInd ( |
| 4191 | tHalHandle hHal, |
| 4192 | void (*callbackRoutine) (void *callbackContext, tPmcState pmcState)) |
| 4193 | { |
| 4194 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4195 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4196 | |
| 4197 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4198 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4199 | { |
| 4200 | status = pmcDeregisterDeviceStateUpdateInd (hHal, callbackRoutine); |
| 4201 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4202 | } |
| 4203 | |
| 4204 | return (status); |
| 4205 | } |
| 4206 | |
| 4207 | /* --------------------------------------------------------------------------- |
| 4208 | \fn sme_WowlAddBcastPattern |
| 4209 | \brief Add a pattern for Pattern Byte Matching in Wowl mode. Firmware will |
| 4210 | do a pattern match on these patterns when Wowl is enabled during BMPS |
| 4211 | mode. Note that Firmware performs the pattern matching only on |
| 4212 | broadcast frames and while Libra is in BMPS mode. |
| 4213 | \param hHal - The handle returned by macOpen. |
| 4214 | \param pattern - Pattern to be added |
| 4215 | \return eHalStatus |
| 4216 | eHAL_STATUS_FAILURE Cannot add pattern |
| 4217 | eHAL_STATUS_SUCCESS Request accepted. |
| 4218 | ---------------------------------------------------------------------------*/ |
| 4219 | eHalStatus sme_WowlAddBcastPattern ( |
| 4220 | tHalHandle hHal, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4221 | tpSirWowlAddBcastPtrn pattern, |
| 4222 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4223 | { |
| 4224 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4225 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4226 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4227 | TRACE_CODE_SME_RX_HDD_WOWL_ADDBCAST_PATTERN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4228 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4229 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4230 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4231 | status = pmcWowlAddBcastPattern (hHal, pattern, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4232 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4233 | } |
| 4234 | |
| 4235 | return (status); |
| 4236 | } |
| 4237 | |
| 4238 | /* --------------------------------------------------------------------------- |
| 4239 | \fn sme_WowlDelBcastPattern |
| 4240 | \brief Delete a pattern that was added for Pattern Byte Matching. |
| 4241 | \param hHal - The handle returned by macOpen. |
| 4242 | \param pattern - Pattern to be deleted |
| 4243 | \return eHalStatus |
| 4244 | eHAL_STATUS_FAILURE Cannot delete pattern |
| 4245 | eHAL_STATUS_SUCCESS Request accepted. |
| 4246 | ---------------------------------------------------------------------------*/ |
| 4247 | eHalStatus sme_WowlDelBcastPattern ( |
| 4248 | tHalHandle hHal, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4249 | tpSirWowlDelBcastPtrn pattern, |
| 4250 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4251 | { |
| 4252 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4253 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4254 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4255 | TRACE_CODE_SME_RX_HDD_WOWL_DELBCAST_PATTERN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4256 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4257 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4258 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4259 | status = pmcWowlDelBcastPattern (hHal, pattern, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4260 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4261 | } |
| 4262 | |
| 4263 | return (status); |
| 4264 | } |
| 4265 | |
| 4266 | /* --------------------------------------------------------------------------- |
| 4267 | \fn sme_EnterWowl |
| 4268 | \brief This is the SME API exposed to HDD to request enabling of WOWL mode. |
| 4269 | WoWLAN works on top of BMPS mode. If the device is not in BMPS mode, |
| 4270 | SME will will cache the information that WOWL has been enabled and |
| 4271 | attempt to put the device in BMPS. On entry into BMPS, SME will |
| 4272 | enable the WOWL mode. |
| 4273 | Note 1: If we exit BMPS mode (someone requests full power), we |
| 4274 | will NOT resume WOWL when we go back to BMPS again. Request for full |
| 4275 | power (while in WOWL mode) means disable WOWL and go to full power. |
| 4276 | Note 2: Both UAPSD and WOWL work on top of BMPS. On entry into BMPS, SME |
| 4277 | will give priority to UAPSD and enable only UAPSD if both UAPSD and WOWL |
| 4278 | are required. Currently there is no requirement or use case to support |
| 4279 | UAPSD and WOWL at the same time. |
| 4280 | |
| 4281 | \param hHal - The handle returned by macOpen. |
| 4282 | \param enterWowlCallbackRoutine - Callback routine provided by HDD. |
| 4283 | Used for success/failure notification by SME |
| 4284 | \param enterWowlCallbackContext - A cookie passed by HDD, that is passed back to HDD |
| 4285 | at the time of callback. |
| 4286 | \param wakeReasonIndCB - Callback routine provided by HDD. |
| 4287 | Used for Wake Reason Indication by SME |
| 4288 | \param wakeReasonIndCBContext - A cookie passed by HDD, that is passed back to HDD |
| 4289 | at the time of callback. |
| 4290 | \return eHalStatus |
| 4291 | eHAL_STATUS_SUCCESS Device is already in WoWLAN mode |
| 4292 | eHAL_STATUS_FAILURE Device cannot enter WoWLAN mode. |
| 4293 | eHAL_STATUS_PMC_PENDING Request accepted. SME will enable WOWL after |
| 4294 | BMPS mode is entered. |
| 4295 | ---------------------------------------------------------------------------*/ |
| 4296 | eHalStatus sme_EnterWowl ( |
| 4297 | tHalHandle hHal, |
| 4298 | void (*enterWowlCallbackRoutine) (void *callbackContext, eHalStatus status), |
| 4299 | void *enterWowlCallbackContext, |
| 4300 | #ifdef WLAN_WAKEUP_EVENTS |
| 4301 | void (*wakeIndicationCB) (void *callbackContext, tpSirWakeReasonInd pWakeReasonInd), |
| 4302 | void *wakeIndicationCBContext, |
| 4303 | #endif // WLAN_WAKEUP_EVENTS |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4304 | tpSirSmeWowlEnterParams wowlEnterParams, tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4305 | { |
| 4306 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4307 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4308 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4309 | TRACE_CODE_SME_RX_HDD_ENTER_WOWL, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4310 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4311 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4312 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4313 | status = pmcEnterWowl (hHal, enterWowlCallbackRoutine, enterWowlCallbackContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4314 | #ifdef WLAN_WAKEUP_EVENTS |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4315 | wakeIndicationCB, wakeIndicationCBContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4316 | #endif // WLAN_WAKEUP_EVENTS |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 4317 | wowlEnterParams, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4318 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4319 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4320 | return (status); |
| 4321 | } |
| 4322 | /* --------------------------------------------------------------------------- |
| 4323 | \fn sme_ExitWowl |
| 4324 | \brief This is the SME API exposed to HDD to request exit from WoWLAN mode. |
| 4325 | SME will initiate exit from WoWLAN mode and device will be put in BMPS |
| 4326 | mode. |
| 4327 | \param hHal - The handle returned by macOpen. |
| 4328 | \return eHalStatus |
| 4329 | eHAL_STATUS_FAILURE Device cannot exit WoWLAN mode. |
| 4330 | eHAL_STATUS_SUCCESS Request accepted to exit WoWLAN mode. |
| 4331 | ---------------------------------------------------------------------------*/ |
| 4332 | eHalStatus sme_ExitWowl (tHalHandle hHal) |
| 4333 | { |
| 4334 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4335 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4336 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4337 | TRACE_CODE_SME_RX_HDD_EXIT_WOWL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4338 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4339 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4340 | { |
| 4341 | status = pmcExitWowl (hHal); |
| 4342 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4343 | } |
| 4344 | |
| 4345 | return (status); |
| 4346 | } |
| 4347 | |
| 4348 | /* --------------------------------------------------------------------------- |
| 4349 | |
| 4350 | \fn sme_RoamSetKey |
| 4351 | |
| 4352 | \brief To set encryption key. This function should be called only when connected |
| 4353 | This is an asynchronous API. |
| 4354 | |
| 4355 | \param pSetKeyInfo - pointer to a caller allocated object of tCsrSetContextInfo |
| 4356 | |
| 4357 | \param pRoamId Upon success return, this is the id caller can use to identify the request in roamcallback |
| 4358 | |
| 4359 | \return eHalStatus SUCCESS Roam callback will be called indicate actually results |
| 4360 | |
| 4361 | FAILURE or RESOURCES The API finished and failed. |
| 4362 | |
| 4363 | -------------------------------------------------------------------------------*/ |
| 4364 | eHalStatus sme_RoamSetKey(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamSetKey *pSetKey, tANI_U32 *pRoamId) |
| 4365 | { |
| 4366 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4367 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4368 | tANI_U32 roamId; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4369 | tANI_U32 i; |
| 4370 | tCsrRoamSession *pSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4371 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4372 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4373 | TRACE_CODE_SME_RX_HDD_SET_KEY, sessionId, 0)); |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 4374 | if (pSetKey->keyLength > CSR_MAX_KEY_LEN) |
| 4375 | { |
| 4376 | smsLog(pMac, LOGE, FL("Invalid key length %d"), pSetKey->keyLength); |
| 4377 | return eHAL_STATUS_FAILURE; |
| 4378 | } |
| 4379 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4380 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4381 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4382 | { |
| 4383 | roamId = GET_NEXT_ROAM_ID(&pMac->roam); |
| 4384 | if(pRoamId) |
| 4385 | { |
| 4386 | *pRoamId = roamId; |
| 4387 | } |
| 4388 | |
Jeff Johnson | f89f4b5 | 2013-03-27 10:32:44 -0700 | [diff] [blame] | 4389 | smsLog(pMac, LOG2, FL("keyLength %d"), pSetKey->keyLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4390 | |
| 4391 | for(i=0; i<pSetKey->keyLength; i++) |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4392 | smsLog(pMac, LOG2, FL("%02x"), pSetKey->Key[i]); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4393 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4394 | smsLog(pMac, LOG2, "\n sessionId=%d roamId=%d", sessionId, roamId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4395 | |
| 4396 | pSession = CSR_GET_SESSION(pMac, sessionId); |
| 4397 | |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4398 | if(!pSession) |
| 4399 | { |
| 4400 | 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] | 4401 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 4402 | return eHAL_STATUS_FAILURE; |
| 4403 | } |
| 4404 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4405 | if(CSR_IS_INFRA_AP(&pSession->connectedProfile)) |
| 4406 | { |
| 4407 | if(pSetKey->keyDirection == eSIR_TX_DEFAULT) |
| 4408 | { |
| 4409 | if ( ( eCSR_ENCRYPT_TYPE_WEP40 == pSetKey->encType ) || |
| 4410 | ( eCSR_ENCRYPT_TYPE_WEP40_STATICKEY == pSetKey->encType )) |
| 4411 | { |
| 4412 | pSession->pCurRoamProfile->negotiatedUCEncryptionType = eCSR_ENCRYPT_TYPE_WEP40_STATICKEY; |
| 4413 | } |
| 4414 | if ( ( eCSR_ENCRYPT_TYPE_WEP104 == pSetKey->encType ) || |
| 4415 | ( eCSR_ENCRYPT_TYPE_WEP104_STATICKEY == pSetKey->encType )) |
| 4416 | { |
| 4417 | pSession->pCurRoamProfile->negotiatedUCEncryptionType = eCSR_ENCRYPT_TYPE_WEP104_STATICKEY; |
| 4418 | } |
| 4419 | } |
| 4420 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4421 | |
| 4422 | status = csrRoamSetKey ( pMac, sessionId, pSetKey, roamId ); |
| 4423 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4424 | } |
| 4425 | |
| 4426 | return (status); |
| 4427 | } |
| 4428 | |
| 4429 | |
| 4430 | /* --------------------------------------------------------------------------- |
| 4431 | |
| 4432 | \fn sme_RoamRemoveKey |
| 4433 | |
| 4434 | \brief To set encryption key. This is an asynchronous API. |
| 4435 | |
| 4436 | \param pRemoveKey - pointer to a caller allocated object of tCsrRoamRemoveKey |
| 4437 | |
| 4438 | \param pRoamId Upon success return, this is the id caller can use to identify the request in roamcallback |
| 4439 | |
| 4440 | \return eHalStatus SUCCESS Roam callback will be called indicate actually results |
| 4441 | |
| 4442 | FAILURE or RESOURCES The API finished and failed. |
| 4443 | |
| 4444 | -------------------------------------------------------------------------------*/ |
| 4445 | eHalStatus sme_RoamRemoveKey(tHalHandle hHal, tANI_U8 sessionId, |
| 4446 | tCsrRoamRemoveKey *pRemoveKey, tANI_U32 *pRoamId) |
| 4447 | { |
| 4448 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4449 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4450 | tANI_U32 roamId; |
| 4451 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4452 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4453 | TRACE_CODE_SME_RX_HDD_REMOVE_KEY, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4454 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4455 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4456 | { |
| 4457 | roamId = GET_NEXT_ROAM_ID(&pMac->roam); |
| 4458 | if(pRoamId) |
| 4459 | { |
| 4460 | *pRoamId = roamId; |
| 4461 | } |
| 4462 | status = csrRoamIssueRemoveKeyCommand( pMac, sessionId, pRemoveKey, roamId ); |
| 4463 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4464 | } |
| 4465 | |
| 4466 | return (status); |
| 4467 | } |
| 4468 | |
| 4469 | /* --------------------------------------------------------------------------- |
| 4470 | \fn sme_GetRssi |
| 4471 | \brief a wrapper function that client calls to register a callback to get RSSI |
| 4472 | |
| 4473 | \param callback - SME sends back the requested stats using the callback |
| 4474 | \param staId - The station ID for which the stats is requested for |
| 4475 | \param pContext - user context to be passed back along with the callback |
| 4476 | \param pVosContext - vos context |
| 4477 | \return eHalStatus |
| 4478 | ---------------------------------------------------------------------------*/ |
| 4479 | eHalStatus sme_GetRssi(tHalHandle hHal, |
| 4480 | tCsrRssiCallback callback, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 4481 | tANI_U8 staId, tCsrBssid bssId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4482 | void *pContext, void* pVosContext) |
| 4483 | { |
| 4484 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4485 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4486 | |
| 4487 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4488 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4489 | { |
| 4490 | status = csrGetRssi( pMac, callback, |
| 4491 | staId, bssId, pContext, pVosContext); |
| 4492 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4493 | } |
| 4494 | return (status); |
| 4495 | } |
Madan Mohan Koyyalamudi | d9383fd | 2013-08-13 09:27:30 +0530 | [diff] [blame] | 4496 | |
| 4497 | /* --------------------------------------------------------------------------- |
| 4498 | \fn sme_GetSnr |
| 4499 | \brief a wrapper function that client calls to register a callback to |
| 4500 | get SNR |
| 4501 | |
| 4502 | \param callback - SME sends back the requested stats using the callback |
| 4503 | \param staId - The station ID for which the stats is requested for |
| 4504 | \param pContext - user context to be passed back along with the callback |
| 4505 | \param pVosContext - vos context |
| 4506 | \return eHalStatus |
| 4507 | ---------------------------------------------------------------------------*/ |
| 4508 | eHalStatus sme_GetSnr(tHalHandle hHal, |
| 4509 | tCsrSnrCallback callback, |
| 4510 | tANI_U8 staId, tCsrBssid bssId, |
| 4511 | void *pContext) |
| 4512 | { |
| 4513 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4514 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4515 | |
| 4516 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4517 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4518 | { |
| 4519 | status = csrGetSnr(pMac, callback, |
| 4520 | staId, bssId, pContext); |
| 4521 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4522 | } |
| 4523 | return status; |
| 4524 | } |
Srinivas Girigowda | d34cedb | 2013-01-25 13:33:11 -0800 | [diff] [blame] | 4525 | #if defined WLAN_FEATURE_VOWIFI_11R || defined FEATURE_WLAN_CCX || defined(FEATURE_WLAN_LFR) |
| 4526 | /* --------------------------------------------------------------------------- |
| 4527 | \fn sme_GetRoamRssi |
| 4528 | \brief a wrapper function that client calls to register a callback to get Roam RSSI |
| 4529 | |
| 4530 | \param callback - SME sends back the requested stats using the callback |
| 4531 | \param staId - The station ID for which the stats is requested for |
| 4532 | \param pContext - user context to be passed back along with the callback |
| 4533 | \param pVosContext - vos context |
| 4534 | \return eHalStatus |
| 4535 | ---------------------------------------------------------------------------*/ |
| 4536 | eHalStatus sme_GetRoamRssi(tHalHandle hHal, |
| 4537 | tCsrRssiCallback callback, |
| 4538 | tANI_U8 staId, tCsrBssid bssId, |
| 4539 | void *pContext, void* pVosContext) |
| 4540 | { |
| 4541 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4542 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4543 | |
| 4544 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4545 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4546 | { |
| 4547 | status = csrGetRoamRssi( pMac, callback, |
| 4548 | staId, bssId, pContext, pVosContext); |
| 4549 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4550 | } |
| 4551 | return (status); |
| 4552 | } |
| 4553 | #endif |
| 4554 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4555 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 4556 | #if defined(FEATURE_WLAN_CCX) && defined(FEATURE_WLAN_CCX_UPLOAD) |
| 4557 | /* --------------------------------------------------------------------------- |
| 4558 | \fn sme_GetTsmStats |
| 4559 | \brief a wrapper function that client calls to register a callback to get TSM Stats |
| 4560 | |
| 4561 | \param callback - SME sends back the requested stats using the callback |
| 4562 | \param staId - The station ID for which the stats is requested for |
| 4563 | \param pContext - user context to be passed back along with the callback |
| 4564 | \param pVosContext - vos context |
| 4565 | \return eHalStatus |
| 4566 | ---------------------------------------------------------------------------*/ |
| 4567 | eHalStatus sme_GetTsmStats(tHalHandle hHal, |
| 4568 | tCsrTsmStatsCallback callback, |
| 4569 | tANI_U8 staId, tCsrBssid bssId, |
| 4570 | void *pContext, void* pVosContext, tANI_U8 tid) |
| 4571 | { |
| 4572 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4573 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4574 | |
| 4575 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4576 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4577 | { |
| 4578 | status = csrGetTsmStats( pMac, callback, |
| 4579 | staId, bssId, pContext, pVosContext, tid); |
| 4580 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4581 | } |
| 4582 | return (status); |
| 4583 | } |
| 4584 | #endif |
| 4585 | |
| 4586 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4587 | /* --------------------------------------------------------------------------- |
| 4588 | \fn sme_GetStatistics |
| 4589 | \brief a wrapper function that client calls to register a callback to get |
| 4590 | different PHY level statistics from CSR. |
| 4591 | |
| 4592 | \param requesterId - different client requesting for statistics, HDD, UMA/GAN etc |
| 4593 | \param statsMask - The different category/categories of stats requester is looking for |
| 4594 | \param callback - SME sends back the requested stats using the callback |
| 4595 | \param periodicity - If requester needs periodic update in millisec, 0 means |
| 4596 | it's an one time request |
| 4597 | \param cache - If requester is happy with cached stats |
| 4598 | \param staId - The station ID for which the stats is requested for |
| 4599 | \param pContext - user context to be passed back along with the callback |
| 4600 | \return eHalStatus |
| 4601 | ---------------------------------------------------------------------------*/ |
| 4602 | eHalStatus sme_GetStatistics(tHalHandle hHal, eCsrStatsRequesterType requesterId, |
| 4603 | tANI_U32 statsMask, |
| 4604 | tCsrStatsCallback callback, |
| 4605 | tANI_U32 periodicity, tANI_BOOLEAN cache, |
| 4606 | tANI_U8 staId, void *pContext) |
| 4607 | { |
| 4608 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4609 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4610 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4611 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4612 | TRACE_CODE_SME_RX_HDD_GET_STATS, NO_SESSION, periodicity)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4613 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4614 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4615 | { |
| 4616 | status = csrGetStatistics( pMac, requesterId , statsMask, callback, |
| 4617 | periodicity, cache, staId, pContext); |
| 4618 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4619 | } |
| 4620 | |
| 4621 | return (status); |
| 4622 | |
| 4623 | } |
| 4624 | |
| 4625 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 8af9b40 | 2013-07-11 14:59:10 +0530 | [diff] [blame] | 4626 | \fn smeGetTLSTAState |
| 4627 | \helper function to get the TL STA State whenever the function is called. |
| 4628 | |
| 4629 | \param staId - The staID to be passed to the TL |
| 4630 | to get the relevant TL STA State |
| 4631 | \return the state as tANI_U16 |
| 4632 | ---------------------------------------------------------------------------*/ |
| 4633 | tANI_U16 smeGetTLSTAState(tHalHandle hHal, tANI_U8 staId) |
| 4634 | { |
| 4635 | tANI_U16 tlSTAState = TL_INIT_STATE; |
| 4636 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4637 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4638 | |
| 4639 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4640 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4641 | { |
| 4642 | tlSTAState = csrGetTLSTAState( pMac, staId); |
| 4643 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4644 | } |
| 4645 | |
| 4646 | return tlSTAState; |
| 4647 | } |
| 4648 | |
| 4649 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4650 | |
| 4651 | \fn sme_GetCountryCode |
| 4652 | |
| 4653 | \brief To return the current country code. If no country code is applied, default country code is |
| 4654 | used to fill the buffer. |
| 4655 | If 11d supported is turned off, an error is return and the last applied/default country code is used. |
| 4656 | This is a synchronous API. |
| 4657 | |
| 4658 | \param pBuf - pointer to a caller allocated buffer for returned country code. |
| 4659 | |
| 4660 | \param pbLen For input, this parameter indicates how big is the buffer. |
| 4661 | Upon return, this parameter has the number of bytes for country. If pBuf |
| 4662 | doesn't have enough space, this function returns |
| 4663 | fail status and this parameter contains the number that is needed. |
| 4664 | |
| 4665 | \return eHalStatus SUCCESS. |
| 4666 | |
| 4667 | FAILURE or RESOURCES The API finished and failed. |
| 4668 | |
| 4669 | -------------------------------------------------------------------------------*/ |
| 4670 | eHalStatus sme_GetCountryCode(tHalHandle hHal, tANI_U8 *pBuf, tANI_U8 *pbLen) |
| 4671 | { |
| 4672 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4673 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4674 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4675 | TRACE_CODE_SME_RX_HDD_GET_CNTRYCODE, NO_SESSION, 0)); |
| 4676 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4677 | return ( csrGetCountryCode( pMac, pBuf, pbLen ) ); |
| 4678 | } |
| 4679 | |
| 4680 | |
| 4681 | /* --------------------------------------------------------------------------- |
| 4682 | |
| 4683 | \fn sme_SetCountryCode |
| 4684 | |
| 4685 | \brief To change the current/default country code. |
| 4686 | If 11d supported is turned off, an error is return. |
| 4687 | This is a synchronous API. |
| 4688 | |
| 4689 | \param pCountry - pointer to a caller allocated buffer for the country code. |
| 4690 | |
| 4691 | \param pfRestartNeeded A pointer to caller allocated memory, upon successful return, it indicates |
| 4692 | whether a reset is required. |
| 4693 | |
| 4694 | \return eHalStatus SUCCESS. |
| 4695 | |
| 4696 | FAILURE or RESOURCES The API finished and failed. |
| 4697 | |
| 4698 | -------------------------------------------------------------------------------*/ |
| 4699 | eHalStatus sme_SetCountryCode(tHalHandle hHal, tANI_U8 *pCountry, tANI_BOOLEAN *pfRestartNeeded) |
| 4700 | { |
| 4701 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4702 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4703 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4704 | TRACE_CODE_SME_RX_HDD_SET_CNTRYCODE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4705 | return ( csrSetCountryCode( pMac, pCountry, pfRestartNeeded ) ); |
| 4706 | } |
| 4707 | |
| 4708 | |
| 4709 | /* --------------------------------------------------------------------------- |
| 4710 | \fn sme_ResetCountryCodeInformation |
| 4711 | \brief this function is to reset the country code current being used back to EEPROM default |
| 4712 | this includes channel list and power setting. This is a synchronous API. |
| 4713 | \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether |
| 4714 | a restart is needed to apply the change |
| 4715 | \return eHalStatus |
| 4716 | -------------------------------------------------------------------------------*/ |
| 4717 | eHalStatus sme_ResetCountryCodeInformation(tHalHandle hHal, tANI_BOOLEAN *pfRestartNeeded) |
| 4718 | { |
| 4719 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4720 | |
| 4721 | return ( csrResetCountryCodeInformation( pMac, pfRestartNeeded ) ); |
| 4722 | } |
| 4723 | |
| 4724 | |
| 4725 | /* --------------------------------------------------------------------------- |
| 4726 | \fn sme_GetSupportedCountryCode |
| 4727 | \brief this function is to get a list of the country code current being supported |
| 4728 | \param pBuf - Caller allocated buffer with at least 3 bytes, upon success return, |
| 4729 | this has the country code list. 3 bytes for each country code. This may be NULL if |
| 4730 | caller wants to know the needed byte count. |
| 4731 | \param pbLen - Caller allocated, as input, it indicates the length of pBuf. Upon success return, |
| 4732 | this contains the length of the data in pBuf. If pbuf is NULL, as input, *pbLen should be 0. |
| 4733 | \return eHalStatus |
| 4734 | -------------------------------------------------------------------------------*/ |
| 4735 | eHalStatus sme_GetSupportedCountryCode(tHalHandle hHal, tANI_U8 *pBuf, tANI_U32 *pbLen) |
| 4736 | { |
| 4737 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4738 | |
| 4739 | return ( csrGetSupportedCountryCode( pMac, pBuf, pbLen ) ); |
| 4740 | } |
| 4741 | |
| 4742 | |
| 4743 | /* --------------------------------------------------------------------------- |
| 4744 | \fn sme_GetCurrentRegulatoryDomain |
| 4745 | \brief this function is to get the current regulatory domain. This is a synchronous API. |
| 4746 | This function must be called after CFG is downloaded and all the band/mode setting already passed into |
| 4747 | SME. The function fails if 11d support is turned off. |
| 4748 | \param pDomain - Caller allocated buffer to return the current domain. |
| 4749 | \return eHalStatus SUCCESS. |
| 4750 | |
| 4751 | FAILURE or RESOURCES The API finished and failed. |
| 4752 | -------------------------------------------------------------------------------*/ |
| 4753 | eHalStatus sme_GetCurrentRegulatoryDomain(tHalHandle hHal, v_REGDOMAIN_t *pDomain) |
| 4754 | { |
| 4755 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4756 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 4757 | |
| 4758 | if( pDomain ) |
| 4759 | { |
| 4760 | if( csrIs11dSupported( pMac ) ) |
| 4761 | { |
| 4762 | *pDomain = csrGetCurrentRegulatoryDomain( pMac ); |
| 4763 | status = eHAL_STATUS_SUCCESS; |
| 4764 | } |
| 4765 | else |
| 4766 | { |
| 4767 | status = eHAL_STATUS_FAILURE; |
| 4768 | } |
| 4769 | } |
| 4770 | |
| 4771 | return ( status ); |
| 4772 | } |
| 4773 | |
| 4774 | |
| 4775 | /* --------------------------------------------------------------------------- |
| 4776 | \fn sme_SetRegulatoryDomain |
| 4777 | \brief this function is to set the current regulatory domain. |
| 4778 | This function must be called after CFG is downloaded and all the band/mode setting already passed into |
| 4779 | SME. This is a synchronous API. |
| 4780 | \param domainId - indicate the domain (defined in the driver) needs to set to. |
| 4781 | See v_REGDOMAIN_t for definition |
| 4782 | \param pfRestartNeeded - pointer to a caller allocated space. Upon successful return, it indicates whether |
| 4783 | a restart is needed to apply the change |
| 4784 | \return eHalStatus |
| 4785 | -------------------------------------------------------------------------------*/ |
| 4786 | eHalStatus sme_SetRegulatoryDomain(tHalHandle hHal, v_REGDOMAIN_t domainId, tANI_BOOLEAN *pfRestartNeeded) |
| 4787 | { |
| 4788 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4789 | |
| 4790 | return ( csrSetRegulatoryDomain( pMac, domainId, pfRestartNeeded ) ); |
| 4791 | } |
| 4792 | |
| 4793 | |
| 4794 | /* --------------------------------------------------------------------------- |
| 4795 | |
| 4796 | \fn sme_GetRegulatoryDomainForCountry |
| 4797 | |
| 4798 | \brief To return a regulatory domain base on a country code. This is a synchronous API. |
| 4799 | |
| 4800 | \param pCountry - pointer to a caller allocated buffer for input country code. |
| 4801 | |
| 4802 | \param pDomainId Upon successful return, it is the domain that country belongs to. |
| 4803 | If it is NULL, returning success means that the country code is known. |
| 4804 | |
| 4805 | \return eHalStatus SUCCESS. |
| 4806 | |
| 4807 | FAILURE or RESOURCES The API finished and failed. |
| 4808 | |
| 4809 | -------------------------------------------------------------------------------*/ |
| 4810 | eHalStatus sme_GetRegulatoryDomainForCountry(tHalHandle hHal, tANI_U8 *pCountry, v_REGDOMAIN_t *pDomainId) |
| 4811 | { |
| 4812 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4813 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 4814 | return csrGetRegulatoryDomainForCountry(pMac, pCountry, pDomainId, |
| 4815 | COUNTRY_QUERY); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4816 | } |
| 4817 | |
| 4818 | |
| 4819 | |
| 4820 | |
| 4821 | /* --------------------------------------------------------------------------- |
| 4822 | |
| 4823 | \fn sme_GetSupportedRegulatoryDomains |
| 4824 | |
| 4825 | \brief To return a list of supported regulatory domains. This is a synchronous API. |
| 4826 | |
| 4827 | \param pDomains - pointer to a caller allocated buffer for returned regulatory domains. |
| 4828 | |
| 4829 | \param pNumDomains For input, this parameter indicates howm many domains pDomains can hold. |
| 4830 | Upon return, this parameter has the number for supported domains. If pDomains |
| 4831 | doesn't have enough space for all the supported domains, this function returns |
| 4832 | fail status and this parameter contains the number that is needed. |
| 4833 | |
| 4834 | \return eHalStatus SUCCESS. |
| 4835 | |
| 4836 | FAILURE or RESOURCES The API finished and failed. |
| 4837 | |
| 4838 | -------------------------------------------------------------------------------*/ |
| 4839 | eHalStatus sme_GetSupportedRegulatoryDomains(tHalHandle hHal, v_REGDOMAIN_t *pDomains, tANI_U32 *pNumDomains) |
| 4840 | { |
| 4841 | eHalStatus status = eHAL_STATUS_INVALID_PARAMETER; |
| 4842 | |
| 4843 | //We support all domains for now |
| 4844 | if( pNumDomains ) |
| 4845 | { |
| 4846 | if( NUM_REG_DOMAINS <= *pNumDomains ) |
| 4847 | { |
| 4848 | status = eHAL_STATUS_SUCCESS; |
| 4849 | } |
| 4850 | *pNumDomains = NUM_REG_DOMAINS; |
| 4851 | } |
| 4852 | if( HAL_STATUS_SUCCESS( status ) ) |
| 4853 | { |
| 4854 | if( pDomains ) |
| 4855 | { |
| 4856 | pDomains[0] = REGDOMAIN_FCC; |
| 4857 | pDomains[1] = REGDOMAIN_ETSI; |
| 4858 | pDomains[2] = REGDOMAIN_JAPAN; |
| 4859 | pDomains[3] = REGDOMAIN_WORLD; |
| 4860 | pDomains[4] = REGDOMAIN_N_AMER_EXC_FCC; |
| 4861 | pDomains[5] = REGDOMAIN_APAC; |
| 4862 | pDomains[6] = REGDOMAIN_KOREA; |
| 4863 | pDomains[7] = REGDOMAIN_HI_5GHZ; |
| 4864 | pDomains[8] = REGDOMAIN_NO_5GHZ; |
| 4865 | } |
| 4866 | else |
| 4867 | { |
| 4868 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 4869 | } |
| 4870 | } |
| 4871 | |
| 4872 | return ( status ); |
| 4873 | } |
| 4874 | |
| 4875 | |
| 4876 | //some support functions |
| 4877 | tANI_BOOLEAN sme_Is11dSupported(tHalHandle hHal) |
| 4878 | { |
| 4879 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4880 | |
| 4881 | return ( csrIs11dSupported( pMac ) ); |
| 4882 | } |
| 4883 | |
| 4884 | |
| 4885 | tANI_BOOLEAN sme_Is11hSupported(tHalHandle hHal) |
| 4886 | { |
| 4887 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4888 | |
| 4889 | return ( csrIs11hSupported( pMac ) ); |
| 4890 | } |
| 4891 | |
| 4892 | |
| 4893 | tANI_BOOLEAN sme_IsWmmSupported(tHalHandle hHal) |
| 4894 | { |
| 4895 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4896 | |
| 4897 | return ( csrIsWmmSupported( pMac ) ); |
| 4898 | } |
| 4899 | |
| 4900 | //Upper layer to get the list of the base channels to scan for passively 11d info from csr |
| 4901 | eHalStatus sme_ScanGetBaseChannels( tHalHandle hHal, tCsrChannelInfo * pChannelInfo ) |
| 4902 | { |
| 4903 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4904 | |
| 4905 | return(csrScanGetBaseChannels(pMac,pChannelInfo) ); |
| 4906 | } |
| 4907 | |
| 4908 | /* --------------------------------------------------------------------------- |
| 4909 | |
| 4910 | \fn sme_ChangeCountryCode |
| 4911 | |
| 4912 | \brief Change Country code from upperlayer during WLAN driver operation. |
| 4913 | This is a synchronous API. |
| 4914 | |
| 4915 | \param hHal - The handle returned by macOpen. |
| 4916 | |
| 4917 | \param pCountry New Country Code String |
| 4918 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 4919 | \param sendRegHint If we want to send reg hint to nl80211 |
| 4920 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4921 | \return eHalStatus SUCCESS. |
| 4922 | |
| 4923 | FAILURE or RESOURCES The API finished and failed. |
| 4924 | |
| 4925 | -------------------------------------------------------------------------------*/ |
| 4926 | eHalStatus sme_ChangeCountryCode( tHalHandle hHal, |
| 4927 | tSmeChangeCountryCallback callback, |
| 4928 | tANI_U8 *pCountry, |
| 4929 | void *pContext, |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 4930 | void* pVosContext, |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 4931 | tAniBool countryFromUserSpace, |
| 4932 | tAniBool sendRegHint ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4933 | { |
| 4934 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 4935 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 4936 | vos_msg_t msg; |
| 4937 | tAniChangeCountryCodeReq *pMsg; |
| 4938 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 4939 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 4940 | TRACE_CODE_SME_RX_HDD_CHANGE_CNTRYCODE, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4941 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 4942 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 4943 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4944 | smsLog(pMac, LOG1, FL(" called")); |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 4945 | |
| 4946 | if ((csrGetInfraSessionId(pMac) != -1) && |
| 4947 | (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority)) |
| 4948 | { |
| 4949 | |
| 4950 | smsLog(pMac, LOGW, "Set Country Code Fail since the STA is associated and userspace does not have priority "); |
| 4951 | |
| 4952 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4953 | status = eHAL_STATUS_FAILURE; |
| 4954 | return status; |
| 4955 | } |
| 4956 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 4957 | pMsg = vos_mem_malloc(sizeof(tAniChangeCountryCodeReq)); |
| 4958 | if ( NULL == pMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4959 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4960 | 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] | 4961 | sme_ReleaseGlobalLock( &pMac->sme ); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 4962 | return eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4963 | } |
| 4964 | |
| 4965 | pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_CHANGE_COUNTRY_CODE); |
| 4966 | pMsg->msgLen = (tANI_U16)sizeof(tAniChangeCountryCodeReq); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 4967 | vos_mem_copy(pMsg->countryCode, pCountry, 3); |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 4968 | pMsg->countryFromUserSpace = countryFromUserSpace; |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 4969 | pMsg->sendRegHint = sendRegHint; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4970 | pMsg->changeCCCallback = callback; |
| 4971 | pMsg->pDevContext = pContext; |
| 4972 | pMsg->pVosContext = pVosContext; |
| 4973 | |
| 4974 | msg.type = eWNI_SME_CHANGE_COUNTRY_CODE; |
| 4975 | msg.bodyptr = pMsg; |
| 4976 | msg.reserved = 0; |
| 4977 | |
| 4978 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg)) |
| 4979 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4980 | smsLog(pMac, LOGE, " sme_ChangeCountryCode failed to post msg to self "); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 4981 | vos_mem_free((void *)pMsg); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4982 | status = eHAL_STATUS_FAILURE; |
| 4983 | } |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 4984 | smsLog(pMac, LOG1, FL(" returned")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 4985 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 4986 | } |
| 4987 | |
| 4988 | return (status); |
| 4989 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 4990 | |
| 4991 | /*-------------------------------------------------------------------------- |
| 4992 | |
| 4993 | \fn sme_GenericChangeCountryCode |
| 4994 | |
| 4995 | \brief Change Country code from upperlayer during WLAN driver operation. |
| 4996 | This is a synchronous API. |
| 4997 | |
| 4998 | \param hHal - The handle returned by macOpen. |
| 4999 | |
| 5000 | \param pCountry New Country Code String |
| 5001 | |
| 5002 | \param reg_domain regulatory domain |
| 5003 | |
| 5004 | \return eHalStatus SUCCESS. |
| 5005 | |
| 5006 | FAILURE or RESOURCES The API finished and failed. |
| 5007 | |
| 5008 | -----------------------------------------------------------------------------*/ |
| 5009 | eHalStatus sme_GenericChangeCountryCode( tHalHandle hHal, |
| 5010 | tANI_U8 *pCountry, |
| 5011 | v_REGDOMAIN_t reg_domain) |
| 5012 | { |
| 5013 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5014 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5015 | vos_msg_t msg; |
| 5016 | tAniGenericChangeCountryCodeReq *pMsg; |
| 5017 | |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 5018 | if (NULL == pMac) |
| 5019 | { |
| 5020 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 5021 | "%s: pMac is null", __func__); |
| 5022 | return status; |
| 5023 | } |
| 5024 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5025 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5026 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5027 | { |
| 5028 | smsLog(pMac, LOG1, FL(" called")); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5029 | pMsg = vos_mem_malloc(sizeof(tAniGenericChangeCountryCodeReq)); |
| 5030 | if (NULL == pMsg) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5031 | { |
| 5032 | smsLog(pMac, LOGE, " sme_GenericChangeCountryCode: failed to allocate mem for req"); |
| 5033 | sme_ReleaseGlobalLock( &pMac->sme ); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5034 | return eHAL_STATUS_FAILURE; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5035 | } |
| 5036 | |
| 5037 | pMsg->msgType = pal_cpu_to_be16((tANI_U16)eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE); |
| 5038 | pMsg->msgLen = (tANI_U16)sizeof(tAniGenericChangeCountryCodeReq); |
Sameer Thalappil | 7324e8b | 2014-01-15 10:32:54 -0800 | [diff] [blame] | 5039 | vos_mem_copy(pMsg->countryCode, pCountry, 2); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5040 | pMsg->domain_index = reg_domain; |
| 5041 | |
| 5042 | msg.type = eWNI_SME_GENERIC_CHANGE_COUNTRY_CODE; |
| 5043 | msg.bodyptr = pMsg; |
| 5044 | msg.reserved = 0; |
| 5045 | |
| 5046 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MQ_ID_SME, &msg)) |
| 5047 | { |
| 5048 | smsLog(pMac, LOGE, "sme_GenericChangeCountryCode failed to post msg to self"); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 5049 | vos_mem_free(pMsg); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 5050 | status = eHAL_STATUS_FAILURE; |
| 5051 | } |
| 5052 | smsLog(pMac, LOG1, FL(" returned")); |
| 5053 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5054 | } |
| 5055 | |
| 5056 | return (status); |
| 5057 | } |
Mihir Shete | e1093ba | 2014-01-21 20:13:32 +0530 | [diff] [blame] | 5058 | |
| 5059 | /* --------------------------------------------------------------------------- |
| 5060 | |
| 5061 | \fn sme_InitChannels |
| 5062 | |
| 5063 | \brief Used to initialize CSR channel lists while driver loading |
| 5064 | |
| 5065 | \param hHal - global pMac structure |
| 5066 | |
| 5067 | \return eHalStatus SUCCESS. |
| 5068 | |
| 5069 | FAILURE or RESOURCES The API finished and failed. |
| 5070 | |
| 5071 | -------------------------------------------------------------------------------*/ |
| 5072 | eHalStatus sme_InitChannels(tHalHandle hHal) |
| 5073 | { |
| 5074 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5075 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 5076 | |
| 5077 | if (NULL == pMac) |
| 5078 | { |
| 5079 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 5080 | "%s: pMac is null", __func__); |
| 5081 | return status; |
| 5082 | } |
| 5083 | |
| 5084 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5085 | if (HAL_STATUS_SUCCESS(status)) |
| 5086 | { |
| 5087 | status = csrInitChannels(pMac); |
| 5088 | sme_ReleaseGlobalLock(&pMac->sme); |
| 5089 | } |
| 5090 | return status; |
| 5091 | } |
| 5092 | |
Sundaresan Ramachandran | 76e48e8 | 2013-07-15 13:07:17 +0530 | [diff] [blame] | 5093 | /* --------------------------------------------------------------------------- |
| 5094 | |
| 5095 | \fn sme_DHCPStartInd |
| 5096 | |
| 5097 | \brief API to signal the FW about the DHCP Start event. |
| 5098 | |
| 5099 | \param hHal - HAL handle for device. |
| 5100 | |
| 5101 | \param device_mode - mode(AP,SAP etc) of the device. |
| 5102 | |
| 5103 | \param macAddr - MAC address of the device. |
| 5104 | |
| 5105 | \return eHalStatus SUCCESS. |
| 5106 | |
| 5107 | FAILURE or RESOURCES The API finished and failed. |
| 5108 | --------------------------------------------------------------------------*/ |
| 5109 | eHalStatus sme_DHCPStartInd( tHalHandle hHal, |
| 5110 | tANI_U8 device_mode, |
| 5111 | tANI_U8 *macAddr ) |
| 5112 | { |
| 5113 | eHalStatus status; |
| 5114 | VOS_STATUS vosStatus; |
| 5115 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5116 | vos_msg_t vosMessage; |
| 5117 | tAniDHCPInd *pMsg; |
| 5118 | |
| 5119 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5120 | if ( eHAL_STATUS_SUCCESS == status) |
| 5121 | { |
| 5122 | pMsg = (tAniDHCPInd*)vos_mem_malloc(sizeof(tAniDHCPInd)); |
| 5123 | if (NULL == pMsg) |
| 5124 | { |
| 5125 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5126 | "%s: Not able to allocate memory for dhcp start", __func__); |
| 5127 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5128 | return eHAL_STATUS_FAILURE; |
| 5129 | } |
| 5130 | pMsg->msgType = WDA_DHCP_START_IND; |
| 5131 | pMsg->msgLen = (tANI_U16)sizeof(tAniDHCPInd); |
| 5132 | pMsg->device_mode = device_mode; |
| 5133 | vos_mem_copy( pMsg->macAddr, macAddr, sizeof(tSirMacAddr)); |
| 5134 | |
| 5135 | vosMessage.type = WDA_DHCP_START_IND; |
| 5136 | vosMessage.bodyptr = pMsg; |
| 5137 | vosMessage.reserved = 0; |
| 5138 | |
| 5139 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 5140 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 5141 | { |
| 5142 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5143 | "%s: Post DHCP Start MSG fail", __func__); |
| 5144 | vos_mem_free(pMsg); |
| 5145 | status = eHAL_STATUS_FAILURE; |
| 5146 | } |
| 5147 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5148 | } |
| 5149 | return (status); |
| 5150 | } |
| 5151 | /* --------------------------------------------------------------------------- |
| 5152 | \fn sme_DHCPStopInd |
| 5153 | |
| 5154 | \brief API to signal the FW about the DHCP complete event. |
| 5155 | |
| 5156 | \param hHal - HAL handle for device. |
| 5157 | |
| 5158 | \param device_mode - mode(AP, SAP etc) of the device. |
| 5159 | |
| 5160 | \param macAddr - MAC address of the device. |
| 5161 | |
| 5162 | \return eHalStatus SUCCESS. |
| 5163 | FAILURE or RESOURCES The API finished and failed. |
| 5164 | --------------------------------------------------------------------------*/ |
| 5165 | eHalStatus sme_DHCPStopInd( tHalHandle hHal, |
| 5166 | tANI_U8 device_mode, |
| 5167 | tANI_U8 *macAddr ) |
| 5168 | { |
| 5169 | eHalStatus status; |
| 5170 | VOS_STATUS vosStatus; |
| 5171 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5172 | vos_msg_t vosMessage; |
| 5173 | tAniDHCPInd *pMsg; |
| 5174 | |
| 5175 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5176 | if ( eHAL_STATUS_SUCCESS == status) |
| 5177 | { |
| 5178 | pMsg = (tAniDHCPInd*)vos_mem_malloc(sizeof(tAniDHCPInd)); |
| 5179 | if (NULL == pMsg) |
| 5180 | { |
| 5181 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5182 | "%s: Not able to allocate memory for dhcp stop", __func__); |
| 5183 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5184 | return eHAL_STATUS_FAILURE; |
| 5185 | } |
| 5186 | |
| 5187 | pMsg->msgType = WDA_DHCP_STOP_IND; |
| 5188 | pMsg->msgLen = (tANI_U16)sizeof(tAniDHCPInd); |
| 5189 | pMsg->device_mode = device_mode; |
| 5190 | vos_mem_copy( pMsg->macAddr, macAddr, sizeof(tSirMacAddr)); |
| 5191 | |
| 5192 | vosMessage.type = WDA_DHCP_STOP_IND; |
| 5193 | vosMessage.bodyptr = pMsg; |
| 5194 | vosMessage.reserved = 0; |
| 5195 | |
| 5196 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 5197 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 5198 | { |
| 5199 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 5200 | "%s: Post DHCP Stop MSG fail", __func__); |
| 5201 | vos_mem_free(pMsg); |
| 5202 | status = eHAL_STATUS_FAILURE; |
| 5203 | } |
| 5204 | |
| 5205 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5206 | } |
| 5207 | return (status); |
| 5208 | } |
| 5209 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5210 | |
| 5211 | /* --------------------------------------------------------------------------- |
| 5212 | \fn sme_BtcSignalBtEvent |
| 5213 | \brief API to signal Bluetooth (BT) event to the WLAN driver. Based on the |
| 5214 | BT event type and the current operating mode of Libra (full power, |
| 5215 | BMPS, UAPSD etc), appropriate Bluetooth Coexistence (BTC) strategy |
| 5216 | would be employed. |
| 5217 | \param hHal - The handle returned by macOpen. |
| 5218 | \param pBtEvent - Pointer to a caller allocated object of type tSmeBtEvent |
| 5219 | Caller owns the memory and is responsible for freeing it. |
| 5220 | \return VOS_STATUS |
| 5221 | VOS_STATUS_E_FAILURE BT Event not passed to HAL. This can happen |
| 5222 | if BTC execution mode is set to BTC_WLAN_ONLY |
| 5223 | or BTC_PTA_ONLY. |
| 5224 | VOS_STATUS_SUCCESS BT Event passed to HAL |
| 5225 | ---------------------------------------------------------------------------*/ |
| 5226 | VOS_STATUS sme_BtcSignalBtEvent (tHalHandle hHal, tpSmeBtEvent pBtEvent) |
| 5227 | { |
| 5228 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5229 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5230 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5231 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5232 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5233 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5234 | TRACE_CODE_SME_RX_HDD_BTC_SIGNALEVENT, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5235 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5236 | { |
| 5237 | status = btcSignalBTEvent (hHal, pBtEvent); |
| 5238 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5239 | } |
| 5240 | #endif |
| 5241 | return (status); |
| 5242 | } |
| 5243 | |
| 5244 | /* --------------------------------------------------------------------------- |
| 5245 | \fn sme_BtcSetConfig |
| 5246 | \brief API to change the current Bluetooth Coexistence (BTC) configuration |
| 5247 | This function should be invoked only after CFG download has completed. |
| 5248 | Calling it after sme_HDDReadyInd is recommended. |
| 5249 | \param hHal - The handle returned by macOpen. |
| 5250 | \param pSmeBtcConfig - Pointer to a caller allocated object of type tSmeBtcConfig. |
| 5251 | Caller owns the memory and is responsible for freeing it. |
| 5252 | \return VOS_STATUS |
| 5253 | VOS_STATUS_E_FAILURE Config not passed to HAL. |
| 5254 | VOS_STATUS_SUCCESS Config passed to HAL |
| 5255 | ---------------------------------------------------------------------------*/ |
| 5256 | VOS_STATUS sme_BtcSetConfig (tHalHandle hHal, tpSmeBtcConfig pSmeBtcConfig) |
| 5257 | { |
| 5258 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5259 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5260 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5261 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5262 | TRACE_CODE_SME_RX_HDD_BTC_SETCONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5263 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5264 | { |
| 5265 | status = btcSetConfig (hHal, pSmeBtcConfig); |
| 5266 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5267 | } |
| 5268 | #endif |
| 5269 | return (status); |
| 5270 | } |
| 5271 | |
| 5272 | /* --------------------------------------------------------------------------- |
| 5273 | \fn sme_BtcGetConfig |
| 5274 | \brief API to retrieve the current Bluetooth Coexistence (BTC) configuration |
| 5275 | \param hHal - The handle returned by macOpen. |
| 5276 | \param pSmeBtcConfig - Pointer to a caller allocated object of type |
| 5277 | tSmeBtcConfig. Caller owns the memory and is responsible |
| 5278 | for freeing it. |
| 5279 | \return VOS_STATUS |
| 5280 | VOS_STATUS_E_FAILURE - failure |
| 5281 | VOS_STATUS_SUCCESS success |
| 5282 | ---------------------------------------------------------------------------*/ |
| 5283 | VOS_STATUS sme_BtcGetConfig (tHalHandle hHal, tpSmeBtcConfig pSmeBtcConfig) |
| 5284 | { |
| 5285 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5286 | #ifndef WLAN_MDM_CODE_REDUCTION_OPT |
| 5287 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5288 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5289 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5290 | TRACE_CODE_SME_RX_HDD_BTC_GETCONFIG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5291 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5292 | { |
| 5293 | status = btcGetConfig (hHal, pSmeBtcConfig); |
| 5294 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5295 | } |
| 5296 | #endif |
| 5297 | return (status); |
| 5298 | } |
| 5299 | /* --------------------------------------------------------------------------- |
| 5300 | \fn sme_SetCfgPrivacy |
| 5301 | \brief API to set configure privacy parameters |
| 5302 | \param hHal - The handle returned by macOpen. |
| 5303 | \param pProfile - Pointer CSR Roam profile. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5304 | \param fPrivacy - This parameter indicates status of privacy |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5305 | |
| 5306 | \return void |
| 5307 | ---------------------------------------------------------------------------*/ |
| 5308 | void sme_SetCfgPrivacy( tHalHandle hHal, |
| 5309 | tCsrRoamProfile *pProfile, |
| 5310 | tANI_BOOLEAN fPrivacy |
| 5311 | ) |
| 5312 | { |
| 5313 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5314 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5315 | TRACE_CODE_SME_RX_HDD_SET_CFGPRIVACY, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5316 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5317 | { |
| 5318 | csrSetCfgPrivacy(pMac, pProfile, fPrivacy); |
| 5319 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5320 | } |
| 5321 | } |
| 5322 | |
| 5323 | #if defined WLAN_FEATURE_VOWIFI |
| 5324 | /* --------------------------------------------------------------------------- |
| 5325 | \fn sme_NeighborReportRequest |
| 5326 | \brief API to request neighbor report. |
| 5327 | \param hHal - The handle returned by macOpen. |
| 5328 | \param pRrmNeighborReq - Pointer to a caller allocated object of type |
| 5329 | tRrmNeighborReq. Caller owns the memory and is responsible |
| 5330 | for freeing it. |
| 5331 | \return VOS_STATUS |
| 5332 | VOS_STATUS_E_FAILURE - failure |
| 5333 | VOS_STATUS_SUCCESS success |
| 5334 | ---------------------------------------------------------------------------*/ |
| 5335 | VOS_STATUS sme_NeighborReportRequest (tHalHandle hHal, tANI_U8 sessionId, |
| 5336 | tpRrmNeighborReq pRrmNeighborReq, tpRrmNeighborRspCallbackInfo callbackInfo) |
| 5337 | { |
| 5338 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5339 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5340 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5341 | TRACE_CODE_SME_RX_HDD_NEIGHBOR_REPORTREQ, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5342 | |
| 5343 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5344 | { |
| 5345 | status = sme_RrmNeighborReportRequest (hHal, sessionId, pRrmNeighborReq, callbackInfo); |
| 5346 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5347 | } |
| 5348 | |
| 5349 | return (status); |
| 5350 | } |
| 5351 | #endif |
| 5352 | |
| 5353 | //The following are debug APIs to support direct read/write register/memory |
| 5354 | //They are placed in SME because HW cannot be access when in LOW_POWER state |
| 5355 | //AND not connected. The knowledge and synchronization is done in SME |
| 5356 | |
| 5357 | //sme_DbgReadRegister |
| 5358 | //Caller needs to validate the input values |
| 5359 | VOS_STATUS sme_DbgReadRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t *pRegValue) |
| 5360 | { |
| 5361 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5362 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5363 | tPmcPowerState PowerState; |
| 5364 | tANI_U32 sessionId = 0; |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5365 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5366 | TRACE_CODE_SME_RX_HDD_DBG_READREG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5367 | |
| 5368 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5369 | |
| 5370 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5371 | { |
Hoonki Lee | 0af6aaf | 2013-02-08 12:26:44 -0800 | [diff] [blame] | 5372 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgReadRegister(regAddr, pRegValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5373 | { |
| 5374 | return VOS_STATUS_SUCCESS; |
| 5375 | } |
| 5376 | return VOS_STATUS_E_FAILURE; |
| 5377 | } |
| 5378 | |
| 5379 | /* 2) NON FTM mode driver *************************************************/ |
| 5380 | |
| 5381 | /* Acquire SME global lock */ |
| 5382 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5383 | { |
| 5384 | return VOS_STATUS_E_FAILURE; |
| 5385 | } |
| 5386 | |
| 5387 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5388 | { |
| 5389 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5390 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5391 | { |
Hoonki Lee | 0af6aaf | 2013-02-08 12:26:44 -0800 | [diff] [blame] | 5392 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgReadRegister(regAddr, pRegValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5393 | { |
| 5394 | status = VOS_STATUS_SUCCESS; |
| 5395 | } |
| 5396 | else |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5397 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5398 | status = VOS_STATUS_E_FAILURE; |
| 5399 | } |
| 5400 | } |
| 5401 | else |
| 5402 | { |
| 5403 | status = VOS_STATUS_E_FAILURE; |
| 5404 | } |
| 5405 | } |
| 5406 | |
| 5407 | /* This is a hack for Qualky/pttWniSocket |
| 5408 | Current implementation doesn't allow pttWniSocket to inform Qualky an error */ |
| 5409 | if ( VOS_STATUS_SUCCESS != status ) |
| 5410 | { |
| 5411 | *pRegValue = 0xDEADBEEF; |
| 5412 | status = VOS_STATUS_SUCCESS; |
| 5413 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5414 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5415 | /* Release SME global lock */ |
| 5416 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5417 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5418 | return (status); |
| 5419 | } |
| 5420 | |
| 5421 | |
| 5422 | //sme_DbgWriteRegister |
| 5423 | //Caller needs to validate the input values |
| 5424 | VOS_STATUS sme_DbgWriteRegister(tHalHandle hHal, v_U32_t regAddr, v_U32_t regValue) |
| 5425 | { |
| 5426 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5427 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5428 | tPmcPowerState PowerState; |
| 5429 | tANI_U32 sessionId = 0; |
| 5430 | |
| 5431 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5432 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5433 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5434 | TRACE_CODE_SME_RX_HDD_DBG_WRITEREG, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5435 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5436 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5437 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteRegister(regAddr, regValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5438 | { |
| 5439 | return VOS_STATUS_SUCCESS; |
| 5440 | } |
| 5441 | return VOS_STATUS_E_FAILURE; |
| 5442 | } |
| 5443 | |
| 5444 | /* 2) NON FTM mode driver *************************************************/ |
| 5445 | |
| 5446 | /* Acquire SME global lock */ |
| 5447 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5448 | { |
| 5449 | return VOS_STATUS_E_FAILURE; |
| 5450 | } |
| 5451 | |
| 5452 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5453 | { |
| 5454 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5455 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5456 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5457 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteRegister(regAddr, regValue)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5458 | { |
| 5459 | status = VOS_STATUS_SUCCESS; |
| 5460 | } |
| 5461 | else |
| 5462 | { |
| 5463 | status = VOS_STATUS_E_FAILURE; |
| 5464 | } |
| 5465 | } |
| 5466 | else |
| 5467 | { |
| 5468 | status = VOS_STATUS_E_FAILURE; |
| 5469 | } |
| 5470 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5471 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5472 | /* Release SME global lock */ |
| 5473 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5474 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5475 | return (status); |
| 5476 | } |
| 5477 | |
| 5478 | |
| 5479 | |
| 5480 | //sme_DbgReadMemory |
| 5481 | //Caller needs to validate the input values |
| 5482 | //pBuf caller allocated buffer has the length of nLen |
| 5483 | VOS_STATUS sme_DbgReadMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen) |
| 5484 | { |
| 5485 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5486 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5487 | tPmcPowerState PowerState; |
| 5488 | tANI_U32 sessionId = 0; |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 5489 | tANI_U32 cmd = READ_MEMORY_DUMP_CMD; |
| 5490 | tANI_U32 arg1 = memAddr; |
| 5491 | tANI_U32 arg2 = nLen/4; |
| 5492 | tANI_U32 arg3 = 4; |
| 5493 | tANI_U32 arg4 = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5494 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5495 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5496 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5497 | TRACE_CODE_SME_RX_HDD_DBG_READMEM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5498 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5499 | { |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 5500 | if (VOS_STATUS_SUCCESS == WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, (tANI_U8*)pBuf)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5501 | { |
| 5502 | return VOS_STATUS_SUCCESS; |
| 5503 | } |
| 5504 | return VOS_STATUS_E_FAILURE; |
| 5505 | } |
| 5506 | |
| 5507 | /* 2) NON FTM mode driver *************************************************/ |
| 5508 | |
| 5509 | /* Acquire SME global lock */ |
| 5510 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5511 | { |
| 5512 | return VOS_STATUS_E_FAILURE; |
| 5513 | } |
| 5514 | |
| 5515 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5516 | { |
| 5517 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5518 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5519 | { |
Gopichand Nakkala | fab3fae | 2013-01-07 15:01:01 -0800 | [diff] [blame] | 5520 | if (VOS_STATUS_SUCCESS == WDA_HALDumpCmdReq(pMac, cmd, arg1, arg2, arg3, arg4, (tANI_U8 *)pBuf)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5521 | { |
| 5522 | status = VOS_STATUS_SUCCESS; |
| 5523 | } |
| 5524 | else |
| 5525 | { |
| 5526 | status = VOS_STATUS_E_FAILURE; |
| 5527 | } |
| 5528 | } |
| 5529 | else |
| 5530 | { |
| 5531 | status = VOS_STATUS_E_FAILURE; |
| 5532 | } |
| 5533 | } |
| 5534 | |
| 5535 | /* This is a hack for Qualky/pttWniSocket |
| 5536 | Current implementation doesn't allow pttWniSocket to inform Qualky an error */ |
| 5537 | if (VOS_STATUS_SUCCESS != status) |
| 5538 | { |
| 5539 | vos_mem_set(pBuf, nLen, 0xCD); |
| 5540 | status = VOS_STATUS_SUCCESS; |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5541 | 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] | 5542 | } |
| 5543 | |
| 5544 | /* Release SME lock */ |
| 5545 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5546 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5547 | return (status); |
| 5548 | } |
| 5549 | |
| 5550 | |
| 5551 | //sme_DbgWriteMemory |
| 5552 | //Caller needs to validate the input values |
| 5553 | VOS_STATUS sme_DbgWriteMemory(tHalHandle hHal, v_U32_t memAddr, v_U8_t *pBuf, v_U32_t nLen) |
| 5554 | { |
| 5555 | VOS_STATUS status = VOS_STATUS_E_FAILURE; |
| 5556 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5557 | tPmcPowerState PowerState; |
| 5558 | tANI_U32 sessionId = 0; |
| 5559 | |
| 5560 | /* 1) To make Quarky work in FTM mode **************************************/ |
| 5561 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 5562 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 5563 | TRACE_CODE_SME_RX_HDD_DBG_WRITEMEM, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5564 | if(eDRIVER_TYPE_MFG == pMac->gDriverType) |
| 5565 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5566 | { |
| 5567 | return VOS_STATUS_SUCCESS; |
| 5568 | } |
| 5569 | return VOS_STATUS_E_FAILURE; |
| 5570 | } |
| 5571 | |
| 5572 | /* 2) NON FTM mode driver *************************************************/ |
| 5573 | |
| 5574 | /* Acquire SME global lock */ |
| 5575 | if (eHAL_STATUS_SUCCESS != sme_AcquireGlobalLock(&pMac->sme)) |
| 5576 | { |
| 5577 | return VOS_STATUS_E_FAILURE; |
| 5578 | } |
| 5579 | |
| 5580 | if(HAL_STATUS_SUCCESS(pmcQueryPowerState(pMac, &PowerState, NULL, NULL))) |
| 5581 | { |
| 5582 | /* Are we not in IMPS mode? Or are we in connected? Then we're safe*/ |
| 5583 | if(!csrIsConnStateDisconnected(pMac, sessionId) || (ePMC_LOW_POWER != PowerState)) |
| 5584 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5585 | if (eWLAN_PAL_STATUS_SUCCESS == wpalDbgWriteMemory(memAddr, (void *)pBuf, nLen)) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5586 | { |
| 5587 | status = VOS_STATUS_SUCCESS; |
| 5588 | } |
| 5589 | else |
| 5590 | { |
| 5591 | status = VOS_STATUS_E_FAILURE; |
| 5592 | } |
| 5593 | } |
| 5594 | else |
| 5595 | { |
| 5596 | status = VOS_STATUS_E_FAILURE; |
| 5597 | } |
| 5598 | } |
| 5599 | |
| 5600 | /* Release Global lock */ |
| 5601 | sme_ReleaseGlobalLock(&pMac->sme); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5602 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5603 | return (status); |
| 5604 | } |
| 5605 | |
| 5606 | |
Katya Nigam | 70d6833 | 2013-09-16 16:49:45 +0530 | [diff] [blame] | 5607 | void pmcLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString, ...) |
| 5608 | { |
| 5609 | VOS_TRACE_LEVEL vosDebugLevel; |
| 5610 | char logBuffer[LOG_SIZE]; |
| 5611 | va_list marker; |
| 5612 | |
| 5613 | /* getting proper Debug level */ |
| 5614 | vosDebugLevel = getVosDebugLevel(loglevel); |
| 5615 | |
| 5616 | /* extracting arguments from pstring */ |
| 5617 | va_start( marker, pString ); |
| 5618 | vsnprintf(logBuffer, LOG_SIZE, pString, marker); |
| 5619 | |
| 5620 | VOS_TRACE(VOS_MODULE_ID_PMC, vosDebugLevel, "%s", logBuffer); |
| 5621 | va_end( marker ); |
| 5622 | } |
| 5623 | |
| 5624 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5625 | void smsLog(tpAniSirGlobal pMac, tANI_U32 loglevel, const char *pString,...) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5626 | { |
| 5627 | #ifdef WLAN_DEBUG |
| 5628 | // Verify against current log level |
| 5629 | if ( loglevel > pMac->utils.gLogDbgLevel[LOG_INDEX_FOR_MODULE( SIR_SMS_MODULE_ID )] ) |
| 5630 | return; |
| 5631 | else |
| 5632 | { |
| 5633 | va_list marker; |
| 5634 | |
| 5635 | va_start( marker, pString ); /* Initialize variable arguments. */ |
| 5636 | |
| 5637 | logDebug(pMac, SIR_SMS_MODULE_ID, loglevel, pString, marker); |
| 5638 | |
| 5639 | va_end( marker ); /* Reset variable arguments. */ |
| 5640 | } |
| 5641 | #endif |
| 5642 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5643 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5644 | /* --------------------------------------------------------------------------- |
| 5645 | \fn sme_GetWcnssWlanCompiledVersion |
| 5646 | \brief This API returns the version of the WCNSS WLAN API with |
| 5647 | which the HOST driver was built |
| 5648 | \param hHal - The handle returned by macOpen. |
| 5649 | \param pVersion - Points to the Version structure to be filled |
| 5650 | \return VOS_STATUS |
| 5651 | VOS_STATUS_E_INVAL - failure |
| 5652 | VOS_STATUS_SUCCESS success |
| 5653 | ---------------------------------------------------------------------------*/ |
| 5654 | VOS_STATUS sme_GetWcnssWlanCompiledVersion(tHalHandle hHal, |
| 5655 | tSirVersionType *pVersion) |
| 5656 | { |
| 5657 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 5658 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5659 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 5660 | |
| 5661 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5662 | { |
| 5663 | if( pVersion != NULL ) |
| 5664 | { |
| 5665 | status = WDA_GetWcnssWlanCompiledVersion(vosContext, pVersion); |
| 5666 | } |
| 5667 | else |
| 5668 | { |
| 5669 | status = VOS_STATUS_E_INVAL; |
| 5670 | } |
| 5671 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5672 | } |
| 5673 | |
| 5674 | return (status); |
| 5675 | } |
| 5676 | |
| 5677 | |
| 5678 | /* --------------------------------------------------------------------------- |
| 5679 | \fn sme_GetWcnssWlanReportedVersion |
| 5680 | \brief This API returns the version of the WCNSS WLAN API with |
| 5681 | which the WCNSS driver reports it was built |
| 5682 | \param hHal - The handle returned by macOpen. |
| 5683 | \param pVersion - Points to the Version structure to be filled |
| 5684 | \return VOS_STATUS |
| 5685 | VOS_STATUS_E_INVAL - failure |
| 5686 | VOS_STATUS_SUCCESS success |
| 5687 | ---------------------------------------------------------------------------*/ |
| 5688 | VOS_STATUS sme_GetWcnssWlanReportedVersion(tHalHandle hHal, |
| 5689 | tSirVersionType *pVersion) |
| 5690 | { |
| 5691 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 5692 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5693 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 5694 | |
| 5695 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5696 | { |
| 5697 | if( pVersion != NULL ) |
| 5698 | { |
| 5699 | status = WDA_GetWcnssWlanReportedVersion(vosContext, pVersion); |
| 5700 | } |
| 5701 | else |
| 5702 | { |
| 5703 | status = VOS_STATUS_E_INVAL; |
| 5704 | } |
| 5705 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5706 | } |
| 5707 | |
| 5708 | return (status); |
| 5709 | } |
| 5710 | |
| 5711 | |
| 5712 | /* --------------------------------------------------------------------------- |
| 5713 | \fn sme_GetWcnssSoftwareVersion |
| 5714 | \brief This API returns the version string of the WCNSS driver |
| 5715 | \param hHal - The handle returned by macOpen. |
| 5716 | \param pVersion - Points to the Version string buffer to be filled |
| 5717 | \param versionBufferSize - THe size of the Version string buffer |
| 5718 | \return VOS_STATUS |
| 5719 | VOS_STATUS_E_INVAL - failure |
| 5720 | VOS_STATUS_SUCCESS success |
| 5721 | ---------------------------------------------------------------------------*/ |
| 5722 | VOS_STATUS sme_GetWcnssSoftwareVersion(tHalHandle hHal, |
| 5723 | tANI_U8 *pVersion, |
| 5724 | tANI_U32 versionBufferSize) |
| 5725 | { |
| 5726 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 5727 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5728 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 5729 | |
| 5730 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5731 | { |
| 5732 | if( pVersion != NULL ) |
| 5733 | { |
| 5734 | status = WDA_GetWcnssSoftwareVersion(vosContext, pVersion, |
| 5735 | versionBufferSize); |
| 5736 | } |
| 5737 | else |
| 5738 | { |
| 5739 | status = VOS_STATUS_E_INVAL; |
| 5740 | } |
| 5741 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5742 | } |
| 5743 | |
| 5744 | return (status); |
| 5745 | } |
| 5746 | |
| 5747 | |
| 5748 | /* --------------------------------------------------------------------------- |
| 5749 | \fn sme_GetWcnssHardwareVersion |
| 5750 | \brief This API returns the version string of the WCNSS hardware |
| 5751 | \param hHal - The handle returned by macOpen. |
| 5752 | \param pVersion - Points to the Version string buffer to be filled |
| 5753 | \param versionBufferSize - THe size of the Version string buffer |
| 5754 | \return VOS_STATUS |
| 5755 | VOS_STATUS_E_INVAL - failure |
| 5756 | VOS_STATUS_SUCCESS success |
| 5757 | ---------------------------------------------------------------------------*/ |
| 5758 | VOS_STATUS sme_GetWcnssHardwareVersion(tHalHandle hHal, |
| 5759 | tANI_U8 *pVersion, |
| 5760 | tANI_U32 versionBufferSize) |
| 5761 | { |
| 5762 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 5763 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5764 | v_CONTEXT_t vosContext = vos_get_global_context(VOS_MODULE_ID_SME, NULL); |
| 5765 | |
| 5766 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 5767 | { |
| 5768 | if( pVersion != NULL ) |
| 5769 | { |
| 5770 | status = WDA_GetWcnssHardwareVersion(vosContext, pVersion, |
| 5771 | versionBufferSize); |
| 5772 | } |
| 5773 | else |
| 5774 | { |
| 5775 | status = VOS_STATUS_E_INVAL; |
| 5776 | } |
| 5777 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5778 | } |
| 5779 | |
| 5780 | return (status); |
| 5781 | } |
Jeff Johnson | 4824d4c | 2013-02-12 14:23:57 -0800 | [diff] [blame] | 5782 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5783 | |
| 5784 | #ifdef FEATURE_WLAN_WAPI |
| 5785 | /* --------------------------------------------------------------------------- |
| 5786 | \fn sme_RoamSetBKIDCache |
| 5787 | \brief The SME API exposed to HDD to allow HDD to provde SME the BKID |
| 5788 | candidate list. |
| 5789 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 5790 | it is opened (by calling halOpen). |
| 5791 | \param pBKIDCache - caller allocated buffer point to an array of tBkidCacheInfo |
| 5792 | \param numItems - a variable that has the number of tBkidCacheInfo allocated |
| 5793 | when retruning, this is the number of items put into pBKIDCache |
| 5794 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 5795 | big enough and pNumItems has the number of tBkidCacheInfo. |
| 5796 | ---------------------------------------------------------------------------*/ |
| 5797 | eHalStatus sme_RoamSetBKIDCache( tHalHandle hHal, tANI_U32 sessionId, tBkidCacheInfo *pBKIDCache, |
| 5798 | tANI_U32 numItems ) |
| 5799 | { |
| 5800 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5801 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5802 | |
| 5803 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5804 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5805 | { |
| 5806 | status = csrRoamSetBKIDCache( pMac, sessionId, pBKIDCache, numItems ); |
| 5807 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5808 | } |
| 5809 | |
| 5810 | return (status); |
| 5811 | } |
| 5812 | |
| 5813 | /* --------------------------------------------------------------------------- |
| 5814 | \fn sme_RoamGetBKIDCache |
| 5815 | \brief The SME API exposed to HDD to allow HDD to request SME to return its |
| 5816 | BKID cache. |
| 5817 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 5818 | it is opened (by calling halOpen). |
| 5819 | \param pNum - caller allocated memory that has the space of the number of |
| 5820 | tBkidCacheInfo as input. Upon returned, *pNum has the needed number of entries |
| 5821 | in SME cache. |
| 5822 | \param pBkidCache - Caller allocated memory that contains BKID cache, if any, |
| 5823 | upon return |
| 5824 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 5825 | big enough. |
| 5826 | ---------------------------------------------------------------------------*/ |
| 5827 | eHalStatus sme_RoamGetBKIDCache(tHalHandle hHal, tANI_U32 *pNum, |
| 5828 | tBkidCacheInfo *pBkidCache) |
| 5829 | { |
| 5830 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5831 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5832 | |
| 5833 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5834 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5835 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5836 | smsLog(pMac, LOGE, FL(" !!!!!!!!!!!!!!!!!!SessionId is hardcoded")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5837 | status = csrRoamGetBKIDCache( pMac, 0, pNum, pBkidCache ); |
| 5838 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5839 | } |
| 5840 | |
| 5841 | return (status); |
| 5842 | } |
| 5843 | |
| 5844 | /* --------------------------------------------------------------------------- |
| 5845 | \fn sme_RoamGetNumBKIDCache |
| 5846 | \brief The SME API exposed to HDD to allow HDD to request SME to return the |
| 5847 | number of BKID cache entries. |
| 5848 | \param hHal - Handle to the HAL. The HAL handle is returned by the HAL after |
| 5849 | it is opened (by calling halOpen). |
| 5850 | \return tANI_U32 - the number of BKID cache entries. |
| 5851 | ---------------------------------------------------------------------------*/ |
| 5852 | tANI_U32 sme_RoamGetNumBKIDCache(tHalHandle hHal, tANI_U32 sessionId) |
| 5853 | { |
| 5854 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5855 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5856 | tANI_U32 numBkidCache = 0; |
| 5857 | |
| 5858 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5859 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5860 | { |
| 5861 | numBkidCache = csrRoamGetNumBKIDCache( pMac, sessionId ); |
| 5862 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5863 | } |
| 5864 | |
| 5865 | return (numBkidCache); |
| 5866 | } |
| 5867 | |
| 5868 | /* --------------------------------------------------------------------------- |
| 5869 | \fn sme_ScanGetBKIDCandidateList |
| 5870 | \brief a wrapper function to return the BKID candidate list |
| 5871 | \param pBkidList - caller allocated buffer point to an array of |
| 5872 | tBkidCandidateInfo |
| 5873 | \param pNumItems - pointer to a variable that has the number of |
| 5874 | tBkidCandidateInfo allocated when retruning, this is |
| 5875 | either the number needed or number of items put into |
| 5876 | pPmkidList |
| 5877 | \return eHalStatus - when fail, it usually means the buffer allocated is not |
| 5878 | big enough and pNumItems |
| 5879 | has the number of tBkidCandidateInfo. |
| 5880 | \Note: pNumItems is a number of tBkidCandidateInfo, |
| 5881 | not sizeof(tBkidCandidateInfo) * something |
| 5882 | ---------------------------------------------------------------------------*/ |
| 5883 | eHalStatus sme_ScanGetBKIDCandidateList(tHalHandle hHal, tANI_U32 sessionId, |
| 5884 | tBkidCandidateInfo *pBkidList, |
| 5885 | tANI_U32 *pNumItems ) |
| 5886 | { |
| 5887 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 5888 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 5889 | |
| 5890 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 5891 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 5892 | { |
| 5893 | status = csrScanGetBKIDCandidateList( pMac, sessionId, pBkidList, pNumItems ); |
| 5894 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5895 | } |
| 5896 | |
| 5897 | return (status); |
| 5898 | } |
| 5899 | #endif /* FEATURE_WLAN_WAPI */ |
| 5900 | |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5901 | #ifdef FEATURE_OEM_DATA_SUPPORT |
| 5902 | |
| 5903 | /***************************************************************************** |
| 5904 | OEM DATA related modifications and function additions |
| 5905 | *****************************************************************************/ |
| 5906 | |
| 5907 | /* --------------------------------------------------------------------------- |
| 5908 | \fn sme_getOemDataRsp |
| 5909 | \brief a wrapper function to obtain the OEM DATA RSP |
| 5910 | \param pOemDataRsp - A pointer to the response object |
| 5911 | \param pContext - a pointer passed in for the callback |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5912 | \return eHalStatus |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5913 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5914 | eHalStatus sme_getOemDataRsp(tHalHandle hHal, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5915 | tOemDataRsp **pOemDataRsp) |
| 5916 | { |
| 5917 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 5918 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 5919 | |
| 5920 | do |
| 5921 | { |
| 5922 | //acquire the lock for the sme object |
| 5923 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5924 | |
| 5925 | if(!HAL_STATUS_SUCCESS(status)) |
| 5926 | { |
| 5927 | break; |
| 5928 | } |
| 5929 | |
| 5930 | if(pMac->oemData.pOemDataRsp != NULL) |
| 5931 | { |
| 5932 | *pOemDataRsp = pMac->oemData.pOemDataRsp; |
| 5933 | } |
| 5934 | else |
| 5935 | { |
| 5936 | status = eHAL_STATUS_FAILURE; |
| 5937 | } |
| 5938 | |
| 5939 | //release the lock for the sme object |
| 5940 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5941 | |
| 5942 | } while(0); |
| 5943 | |
| 5944 | return status; |
| 5945 | } |
| 5946 | |
| 5947 | /* --------------------------------------------------------------------------- |
| 5948 | \fn sme_OemDataReq |
| 5949 | \brief a wrapper function for OEM DATA REQ |
| 5950 | \param sessionId - session id to be used. |
| 5951 | \param pOemDataReqId - pointer to an object to get back the request ID |
| 5952 | \param callback - a callback function that is called upon finish |
| 5953 | \param pContext - a pointer passed in for the callback |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5954 | \return eHalStatus |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5955 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5956 | eHalStatus sme_OemDataReq(tHalHandle hHal, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5957 | tANI_U8 sessionId, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 5958 | tOemDataReqConfig *pOemDataReqConfig, |
| 5959 | tANI_U32 *pOemDataReqID, |
| 5960 | oemData_OemDataReqCompleteCallback callback, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5961 | void *pContext) |
| 5962 | { |
| 5963 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 5964 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 5965 | |
| 5966 | do |
| 5967 | { |
| 5968 | //acquire the lock for the sme object |
| 5969 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 5970 | if(HAL_STATUS_SUCCESS(status)) |
| 5971 | { |
| 5972 | tANI_U32 lOemDataReqId = pMac->oemData.oemDataReqID++; //let it wrap around |
| 5973 | |
| 5974 | if(pOemDataReqID) |
| 5975 | { |
| 5976 | *pOemDataReqID = lOemDataReqId; |
| 5977 | } |
| 5978 | else |
Leela Venkata Kiran Kumar Reddy Chirala | 090cc1f | 2013-03-07 17:40:17 -0800 | [diff] [blame] | 5979 | { |
| 5980 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5981 | return eHAL_STATUS_FAILURE; |
| 5982 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5983 | |
| 5984 | status = oemData_OemDataReq(hHal, sessionId, pOemDataReqConfig, pOemDataReqID, callback, pContext); |
| 5985 | |
| 5986 | //release the lock for the sme object |
| 5987 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 5988 | } |
| 5989 | } while(0); |
| 5990 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 5991 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 5992 | |
| 5993 | return(status); |
| 5994 | } |
| 5995 | |
| 5996 | #endif /*FEATURE_OEM_DATA_SUPPORT*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 5997 | |
| 5998 | /*-------------------------------------------------------------------------- |
| 5999 | |
| 6000 | \brief sme_OpenSession() - Open a session for scan/roam operation. |
| 6001 | |
| 6002 | This is a synchronous API. |
| 6003 | |
| 6004 | |
| 6005 | \param hHal - The handle returned by macOpen. |
| 6006 | \param callback - A pointer to the function caller specifies for roam/connect status indication |
| 6007 | \param pContext - The context passed with callback |
| 6008 | \param pSelfMacAddr - Caller allocated memory filled with self MAC address (6 bytes) |
| 6009 | \param pbSessionId - pointer to a caller allocated buffer for returned session ID |
| 6010 | |
| 6011 | \return eHAL_STATUS_SUCCESS - session is opened. sessionId returned. |
| 6012 | |
| 6013 | Other status means SME is failed to open the session. |
| 6014 | eHAL_STATUS_RESOURCES - no more session available. |
| 6015 | \sa |
| 6016 | |
| 6017 | --------------------------------------------------------------------------*/ |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 6018 | eHalStatus sme_OpenSession(tHalHandle hHal, csrRoamCompleteCallback callback, |
| 6019 | void *pContext, tANI_U8 *pSelfMacAddr, |
| 6020 | tANI_U8 *pbSessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6021 | { |
| 6022 | eHalStatus status; |
| 6023 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6024 | |
| 6025 | if( NULL == pbSessionId ) |
| 6026 | { |
| 6027 | status = eHAL_STATUS_INVALID_PARAMETER; |
| 6028 | } |
| 6029 | else |
| 6030 | { |
| 6031 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6032 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6033 | { |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 6034 | status = csrRoamOpenSession(pMac, callback, pContext, |
| 6035 | pSelfMacAddr, pbSessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6036 | |
| 6037 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6038 | } |
| 6039 | } |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6040 | if( NULL != pbSessionId ) |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6041 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6042 | TRACE_CODE_SME_RX_HDD_OPEN_SESSION,*pbSessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6043 | |
| 6044 | return ( status ); |
| 6045 | } |
| 6046 | |
| 6047 | |
| 6048 | /*-------------------------------------------------------------------------- |
| 6049 | |
| 6050 | \brief sme_CloseSession() - Open a session for scan/roam operation. |
| 6051 | |
| 6052 | This is a synchronous API. |
| 6053 | |
| 6054 | |
| 6055 | \param hHal - The handle returned by macOpen. |
| 6056 | |
| 6057 | \param sessionId - A previous opened session's ID. |
| 6058 | |
| 6059 | \return eHAL_STATUS_SUCCESS - session is closed. |
| 6060 | |
| 6061 | Other status means SME is failed to open the session. |
| 6062 | eHAL_STATUS_INVALID_PARAMETER - session is not opened. |
| 6063 | \sa |
| 6064 | |
| 6065 | --------------------------------------------------------------------------*/ |
| 6066 | eHalStatus sme_CloseSession(tHalHandle hHal, tANI_U8 sessionId, |
| 6067 | csrRoamSessionCloseCallback callback, void *pContext) |
| 6068 | { |
| 6069 | eHalStatus status; |
| 6070 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6071 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6072 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6073 | TRACE_CODE_SME_RX_HDD_CLOSE_SESSION, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6074 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6075 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6076 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6077 | status = csrRoamCloseSession( pMac, sessionId, FALSE, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6078 | callback, pContext ); |
| 6079 | |
| 6080 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6081 | } |
| 6082 | |
| 6083 | return ( status ); |
| 6084 | } |
| 6085 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6086 | /* --------------------------------------------------------------------------- |
| 6087 | |
| 6088 | \fn sme_RoamUpdateAPWPSIE |
| 6089 | |
| 6090 | \brief To update AP's WPS IE. This function should be called after SME AP session is created |
| 6091 | This is an asynchronous API. |
| 6092 | |
| 6093 | \param pAPWPSIES - pointer to a caller allocated object of tSirAPWPSIEs |
| 6094 | |
| 6095 | \return eHalStatus – SUCCESS – |
| 6096 | |
| 6097 | FAILURE or RESOURCES – The API finished and failed. |
| 6098 | |
| 6099 | -------------------------------------------------------------------------------*/ |
| 6100 | eHalStatus sme_RoamUpdateAPWPSIE(tHalHandle hHal, tANI_U8 sessionId, tSirAPWPSIEs *pAPWPSIES) |
| 6101 | { |
| 6102 | |
| 6103 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6104 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6105 | |
| 6106 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6107 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6108 | { |
| 6109 | |
| 6110 | status = csrRoamUpdateAPWPSIE( pMac, sessionId, pAPWPSIES ); |
| 6111 | |
| 6112 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6113 | } |
| 6114 | |
| 6115 | return (status); |
| 6116 | } |
| 6117 | /* --------------------------------------------------------------------------- |
| 6118 | |
| 6119 | \fn sme_RoamUpdateAPWPARSNIEs |
| 6120 | |
| 6121 | \brief To update AP's WPA/RSN IEs. This function should be called after SME AP session is created |
| 6122 | This is an asynchronous API. |
| 6123 | |
| 6124 | \param pAPSirRSNie - pointer to a caller allocated object of tSirRSNie with WPS/RSN IEs |
| 6125 | |
| 6126 | \return eHalStatus – SUCCESS – |
| 6127 | |
| 6128 | FAILURE or RESOURCES – The API finished and failed. |
| 6129 | |
| 6130 | -------------------------------------------------------------------------------*/ |
| 6131 | eHalStatus sme_RoamUpdateAPWPARSNIEs(tHalHandle hHal, tANI_U8 sessionId, tSirRSNie * pAPSirRSNie) |
| 6132 | { |
| 6133 | |
| 6134 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6135 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6136 | |
| 6137 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6138 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6139 | { |
| 6140 | |
| 6141 | status = csrRoamUpdateWPARSNIEs( pMac, sessionId, pAPSirRSNie); |
| 6142 | |
| 6143 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6144 | } |
| 6145 | |
| 6146 | return (status); |
| 6147 | } |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6148 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6149 | |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6150 | \fn sme_ChangeMCCBeaconInterval |
| 6151 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6152 | \brief To update P2P-GO beaconInterval. This function should be called after |
| 6153 | disassociating all the station is done |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6154 | This is an asynchronous API. |
| 6155 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6156 | \param |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6157 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6158 | \return eHalStatus SUCCESS |
| 6159 | FAILURE or RESOURCES |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 6160 | The API finished and failed. |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6161 | |
| 6162 | -------------------------------------------------------------------------------*/ |
| 6163 | eHalStatus sme_ChangeMCCBeaconInterval(tHalHandle hHal, tANI_U8 sessionId) |
| 6164 | { |
| 6165 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6166 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6167 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6168 | smsLog(pMac, LOG1, FL("Update Beacon PARAMS ")); |
Madan Mohan Koyyalamudi | 167b95e | 2012-11-27 15:53:38 -0800 | [diff] [blame] | 6169 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6170 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6171 | { |
| 6172 | status = csrSendChngMCCBeaconInterval( pMac, sessionId); |
| 6173 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6174 | } |
| 6175 | return (status); |
| 6176 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6177 | |
| 6178 | /*-------------------------------------------------------------------------------* |
| 6179 | |
| 6180 | \fn sme_sendBTAmpEvent |
| 6181 | |
| 6182 | \brief to receive the coex priorty request from BT-AMP PAL |
| 6183 | and send the BT_AMP link state to HAL |
| 6184 | |
| 6185 | \param btAmpEvent - btAmpEvent |
| 6186 | |
Jeff Johnson | feddb2d | 2012-12-10 14:41:22 -0800 | [diff] [blame] | 6187 | \return eHalStatus: SUCCESS : BTAmp event successfully sent to HAL |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6188 | |
| 6189 | FAILURE: API failed |
| 6190 | |
| 6191 | -------------------------------------------------------------------------------*/ |
| 6192 | |
| 6193 | eHalStatus sme_sendBTAmpEvent(tHalHandle hHal, tSmeBtAmpEvent btAmpEvent) |
| 6194 | { |
| 6195 | vos_msg_t msg; |
| 6196 | tpSmeBtAmpEvent ptrSmeBtAmpEvent = NULL; |
| 6197 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6198 | |
Leela Venkata Kiran Kumar Reddy Chirala | f7ea543 | 2013-11-15 11:03:04 -0800 | [diff] [blame] | 6199 | ptrSmeBtAmpEvent = vos_mem_malloc(sizeof(tSmeBtAmpEvent)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6200 | if (NULL == ptrSmeBtAmpEvent) |
| 6201 | { |
| 6202 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6203 | "Not able to allocate memory for BTAmp event", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6204 | return status; |
| 6205 | } |
| 6206 | |
| 6207 | vos_mem_copy(ptrSmeBtAmpEvent, (void*)&btAmpEvent, sizeof(tSmeBtAmpEvent)); |
| 6208 | msg.type = WDA_SIGNAL_BTAMP_EVENT; |
| 6209 | msg.reserved = 0; |
| 6210 | msg.bodyptr = ptrSmeBtAmpEvent; |
| 6211 | |
| 6212 | //status = halFW_SendBTAmpEventMesg(pMac, event); |
| 6213 | |
| 6214 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 6215 | { |
| 6216 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6217 | "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] | 6218 | vos_mem_free(ptrSmeBtAmpEvent); |
| 6219 | return status; |
| 6220 | } |
| 6221 | |
| 6222 | return eHAL_STATUS_SUCCESS; |
| 6223 | |
| 6224 | } |
| 6225 | |
| 6226 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6227 | \fn smeIssueFastRoamNeighborAPEvent |
| 6228 | \brief API to trigger fast BSS roam independent of RSSI triggers |
| 6229 | \param hHal - The handle returned by macOpen. |
| 6230 | \param bssid - Pointer to the BSSID to roam to. |
| 6231 | \param fastRoamTrig - Trigger to Scan or roam |
| 6232 | \return eHalStatus |
| 6233 | ---------------------------------------------------------------------------*/ |
| 6234 | eHalStatus smeIssueFastRoamNeighborAPEvent (tHalHandle hHal, |
| 6235 | tANI_U8 *bssid, |
| 6236 | tSmeFastRoamTrigger fastRoamTrig) |
| 6237 | { |
| 6238 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6239 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 6240 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 6241 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6242 | |
| 6243 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6244 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6245 | { |
| 6246 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 6247 | "%s: invoked", __func__); |
| 6248 | |
| 6249 | if (eSME_ROAM_TRIGGER_SCAN == fastRoamTrig) |
| 6250 | { |
| 6251 | smsLog(pMac, LOG1, FL("CFG Channel list scan... ")); |
| 6252 | pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_SCAN; |
| 6253 | vos_mem_copy((void *)(&pNeighborRoamInfo->cfgRoambssId), |
| 6254 | (void *)bssid, sizeof(tSirMacAddr)); |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 6255 | smsLog(pMac, LOG1, "Calling Roam Look Up down Event BSSID " |
| 6256 | MAC_ADDRESS_STR, MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6257 | |
| 6258 | vosStatus = csrNeighborRoamTransitToCFGChanScan(pMac); |
| 6259 | if (VOS_STATUS_SUCCESS != vosStatus) |
| 6260 | { |
| 6261 | smsLog(pMac, LOGE, |
| 6262 | FL("CFG Channel list scan state failed with status %d "), |
| 6263 | vosStatus); |
| 6264 | } |
| 6265 | } |
| 6266 | else if (eSME_ROAM_TRIGGER_FAST_ROAM == fastRoamTrig) |
| 6267 | { |
| 6268 | vos_mem_copy((void *)(&pNeighborRoamInfo->cfgRoambssId), |
| 6269 | (void *)bssid, sizeof(tSirMacAddr)); |
| 6270 | pNeighborRoamInfo->cfgRoamEn = eSME_ROAM_TRIGGER_FAST_ROAM; |
Arif Hussain | a7c8e41 | 2013-11-20 11:06:42 -0800 | [diff] [blame] | 6271 | smsLog(pMac, LOG1, "Roam to BSSID "MAC_ADDRESS_STR, |
| 6272 | MAC_ADDR_ARRAY(pNeighborRoamInfo->cfgRoambssId)); |
Madan Mohan Koyyalamudi | 4810141 | 2013-09-11 23:09:37 +0530 | [diff] [blame] | 6273 | |
| 6274 | vosStatus = csrNeighborRoamReassocIndCallback(pMac->roam.gVosContext, |
| 6275 | 0, |
| 6276 | pMac, |
| 6277 | 0); |
| 6278 | |
| 6279 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 6280 | { |
| 6281 | smsLog(pMac, |
| 6282 | LOGE, |
| 6283 | FL(" Call to csrNeighborRoamReassocIndCallback failed, status = %d"), |
| 6284 | vosStatus); |
| 6285 | } |
| 6286 | } |
| 6287 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6288 | } |
| 6289 | return vosStatus; |
| 6290 | } |
| 6291 | /* --------------------------------------------------------------------------- |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6292 | \fn sme_SetHostOffload |
| 6293 | \brief API to set the host offload feature. |
| 6294 | \param hHal - The handle returned by macOpen. |
| 6295 | \param pRequest - Pointer to the offload request. |
| 6296 | \return eHalStatus |
| 6297 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6298 | eHalStatus sme_SetHostOffload (tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6299 | tpSirHostOffloadReq pRequest) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6300 | { |
| 6301 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6302 | eHalStatus status = eHAL_STATUS_FAILURE; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6303 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6304 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6305 | TRACE_CODE_SME_RX_HDD_SET_HOSTOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6306 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6307 | { |
| 6308 | #ifdef WLAN_NS_OFFLOAD |
| 6309 | if(SIR_IPV6_NS_OFFLOAD == pRequest->offloadType) |
| 6310 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6311 | status = pmcSetNSOffload( hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6312 | } |
| 6313 | else |
| 6314 | #endif //WLAN_NS_OFFLOAD |
| 6315 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6316 | status = pmcSetHostOffload (hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6317 | } |
| 6318 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6319 | } |
| 6320 | |
| 6321 | return (status); |
| 6322 | } |
| 6323 | |
| 6324 | #ifdef WLAN_FEATURE_GTK_OFFLOAD |
| 6325 | /* --------------------------------------------------------------------------- |
| 6326 | \fn sme_SetGTKOffload |
| 6327 | \brief API to set GTK offload information. |
| 6328 | \param hHal - The handle returned by macOpen. |
| 6329 | \param pRequest - Pointer to the GTK offload request. |
| 6330 | \return eHalStatus |
| 6331 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6332 | eHalStatus sme_SetGTKOffload (tHalHandle hHal, tpSirGtkOffloadParams pRequest, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6333 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6334 | { |
| 6335 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6336 | eHalStatus status; |
| 6337 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6338 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6339 | TRACE_CODE_SME_RX_HDD_SET_GTKOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6340 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6341 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6342 | status = pmcSetGTKOffload( hHal, pRequest, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6343 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6344 | } |
| 6345 | |
| 6346 | return (status); |
| 6347 | } |
| 6348 | |
| 6349 | /* --------------------------------------------------------------------------- |
| 6350 | \fn sme_GetGTKOffload |
| 6351 | \brief API to get GTK offload information. |
| 6352 | \param hHal - The handle returned by macOpen. |
| 6353 | \param pRequest - Pointer to the GTK offload response. |
| 6354 | \return eHalStatus |
| 6355 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6356 | eHalStatus sme_GetGTKOffload (tHalHandle hHal, GTKOffloadGetInfoCallback callbackRoutine, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6357 | void *callbackContext, tANI_U8 sessionId ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6358 | { |
| 6359 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6360 | eHalStatus status; |
| 6361 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6362 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6363 | TRACE_CODE_SME_RX_HDD_GET_GTKOFFLOAD, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6364 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6365 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6366 | pmcGetGTKOffload(hHal, callbackRoutine, callbackContext, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6367 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6368 | } |
| 6369 | |
| 6370 | return (status); |
| 6371 | } |
| 6372 | #endif // WLAN_FEATURE_GTK_OFFLOAD |
| 6373 | |
| 6374 | /* --------------------------------------------------------------------------- |
| 6375 | \fn sme_SetKeepAlive |
| 6376 | \brief API to set the Keep Alive feature. |
| 6377 | \param hHal - The handle returned by macOpen. |
| 6378 | \param pRequest - Pointer to the Keep Alive request. |
| 6379 | \return eHalStatus |
| 6380 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6381 | eHalStatus sme_SetKeepAlive (tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6382 | tpSirKeepAliveReq pRequest) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6383 | { |
| 6384 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6385 | eHalStatus status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6386 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6387 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 6388 | status = pmcSetKeepAlive (hHal, pRequest, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6389 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6390 | } |
| 6391 | |
| 6392 | return (status); |
| 6393 | } |
| 6394 | |
| 6395 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 6396 | /* --------------------------------------------------------------------------- |
| 6397 | \fn sme_SetPreferredNetworkList |
| 6398 | \brief API to set the Preferred Network List Offload feature. |
| 6399 | \param hHal - The handle returned by macOpen. |
| 6400 | \param pRequest - Pointer to the offload request. |
| 6401 | \return eHalStatus |
| 6402 | ---------------------------------------------------------------------------*/ |
| 6403 | eHalStatus sme_SetPreferredNetworkList (tHalHandle hHal, tpSirPNOScanReq pRequest, tANI_U8 sessionId, void (*callbackRoutine) (void *callbackContext, tSirPrefNetworkFoundInd *pPrefNetworkFoundInd), void *callbackContext ) |
| 6404 | { |
| 6405 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6406 | eHalStatus status; |
| 6407 | |
| 6408 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6409 | { |
| 6410 | pmcSetPreferredNetworkList(hHal, pRequest, sessionId, callbackRoutine, callbackContext); |
| 6411 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6412 | } |
| 6413 | |
| 6414 | return (status); |
| 6415 | } |
| 6416 | |
| 6417 | eHalStatus sme_SetRSSIFilter(tHalHandle hHal, v_U8_t rssiThreshold) |
| 6418 | { |
| 6419 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6420 | eHalStatus status; |
| 6421 | |
| 6422 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6423 | { |
| 6424 | pmcSetRssiFilter(hHal, rssiThreshold); |
| 6425 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6426 | } |
| 6427 | |
| 6428 | return (status); |
| 6429 | } |
| 6430 | |
| 6431 | #endif // FEATURE_WLAN_SCAN_PNO |
| 6432 | |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 6433 | eHalStatus sme_SetPowerParams(tHalHandle hHal, tSirSetPowerParamsReq* pwParams, tANI_BOOLEAN forced) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6434 | { |
| 6435 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6436 | eHalStatus status; |
| 6437 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6438 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6439 | TRACE_CODE_SME_RX_HDD_SET_POWERPARAMS, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6440 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6441 | { |
Tushnim Bhattacharyya | 3a37def | 2013-02-24 11:11:15 -0800 | [diff] [blame] | 6442 | pmcSetPowerParams(hHal, pwParams, forced); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6443 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6444 | } |
| 6445 | |
| 6446 | return (status); |
| 6447 | } |
| 6448 | |
| 6449 | /* --------------------------------------------------------------------------- |
| 6450 | \fn sme_AbortMacScan |
| 6451 | \brief API to cancel MAC scan. |
| 6452 | \param hHal - The handle returned by macOpen. |
Madan Mohan Koyyalamudi | ff3a715 | 2013-06-13 14:47:55 +0530 | [diff] [blame] | 6453 | \param sessionId - sessionId on which we need to abort scan. |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 6454 | \param reason - Reason to abort the scan. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6455 | \return VOS_STATUS |
| 6456 | VOS_STATUS_E_FAILURE - failure |
| 6457 | VOS_STATUS_SUCCESS success |
| 6458 | ---------------------------------------------------------------------------*/ |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 6459 | eHalStatus sme_AbortMacScan(tHalHandle hHal, tANI_U8 sessionId, |
| 6460 | eCsrAbortReason reason) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6461 | { |
| 6462 | eHalStatus status; |
| 6463 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6464 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6465 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6466 | TRACE_CODE_SME_RX_HDD_ABORT_MACSCAN, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6467 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6468 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6469 | { |
Srinivas, Dasari | 138af4f | 2014-02-07 11:13:45 +0530 | [diff] [blame] | 6470 | status = csrScanAbortMacScan(pMac, sessionId, reason); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6471 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6472 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6473 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6474 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6475 | return ( status ); |
| 6476 | } |
| 6477 | |
| 6478 | /* ---------------------------------------------------------------------------- |
| 6479 | \fn sme_GetOperationChannel |
| 6480 | \brief API to get current channel on which STA is parked |
| 6481 | this function gives channel information only of infra station or IBSS station |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6482 | \param hHal, pointer to memory location and sessionId |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6483 | \returns eHAL_STATUS_SUCCESS |
| 6484 | eHAL_STATUS_FAILURE |
| 6485 | -------------------------------------------------------------------------------*/ |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6486 | eHalStatus sme_GetOperationChannel(tHalHandle hHal, tANI_U32 *pChannel, tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6487 | { |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6488 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6489 | tCsrRoamSession *pSession; |
| 6490 | |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6491 | if (CSR_IS_SESSION_VALID( pMac, sessionId )) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6492 | { |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6493 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6494 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6495 | if(( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRASTRUCTURE ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6496 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_IBSS ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6497 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_INFRA_AP ) || |
Jeff Johnson | 04dd8a8 | 2012-06-29 20:41:40 -0700 | [diff] [blame] | 6498 | ( pSession->connectedProfile.BSSType == eCSR_BSS_TYPE_START_IBSS )) |
| 6499 | { |
| 6500 | *pChannel =pSession->connectedProfile.operationChannel; |
| 6501 | return eHAL_STATUS_SUCCESS; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6502 | } |
| 6503 | } |
| 6504 | return eHAL_STATUS_FAILURE; |
| 6505 | }// sme_GetOperationChannel ends here |
| 6506 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6507 | /* --------------------------------------------------------------------------- |
| 6508 | |
| 6509 | \fn sme_RegisterMgtFrame |
| 6510 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6511 | \brief To register managment frame of specified type and subtype. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6512 | \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] | 6513 | \param matchData - data which needs to be matched before passing frame |
| 6514 | to HDD. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6515 | \param matchDataLen - Length of matched data. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6516 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6517 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6518 | eHalStatus sme_RegisterMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6519 | tANI_U16 frameType, tANI_U8* matchData, tANI_U16 matchLen) |
| 6520 | { |
| 6521 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6522 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6523 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6524 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6525 | TRACE_CODE_SME_RX_HDD_REGISTER_MGMTFR, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6526 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6527 | { |
| 6528 | tSirRegisterMgmtFrame *pMsg; |
| 6529 | tANI_U16 len; |
| 6530 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6531 | |
| 6532 | if(!pSession) |
| 6533 | { |
| 6534 | 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] | 6535 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6536 | return eHAL_STATUS_FAILURE; |
| 6537 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6538 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6539 | if( !pSession->sessionActive ) |
| 6540 | { |
| 6541 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6542 | "%s Invalid Sessionid", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6543 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6544 | return eHAL_STATUS_FAILURE; |
| 6545 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6546 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6547 | len = sizeof(tSirRegisterMgmtFrame) + matchLen; |
| 6548 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6549 | pMsg = vos_mem_malloc(len); |
| 6550 | if ( NULL == pMsg ) |
| 6551 | status = eHAL_STATUS_FAILURE; |
| 6552 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6553 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6554 | vos_mem_set(pMsg, len, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6555 | pMsg->messageType = eWNI_SME_REGISTER_MGMT_FRAME_REQ; |
| 6556 | pMsg->length = len; |
| 6557 | pMsg->sessionId = sessionId; |
| 6558 | pMsg->registerFrame = VOS_TRUE; |
| 6559 | pMsg->frameType = frameType; |
| 6560 | pMsg->matchLen = matchLen; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6561 | vos_mem_copy(pMsg->matchData, matchData, matchLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6562 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 6563 | } |
| 6564 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6565 | } |
| 6566 | return status; |
| 6567 | } |
| 6568 | |
| 6569 | /* --------------------------------------------------------------------------- |
| 6570 | |
| 6571 | \fn sme_DeregisterMgtFrame |
| 6572 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6573 | \brief To De-register managment frame of specified type and subtype. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6574 | \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] | 6575 | \param matchData - data which needs to be matched before passing frame |
| 6576 | to HDD. |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6577 | \param matchDataLen - Length of matched data. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6578 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6579 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6580 | eHalStatus sme_DeregisterMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6581 | tANI_U16 frameType, tANI_U8* matchData, tANI_U16 matchLen) |
| 6582 | { |
| 6583 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6584 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6585 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6586 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6587 | TRACE_CODE_SME_RX_HDD_DEREGISTER_MGMTFR, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6588 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6589 | { |
| 6590 | tSirRegisterMgmtFrame *pMsg; |
| 6591 | tANI_U16 len; |
| 6592 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6593 | |
| 6594 | if(!pSession) |
| 6595 | { |
| 6596 | 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] | 6597 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 6598 | return eHAL_STATUS_FAILURE; |
| 6599 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6600 | |
| 6601 | if( !pSession->sessionActive ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6602 | { |
| 6603 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6604 | "%s Invalid Sessionid", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6605 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6606 | return eHAL_STATUS_FAILURE; |
| 6607 | } |
| 6608 | |
| 6609 | len = sizeof(tSirRegisterMgmtFrame) + matchLen; |
| 6610 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6611 | pMsg = vos_mem_malloc(len); |
| 6612 | if ( NULL == pMsg ) |
| 6613 | status = eHAL_STATUS_FAILURE; |
| 6614 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6615 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6616 | vos_mem_set(pMsg, len, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6617 | pMsg->messageType = eWNI_SME_REGISTER_MGMT_FRAME_REQ; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6618 | pMsg->length = len; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6619 | pMsg->registerFrame = VOS_FALSE; |
| 6620 | pMsg->frameType = frameType; |
| 6621 | pMsg->matchLen = matchLen; |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 6622 | vos_mem_copy(pMsg->matchData, matchData, matchLen); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6623 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 6624 | } |
| 6625 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6626 | } |
| 6627 | return status; |
| 6628 | } |
| 6629 | |
| 6630 | /* --------------------------------------------------------------------------- |
| 6631 | \fn sme_RemainOnChannel |
| 6632 | \brief API to request remain on channel for 'x' duration. used in p2p in listen state |
| 6633 | \param hHal - The handle returned by macOpen. |
| 6634 | \param pRequest - channel |
| 6635 | \param duration - duration in ms |
| 6636 | \param callback - HDD registered callback to process reaminOnChannelRsp |
| 6637 | \param context - HDD Callback param |
| 6638 | \return eHalStatus |
| 6639 | ---------------------------------------------------------------------------*/ |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6640 | eHalStatus sme_RemainOnChannel(tHalHandle hHal, tANI_U8 sessionId, |
| 6641 | tANI_U8 channel, tANI_U32 duration, |
Gopichand Nakkala | 924e455 | 2013-05-08 19:18:14 +0530 | [diff] [blame] | 6642 | remainOnChanCallback callback, |
| 6643 | void *pContext, |
| 6644 | tANI_U8 isP2PProbeReqAllowed) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6645 | { |
| 6646 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6647 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6648 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6649 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6650 | TRACE_CODE_SME_RX_HDD_REMAIN_ONCHAN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6651 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6652 | { |
Gopichand Nakkala | 924e455 | 2013-05-08 19:18:14 +0530 | [diff] [blame] | 6653 | status = p2pRemainOnChannel (hHal, sessionId, channel, duration, callback, pContext, |
| 6654 | isP2PProbeReqAllowed |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6655 | #ifdef WLAN_FEATURE_P2P_INTERNAL |
| 6656 | , eP2PRemainOnChnReasonUnknown |
| 6657 | #endif |
| 6658 | ); |
| 6659 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6660 | } |
| 6661 | return(status); |
| 6662 | } |
| 6663 | |
| 6664 | /* --------------------------------------------------------------------------- |
| 6665 | \fn sme_ReportProbeReq |
| 6666 | \brief API to enable/disable forwarding of probeReq to apps in p2p. |
| 6667 | \param hHal - The handle returned by macOpen. |
| 6668 | \param falg: to set the Probe request forarding to wpa_supplicant in listen state in p2p |
| 6669 | \return eHalStatus |
| 6670 | ---------------------------------------------------------------------------*/ |
| 6671 | |
| 6672 | #ifndef WLAN_FEATURE_CONCURRENT_P2P |
| 6673 | eHalStatus sme_ReportProbeReq(tHalHandle hHal, tANI_U8 flag) |
| 6674 | { |
| 6675 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6676 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6677 | |
| 6678 | do |
| 6679 | { |
| 6680 | //acquire the lock for the sme object |
| 6681 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6682 | if(HAL_STATUS_SUCCESS(status)) |
| 6683 | { |
| 6684 | /* call set in context */ |
| 6685 | pMac->p2pContext.probeReqForwarding = flag; |
| 6686 | //release the lock for the sme object |
| 6687 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6688 | } |
| 6689 | } while(0); |
| 6690 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6691 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6692 | |
| 6693 | return(status); |
| 6694 | } |
| 6695 | |
| 6696 | /* --------------------------------------------------------------------------- |
| 6697 | \fn sme_updateP2pIe |
| 6698 | \brief API to set the P2p Ie in p2p context |
| 6699 | \param hHal - The handle returned by macOpen. |
| 6700 | \param p2pIe - Ptr to p2pIe from HDD. |
| 6701 | \param p2pIeLength: length of p2pIe |
| 6702 | \return eHalStatus |
| 6703 | ---------------------------------------------------------------------------*/ |
| 6704 | |
| 6705 | eHalStatus sme_updateP2pIe(tHalHandle hHal, void *p2pIe, tANI_U32 p2pIeLength) |
| 6706 | { |
| 6707 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6708 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6709 | |
| 6710 | //acquire the lock for the sme object |
| 6711 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6712 | if(HAL_STATUS_SUCCESS(status)) |
| 6713 | { |
| 6714 | if(NULL != pMac->p2pContext.probeRspIe){ |
| 6715 | vos_mem_free(pMac->p2pContext.probeRspIe); |
| 6716 | pMac->p2pContext.probeRspIeLength = 0; |
| 6717 | } |
| 6718 | |
| 6719 | pMac->p2pContext.probeRspIe = vos_mem_malloc(p2pIeLength); |
| 6720 | if (NULL == pMac->p2pContext.probeRspIe) |
| 6721 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 6722 | smsLog(pMac, LOGE, "%s: Unable to allocate P2P IE", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6723 | pMac->p2pContext.probeRspIeLength = 0; |
| 6724 | status = eHAL_STATUS_FAILURE; |
| 6725 | } |
| 6726 | else |
| 6727 | { |
| 6728 | pMac->p2pContext.probeRspIeLength = p2pIeLength; |
| 6729 | |
| 6730 | sirDumpBuf( pMac, SIR_LIM_MODULE_ID, LOG2, |
| 6731 | pMac->p2pContext.probeRspIe, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6732 | pMac->p2pContext.probeRspIeLength ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6733 | vos_mem_copy((tANI_U8 *)pMac->p2pContext.probeRspIe, p2pIe, |
| 6734 | p2pIeLength); |
| 6735 | } |
| 6736 | |
| 6737 | //release the lock for the sme object |
| 6738 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6739 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6740 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6741 | smsLog(pMac, LOG2, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6742 | |
| 6743 | return(status); |
| 6744 | } |
| 6745 | #endif |
| 6746 | |
| 6747 | /* --------------------------------------------------------------------------- |
| 6748 | \fn sme_sendAction |
| 6749 | \brief API to send action frame from supplicant. |
| 6750 | \param hHal - The handle returned by macOpen. |
| 6751 | \return eHalStatus |
| 6752 | ---------------------------------------------------------------------------*/ |
| 6753 | |
| 6754 | eHalStatus sme_sendAction(tHalHandle hHal, tANI_U8 sessionId, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6755 | const tANI_U8 *pBuf, tANI_U32 len, |
| 6756 | tANI_U16 wait, tANI_BOOLEAN noack) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6757 | { |
| 6758 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6759 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6760 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6761 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6762 | TRACE_CODE_SME_RX_HDD_SEND_ACTION, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6763 | //acquire the lock for the sme object |
| 6764 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 6765 | if(HAL_STATUS_SUCCESS(status)) |
| 6766 | { |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 6767 | p2pSendAction(hHal, sessionId, pBuf, len, wait, noack); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6768 | //release the lock for the sme object |
| 6769 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6770 | } |
| 6771 | |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 6772 | smsLog(pMac, LOGW, "exiting function %s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6773 | |
| 6774 | return(status); |
| 6775 | } |
| 6776 | |
| 6777 | eHalStatus sme_CancelRemainOnChannel(tHalHandle hHal, tANI_U8 sessionId ) |
| 6778 | { |
| 6779 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6780 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6781 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6782 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6783 | TRACE_CODE_SME_RX_HDD_CANCEL_REMAIN_ONCHAN, sessionId, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6784 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6785 | { |
| 6786 | status = p2pCancelRemainOnChannel (hHal, sessionId); |
| 6787 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6788 | } |
| 6789 | return(status); |
| 6790 | } |
| 6791 | |
| 6792 | //Power Save Related |
| 6793 | eHalStatus sme_p2pSetPs(tHalHandle hHal, tP2pPsConfig * data) |
| 6794 | { |
| 6795 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6796 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6797 | |
| 6798 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6799 | { |
| 6800 | status = p2pSetPs (hHal, data); |
| 6801 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6802 | } |
| 6803 | return(status); |
| 6804 | } |
| 6805 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6806 | |
| 6807 | /* --------------------------------------------------------------------------- |
| 6808 | |
| 6809 | \fn sme_ConfigureRxpFilter |
| 6810 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6811 | \brief |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6812 | SME will pass this request to lower mac to set/reset the filter on RXP for |
| 6813 | multicast & broadcast traffic. |
| 6814 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6815 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6816 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6817 | hHal - The handle returned by macOpen. |
| 6818 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6819 | filterMask- Currently the API takes a 1 or 0 (set or reset) as filter. |
| 6820 | Basically to enable/disable the filter (to filter "all" mcbc traffic) based |
| 6821 | on this param. In future we can use this as a mask to set various types of |
| 6822 | filters as suggested below: |
| 6823 | FILTER_ALL_MULTICAST: |
| 6824 | FILTER_ALL_BROADCAST: |
| 6825 | FILTER_ALL_MULTICAST_BROADCAST: |
| 6826 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6827 | |
| 6828 | \return eHalStatus |
| 6829 | |
| 6830 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6831 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6832 | eHalStatus sme_ConfigureRxpFilter( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6833 | tpSirWlanSetRxpFilters wlanRxpFilterParam) |
| 6834 | { |
| 6835 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6836 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 6837 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6838 | vos_msg_t vosMessage; |
| 6839 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6840 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6841 | TRACE_CODE_SME_RX_HDD_CONFIG_RXPFIL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6842 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6843 | { |
| 6844 | /* serialize the req through MC thread */ |
| 6845 | vosMessage.bodyptr = wlanRxpFilterParam; |
| 6846 | vosMessage.type = WDA_CFG_RXP_FILTER_REQ; |
| 6847 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 6848 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 6849 | { |
| 6850 | status = eHAL_STATUS_FAILURE; |
| 6851 | } |
| 6852 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6853 | } |
| 6854 | return(status); |
| 6855 | } |
| 6856 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6857 | /* --------------------------------------------------------------------------- |
| 6858 | |
| 6859 | \fn sme_ConfigureSuspendInd |
| 6860 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6861 | \brief |
| 6862 | 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] | 6863 | be suspended |
| 6864 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6865 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6866 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6867 | hHal - The handle returned by macOpen. |
| 6868 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6869 | wlanSuspendParam- Depicts the wlan suspend params |
| 6870 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6871 | |
| 6872 | \return eHalStatus |
| 6873 | |
| 6874 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6875 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6876 | eHalStatus sme_ConfigureSuspendInd( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6877 | tpSirWlanSuspendParam wlanSuspendParam) |
| 6878 | { |
| 6879 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6880 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 6881 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6882 | vos_msg_t vosMessage; |
| 6883 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6884 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6885 | TRACE_CODE_SME_RX_HDD_CONFIG_SUSPENDIND, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6886 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6887 | { |
| 6888 | /* serialize the req through MC thread */ |
| 6889 | vosMessage.bodyptr = wlanSuspendParam; |
| 6890 | vosMessage.type = WDA_WLAN_SUSPEND_IND; |
| 6891 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 6892 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 6893 | { |
| 6894 | status = eHAL_STATUS_FAILURE; |
| 6895 | } |
| 6896 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6897 | } |
| 6898 | return(status); |
| 6899 | } |
| 6900 | |
| 6901 | /* --------------------------------------------------------------------------- |
| 6902 | |
| 6903 | \fn sme_ConfigureResumeReq |
| 6904 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6905 | \brief |
| 6906 | 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] | 6907 | be Resumed |
| 6908 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6909 | \param |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6910 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6911 | hHal - The handle returned by macOpen. |
| 6912 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6913 | wlanResumeParam- Depicts the wlan resume params |
| 6914 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6915 | |
| 6916 | \return eHalStatus |
| 6917 | |
| 6918 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6919 | --------------------------------------------------------------------------- */ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6920 | eHalStatus sme_ConfigureResumeReq( tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6921 | tpSirWlanResumeParam wlanResumeParam) |
| 6922 | { |
| 6923 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 6924 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 6925 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 6926 | vos_msg_t vosMessage; |
| 6927 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 6928 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 6929 | TRACE_CODE_SME_RX_HDD_CONFIG_RESUMEREQ, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6930 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 6931 | { |
| 6932 | /* serialize the req through MC thread */ |
| 6933 | vosMessage.bodyptr = wlanResumeParam; |
| 6934 | vosMessage.type = WDA_WLAN_RESUME_REQ; |
| 6935 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 6936 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 6937 | { |
| 6938 | status = eHAL_STATUS_FAILURE; |
| 6939 | } |
| 6940 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6941 | } |
| 6942 | return(status); |
| 6943 | } |
| 6944 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6945 | /* --------------------------------------------------------------------------- |
| 6946 | |
| 6947 | \fn sme_GetInfraSessionId |
| 6948 | |
| 6949 | \brief To get the session ID for infra session, if connected |
| 6950 | This is a synchronous API. |
| 6951 | |
| 6952 | \param hHal - The handle returned by macOpen. |
| 6953 | |
| 6954 | \return sessionid, -1 if infra session is not connected |
| 6955 | |
| 6956 | -------------------------------------------------------------------------------*/ |
| 6957 | tANI_S8 sme_GetInfraSessionId(tHalHandle hHal) |
| 6958 | { |
| 6959 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6960 | tANI_S8 sessionid = -1; |
| 6961 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 6962 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 6963 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6964 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6965 | { |
| 6966 | |
| 6967 | sessionid = csrGetInfraSessionId( pMac); |
| 6968 | |
| 6969 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 6970 | } |
| 6971 | |
| 6972 | return (sessionid); |
| 6973 | } |
| 6974 | |
| 6975 | /* --------------------------------------------------------------------------- |
| 6976 | |
| 6977 | \fn sme_GetInfraOperationChannel |
| 6978 | |
| 6979 | \brief To get the operating channel for infra session, if connected |
| 6980 | This is a synchronous API. |
| 6981 | |
| 6982 | \param hHal - The handle returned by macOpen. |
| 6983 | \param sessionId - the sessionId returned by sme_OpenSession. |
| 6984 | |
| 6985 | \return operating channel, 0 if infra session is not connected |
| 6986 | |
| 6987 | -------------------------------------------------------------------------------*/ |
| 6988 | tANI_U8 sme_GetInfraOperationChannel( tHalHandle hHal, tANI_U8 sessionId) |
| 6989 | { |
| 6990 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 6991 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 6992 | tANI_U8 channel = 0; |
| 6993 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 6994 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 6995 | { |
| 6996 | |
| 6997 | channel = csrGetInfraOperationChannel( pMac, sessionId); |
| 6998 | |
| 6999 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7000 | } |
| 7001 | |
| 7002 | return (channel); |
| 7003 | } |
| 7004 | |
| 7005 | //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] | 7006 | //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] | 7007 | tANI_U8 sme_GetConcurrentOperationChannel( tHalHandle hHal ) |
| 7008 | { |
| 7009 | eHalStatus status = eHAL_STATUS_FAILURE; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7010 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7011 | tANI_U8 channel = 0; |
| 7012 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7013 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7014 | { |
| 7015 | |
| 7016 | channel = csrGetConcurrentOperationChannel( pMac ); |
| 7017 | 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] | 7018 | " Other Concurrent Channel = %d", __func__,channel); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7019 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7020 | } |
| 7021 | |
| 7022 | return (channel); |
| 7023 | } |
| 7024 | |
| 7025 | #ifdef FEATURE_WLAN_SCAN_PNO |
| 7026 | /****************************************************************************** |
| 7027 | * |
| 7028 | * Name: sme_PreferredNetworkFoundInd |
| 7029 | * |
| 7030 | * Description: |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7031 | * Invoke Preferred Network Found Indication |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7032 | * |
| 7033 | * Parameters: |
| 7034 | * hHal - HAL handle for device |
| 7035 | * pMsg - found network description |
| 7036 | * |
| 7037 | * Returns: eHalStatus |
| 7038 | * |
| 7039 | ******************************************************************************/ |
| 7040 | eHalStatus sme_PreferredNetworkFoundInd (tHalHandle hHal, void* pMsg) |
| 7041 | { |
| 7042 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7043 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7044 | tSirPrefNetworkFoundInd *pPrefNetworkFoundInd = (tSirPrefNetworkFoundInd *)pMsg; |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7045 | v_U8_t dumpSsId[SIR_MAC_MAX_SSID_LENGTH + 1]; |
| 7046 | tANI_U8 ssIdLength = 0; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7047 | |
| 7048 | if (NULL == pMsg) |
| 7049 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7050 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7051 | status = eHAL_STATUS_FAILURE; |
| 7052 | } |
| 7053 | else |
| 7054 | { |
| 7055 | if (pPrefNetworkFoundInd->ssId.length > 0) |
| 7056 | { |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7057 | ssIdLength = CSR_MIN(SIR_MAC_MAX_SSID_LENGTH, |
| 7058 | pPrefNetworkFoundInd->ssId.length); |
| 7059 | vos_mem_copy(dumpSsId, pPrefNetworkFoundInd->ssId.ssId, ssIdLength); |
| 7060 | dumpSsId[ssIdLength] = 0; |
| 7061 | smsLog(pMac, LOG2, "%s:SSID=%s frame length %d", |
| 7062 | __func__, dumpSsId, pPrefNetworkFoundInd->frameLength); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7063 | |
Vinay Krishna Eranna | b13043b | 2013-12-06 11:50:21 +0530 | [diff] [blame] | 7064 | /* Flush scan results, So as to avoid indication/updation of |
| 7065 | * stale entries, which may not have aged out during APPS collapse |
| 7066 | */ |
| 7067 | sme_ScanFlushResult(hHal,0); |
| 7068 | |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7069 | //Save the frame to scan result |
| 7070 | if (pPrefNetworkFoundInd->mesgLen > sizeof(tSirPrefNetworkFoundInd)) |
| 7071 | { |
| 7072 | //we may have a frame |
| 7073 | status = csrScanSavePreferredNetworkFound(pMac, |
| 7074 | pPrefNetworkFoundInd); |
| 7075 | if (!HAL_STATUS_SUCCESS(status)) |
| 7076 | { |
| 7077 | smsLog(pMac, LOGE, FL(" fail to save preferred network")); |
| 7078 | } |
| 7079 | } |
| 7080 | else |
| 7081 | { |
Jeff Johnson | afeb958 | 2013-11-22 18:39:00 -0800 | [diff] [blame] | 7082 | smsLog(pMac, LOGE, FL(" not enough data length %u needed %zu"), |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7083 | pPrefNetworkFoundInd->mesgLen, sizeof(tSirPrefNetworkFoundInd)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7084 | } |
| 7085 | |
Srikant Kuppa | 066904f | 2013-05-07 13:56:02 -0700 | [diff] [blame] | 7086 | /* Call Preferred Netowrk Found Indication callback routine. */ |
| 7087 | if (HAL_STATUS_SUCCESS(status) && (pMac->pmc.prefNetwFoundCB != NULL)) |
| 7088 | { |
| 7089 | pMac->pmc.prefNetwFoundCB( |
| 7090 | pMac->pmc.preferredNetworkFoundIndCallbackContext, |
| 7091 | pPrefNetworkFoundInd); |
| 7092 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7093 | } |
| 7094 | else |
| 7095 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7096 | smsLog(pMac, LOGE, "%s: callback failed - SSID is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7097 | status = eHAL_STATUS_FAILURE; |
| 7098 | } |
| 7099 | } |
| 7100 | |
| 7101 | |
| 7102 | return(status); |
| 7103 | } |
| 7104 | |
| 7105 | #endif // FEATURE_WLAN_SCAN_PNO |
| 7106 | |
| 7107 | |
| 7108 | eHalStatus sme_GetCfgValidChannels(tHalHandle hHal, tANI_U8 *aValidChannels, tANI_U32 *len) |
| 7109 | { |
| 7110 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7111 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7112 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7113 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7114 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7115 | { |
| 7116 | status = csrGetCfgValidChannels(pMac, aValidChannels, len); |
| 7117 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7118 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7119 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7120 | return (status); |
| 7121 | } |
| 7122 | |
| 7123 | |
| 7124 | /* --------------------------------------------------------------------------- |
| 7125 | |
| 7126 | \fn sme_SetTxPerTracking |
| 7127 | |
| 7128 | \brief Set Tx PER tracking configuration parameters |
| 7129 | |
| 7130 | \param hHal - The handle returned by macOpen. |
| 7131 | \param pTxPerTrackingConf - Tx PER configuration parameters |
| 7132 | |
| 7133 | \return eHalStatus |
| 7134 | |
| 7135 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7136 | eHalStatus sme_SetTxPerTracking(tHalHandle hHal, |
| 7137 | void (*pCallbackfn) (void *pCallbackContext), |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7138 | void *pCallbackContext, |
| 7139 | tpSirTxPerTrackingParam pTxPerTrackingParam) |
| 7140 | { |
| 7141 | vos_msg_t msg; |
| 7142 | tpSirTxPerTrackingParam pTxPerTrackingParamReq = NULL; |
| 7143 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7144 | |
| 7145 | if ( eHAL_STATUS_SUCCESS == sme_AcquireGlobalLock( &pMac->sme ) ) |
| 7146 | { |
| 7147 | pMac->sme.pTxPerHitCallback = pCallbackfn; |
| 7148 | pMac->sme.pTxPerHitCbContext = pCallbackContext; |
| 7149 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7150 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7151 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7152 | // free this memory in failure case or WDA request callback function |
| 7153 | pTxPerTrackingParamReq = vos_mem_malloc(sizeof(tSirTxPerTrackingParam)); |
| 7154 | if (NULL == pTxPerTrackingParamReq) |
| 7155 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7156 | 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] | 7157 | return eHAL_STATUS_FAILURE; |
| 7158 | } |
| 7159 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7160 | vos_mem_copy(pTxPerTrackingParamReq, (void*)pTxPerTrackingParam, |
| 7161 | sizeof(tSirTxPerTrackingParam)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7162 | msg.type = WDA_SET_TX_PER_TRACKING_REQ; |
| 7163 | msg.reserved = 0; |
| 7164 | msg.bodyptr = pTxPerTrackingParamReq; |
| 7165 | |
| 7166 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7167 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7168 | 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] | 7169 | vos_mem_free(pTxPerTrackingParamReq); |
| 7170 | return eHAL_STATUS_FAILURE; |
| 7171 | } |
| 7172 | |
| 7173 | return eHAL_STATUS_SUCCESS; |
| 7174 | } |
| 7175 | |
| 7176 | /* --------------------------------------------------------------------------- |
| 7177 | |
| 7178 | \fn sme_HandleChangeCountryCode |
| 7179 | |
| 7180 | \brief Change Country code, Reg Domain and channel list |
| 7181 | |
| 7182 | \details Country Code Priority |
| 7183 | 0 = 11D > Configured Country > NV |
| 7184 | 1 = Configured Country > 11D > NV |
| 7185 | If Supplicant country code is priority than 11d is disabled. |
| 7186 | If 11D is enabled, we update the country code after every scan. |
| 7187 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 7188 | Country code from Supplicant is set as current courtry code. |
| 7189 | User can send reset command XX (instead of country code) to reset the |
| 7190 | country code to default values which is read from NV. |
| 7191 | In case of reset, 11D is enabled and default NV code is Set as current country code |
| 7192 | If 11D is priority, |
| 7193 | Than Supplicant country code code is set to default code. But 11D code is set as current country code |
| 7194 | |
| 7195 | \param pMac - The handle returned by macOpen. |
| 7196 | \param pMsgBuf - MSG Buffer |
| 7197 | |
| 7198 | \return eHalStatus |
| 7199 | |
| 7200 | -------------------------------------------------------------------------------*/ |
| 7201 | eHalStatus sme_HandleChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) |
| 7202 | { |
| 7203 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7204 | tAniChangeCountryCodeReq *pMsg; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7205 | v_REGDOMAIN_t domainIdIoctl; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7206 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 7207 | static uNvTables nvTables; |
| 7208 | pMsg = (tAniChangeCountryCodeReq *)pMsgBuf; |
| 7209 | |
| 7210 | |
| 7211 | /* if the reset Supplicant country code command is triggered, enable 11D, reset the NV country code and return */ |
| 7212 | if( VOS_TRUE == vos_mem_compare(pMsg->countryCode, SME_INVALID_COUNTRY_CODE, 2) ) |
| 7213 | { |
| 7214 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7215 | |
| 7216 | vosStatus = vos_nv_readDefaultCountryTable( &nvTables ); |
| 7217 | |
| 7218 | /* read the country code from NV and use it */ |
| 7219 | if ( VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 7220 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7221 | vos_mem_copy(pMsg->countryCode, |
| 7222 | nvTables.defaultCountryTable.countryCode, |
| 7223 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7224 | } |
| 7225 | else |
| 7226 | { |
| 7227 | status = eHAL_STATUS_FAILURE; |
| 7228 | return status; |
| 7229 | } |
| 7230 | } |
| 7231 | else |
| 7232 | { |
| 7233 | /* if Supplicant country code has priority, disable 11d */ |
Gopichand Nakkala | acd9411 | 2013-05-29 21:37:47 +0530 | [diff] [blame] | 7234 | if(pMac->roam.configParam.fSupplicantCountryCodeHasPriority && |
| 7235 | pMsg->countryFromUserSpace) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7236 | { |
| 7237 | pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE; |
| 7238 | } |
| 7239 | } |
| 7240 | |
| 7241 | /* WEXT set country code means |
| 7242 | * 11D should be supported? |
| 7243 | * 11D Channel should be enforced? |
| 7244 | * 11D Country code should be matched? |
| 7245 | * 11D Reg Domian should be matched? |
| 7246 | * Country string changed */ |
| 7247 | if(pMac->roam.configParam.Is11dSupportEnabled && |
| 7248 | pMac->roam.configParam.fEnforce11dChannels && |
| 7249 | pMac->roam.configParam.fEnforceCountryCodeMatch && |
| 7250 | pMac->roam.configParam.fEnforceDefaultDomain && |
| 7251 | !csrSave11dCountryString(pMac, pMsg->countryCode, eANI_BOOLEAN_TRUE)) |
| 7252 | { |
| 7253 | /* All 11D related options are already enabled |
| 7254 | * Country string is not changed |
| 7255 | * Do not need do anything for country code change request */ |
| 7256 | return eHAL_STATUS_SUCCESS; |
| 7257 | } |
| 7258 | |
| 7259 | /* Set Current Country code and Current Regulatory domain */ |
| 7260 | status = csrSetCountryCode(pMac, pMsg->countryCode, NULL); |
| 7261 | if(eHAL_STATUS_SUCCESS != status) |
| 7262 | { |
| 7263 | /* Supplicant country code failed. So give 11D priority */ |
| 7264 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7265 | smsLog(pMac, LOGE, "Set Country Code Fail %d", status); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7266 | return status; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7267 | } |
| 7268 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7269 | /* overwrite the defualt country code */ |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7270 | vos_mem_copy(pMac->scan.countryCodeDefault, |
| 7271 | pMac->scan.countryCodeCurrent, |
| 7272 | WNI_CFG_COUNTRY_CODE_LEN); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7273 | |
| 7274 | /* Get Domain ID from country code */ |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7275 | status = csrGetRegulatoryDomainForCountry(pMac, |
| 7276 | pMac->scan.countryCodeCurrent, |
| 7277 | (v_REGDOMAIN_t *) &domainIdIoctl, |
| 7278 | COUNTRY_QUERY); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7279 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7280 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7281 | smsLog( pMac, LOGE, FL(" fail to get regId %d"), domainIdIoctl ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7282 | return status; |
| 7283 | } |
Tushnim Bhattacharyya | 796ffe8 | 2013-11-05 16:31:36 -0800 | [diff] [blame] | 7284 | else if (REGDOMAIN_WORLD == domainIdIoctl) |
| 7285 | { |
| 7286 | /* Supplicant country code is invalid, so we are on world mode now. So |
| 7287 | give 11D chance to update */ |
| 7288 | pMac->roam.configParam.Is11dSupportEnabled = pMac->roam.configParam.Is11dSupportEnabledOriginal; |
| 7289 | smsLog(pMac, LOG1, FL("Country Code unrecognized by driver")); |
| 7290 | } |
| 7291 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7292 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 7293 | status = WDA_SetRegDomain(pMac, domainIdIoctl, pMsg->sendRegHint); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7294 | |
| 7295 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7296 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7297 | smsLog( pMac, LOGE, FL(" fail to set regId %d"), domainIdIoctl ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7298 | return status; |
| 7299 | } |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7300 | else |
| 7301 | { |
| 7302 | //if 11d has priority, clear currentCountryBssid & countryCode11d to get |
| 7303 | //set again if we find AP with 11d info during scan |
| 7304 | if (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) |
| 7305 | { |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7306 | smsLog( pMac, LOGW, FL("Clearing currentCountryBssid, countryCode11d")); |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7307 | vos_mem_zero(&pMac->scan.currentCountryBssid, sizeof(tCsrBssid)); |
| 7308 | vos_mem_zero( pMac->scan.countryCode11d, sizeof( pMac->scan.countryCode11d ) ); |
| 7309 | } |
| 7310 | } |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7311 | #ifndef CONFIG_ENABLE_LINUX_REG |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7312 | /* set to default domain ID */ |
| 7313 | pMac->scan.domainIdDefault = pMac->scan.domainIdCurrent; |
| 7314 | |
| 7315 | /* get the channels based on new cc */ |
| 7316 | status = csrInitGetChannels( pMac ); |
| 7317 | |
| 7318 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7319 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7320 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7321 | return status; |
| 7322 | } |
| 7323 | |
| 7324 | /* reset info based on new cc, and we are done */ |
Gopichand Nakkala | b9185f2 | 2012-12-21 08:03:42 -0800 | [diff] [blame] | 7325 | csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7326 | /* Country code Changed, Purge Only scan result |
| 7327 | * which does not have channel number belong to 11d |
| 7328 | * channel list |
| 7329 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 7330 | csrScanFilterResults(pMac); |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7331 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7332 | #endif |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7333 | if( pMsg->changeCCCallback ) |
| 7334 | { |
| 7335 | ((tSmeChangeCountryCallback)(pMsg->changeCCCallback))((void *)pMsg->pDevContext); |
| 7336 | } |
| 7337 | |
| 7338 | return eHAL_STATUS_SUCCESS; |
| 7339 | } |
| 7340 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7341 | /* --------------------------------------------------------------------------- |
| 7342 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7343 | \fn sme_HandleChangeCountryCodeByUser |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7344 | |
| 7345 | \brief Change Country code, Reg Domain and channel list |
| 7346 | |
| 7347 | If Supplicant country code is priority than 11d is disabled. |
| 7348 | If 11D is enabled, we update the country code after every scan. |
| 7349 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 7350 | Country code from Supplicant is set as current country code. |
| 7351 | |
| 7352 | \param pMac - The handle returned by macOpen. |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7353 | \param pMsg - Carrying new CC & domain set in kernel by user |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7354 | |
| 7355 | \return eHalStatus |
| 7356 | |
| 7357 | -------------------------------------------------------------------------------*/ |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7358 | eHalStatus sme_HandleChangeCountryCodeByUser(tpAniSirGlobal pMac, |
| 7359 | tAniGenericChangeCountryCodeReq *pMsg) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7360 | { |
| 7361 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7362 | v_REGDOMAIN_t reg_domain_id; |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7363 | v_BOOL_t is11dCountry = VOS_FALSE; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7364 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7365 | smsLog(pMac, LOG1, FL(" called")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7366 | reg_domain_id = (v_REGDOMAIN_t)pMsg->domain_index; |
| 7367 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7368 | if (memcmp(pMsg->countryCode, pMac->scan.countryCode11d, |
| 7369 | VOS_COUNTRY_CODE_LEN) == 0) |
| 7370 | { |
| 7371 | is11dCountry = VOS_TRUE; |
| 7372 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7373 | |
Amar Singhal | 97a2d99 | 2013-11-19 10:58:07 -0800 | [diff] [blame] | 7374 | if ((!is11dCountry) && (!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) && |
| 7375 | (csrGetInfraSessionId(pMac) != -1 )) |
| 7376 | { |
| 7377 | |
| 7378 | smsLog( pMac, LOGW, FL(" incorrect country being set, nullify this request")); |
| 7379 | |
| 7380 | /* we have got a request for a country that should not have been added since the |
| 7381 | STA is associated; nullify this request */ |
| 7382 | status = csrGetRegulatoryDomainForCountry(pMac, |
| 7383 | pMac->scan.countryCode11d, |
| 7384 | (v_REGDOMAIN_t *) ®_domain_id, |
| 7385 | COUNTRY_IE); |
| 7386 | |
| 7387 | return eHAL_STATUS_FAILURE; |
| 7388 | } |
| 7389 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7390 | /* if Supplicant country code has priority, disable 11d */ |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7391 | if (!is11dCountry && pMac->roam.configParam.fSupplicantCountryCodeHasPriority) |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7392 | { |
| 7393 | pMac->roam.configParam.Is11dSupportEnabled = eANI_BOOLEAN_FALSE; |
| 7394 | } |
| 7395 | |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7396 | vos_mem_copy(pMac->scan.countryCodeCurrent, pMsg->countryCode, |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7397 | WNI_CFG_COUNTRY_CODE_LEN); |
| 7398 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 7399 | status = WDA_SetRegDomain(pMac, reg_domain_id, eSIR_TRUE); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7400 | |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7401 | if (VOS_FALSE == is11dCountry ) |
| 7402 | { |
| 7403 | /* overwrite the defualt country code */ |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7404 | vos_mem_copy(pMac->scan.countryCodeDefault, |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7405 | pMac->scan.countryCodeCurrent, WNI_CFG_COUNTRY_CODE_LEN); |
| 7406 | /* set to default domain ID */ |
| 7407 | pMac->scan.domainIdDefault = pMac->scan.domainIdCurrent; |
| 7408 | } |
| 7409 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7410 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7411 | { |
| 7412 | smsLog( pMac, LOGE, FL(" fail to set regId %d"), reg_domain_id ); |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7413 | return status; |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7414 | } |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7415 | else |
| 7416 | { |
| 7417 | //if 11d has priority, clear currentCountryBssid & countryCode11d to get |
| 7418 | //set again if we find AP with 11d info during scan |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7419 | if((!pMac->roam.configParam.fSupplicantCountryCodeHasPriority) && |
| 7420 | (VOS_FALSE == is11dCountry )) |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7421 | { |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7422 | smsLog( pMac, LOGW, FL("Clearing currentCountryBssid, countryCode11d")); |
Tushnim Bhattacharyya | c3022ef | 2013-10-24 15:58:56 -0700 | [diff] [blame] | 7423 | vos_mem_zero(&pMac->scan.currentCountryBssid, sizeof(tCsrBssid)); |
| 7424 | vos_mem_zero( pMac->scan.countryCode11d, sizeof( pMac->scan.countryCode11d ) ); |
| 7425 | } |
| 7426 | } |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7427 | |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7428 | /* get the channels based on new cc */ |
| 7429 | status = csrInitGetChannels(pMac); |
| 7430 | |
| 7431 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7432 | { |
| 7433 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
| 7434 | return status; |
| 7435 | } |
| 7436 | |
| 7437 | /* reset info based on new cc, and we are done */ |
| 7438 | csrResetCountryInformation(pMac, eANI_BOOLEAN_TRUE, eANI_BOOLEAN_TRUE); |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7439 | if (VOS_TRUE == is11dCountry) |
| 7440 | { |
Kiet Lam | 6c58333 | 2013-10-14 05:37:09 +0530 | [diff] [blame] | 7441 | pMac->scan.f11dInfoApplied = eANI_BOOLEAN_TRUE; |
| 7442 | pMac->scan.f11dInfoReset = eANI_BOOLEAN_FALSE; |
| 7443 | } |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7444 | /* Country code Changed, Purge Only scan result |
| 7445 | * which does not have channel number belong to 11d |
| 7446 | * channel list |
| 7447 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 7448 | csrScanFilterResults(pMac); |
Kiet Lam | bd5cd9b | 2013-11-11 19:01:45 +0530 | [diff] [blame] | 7449 | // Do active scans after the country is set by User hints or Country IE |
| 7450 | pMac->scan.curScanType = eSIR_ACTIVE_SCAN; |
| 7451 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7452 | smsLog(pMac, LOG1, FL(" returned")); |
| 7453 | return eHAL_STATUS_SUCCESS; |
| 7454 | } |
| 7455 | |
| 7456 | /* --------------------------------------------------------------------------- |
| 7457 | |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7458 | \fn sme_HandleChangeCountryCodeByCore |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7459 | |
| 7460 | \brief Update Country code in the driver if set by kernel as world |
| 7461 | |
| 7462 | If 11D is enabled, we update the country code after every scan & notify kernel. |
| 7463 | This is to make sure kernel & driver are in sync in case of CC found in |
| 7464 | driver but not in kernel database |
| 7465 | |
| 7466 | \param pMac - The handle returned by macOpen. |
| 7467 | \param pMsg - Carrying new CC set in kernel |
| 7468 | |
| 7469 | \return eHalStatus |
| 7470 | |
| 7471 | -------------------------------------------------------------------------------*/ |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7472 | eHalStatus sme_HandleChangeCountryCodeByCore(tpAniSirGlobal pMac, tAniGenericChangeCountryCodeReq *pMsg) |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7473 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7474 | eHalStatus status; |
| 7475 | |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7476 | smsLog(pMac, LOG1, FL(" called")); |
| 7477 | |
| 7478 | //this is to make sure kernel & driver are in sync in case of CC found in |
| 7479 | //driver but not in kernel database |
| 7480 | if (('0' == pMsg->countryCode[0]) && ('0' == pMsg->countryCode[1])) |
| 7481 | { |
Tushnim Bhattacharyya | 582ac1d | 2013-11-07 23:44:09 -0800 | [diff] [blame] | 7482 | smsLog( pMac, LOGW, FL("Setting countryCode11d & countryCodeCurrent to world CC")); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7483 | vos_mem_copy(pMac->scan.countryCode11d, pMsg->countryCode, |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7484 | WNI_CFG_COUNTRY_CODE_LEN); |
Kiet Lam | f2f201e | 2013-11-16 21:24:16 +0530 | [diff] [blame] | 7485 | vos_mem_copy(pMac->scan.countryCodeCurrent, pMsg->countryCode, |
Tushnim Bhattacharyya | 582ac1d | 2013-11-07 23:44:09 -0800 | [diff] [blame] | 7486 | WNI_CFG_COUNTRY_CODE_LEN); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7487 | } |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7488 | |
Abhishek Singh | a306a44 | 2013-11-07 18:39:01 +0530 | [diff] [blame] | 7489 | status = WDA_SetRegDomain(pMac, REGDOMAIN_WORLD, eSIR_TRUE); |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7490 | |
| 7491 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7492 | { |
| 7493 | smsLog( pMac, LOGE, FL(" fail to set regId") ); |
| 7494 | return status; |
| 7495 | } |
| 7496 | else |
| 7497 | { |
| 7498 | status = csrInitGetChannels(pMac); |
| 7499 | if ( status != eHAL_STATUS_SUCCESS ) |
| 7500 | { |
| 7501 | smsLog( pMac, LOGE, FL(" fail to get Channels ")); |
| 7502 | } |
| 7503 | else |
| 7504 | { |
| 7505 | csrInitChannelList(pMac); |
| 7506 | } |
| 7507 | } |
Agarwal Ashish | faef669 | 2014-01-29 19:40:30 +0530 | [diff] [blame] | 7508 | /* Country code Changed, Purge Only scan result |
| 7509 | * which does not have channel number belong to 11d |
| 7510 | * channel list |
| 7511 | */ |
Srinivas, Dasari | 42bf770 | 2014-02-07 11:29:53 +0530 | [diff] [blame] | 7512 | csrScanFilterResults(pMac); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7513 | smsLog(pMac, LOG1, FL(" returned")); |
| 7514 | return eHAL_STATUS_SUCCESS; |
| 7515 | } |
| 7516 | |
| 7517 | /* --------------------------------------------------------------------------- |
| 7518 | |
| 7519 | \fn sme_HandleGenericChangeCountryCode |
| 7520 | |
| 7521 | \brief Change Country code, Reg Domain and channel list |
| 7522 | |
| 7523 | If Supplicant country code is priority than 11d is disabled. |
| 7524 | If 11D is enabled, we update the country code after every scan. |
| 7525 | Hence when Supplicant country code is priority, we don't need 11D info. |
| 7526 | Country code from kernel is set as current country code. |
| 7527 | |
| 7528 | \param pMac - The handle returned by macOpen. |
| 7529 | \param pMsgBuf - message buffer |
| 7530 | |
| 7531 | \return eHalStatus |
| 7532 | |
| 7533 | -------------------------------------------------------------------------------*/ |
| 7534 | eHalStatus sme_HandleGenericChangeCountryCode(tpAniSirGlobal pMac, void *pMsgBuf) |
| 7535 | { |
| 7536 | tAniGenericChangeCountryCodeReq *pMsg; |
| 7537 | v_REGDOMAIN_t reg_domain_id; |
| 7538 | |
| 7539 | smsLog(pMac, LOG1, FL(" called")); |
| 7540 | pMsg = (tAniGenericChangeCountryCodeReq *)pMsgBuf; |
| 7541 | reg_domain_id = (v_REGDOMAIN_t)pMsg->domain_index; |
| 7542 | |
| 7543 | if (REGDOMAIN_COUNT == reg_domain_id) |
| 7544 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 7545 | sme_HandleChangeCountryCodeByCore(pMac, pMsg); |
Tushnim Bhattacharyya | c3c1e8e | 2013-10-29 17:27:43 -0700 | [diff] [blame] | 7546 | } |
| 7547 | else |
| 7548 | { |
| 7549 | sme_HandleChangeCountryCodeByUser(pMac, pMsg); |
| 7550 | } |
| 7551 | smsLog(pMac, LOG1, FL(" returned")); |
Amar Singhal | 0d15bd5 | 2013-10-12 23:13:13 -0700 | [diff] [blame] | 7552 | return eHAL_STATUS_SUCCESS; |
| 7553 | } |
| 7554 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7555 | #ifdef WLAN_FEATURE_PACKET_FILTERING |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 7556 | eHalStatus sme_8023MulticastList (tHalHandle hHal, tANI_U8 sessionId, tpSirRcvFltMcAddrList pMulticastAddrs) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7557 | { |
| 7558 | tpSirRcvFltMcAddrList pRequestBuf; |
| 7559 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7560 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7561 | tCsrRoamSession *pSession = NULL; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7562 | |
| 7563 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "%s: " |
Gopichand Nakkala | 66c0bd0 | 2013-04-10 11:36:29 +0530 | [diff] [blame] | 7564 | "ulMulticastAddrCnt=%d, multicastAddr[0]=%p", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7565 | pMulticastAddrs->ulMulticastAddrCnt, |
| 7566 | pMulticastAddrs->multicastAddr[0]); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7567 | |
| 7568 | /* |
| 7569 | *Find the connected Infra / P2P_client connected session |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 7570 | */ |
| 7571 | if (CSR_IS_SESSION_VALID(pMac, sessionId) && |
| 7572 | csrIsConnStateInfra(pMac, sessionId)) |
| 7573 | { |
| 7574 | pSession = CSR_GET_SESSION( pMac, sessionId ); |
| 7575 | } |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7576 | |
| 7577 | if(pSession == NULL ) |
| 7578 | { |
| 7579 | 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] | 7580 | "the right session", __func__); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7581 | return eHAL_STATUS_FAILURE; |
| 7582 | } |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 7583 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7584 | pRequestBuf = vos_mem_malloc(sizeof(tSirRcvFltMcAddrList)); |
| 7585 | if (NULL == pRequestBuf) |
| 7586 | { |
| 7587 | 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] | 7588 | "allocate memory for 8023 Multicast List request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7589 | return eHAL_STATUS_FAILED_ALLOC; |
| 7590 | } |
Amar Singhal | f3a6e76 | 2013-02-19 15:06:50 -0800 | [diff] [blame] | 7591 | |
| 7592 | if( !csrIsConnStateConnectedInfra (pMac, sessionId )) |
| 7593 | { |
| 7594 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, "%s: Ignoring the " |
| 7595 | "indication as we are not connected", __func__); |
| 7596 | vos_mem_free(pRequestBuf); |
| 7597 | return eHAL_STATUS_FAILURE; |
| 7598 | } |
| 7599 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7600 | vos_mem_copy(pRequestBuf, pMulticastAddrs, sizeof(tSirRcvFltMcAddrList)); |
| 7601 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7602 | vos_mem_copy(pRequestBuf->selfMacAddr, pSession->selfMacAddr, |
| 7603 | sizeof(tSirMacAddr)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7604 | vos_mem_copy(pRequestBuf->bssId, pSession->connectedProfile.bssid, |
| 7605 | sizeof(tSirMacAddr)); |
| 7606 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7607 | msg.type = WDA_8023_MULTICAST_LIST_REQ; |
| 7608 | msg.reserved = 0; |
| 7609 | msg.bodyptr = pRequestBuf; |
| 7610 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7611 | { |
| 7612 | 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] | 7613 | "post WDA_8023_MULTICAST_LIST message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7614 | vos_mem_free(pRequestBuf); |
| 7615 | return eHAL_STATUS_FAILURE; |
| 7616 | } |
| 7617 | |
| 7618 | return eHAL_STATUS_SUCCESS; |
| 7619 | } |
| 7620 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7621 | eHalStatus sme_ReceiveFilterSetFilter(tHalHandle hHal, tpSirRcvPktFilterCfgType pRcvPktFilterCfg, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7622 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7623 | { |
| 7624 | tpSirRcvPktFilterCfgType pRequestBuf; |
| 7625 | v_SINT_t allocSize; |
| 7626 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7627 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7628 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7629 | v_U8_t idx=0; |
| 7630 | |
| 7631 | 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] | 7632 | "filterId = %d", __func__, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7633 | pRcvPktFilterCfg->filterType, pRcvPktFilterCfg->filterId); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7634 | |
Madan Mohan Koyyalamudi | d402962 | 2012-10-18 20:30:17 -0700 | [diff] [blame] | 7635 | allocSize = sizeof(tSirRcvPktFilterCfgType); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7636 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7637 | pRequestBuf = vos_mem_malloc(allocSize); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7638 | |
| 7639 | if (NULL == pRequestBuf) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7640 | { |
| 7641 | 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] | 7642 | "allocate memory for Receive Filter Set Filter request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7643 | return eHAL_STATUS_FAILED_ALLOC; |
| 7644 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7645 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7646 | if( NULL == pSession ) |
| 7647 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7648 | 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] | 7649 | vos_mem_free(pRequestBuf); |
| 7650 | return eHAL_STATUS_FAILURE; |
| 7651 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7652 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7653 | vos_mem_copy(pRcvPktFilterCfg->selfMacAddr, pSession->selfMacAddr, |
| 7654 | sizeof(tSirMacAddr)); |
| 7655 | vos_mem_copy(pRcvPktFilterCfg->bssId, pSession->connectedProfile.bssid, |
| 7656 | sizeof(tSirMacAddr)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7657 | vos_mem_copy(pRequestBuf, pRcvPktFilterCfg, allocSize); |
| 7658 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7659 | msg.type = WDA_RECEIVE_FILTER_SET_FILTER_REQ; |
| 7660 | msg.reserved = 0; |
| 7661 | msg.bodyptr = pRequestBuf; |
| 7662 | |
| 7663 | 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] | 7664 | "FT %d FID %d ", |
| 7665 | pRequestBuf->filterType, pRequestBuf->filterId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7666 | |
| 7667 | 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] | 7668 | "params %d CT %d", |
| 7669 | pRequestBuf->numFieldParams, pRequestBuf->coalesceTime); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7670 | |
| 7671 | for (idx=0; idx<pRequestBuf->numFieldParams; idx++) |
| 7672 | { |
| 7673 | |
| 7674 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7675 | "Proto %d Comp Flag %d ", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7676 | pRequestBuf->paramsData[idx].protocolLayer, |
| 7677 | pRequestBuf->paramsData[idx].cmpFlag); |
| 7678 | |
| 7679 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7680 | "Data Offset %d Data Len %d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7681 | pRequestBuf->paramsData[idx].dataOffset, |
| 7682 | pRequestBuf->paramsData[idx].dataLength); |
| 7683 | |
| 7684 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7685 | "CData: %d:%d:%d:%d:%d:%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7686 | pRequestBuf->paramsData[idx].compareData[0], |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7687 | pRequestBuf->paramsData[idx].compareData[1], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7688 | pRequestBuf->paramsData[idx].compareData[2], |
| 7689 | pRequestBuf->paramsData[idx].compareData[3], |
| 7690 | pRequestBuf->paramsData[idx].compareData[4], |
| 7691 | pRequestBuf->paramsData[idx].compareData[5]); |
| 7692 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7693 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7694 | "MData: %d:%d:%d:%d:%d:%d", |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7695 | pRequestBuf->paramsData[idx].dataMask[0], |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7696 | pRequestBuf->paramsData[idx].dataMask[1], |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7697 | pRequestBuf->paramsData[idx].dataMask[2], |
| 7698 | pRequestBuf->paramsData[idx].dataMask[3], |
| 7699 | pRequestBuf->paramsData[idx].dataMask[4], |
| 7700 | pRequestBuf->paramsData[idx].dataMask[5]); |
| 7701 | |
| 7702 | } |
| 7703 | |
| 7704 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7705 | { |
| 7706 | 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] | 7707 | "WDA_RECEIVE_FILTER_SET_FILTER message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7708 | vos_mem_free(pRequestBuf); |
| 7709 | return eHAL_STATUS_FAILURE; |
| 7710 | } |
| 7711 | |
| 7712 | return eHAL_STATUS_SUCCESS; |
| 7713 | } |
| 7714 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7715 | eHalStatus sme_GetFilterMatchCount(tHalHandle hHal, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7716 | FilterMatchCountCallback callbackRoutine, |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7717 | void *callbackContext, |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7718 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7719 | { |
| 7720 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7721 | eHalStatus status; |
| 7722 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7723 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "+%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7724 | |
| 7725 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme))) |
| 7726 | { |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7727 | pmcGetFilterMatchCount(hHal, callbackRoutine, callbackContext, sessionId); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7728 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7729 | } |
| 7730 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7731 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, "-%s", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7732 | |
| 7733 | return (status); |
| 7734 | } |
| 7735 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7736 | eHalStatus sme_ReceiveFilterClearFilter(tHalHandle hHal, tpSirRcvFltPktClearParam pRcvFltPktClearParam, |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7737 | tANI_U8 sessionId) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7738 | { |
| 7739 | tpSirRcvFltPktClearParam pRequestBuf; |
| 7740 | vos_msg_t msg; |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7741 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7742 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7743 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7744 | 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] | 7745 | pRcvFltPktClearParam->filterId); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7746 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7747 | pRequestBuf = vos_mem_malloc(sizeof(tSirRcvFltPktClearParam)); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7748 | if (NULL == pRequestBuf) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7749 | { |
| 7750 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 7751 | "%s: Not able to allocate memory for Receive Filter " |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7752 | "Clear Filter request", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7753 | return eHAL_STATUS_FAILED_ALLOC; |
| 7754 | } |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7755 | if( NULL == pSession ) |
| 7756 | { |
| 7757 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7758 | "%s: Session Not find ", __func__); |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7759 | vos_mem_free(pRequestBuf); |
| 7760 | return eHAL_STATUS_FAILURE; |
| 7761 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7762 | |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7763 | vos_mem_copy(pRcvFltPktClearParam->selfMacAddr, pSession->selfMacAddr, |
| 7764 | sizeof(tSirMacAddr)); |
| 7765 | vos_mem_copy(pRcvFltPktClearParam->bssId, pSession->connectedProfile.bssid, |
| 7766 | sizeof(tSirMacAddr)); |
Jeff Johnson | e724574 | 2012-09-05 17:12:55 -0700 | [diff] [blame] | 7767 | |
Madan Mohan Koyyalamudi | 96dd30d | 2012-10-05 17:24:51 -0700 | [diff] [blame] | 7768 | vos_mem_copy(pRequestBuf, pRcvFltPktClearParam, sizeof(tSirRcvFltPktClearParam)); |
| 7769 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7770 | msg.type = WDA_RECEIVE_FILTER_CLEAR_FILTER_REQ; |
| 7771 | msg.reserved = 0; |
| 7772 | msg.bodyptr = pRequestBuf; |
| 7773 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 7774 | { |
| 7775 | 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] | 7776 | "WDA_RECEIVE_FILTER_CLEAR_FILTER message to WDA", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7777 | vos_mem_free(pRequestBuf); |
| 7778 | return eHAL_STATUS_FAILURE; |
| 7779 | } |
| 7780 | |
| 7781 | return eHAL_STATUS_SUCCESS; |
| 7782 | } |
| 7783 | #endif // WLAN_FEATURE_PACKET_FILTERING |
| 7784 | |
| 7785 | /* --------------------------------------------------------------------------- |
| 7786 | \fn sme_PreChannelSwitchIndFullPowerCB |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7787 | \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] | 7788 | channel switch. |
| 7789 | \param callbackContext |
| 7790 | \param status |
| 7791 | ---------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7792 | void sme_PreChannelSwitchIndFullPowerCB(void *callbackContext, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7793 | eHalStatus status) |
| 7794 | { |
| 7795 | tpAniSirGlobal pMac = (tpAniSirGlobal)callbackContext; |
| 7796 | tSirMbMsg *pMsg; |
| 7797 | tANI_U16 msgLen; |
| 7798 | |
| 7799 | msgLen = (tANI_U16)(sizeof( tSirMbMsg )); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7800 | pMsg = vos_mem_malloc(msgLen); |
| 7801 | if ( NULL != pMsg ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7802 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7803 | vos_mem_set(pMsg, msgLen, 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7804 | pMsg->type = pal_cpu_to_be16((tANI_U16)eWNI_SME_PRE_CHANNEL_SWITCH_FULL_POWER); |
| 7805 | pMsg->msgLen = pal_cpu_to_be16(msgLen); |
| 7806 | status = palSendMBMessage(pMac->hHdd, pMsg); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7807 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7808 | |
| 7809 | return; |
| 7810 | } |
| 7811 | |
| 7812 | /* --------------------------------------------------------------------------- |
| 7813 | \fn sme_HandlePreChannelSwitchInd |
| 7814 | \brief Processes the indcation from PE for pre-channel switch. |
| 7815 | \param hHal |
| 7816 | \- The handle returned by macOpen. return eHalStatus |
| 7817 | ---------------------------------------------------------------------------*/ |
| 7818 | eHalStatus sme_HandlePreChannelSwitchInd(tHalHandle hHal) |
| 7819 | { |
| 7820 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7821 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7822 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7823 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7824 | { |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7825 | status = pmcRequestFullPower(hHal, sme_PreChannelSwitchIndFullPowerCB, |
| 7826 | pMac, eSME_FULL_PWR_NEEDED_BY_CHANNEL_SWITCH); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7827 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7828 | } |
| 7829 | |
| 7830 | return (status); |
| 7831 | } |
| 7832 | |
| 7833 | /* --------------------------------------------------------------------------- |
| 7834 | \fn sme_HandlePostChannelSwitchInd |
| 7835 | \brief Processes the indcation from PE for post-channel switch. |
| 7836 | \param hHal |
| 7837 | \- The handle returned by macOpen. return eHalStatus |
| 7838 | ---------------------------------------------------------------------------*/ |
| 7839 | eHalStatus sme_HandlePostChannelSwitchInd(tHalHandle hHal) |
| 7840 | { |
| 7841 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7842 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7843 | |
| 7844 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7845 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7846 | { |
| 7847 | status = pmcRequestBmps(hHal, NULL, NULL); |
| 7848 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7849 | } |
| 7850 | |
| 7851 | return (status); |
| 7852 | } |
| 7853 | |
| 7854 | /* --------------------------------------------------------------------------- |
| 7855 | |
| 7856 | \fn sme_IsChannelValid |
| 7857 | |
| 7858 | \brief To check if the channel is valid for currently established domain |
| 7859 | This is a synchronous API. |
| 7860 | |
| 7861 | \param hHal - The handle returned by macOpen. |
| 7862 | \param channel - channel to verify |
| 7863 | |
| 7864 | \return TRUE/FALSE, TRUE if channel is valid |
| 7865 | |
| 7866 | -------------------------------------------------------------------------------*/ |
| 7867 | tANI_BOOLEAN sme_IsChannelValid(tHalHandle hHal, tANI_U8 channel) |
| 7868 | { |
| 7869 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7870 | tANI_BOOLEAN valid = FALSE; |
| 7871 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7872 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7873 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7874 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7875 | { |
| 7876 | |
| 7877 | valid = csrRoamIsChannelValid( pMac, channel); |
| 7878 | |
| 7879 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7880 | } |
| 7881 | |
| 7882 | return (valid); |
| 7883 | } |
| 7884 | |
| 7885 | /* --------------------------------------------------------------------------- |
| 7886 | \fn sme_SetFreqBand |
| 7887 | \brief Used to set frequency band. |
| 7888 | \param hHal |
| 7889 | \eBand band value to be configured |
| 7890 | \- return eHalStatus |
| 7891 | -------------------------------------------------------------------------*/ |
| 7892 | eHalStatus sme_SetFreqBand(tHalHandle hHal, eCsrBand eBand) |
| 7893 | { |
| 7894 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7895 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7896 | |
| 7897 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7898 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7899 | { |
| 7900 | status = csrSetBand(hHal, eBand); |
| 7901 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7902 | } |
| 7903 | return status; |
| 7904 | } |
| 7905 | |
| 7906 | /* --------------------------------------------------------------------------- |
| 7907 | \fn sme_GetFreqBand |
| 7908 | \brief Used to get the current band settings. |
| 7909 | \param hHal |
| 7910 | \pBand pointer to hold band value |
| 7911 | \- return eHalStatus |
| 7912 | -------------------------------------------------------------------------*/ |
| 7913 | eHalStatus sme_GetFreqBand(tHalHandle hHal, eCsrBand *pBand) |
| 7914 | { |
| 7915 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 7916 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 7917 | |
| 7918 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 7919 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 7920 | { |
| 7921 | *pBand = csrGetCurrentBand( hHal ); |
| 7922 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 7923 | } |
| 7924 | return status; |
| 7925 | } |
| 7926 | |
| 7927 | #ifdef WLAN_WAKEUP_EVENTS |
| 7928 | /****************************************************************************** |
| 7929 | \fn sme_WakeReasonIndCallback |
| 7930 | |
| 7931 | \brief |
| 7932 | a callback function called when SME received eWNI_SME_WAKE_REASON_IND event from WDA |
| 7933 | |
| 7934 | \param hHal - HAL handle for device |
| 7935 | \param pMsg - Message body passed from WDA; includes Wake Reason Indication parameter |
| 7936 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7937 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7938 | ******************************************************************************/ |
| 7939 | eHalStatus sme_WakeReasonIndCallback (tHalHandle hHal, void* pMsg) |
| 7940 | { |
| 7941 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 7942 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 7943 | tSirWakeReasonInd *pWakeReasonInd = (tSirWakeReasonInd *)pMsg; |
| 7944 | |
| 7945 | if (NULL == pMsg) |
| 7946 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7947 | smsLog(pMac, LOGE, "in %s msg ptr is NULL", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7948 | status = eHAL_STATUS_FAILURE; |
| 7949 | } |
| 7950 | else |
| 7951 | { |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 7952 | smsLog(pMac, LOG2, "SME: entering sme_WakeReasonIndCallback"); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7953 | |
| 7954 | /* Call Wake Reason Indication callback routine. */ |
| 7955 | if (pMac->pmc.wakeReasonIndCB != NULL) |
| 7956 | pMac->pmc.wakeReasonIndCB(pMac->pmc.wakeReasonIndCBContext, pWakeReasonInd); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7957 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7958 | pMac->pmc.wakeReasonIndCB = NULL; |
| 7959 | pMac->pmc.wakeReasonIndCBContext = NULL; |
| 7960 | |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7961 | 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] | 7962 | } |
| 7963 | |
| 7964 | return(status); |
| 7965 | } |
| 7966 | #endif // WLAN_WAKEUP_EVENTS |
| 7967 | |
| 7968 | |
| 7969 | /* --------------------------------------------------------------------------- |
| 7970 | |
| 7971 | \fn sme_SetMaxTxPower |
| 7972 | |
| 7973 | \brief Set the Maximum Transmit Power dynamically. Note: this setting will |
| 7974 | not persist over reboots. |
| 7975 | |
| 7976 | \param hHal |
| 7977 | \param pBssid BSSID to set the power cap for |
| 7978 | \param pBssid pSelfMacAddress self MAC Address |
| 7979 | \param pBssid power to set in dB |
| 7980 | \- return eHalStatus |
| 7981 | |
| 7982 | -------------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 7983 | eHalStatus sme_SetMaxTxPower(tHalHandle hHal, tSirMacAddr pBssid, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7984 | tSirMacAddr pSelfMacAddress, v_S7_t dB) |
| 7985 | { |
| 7986 | vos_msg_t msg; |
| 7987 | tpMaxTxPowerParams pMaxTxParams = NULL; |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 7988 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 7989 | TRACE_CODE_SME_RX_HDD_SET_MAXTXPOW, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7990 | pMaxTxParams = vos_mem_malloc(sizeof(tMaxTxPowerParams)); |
| 7991 | if (NULL == pMaxTxParams) |
| 7992 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 7993 | 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] | 7994 | return eHAL_STATUS_FAILURE; |
| 7995 | } |
| 7996 | |
| 7997 | vos_mem_copy(pMaxTxParams->bssId, pBssid, SIR_MAC_ADDR_LENGTH); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 7998 | vos_mem_copy(pMaxTxParams->selfStaMacAddr, pSelfMacAddress, |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 7999 | SIR_MAC_ADDR_LENGTH); |
| 8000 | pMaxTxParams->power = dB; |
| 8001 | |
| 8002 | msg.type = WDA_SET_MAX_TX_POWER_REQ; |
| 8003 | msg.reserved = 0; |
| 8004 | msg.bodyptr = pMaxTxParams; |
| 8005 | |
| 8006 | if(VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8007 | { |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8008 | 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] | 8009 | vos_mem_free(pMaxTxParams); |
| 8010 | return eHAL_STATUS_FAILURE; |
| 8011 | } |
| 8012 | |
| 8013 | return eHAL_STATUS_SUCCESS; |
| 8014 | } |
| 8015 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8016 | /* --------------------------------------------------------------------------- |
| 8017 | |
Arif Hussain | a5ebce0 | 2013-08-09 15:09:58 -0700 | [diff] [blame] | 8018 | \fn sme_SetMaxTxPowerPerBand |
| 8019 | |
| 8020 | \brief Set the Maximum Transmit Power specific to band dynamically. |
| 8021 | Note: this setting will not persist over reboots. |
| 8022 | |
| 8023 | \param band |
| 8024 | \param power to set in dB |
| 8025 | \- return eHalStatus |
| 8026 | |
| 8027 | ----------------------------------------------------------------------------*/ |
| 8028 | eHalStatus sme_SetMaxTxPowerPerBand(eCsrBand band, v_S7_t dB) |
| 8029 | { |
| 8030 | vos_msg_t msg; |
| 8031 | tpMaxTxPowerPerBandParams pMaxTxPowerPerBandParams = NULL; |
| 8032 | |
| 8033 | pMaxTxPowerPerBandParams = vos_mem_malloc(sizeof(tMaxTxPowerPerBandParams)); |
| 8034 | if (NULL == pMaxTxPowerPerBandParams) |
| 8035 | { |
| 8036 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8037 | "%s:Not able to allocate memory for pMaxTxPowerPerBandParams", |
| 8038 | __func__); |
| 8039 | return eHAL_STATUS_FAILURE; |
| 8040 | } |
| 8041 | |
| 8042 | pMaxTxPowerPerBandParams->power = dB; |
| 8043 | pMaxTxPowerPerBandParams->bandInfo = band; |
| 8044 | |
| 8045 | msg.type = WDA_SET_MAX_TX_POWER_PER_BAND_REQ; |
| 8046 | msg.reserved = 0; |
| 8047 | msg.bodyptr = pMaxTxPowerPerBandParams; |
| 8048 | |
| 8049 | if (VOS_STATUS_SUCCESS != vos_mq_post_message(VOS_MODULE_ID_WDA, &msg)) |
| 8050 | { |
| 8051 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8052 | "%s:Not able to post WDA_SET_MAX_TX_POWER_PER_BAND_REQ", |
| 8053 | __func__); |
| 8054 | vos_mem_free(pMaxTxPowerPerBandParams); |
| 8055 | return eHAL_STATUS_FAILURE; |
| 8056 | } |
| 8057 | |
| 8058 | return eHAL_STATUS_SUCCESS; |
| 8059 | } |
| 8060 | |
| 8061 | /* --------------------------------------------------------------------------- |
| 8062 | |
schang | 86c22c4 | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 8063 | \fn sme_SetTxPower |
| 8064 | |
| 8065 | \brief Set Transmit Power dynamically. Note: this setting will |
| 8066 | not persist over reboots. |
| 8067 | |
| 8068 | \param hHal |
| 8069 | \param sessionId Target Session ID |
| 8070 | \param mW power to set in mW |
| 8071 | \- return eHalStatus |
| 8072 | |
| 8073 | -------------------------------------------------------------------------------*/ |
| 8074 | eHalStatus sme_SetTxPower(tHalHandle hHal, v_U8_t sessionId, v_U8_t mW) |
| 8075 | { |
| 8076 | |
| 8077 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 8078 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8079 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8080 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8081 | TRACE_CODE_SME_RX_HDD_SET_TXPOW, NO_SESSION, 0)); |
schang | 86c22c4 | 2013-03-13 18:41:24 -0700 | [diff] [blame] | 8082 | smsLog(pMac, LOG1, FL("set tx power %dmW"), mW); |
| 8083 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 8084 | if (HAL_STATUS_SUCCESS(status)) |
| 8085 | { |
| 8086 | status = csrSetTxPower(pMac, sessionId, mW); |
| 8087 | sme_ReleaseGlobalLock(&pMac->sme); |
| 8088 | } |
| 8089 | return status; |
| 8090 | } |
| 8091 | |
| 8092 | /* --------------------------------------------------------------------------- |
| 8093 | |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8094 | \fn sme_HideSSID |
| 8095 | |
| 8096 | \brief hide/show SSID dynamically. Note: this setting will |
| 8097 | not persist over reboots. |
| 8098 | |
| 8099 | \param hHal |
| 8100 | \param sessionId |
| 8101 | \param ssidHidden 0 - Broadcast SSID, 1 - Disable broadcast SSID |
| 8102 | \- return eHalStatus |
| 8103 | |
| 8104 | -------------------------------------------------------------------------------*/ |
| 8105 | eHalStatus sme_HideSSID(tHalHandle hHal, v_U8_t sessionId, v_U8_t ssidHidden) |
| 8106 | { |
| 8107 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8108 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8109 | tANI_U16 len; |
| 8110 | |
| 8111 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8112 | { |
| 8113 | tpSirUpdateParams pMsg; |
| 8114 | tCsrRoamSession *pSession = CSR_GET_SESSION( pMac, sessionId ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 8115 | |
| 8116 | if(!pSession) |
| 8117 | { |
| 8118 | 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] | 8119 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 32d95a3 | 2012-09-10 13:15:23 -0700 | [diff] [blame] | 8120 | return eHAL_STATUS_FAILURE; |
| 8121 | } |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8122 | |
| 8123 | if( !pSession->sessionActive ) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8124 | VOS_ASSERT(0); |
| 8125 | |
| 8126 | /* Create the message and send to lim */ |
| 8127 | len = sizeof(tSirUpdateParams); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8128 | pMsg = vos_mem_malloc(len); |
| 8129 | if ( NULL == pMsg ) |
| 8130 | status = eHAL_STATUS_FAILURE; |
| 8131 | else |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8132 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8133 | vos_mem_set(pMsg, sizeof(tSirUpdateParams), 0); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8134 | pMsg->messageType = eWNI_SME_HIDE_SSID_REQ; |
| 8135 | pMsg->length = len; |
| 8136 | /* Data starts from here */ |
| 8137 | pMsg->sessionId = sessionId; |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8138 | pMsg->ssidHidden = ssidHidden; |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8139 | status = palSendMBMessage(pMac->hHdd, pMsg); |
| 8140 | } |
| 8141 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8142 | } |
| 8143 | return status; |
| 8144 | } |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8145 | |
| 8146 | /* --------------------------------------------------------------------------- |
| 8147 | |
| 8148 | \fn sme_SetTmLevel |
| 8149 | \brief Set Thermal Mitigation Level to RIVA |
| 8150 | \param hHal - The handle returned by macOpen. |
| 8151 | \param newTMLevel - new Thermal Mitigation Level |
| 8152 | \param tmMode - Thermal Mitigation handle mode, default 0 |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8153 | \return eHalStatus |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8154 | ---------------------------------------------------------------------------*/ |
| 8155 | eHalStatus sme_SetTmLevel(tHalHandle hHal, v_U16_t newTMLevel, v_U16_t tmMode) |
| 8156 | { |
| 8157 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8158 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 8159 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8160 | vos_msg_t vosMessage; |
| 8161 | tAniSetTmLevelReq *setTmLevelReq = NULL; |
| 8162 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8163 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8164 | TRACE_CODE_SME_RX_HDD_SET_TMLEVEL, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8165 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ) ) ) |
| 8166 | { |
| 8167 | setTmLevelReq = (tAniSetTmLevelReq *)vos_mem_malloc(sizeof(tAniSetTmLevelReq)); |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 8168 | if (NULL == setTmLevelReq) |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8169 | { |
| 8170 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8171 | "%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] | 8172 | sme_ReleaseGlobalLock( &pMac->sme ); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8173 | return eHAL_STATUS_FAILURE; |
| 8174 | } |
| 8175 | |
| 8176 | setTmLevelReq->tmMode = tmMode; |
| 8177 | setTmLevelReq->newTmLevel = newTMLevel; |
| 8178 | |
| 8179 | /* serialize the req through MC thread */ |
| 8180 | vosMessage.bodyptr = setTmLevelReq; |
| 8181 | vosMessage.type = WDA_SET_TM_LEVEL_REQ; |
| 8182 | vosStatus = vos_mq_post_message( VOS_MQ_ID_WDA, &vosMessage ); |
| 8183 | if ( !VOS_IS_STATUS_SUCCESS(vosStatus) ) |
| 8184 | { |
| 8185 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Madan Mohan Koyyalamudi | 87054ba | 2012-11-02 13:24:12 -0700 | [diff] [blame] | 8186 | "%s: Post Set TM Level MSG fail", __func__); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8187 | vos_mem_free(setTmLevelReq); |
| 8188 | status = eHAL_STATUS_FAILURE; |
| 8189 | } |
| 8190 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8191 | } |
| 8192 | return(status); |
| 8193 | } |
| 8194 | |
| 8195 | /*--------------------------------------------------------------------------- |
| 8196 | |
| 8197 | \brief sme_featureCapsExchange() - SME interface to exchange capabilities between |
| 8198 | Host and FW. |
| 8199 | |
| 8200 | \param hHal - HAL handle for device |
| 8201 | |
| 8202 | \return NONE |
| 8203 | |
| 8204 | ---------------------------------------------------------------------------*/ |
| 8205 | void sme_featureCapsExchange( tHalHandle hHal) |
| 8206 | { |
| 8207 | 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] | 8208 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8209 | TRACE_CODE_SME_RX_HDD_CAPS_EXCH, NO_SESSION, 0)); |
Jeff Johnson | 295189b | 2012-06-20 16:38:30 -0700 | [diff] [blame] | 8210 | WDA_featureCapsExchange(vosContext); |
| 8211 | } |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8212 | |
Yathish | 9f22e66 | 2012-12-10 14:21:35 -0800 | [diff] [blame] | 8213 | /*--------------------------------------------------------------------------- |
| 8214 | |
| 8215 | \brief sme_disableFeatureCapablity() - SME interface to disable Active mode offload capablity |
| 8216 | in Host. |
| 8217 | |
| 8218 | \param hHal - HAL handle for device |
| 8219 | |
| 8220 | \return NONE |
| 8221 | |
| 8222 | ---------------------------------------------------------------------------*/ |
| 8223 | void sme_disableFeatureCapablity(tANI_U8 feature_index) |
| 8224 | { |
| 8225 | WDA_disableCapablityFeature(feature_index); |
| 8226 | } |
| 8227 | |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8228 | /* --------------------------------------------------------------------------- |
| 8229 | |
| 8230 | \fn sme_GetDefaultCountryCode |
| 8231 | |
| 8232 | \brief Get the default country code from NV |
| 8233 | |
| 8234 | \param hHal |
| 8235 | \param pCountry |
| 8236 | \- return eHalStatus |
| 8237 | |
| 8238 | -------------------------------------------------------------------------------*/ |
| 8239 | eHalStatus sme_GetDefaultCountryCodeFrmNv(tHalHandle hHal, tANI_U8 *pCountry) |
| 8240 | { |
| 8241 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8242 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8243 | TRACE_CODE_SME_RX_HDD_GET_DEFCCNV, NO_SESSION, 0)); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8244 | return csrGetDefaultCountryCodeFrmNv(pMac, pCountry); |
| 8245 | } |
| 8246 | |
| 8247 | /* --------------------------------------------------------------------------- |
| 8248 | |
| 8249 | \fn sme_GetCurrentCountryCode |
| 8250 | |
| 8251 | \brief Get the current country code |
| 8252 | |
| 8253 | \param hHal |
| 8254 | \param pCountry |
| 8255 | \- return eHalStatus |
| 8256 | |
| 8257 | -------------------------------------------------------------------------------*/ |
| 8258 | eHalStatus sme_GetCurrentCountryCode(tHalHandle hHal, tANI_U8 *pCountry) |
| 8259 | { |
| 8260 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8261 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8262 | TRACE_CODE_SME_RX_HDD_GET_CURCC, NO_SESSION, 0)); |
Jeff Johnson | d13512a | 2012-07-17 11:42:19 -0700 | [diff] [blame] | 8263 | return csrGetCurrentCountryCode(pMac, pCountry); |
| 8264 | } |
| 8265 | |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 8266 | /* --------------------------------------------------------------------------- |
| 8267 | \fn sme_transportDebug |
| 8268 | \brief Dynamically monitoring Transport channels |
| 8269 | Private IOCTL will querry transport channel status if driver loaded |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8270 | \param hHal Upper MAC context |
Jeff Johnson | b88db98 | 2012-12-10 13:34:59 -0800 | [diff] [blame] | 8271 | \param displaySnapshot Display transport channel snapshot option |
Madan Mohan Koyyalamudi | 8cb5398 | 2012-09-28 14:34:47 -0700 | [diff] [blame] | 8272 | \param toggleStallDetect Enable stall detect feature |
| 8273 | This feature will take effect to data performance |
| 8274 | Not integrate till fully verification |
| 8275 | \- return NONE |
| 8276 | -------------------------------------------------------------------------*/ |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8277 | 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] | 8278 | { |
schang | 6295e54 | 2013-03-12 15:31:23 -0700 | [diff] [blame] | 8279 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 8280 | |
| 8281 | if (NULL == pMac) |
| 8282 | { |
| 8283 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 8284 | "%s: invalid context", __func__); |
| 8285 | return; |
| 8286 | } |
| 8287 | WDA_TransportChannelDebug(pMac, displaySnapshot, toggleStallDetect); |
Madan Mohan Koyyalamudi | 3b230fe | 2012-10-18 14:46:32 -0700 | [diff] [blame] | 8288 | } |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 8289 | |
Kiran | 4a17ebe | 2013-01-31 10:43:43 -0800 | [diff] [blame] | 8290 | /* --------------------------------------------------------------------------- |
| 8291 | \fn sme_ResetPowerValuesFor5G |
| 8292 | \brief Reset the power values for 5G band with NV power values. |
| 8293 | \param hHal - HAL handle for device |
| 8294 | \- return NONE |
| 8295 | -------------------------------------------------------------------------*/ |
| 8296 | void sme_ResetPowerValuesFor5G (tHalHandle hHal) |
| 8297 | { |
| 8298 | tpAniSirGlobal pMac = PMAC_STRUCT (hHal); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8299 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8300 | TRACE_CODE_SME_RX_HDD_RESET_PW5G, NO_SESSION, 0)); |
Kiran | 4a17ebe | 2013-01-31 10:43:43 -0800 | [diff] [blame] | 8301 | csrSaveChannelPowerForBand(pMac, eANI_BOOLEAN_TRUE); |
| 8302 | csrApplyPower2Current(pMac); // Store the channel+power info in the global place: Cfg |
| 8303 | } |
| 8304 | |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 8305 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
| 8306 | /* --------------------------------------------------------------------------- |
| 8307 | \fn sme_UpdateRoamPrefer5GHz |
| 8308 | \brief enable/disable Roam prefer 5G runtime option |
| 8309 | This function is called through dynamic setConfig callback function |
| 8310 | to configure the Roam prefer 5G runtime option |
| 8311 | \param hHal - HAL handle for device |
| 8312 | \param nRoamPrefer5GHz Enable/Disable Roam prefer 5G runtime option |
| 8313 | \- return Success or failure |
| 8314 | -------------------------------------------------------------------------*/ |
| 8315 | |
| 8316 | eHalStatus sme_UpdateRoamPrefer5GHz(tHalHandle hHal, v_BOOL_t nRoamPrefer5GHz) |
| 8317 | { |
| 8318 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8319 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8320 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8321 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8322 | TRACE_CODE_SME_RX_HDD_UPDATE_RP5G, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8323 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8324 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8325 | { |
| 8326 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8327 | "%s: gRoamPrefer5GHz is changed from %d to %d", __func__, |
| 8328 | pMac->roam.configParam.nRoamPrefer5GHz, |
| 8329 | nRoamPrefer5GHz); |
| 8330 | pMac->roam.configParam.nRoamPrefer5GHz = nRoamPrefer5GHz; |
| 8331 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8332 | } |
| 8333 | |
| 8334 | return status ; |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 8335 | } |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8336 | |
| 8337 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8338 | \fn sme_setRoamIntraBand |
| 8339 | \brief enable/disable Intra band roaming |
| 8340 | This function is called through dynamic setConfig callback function |
| 8341 | to configure the intra band roaming |
| 8342 | \param hHal - HAL handle for device |
| 8343 | \param nRoamIntraBand Enable/Disable Intra band roaming |
| 8344 | \- return Success or failure |
| 8345 | -------------------------------------------------------------------------*/ |
| 8346 | eHalStatus sme_setRoamIntraBand(tHalHandle hHal, const v_BOOL_t nRoamIntraBand) |
| 8347 | { |
| 8348 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8349 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8350 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8351 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8352 | TRACE_CODE_SME_RX_HDD_SET_ROAMIBAND, NO_SESSION, 0)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8353 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8354 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8355 | { |
| 8356 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8357 | "%s: gRoamIntraBand is changed from %d to %d", __func__, |
| 8358 | pMac->roam.configParam.nRoamIntraBand, |
| 8359 | nRoamIntraBand); |
| 8360 | pMac->roam.configParam.nRoamIntraBand = nRoamIntraBand; |
| 8361 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8362 | } |
| 8363 | |
| 8364 | return status ; |
| 8365 | } |
| 8366 | |
| 8367 | /* --------------------------------------------------------------------------- |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8368 | \fn sme_UpdateRoamScanNProbes |
| 8369 | \brief function to update roam scan N probes |
| 8370 | This function is called through dynamic setConfig callback function |
| 8371 | to update roam scan N probes |
| 8372 | \param hHal - HAL handle for device |
| 8373 | \param nProbes number of probe requests to be sent out |
| 8374 | \- return Success or failure |
| 8375 | -------------------------------------------------------------------------*/ |
| 8376 | eHalStatus sme_UpdateRoamScanNProbes(tHalHandle hHal, const v_U8_t nProbes) |
| 8377 | { |
| 8378 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8379 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8380 | |
| 8381 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8382 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8383 | { |
| 8384 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8385 | "%s: gRoamScanNProbes is changed from %d to %d", __func__, |
| 8386 | pMac->roam.configParam.nProbes, |
| 8387 | nProbes); |
| 8388 | pMac->roam.configParam.nProbes = nProbes; |
| 8389 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8390 | } |
| 8391 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8392 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8393 | { |
| 8394 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 8395 | REASON_NPROBES_CHANGED); |
| 8396 | } |
| 8397 | #endif |
| 8398 | return status ; |
| 8399 | } |
| 8400 | |
| 8401 | /* --------------------------------------------------------------------------- |
| 8402 | \fn sme_UpdateRoamScanHomeAwayTime |
| 8403 | \brief function to update roam scan Home away time |
| 8404 | This function is called through dynamic setConfig callback function |
| 8405 | to update roam scan home away time |
| 8406 | \param hHal - HAL handle for device |
| 8407 | \param nRoamScanAwayTime Scan home away time |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 8408 | \param bSendOffloadCmd If TRUE then send offload command to firmware |
| 8409 | If FALSE then command is not sent to firmware |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8410 | \- return Success or failure |
| 8411 | -------------------------------------------------------------------------*/ |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 8412 | eHalStatus sme_UpdateRoamScanHomeAwayTime(tHalHandle hHal, const v_U16_t nRoamScanHomeAwayTime, |
| 8413 | const eAniBoolean bSendOffloadCmd) |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8414 | { |
| 8415 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8416 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8417 | |
| 8418 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8419 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8420 | { |
| 8421 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8422 | "%s: gRoamScanHomeAwayTime is changed from %d to %d", __func__, |
| 8423 | pMac->roam.configParam.nRoamScanHomeAwayTime, |
| 8424 | nRoamScanHomeAwayTime); |
| 8425 | pMac->roam.configParam.nRoamScanHomeAwayTime = nRoamScanHomeAwayTime; |
| 8426 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8427 | } |
| 8428 | |
| 8429 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
Srinivas Girigowda | 6cf0b82 | 2013-06-27 14:00:20 -0700 | [diff] [blame] | 8430 | if (pMac->roam.configParam.isRoamOffloadScanEnabled && bSendOffloadCmd) |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8431 | { |
| 8432 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 8433 | REASON_HOME_AWAY_TIME_CHANGED); |
| 8434 | } |
| 8435 | #endif |
| 8436 | return status; |
| 8437 | } |
| 8438 | |
| 8439 | |
| 8440 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8441 | \fn sme_getRoamIntraBand |
| 8442 | \brief get Intra band roaming |
| 8443 | \param hHal - HAL handle for device |
| 8444 | \- return Success or failure |
| 8445 | -------------------------------------------------------------------------*/ |
| 8446 | v_BOOL_t sme_getRoamIntraBand(tHalHandle hHal) |
| 8447 | { |
| 8448 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8449 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8450 | TRACE_CODE_SME_RX_HDD_GET_ROAMIBAND, NO_SESSION, 0)); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8451 | return pMac->roam.configParam.nRoamIntraBand; |
| 8452 | } |
| 8453 | |
Varun Reddy Yeturu | 920df21 | 2013-05-22 08:07:23 -0700 | [diff] [blame] | 8454 | /* --------------------------------------------------------------------------- |
| 8455 | \fn sme_getRoamScanNProbes |
| 8456 | \brief get N Probes |
| 8457 | \param hHal - HAL handle for device |
| 8458 | \- return Success or failure |
| 8459 | -------------------------------------------------------------------------*/ |
| 8460 | v_U8_t sme_getRoamScanNProbes(tHalHandle hHal) |
| 8461 | { |
| 8462 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8463 | return pMac->roam.configParam.nProbes; |
| 8464 | } |
| 8465 | |
| 8466 | /* --------------------------------------------------------------------------- |
| 8467 | \fn sme_getRoamScanHomeAwayTime |
| 8468 | \brief get Roam scan home away time |
| 8469 | \param hHal - HAL handle for device |
| 8470 | \- return Success or failure |
| 8471 | -------------------------------------------------------------------------*/ |
| 8472 | v_U16_t sme_getRoamScanHomeAwayTime(tHalHandle hHal) |
| 8473 | { |
| 8474 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8475 | return pMac->roam.configParam.nRoamScanHomeAwayTime; |
| 8476 | } |
| 8477 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8478 | |
| 8479 | /* --------------------------------------------------------------------------- |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8480 | \fn sme_UpdateImmediateRoamRssiDiff |
| 8481 | \brief Update nImmediateRoamRssiDiff |
| 8482 | This function is called through dynamic setConfig callback function |
| 8483 | to configure nImmediateRoamRssiDiff |
| 8484 | Usage: adb shell iwpriv wlan0 setConfig gImmediateRoamRssiDiff=[0 .. 125] |
| 8485 | \param hHal - HAL handle for device |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8486 | \param nImmediateRoamRssiDiff - minimum rssi difference between potential |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8487 | candidate and current AP. |
| 8488 | \- return Success or failure |
| 8489 | -------------------------------------------------------------------------*/ |
| 8490 | |
| 8491 | eHalStatus sme_UpdateImmediateRoamRssiDiff(tHalHandle hHal, v_U8_t nImmediateRoamRssiDiff) |
| 8492 | { |
| 8493 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8494 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8495 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8496 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8497 | TRACE_CODE_SME_RX_HDD_UPDATE_IMMRSSIDIFF, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8498 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8499 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8500 | { |
| 8501 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 8502 | "LFR runtime successfully set immediate roam rssi diff to %d - old value is %d - roam state is %d", |
| 8503 | nImmediateRoamRssiDiff, |
| 8504 | pMac->roam.configParam.nImmediateRoamRssiDiff, |
| 8505 | pMac->roam.neighborRoamInfo.neighborRoamState); |
| 8506 | pMac->roam.configParam.nImmediateRoamRssiDiff = nImmediateRoamRssiDiff; |
| 8507 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8508 | } |
| 8509 | |
| 8510 | return status ; |
| 8511 | } |
| 8512 | |
| 8513 | /* --------------------------------------------------------------------------- |
| 8514 | \fn sme_UpdateRoamRssiDiff |
| 8515 | \brief Update RoamRssiDiff |
| 8516 | This function is called through dynamic setConfig callback function |
| 8517 | to configure RoamRssiDiff |
| 8518 | Usage: adb shell iwpriv wlan0 setConfig RoamRssiDiff=[0 .. 125] |
| 8519 | \param hHal - HAL handle for device |
| 8520 | \param RoamRssiDiff - minimum rssi difference between potential |
| 8521 | candidate and current AP. |
| 8522 | \- return Success or failure |
| 8523 | -------------------------------------------------------------------------*/ |
| 8524 | |
| 8525 | eHalStatus sme_UpdateRoamRssiDiff(tHalHandle hHal, v_U8_t RoamRssiDiff) |
| 8526 | { |
| 8527 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8528 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8529 | |
| 8530 | status = sme_AcquireGlobalLock( &pMac->sme ); |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8531 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8532 | TRACE_CODE_SME_RX_HDD_UPDATE_RSSIDIFF, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8533 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8534 | { |
| 8535 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 8536 | "LFR runtime successfully set roam rssi diff to %d - old value is %d - roam state is %d", |
| 8537 | RoamRssiDiff, |
| 8538 | pMac->roam.configParam.RoamRssiDiff, |
| 8539 | pMac->roam.neighborRoamInfo.neighborRoamState); |
| 8540 | pMac->roam.configParam.RoamRssiDiff = RoamRssiDiff; |
| 8541 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8542 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 8543 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8544 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8545 | { |
| 8546 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_RSSI_DIFF_CHANGED); |
| 8547 | } |
| 8548 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8549 | return status ; |
Madan Mohan Koyyalamudi | 62b55b0 | 2012-12-03 16:45:39 -0800 | [diff] [blame] | 8550 | } |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8551 | |
| 8552 | /*-------------------------------------------------------------------------- |
| 8553 | \brief sme_UpdateFastTransitionEnabled() - enable/disable Fast Transition support at runtime |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8554 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8555 | isFastTransitionEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8556 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8557 | \param hHal - The handle returned by macOpen. |
| 8558 | \return eHAL_STATUS_SUCCESS - SME update isFastTransitionEnabled config successfully. |
| 8559 | Other status means SME is failed to update isFastTransitionEnabled. |
| 8560 | \sa |
| 8561 | --------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8562 | eHalStatus sme_UpdateFastTransitionEnabled(tHalHandle hHal, |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8563 | v_BOOL_t isFastTransitionEnabled) |
| 8564 | { |
| 8565 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8566 | eHalStatus status = eHAL_STATUS_SUCCESS; |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8567 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8568 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8569 | TRACE_CODE_SME_RX_HDD_UPDATE_FTENABLED, NO_SESSION, 0)); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8570 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8571 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8572 | { |
| 8573 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8574 | "%s: FastTransitionEnabled is changed from %d to %d", __func__, |
| 8575 | pMac->roam.configParam.isFastTransitionEnabled, |
| 8576 | isFastTransitionEnabled); |
| 8577 | pMac->roam.configParam.isFastTransitionEnabled = isFastTransitionEnabled; |
| 8578 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8579 | } |
| 8580 | |
| 8581 | return status ; |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8582 | } |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8583 | |
| 8584 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 8585 | \fn sme_UpdateWESMode |
| 8586 | \brief Update WES Mode |
| 8587 | This function is called through dynamic setConfig callback function |
| 8588 | to configure isWESModeEnabled |
| 8589 | \param hHal - HAL handle for device |
| 8590 | \return eHAL_STATUS_SUCCESS - SME update isWESModeEnabled config successfully. |
| 8591 | Other status means SME is failed to update isWESModeEnabled. |
| 8592 | -------------------------------------------------------------------------*/ |
| 8593 | |
| 8594 | eHalStatus sme_UpdateWESMode(tHalHandle hHal, v_BOOL_t isWESModeEnabled) |
| 8595 | { |
| 8596 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8597 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8598 | |
| 8599 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8600 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8601 | { |
| 8602 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 8603 | "LFR runtime successfully set WES Mode to %d - old value is %d - roam state is %d", |
| 8604 | isWESModeEnabled, |
| 8605 | pMac->roam.configParam.isWESModeEnabled, |
| 8606 | pMac->roam.neighborRoamInfo.neighborRoamState); |
| 8607 | pMac->roam.configParam.isWESModeEnabled = isWESModeEnabled; |
| 8608 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8609 | } |
| 8610 | |
| 8611 | return status ; |
| 8612 | } |
| 8613 | |
| 8614 | /* --------------------------------------------------------------------------- |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8615 | \fn sme_SetRoamScanControl |
| 8616 | \brief Set roam scan control |
| 8617 | This function is called to set roam scan control |
| 8618 | if roam scan control is set to 0, roaming scan cache is cleared |
| 8619 | any value other than 0 is treated as invalid value |
| 8620 | \param hHal - HAL handle for device |
| 8621 | \return eHAL_STATUS_SUCCESS - SME update config successfully. |
| 8622 | Other status means SME failure to update |
| 8623 | -------------------------------------------------------------------------*/ |
| 8624 | eHalStatus sme_SetRoamScanControl(tHalHandle hHal, v_BOOL_t roamScanControl) |
| 8625 | { |
| 8626 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8627 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8628 | |
Katya Nigam | bcb705f | 2013-12-26 14:26:22 +0530 | [diff] [blame] | 8629 | MTRACE(vos_trace(VOS_MODULE_ID_SME, |
Leela Venkata Kiran Kumar Reddy Chirala | 7367c20 | 2013-04-10 22:39:51 -0700 | [diff] [blame] | 8630 | TRACE_CODE_SME_RX_HDD_SET_SCANCTRL, NO_SESSION, 0)); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8631 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8632 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8633 | { |
| 8634 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 8635 | "LFR runtime successfully set roam scan control to %d - old value is %d - roam state is %d", |
| 8636 | roamScanControl, |
| 8637 | pMac->roam.configParam.nRoamScanControl, |
| 8638 | pMac->roam.neighborRoamInfo.neighborRoamState); |
| 8639 | pMac->roam.configParam.nRoamScanControl = roamScanControl; |
| 8640 | if ( 0 == roamScanControl) |
| 8641 | { |
| 8642 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 8643 | "LFR runtime successfully cleared roam scan cache"); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 8644 | csrFlushCfgBgScanRoamChannelList(pMac); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 8645 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8646 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8647 | { |
| 8648 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_FLUSH_CHANNEL_LIST); |
| 8649 | } |
| 8650 | #endif |
| 8651 | } |
| 8652 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8653 | } |
| 8654 | return status ; |
| 8655 | } |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8656 | #endif /* (WLAN_FEATURE_VOWIFI_11R) || (FEATURE_WLAN_CCX) || (FEATURE_WLAN_LFR) */ |
| 8657 | |
| 8658 | #ifdef FEATURE_WLAN_LFR |
| 8659 | /*-------------------------------------------------------------------------- |
| 8660 | \brief sme_UpdateIsFastRoamIniFeatureEnabled() - enable/disable LFR support at runtime |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8661 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8662 | isFastRoamIniFeatureEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8663 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8664 | \param hHal - The handle returned by macOpen. |
| 8665 | \return eHAL_STATUS_SUCCESS - SME update isFastRoamIniFeatureEnabled config successfully. |
| 8666 | Other status means SME is failed to update isFastRoamIniFeatureEnabled. |
| 8667 | \sa |
| 8668 | --------------------------------------------------------------------------*/ |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 8669 | eHalStatus sme_UpdateIsFastRoamIniFeatureEnabled(tHalHandle hHal, |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8670 | const v_BOOL_t isFastRoamIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8671 | { |
| 8672 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8673 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8674 | if (pMac->roam.configParam.isFastRoamIniFeatureEnabled == isFastRoamIniFeatureEnabled) |
| 8675 | { |
| 8676 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8677 | "%s: FastRoam is already enabled or disabled, nothing to do (returning) old(%d) new(%d)", __func__, |
| 8678 | pMac->roam.configParam.isFastRoamIniFeatureEnabled, |
| 8679 | isFastRoamIniFeatureEnabled); |
| 8680 | return eHAL_STATUS_SUCCESS; |
| 8681 | } |
| 8682 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8683 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8684 | "%s: FastRoamEnabled is changed from %d to %d", __func__, |
| 8685 | pMac->roam.configParam.isFastRoamIniFeatureEnabled, |
| 8686 | isFastRoamIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8687 | pMac->roam.configParam.isFastRoamIniFeatureEnabled = isFastRoamIniFeatureEnabled; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8688 | csrNeighborRoamUpdateFastRoamingEnabled(pMac, isFastRoamIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8689 | |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8690 | return eHAL_STATUS_SUCCESS; |
| 8691 | } |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 8692 | |
Sameer Thalappil | 4ae66ec | 2013-11-05 14:17:35 -0800 | [diff] [blame] | 8693 | /*-------------------------------------------------------------------------- |
| 8694 | \brief sme_UpdateIsMAWCIniFeatureEnabled() - |
| 8695 | Enable/disable LFR MAWC support at runtime |
| 8696 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 8697 | isMAWCIniFeatureEnabled. |
| 8698 | This is a synchronous call |
| 8699 | \param hHal - The handle returned by macOpen. |
| 8700 | \return eHAL_STATUS_SUCCESS - SME update MAWCEnabled config successfully. |
| 8701 | Other status means SME is failed to update MAWCEnabled. |
| 8702 | \sa |
| 8703 | --------------------------------------------------------------------------*/ |
| 8704 | eHalStatus sme_UpdateIsMAWCIniFeatureEnabled(tHalHandle hHal, |
| 8705 | const v_BOOL_t MAWCEnabled) |
| 8706 | { |
| 8707 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8708 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8709 | |
| 8710 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8711 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8712 | { |
| 8713 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8714 | "%s: MAWCEnabled is changed from %d to %d", __func__, |
| 8715 | pMac->roam.configParam.MAWCEnabled, |
| 8716 | MAWCEnabled); |
| 8717 | pMac->roam.configParam.MAWCEnabled = MAWCEnabled; |
| 8718 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8719 | } |
| 8720 | |
| 8721 | return status ; |
| 8722 | |
| 8723 | } |
| 8724 | |
Srinivas Girigowda | 830bbd0 | 2013-06-13 19:44:16 -0700 | [diff] [blame] | 8725 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8726 | /*-------------------------------------------------------------------------- |
| 8727 | \brief sme_UpdateEnableFastRoamInConcurrency() - enable/disable LFR if Concurrent session exists |
| 8728 | This is a synchronuous call |
| 8729 | \param hHal - The handle returned by macOpen. |
| 8730 | \return eHAL_STATUS_SUCCESS |
| 8731 | Other status means SME is failed |
| 8732 | \sa |
| 8733 | --------------------------------------------------------------------------*/ |
| 8734 | |
| 8735 | eHalStatus sme_UpdateEnableFastRoamInConcurrency(tHalHandle hHal, |
| 8736 | v_BOOL_t bFastRoamInConIniFeatureEnabled) |
| 8737 | { |
| 8738 | |
| 8739 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8740 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8741 | |
| 8742 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8743 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8744 | { |
| 8745 | pMac->roam.configParam.bFastRoamInConIniFeatureEnabled = bFastRoamInConIniFeatureEnabled; |
| 8746 | if (0 == pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8747 | { |
| 8748 | pMac->roam.configParam.bFastRoamInConIniFeatureEnabled = 0; |
| 8749 | } |
| 8750 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8751 | } |
| 8752 | |
| 8753 | return status; |
| 8754 | } |
| 8755 | #endif |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8756 | #endif /* FEATURE_WLAN_LFR */ |
| 8757 | |
| 8758 | #ifdef FEATURE_WLAN_CCX |
| 8759 | /*-------------------------------------------------------------------------- |
| 8760 | \brief sme_UpdateIsCcxFeatureEnabled() - enable/disable CCX support at runtime |
| 8761 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 8762 | isCcxIniFeatureEnabled. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8763 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8764 | \param hHal - The handle returned by macOpen. |
| 8765 | \return eHAL_STATUS_SUCCESS - SME update isCcxIniFeatureEnabled config successfully. |
| 8766 | Other status means SME is failed to update isCcxIniFeatureEnabled. |
| 8767 | \sa |
| 8768 | --------------------------------------------------------------------------*/ |
| 8769 | |
| 8770 | eHalStatus sme_UpdateIsCcxFeatureEnabled(tHalHandle hHal, |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8771 | const v_BOOL_t isCcxIniFeatureEnabled) |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8772 | { |
| 8773 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8774 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8775 | if (pMac->roam.configParam.isCcxIniFeatureEnabled == isCcxIniFeatureEnabled) |
| 8776 | { |
| 8777 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8778 | "%s: CCX Mode is already enabled or disabled, nothing to do (returning) old(%d) new(%d)", __func__, |
| 8779 | pMac->roam.configParam.isCcxIniFeatureEnabled, |
| 8780 | isCcxIniFeatureEnabled); |
| 8781 | return eHAL_STATUS_SUCCESS; |
| 8782 | } |
| 8783 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8784 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8785 | "%s: CcxEnabled is changed from %d to %d", __func__, |
| 8786 | pMac->roam.configParam.isCcxIniFeatureEnabled, |
| 8787 | isCcxIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8788 | pMac->roam.configParam.isCcxIniFeatureEnabled = isCcxIniFeatureEnabled; |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8789 | csrNeighborRoamUpdateCcxModeEnabled(pMac, isCcxIniFeatureEnabled); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8790 | |
| 8791 | if(TRUE == isCcxIniFeatureEnabled) |
| 8792 | { |
| 8793 | sme_UpdateFastTransitionEnabled(hHal, TRUE); |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8794 | } |
Srinivas Girigowda | ba17369 | 2013-08-07 11:55:38 -0700 | [diff] [blame] | 8795 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 8796 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8797 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8798 | { |
| 8799 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CCX_INI_CFG_CHANGED); |
| 8800 | } |
| 8801 | #endif |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8802 | return eHAL_STATUS_SUCCESS; |
| 8803 | } |
| 8804 | #endif /* FEATURE_WLAN_CCX */ |
| 8805 | |
| 8806 | /*-------------------------------------------------------------------------- |
| 8807 | \brief sme_UpdateConfigFwRssiMonitoring() - enable/disable firmware RSSI Monitoring at runtime |
| 8808 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 8809 | fEnableFwRssiMonitoring. |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8810 | This is a synchronous call |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8811 | \param hHal - The handle returned by macOpen. |
| 8812 | \return eHAL_STATUS_SUCCESS - SME update fEnableFwRssiMonitoring. config successfully. |
| 8813 | Other status means SME is failed to update fEnableFwRssiMonitoring. |
| 8814 | \sa |
| 8815 | --------------------------------------------------------------------------*/ |
| 8816 | |
| 8817 | eHalStatus sme_UpdateConfigFwRssiMonitoring(tHalHandle hHal, |
| 8818 | v_BOOL_t fEnableFwRssiMonitoring) |
| 8819 | { |
| 8820 | eHalStatus halStatus = eHAL_STATUS_SUCCESS; |
| 8821 | |
Gopichand Nakkala | 98a98af | 2012-12-31 14:38:47 -0800 | [diff] [blame] | 8822 | if (ccmCfgSetInt(hHal, WNI_CFG_PS_ENABLE_RSSI_MONITOR, fEnableFwRssiMonitoring, |
| 8823 | NULL, eANI_BOOLEAN_FALSE)==eHAL_STATUS_FAILURE) |
| 8824 | { |
| 8825 | halStatus = eHAL_STATUS_FAILURE; |
| 8826 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 8827 | "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] | 8828 | } |
| 8829 | |
| 8830 | return (halStatus); |
| 8831 | } |
| 8832 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 8833 | #ifdef WLAN_FEATURE_NEIGHBOR_ROAMING |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8834 | /*-------------------------------------------------------------------------- |
| 8835 | \brief sme_setNeighborLookupRssiThreshold() - update neighbor lookup rssi threshold |
| 8836 | This is a synchronous call |
| 8837 | \param hHal - The handle returned by macOpen. |
| 8838 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 8839 | Other status means SME is failed to update |
| 8840 | \sa |
| 8841 | --------------------------------------------------------------------------*/ |
| 8842 | eHalStatus sme_setNeighborLookupRssiThreshold(tHalHandle hHal, |
| 8843 | v_U8_t neighborLookupRssiThreshold) |
| 8844 | { |
| 8845 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8846 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8847 | |
| 8848 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8849 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8850 | { |
| 8851 | status = csrNeighborRoamSetLookupRssiThreshold(pMac, neighborLookupRssiThreshold); |
| 8852 | if (HAL_STATUS_SUCCESS(status)) |
| 8853 | { |
| 8854 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 8855 | "LFR runtime successfully set Lookup threshold to %d - old value is %d - roam state is %d", |
| 8856 | neighborLookupRssiThreshold, |
| 8857 | pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold, |
| 8858 | pMac->roam.neighborRoamInfo.neighborRoamState); |
| 8859 | pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold = |
| 8860 | neighborLookupRssiThreshold; |
| 8861 | } |
| 8862 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8863 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8864 | return status; |
| 8865 | } |
| 8866 | |
| 8867 | /*-------------------------------------------------------------------------- |
| 8868 | \brief sme_setNeighborReassocRssiThreshold() - update neighbor reassoc rssi threshold |
| 8869 | This is a synchronous call |
| 8870 | \param hHal - The handle returned by macOpen. |
| 8871 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 8872 | Other status means SME is failed to update |
| 8873 | \sa |
| 8874 | --------------------------------------------------------------------------*/ |
| 8875 | eHalStatus sme_setNeighborReassocRssiThreshold(tHalHandle hHal, |
| 8876 | v_U8_t neighborReassocRssiThreshold) |
| 8877 | { |
| 8878 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8879 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8880 | |
| 8881 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8882 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8883 | { |
| 8884 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 8885 | "LFR runtime successfully set Reassoc threshold to %d - old value is %d - roam state is %d", |
| 8886 | neighborReassocRssiThreshold, |
| 8887 | pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold, |
| 8888 | pMac->roam.neighborRoamInfo.neighborRoamState); |
| 8889 | pMac->roam.configParam.neighborRoamConfig.nNeighborReassocRssiThreshold = |
| 8890 | neighborReassocRssiThreshold; |
| 8891 | pMac->roam.neighborRoamInfo.cfgParams.neighborReassocThreshold = |
| 8892 | neighborReassocRssiThreshold; |
| 8893 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8894 | } |
| 8895 | |
| 8896 | return status ; |
| 8897 | } |
| 8898 | |
| 8899 | |
| 8900 | /*-------------------------------------------------------------------------- |
| 8901 | \brief sme_getNeighborLookupRssiThreshold() - get neighbor lookup rssi threshold |
| 8902 | This is a synchronous call |
| 8903 | \param hHal - The handle returned by macOpen. |
| 8904 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 8905 | Other status means SME is failed to update |
| 8906 | \sa |
| 8907 | --------------------------------------------------------------------------*/ |
| 8908 | v_U8_t sme_getNeighborLookupRssiThreshold(tHalHandle hHal) |
| 8909 | { |
| 8910 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8911 | return pMac->roam.configParam.neighborRoamConfig.nNeighborLookupRssiThreshold; |
| 8912 | } |
| 8913 | |
| 8914 | /*-------------------------------------------------------------------------- |
| 8915 | \brief sme_setNeighborScanRefreshPeriod() - set neighbor scan results refresh period |
| 8916 | This is a synchronous call |
| 8917 | \param hHal - The handle returned by macOpen. |
| 8918 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 8919 | Other status means SME is failed to update |
| 8920 | \sa |
| 8921 | --------------------------------------------------------------------------*/ |
| 8922 | eHalStatus sme_setNeighborScanRefreshPeriod(tHalHandle hHal, |
| 8923 | v_U16_t neighborScanResultsRefreshPeriod) |
| 8924 | { |
| 8925 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8926 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8927 | |
| 8928 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8929 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8930 | { |
| 8931 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 8932 | "LFR runtime successfully set roam scan refresh period to %d - old value is %d - roam state is %d", |
| 8933 | neighborScanResultsRefreshPeriod, |
| 8934 | pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod, |
| 8935 | pMac->roam.neighborRoamInfo.neighborRoamState); |
| 8936 | pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod = |
| 8937 | neighborScanResultsRefreshPeriod; |
| 8938 | pMac->roam.neighborRoamInfo.cfgParams.neighborResultsRefreshPeriod = |
| 8939 | neighborScanResultsRefreshPeriod; |
| 8940 | |
| 8941 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8942 | } |
| 8943 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 8944 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8945 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 8946 | { |
| 8947 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 8948 | REASON_NEIGHBOR_SCAN_REFRESH_PERIOD_CHANGED); |
| 8949 | } |
| 8950 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8951 | return status ; |
| 8952 | } |
| 8953 | |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 8954 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 8955 | /*-------------------------------------------------------------------------- |
| 8956 | \brief sme_UpdateRoamScanOffloadEnabled() - enable/disable roam scan offload feaure |
| 8957 | It is used at in the REG_DYNAMIC_VARIABLE macro definition of |
| 8958 | gRoamScanOffloadEnabled. |
| 8959 | This is a synchronous call |
| 8960 | \param hHal - The handle returned by macOpen. |
| 8961 | \return eHAL_STATUS_SUCCESS - SME update config successfully. |
| 8962 | Other status means SME is failed to update. |
| 8963 | \sa |
| 8964 | --------------------------------------------------------------------------*/ |
| 8965 | |
| 8966 | eHalStatus sme_UpdateRoamScanOffloadEnabled(tHalHandle hHal, |
| 8967 | v_BOOL_t nRoamScanOffloadEnabled) |
| 8968 | { |
| 8969 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8970 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 8971 | |
| 8972 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 8973 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 8974 | { |
| 8975 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 8976 | "%s: gRoamScanOffloadEnabled is changed from %d to %d", __func__, |
| 8977 | pMac->roam.configParam.isRoamOffloadScanEnabled, |
| 8978 | nRoamScanOffloadEnabled); |
| 8979 | pMac->roam.configParam.isRoamOffloadScanEnabled = nRoamScanOffloadEnabled; |
| 8980 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 8981 | } |
| 8982 | |
| 8983 | return status ; |
| 8984 | } |
| 8985 | #endif |
| 8986 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 8987 | /*-------------------------------------------------------------------------- |
| 8988 | \brief sme_getNeighborScanRefreshPeriod() - get neighbor scan results refresh period |
| 8989 | This is a synchronous call |
| 8990 | \param hHal - The handle returned by macOpen. |
| 8991 | \return v_U16_t - Neighbor scan results refresh period value |
| 8992 | \sa |
| 8993 | --------------------------------------------------------------------------*/ |
| 8994 | v_U16_t sme_getNeighborScanRefreshPeriod(tHalHandle hHal) |
| 8995 | { |
| 8996 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 8997 | return pMac->roam.configParam.neighborRoamConfig.nNeighborResultsRefreshPeriod; |
| 8998 | } |
| 8999 | |
| 9000 | /*-------------------------------------------------------------------------- |
| 9001 | \brief sme_getEmptyScanRefreshPeriod() - get empty scan refresh period |
| 9002 | This is a synchronuous call |
| 9003 | \param hHal - The handle returned by macOpen. |
| 9004 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9005 | Other status means SME is failed to update |
| 9006 | \sa |
| 9007 | --------------------------------------------------------------------------*/ |
| 9008 | v_U16_t sme_getEmptyScanRefreshPeriod(tHalHandle hHal) |
| 9009 | { |
| 9010 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9011 | return pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod; |
| 9012 | } |
| 9013 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9014 | /* --------------------------------------------------------------------------- |
| 9015 | \fn sme_UpdateEmptyScanRefreshPeriod |
| 9016 | \brief Update nEmptyScanRefreshPeriod |
| 9017 | This function is called through dynamic setConfig callback function |
| 9018 | to configure nEmptyScanRefreshPeriod |
| 9019 | Usage: adb shell iwpriv wlan0 setConfig nEmptyScanRefreshPeriod=[0 .. 60] |
| 9020 | \param hHal - HAL handle for device |
| 9021 | \param nEmptyScanRefreshPeriod - scan period following empty scan results. |
| 9022 | \- return Success or failure |
| 9023 | -------------------------------------------------------------------------*/ |
| 9024 | |
| 9025 | eHalStatus sme_UpdateEmptyScanRefreshPeriod(tHalHandle hHal, v_U16_t nEmptyScanRefreshPeriod) |
| 9026 | { |
| 9027 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9028 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9029 | |
| 9030 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9031 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9032 | { |
| 9033 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 9034 | "LFR runtime successfully set roam scan period to %d - old value is %d - roam state is %d", |
| 9035 | nEmptyScanRefreshPeriod, |
| 9036 | pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod, |
| 9037 | pMac->roam.neighborRoamInfo.neighborRoamState); |
| 9038 | pMac->roam.configParam.neighborRoamConfig.nEmptyScanRefreshPeriod = nEmptyScanRefreshPeriod; |
| 9039 | pMac->roam.neighborRoamInfo.cfgParams.emptyScanRefreshPeriod = nEmptyScanRefreshPeriod; |
| 9040 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9041 | } |
| 9042 | |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9043 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9044 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9045 | { |
| 9046 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9047 | REASON_EMPTY_SCAN_REF_PERIOD_CHANGED); |
| 9048 | } |
| 9049 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9050 | return status ; |
| 9051 | } |
| 9052 | |
| 9053 | /* --------------------------------------------------------------------------- |
| 9054 | \fn sme_setNeighborScanMinChanTime |
| 9055 | \brief Update nNeighborScanMinChanTime |
| 9056 | This function is called through dynamic setConfig callback function |
| 9057 | to configure gNeighborScanChannelMinTime |
| 9058 | Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMinTime=[0 .. 60] |
| 9059 | \param hHal - HAL handle for device |
| 9060 | \param nNeighborScanMinChanTime - Channel minimum dwell time |
| 9061 | \- return Success or failure |
| 9062 | -------------------------------------------------------------------------*/ |
| 9063 | eHalStatus sme_setNeighborScanMinChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMinChanTime) |
| 9064 | { |
| 9065 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9066 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9067 | |
| 9068 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9069 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9070 | { |
| 9071 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 9072 | "LFR runtime successfully set channel min dwell time to %d - old value is %d - roam state is %d", |
| 9073 | nNeighborScanMinChanTime, |
| 9074 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime, |
| 9075 | pMac->roam.neighborRoamInfo.neighborRoamState); |
| 9076 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMinChanTime = nNeighborScanMinChanTime; |
| 9077 | pMac->roam.neighborRoamInfo.cfgParams.minChannelScanTime = nNeighborScanMinChanTime; |
| 9078 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9079 | } |
| 9080 | |
| 9081 | return status ; |
| 9082 | } |
| 9083 | |
| 9084 | /* --------------------------------------------------------------------------- |
| 9085 | \fn sme_setNeighborScanMaxChanTime |
| 9086 | \brief Update nNeighborScanMaxChanTime |
| 9087 | This function is called through dynamic setConfig callback function |
| 9088 | to configure gNeighborScanChannelMaxTime |
| 9089 | Usage: adb shell iwpriv wlan0 setConfig gNeighborScanChannelMaxTime=[0 .. 60] |
| 9090 | \param hHal - HAL handle for device |
| 9091 | \param nNeighborScanMinChanTime - Channel maximum dwell time |
| 9092 | \- return Success or failure |
| 9093 | -------------------------------------------------------------------------*/ |
| 9094 | eHalStatus sme_setNeighborScanMaxChanTime(tHalHandle hHal, const v_U16_t nNeighborScanMaxChanTime) |
| 9095 | { |
| 9096 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9097 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9098 | |
| 9099 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9100 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9101 | { |
| 9102 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 9103 | "LFR runtime successfully set channel max dwell time to %d - old value is %d - roam state is %d", |
| 9104 | nNeighborScanMaxChanTime, |
| 9105 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime, |
| 9106 | pMac->roam.neighborRoamInfo.neighborRoamState); |
| 9107 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanMaxChanTime = nNeighborScanMaxChanTime; |
| 9108 | pMac->roam.neighborRoamInfo.cfgParams.maxChannelScanTime = nNeighborScanMaxChanTime; |
| 9109 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9110 | } |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9111 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9112 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9113 | { |
| 9114 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9115 | REASON_SCAN_CH_TIME_CHANGED); |
| 9116 | } |
| 9117 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9118 | |
| 9119 | return status ; |
| 9120 | } |
| 9121 | |
| 9122 | /* --------------------------------------------------------------------------- |
| 9123 | \fn sme_getNeighborScanMinChanTime |
| 9124 | \brief get neighbor scan min channel time |
| 9125 | \param hHal - The handle returned by macOpen. |
| 9126 | \return v_U16_t - channel min time value |
| 9127 | -------------------------------------------------------------------------*/ |
| 9128 | v_U16_t sme_getNeighborScanMinChanTime(tHalHandle hHal) |
| 9129 | { |
| 9130 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9131 | return pMac->roam.neighborRoamInfo.cfgParams.minChannelScanTime; |
| 9132 | } |
| 9133 | |
| 9134 | /* --------------------------------------------------------------------------- |
| 9135 | \fn sme_getNeighborScanMaxChanTime |
| 9136 | \brief get neighbor scan max channel time |
| 9137 | \param hHal - The handle returned by macOpen. |
| 9138 | \return v_U16_t - channel max time value |
| 9139 | -------------------------------------------------------------------------*/ |
| 9140 | v_U16_t sme_getNeighborScanMaxChanTime(tHalHandle hHal) |
| 9141 | { |
| 9142 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9143 | return pMac->roam.neighborRoamInfo.cfgParams.maxChannelScanTime; |
| 9144 | } |
| 9145 | |
| 9146 | /* --------------------------------------------------------------------------- |
| 9147 | \fn sme_setNeighborScanPeriod |
| 9148 | \brief Update nNeighborScanPeriod |
| 9149 | This function is called through dynamic setConfig callback function |
| 9150 | to configure nNeighborScanPeriod |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9151 | Usage: adb shell iwpriv wlan0 setConfig nNeighborScanPeriod=[0 .. 1000] |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9152 | \param hHal - HAL handle for device |
| 9153 | \param nNeighborScanPeriod - neighbor scan period |
| 9154 | \- return Success or failure |
| 9155 | -------------------------------------------------------------------------*/ |
| 9156 | eHalStatus sme_setNeighborScanPeriod(tHalHandle hHal, const v_U16_t nNeighborScanPeriod) |
| 9157 | { |
| 9158 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9159 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9160 | |
| 9161 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9162 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9163 | { |
| 9164 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 9165 | "LFR runtime successfully set neighbor scan period to %d - old value is %d - roam state is %d", |
| 9166 | nNeighborScanPeriod, |
| 9167 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod, |
| 9168 | pMac->roam.neighborRoamInfo.neighborRoamState); |
| 9169 | pMac->roam.configParam.neighborRoamConfig.nNeighborScanTimerPeriod = nNeighborScanPeriod; |
| 9170 | pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod = nNeighborScanPeriod; |
| 9171 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9172 | } |
Varun Reddy Yeturu | ce114f7 | 2013-06-05 14:09:58 -0700 | [diff] [blame] | 9173 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9174 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9175 | { |
| 9176 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, |
| 9177 | REASON_SCAN_HOME_TIME_CHANGED); |
| 9178 | } |
| 9179 | #endif |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9180 | |
| 9181 | return status ; |
| 9182 | } |
| 9183 | |
| 9184 | /* --------------------------------------------------------------------------- |
| 9185 | \fn sme_getNeighborScanPeriod |
| 9186 | \brief get neighbor scan period |
| 9187 | \param hHal - The handle returned by macOpen. |
| 9188 | \return v_U16_t - neighbor scan period |
| 9189 | -------------------------------------------------------------------------*/ |
| 9190 | v_U16_t sme_getNeighborScanPeriod(tHalHandle hHal) |
| 9191 | { |
| 9192 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9193 | return pMac->roam.neighborRoamInfo.cfgParams.neighborScanPeriod; |
| 9194 | } |
| 9195 | |
| 9196 | #endif |
| 9197 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9198 | #if defined (WLAN_FEATURE_VOWIFI_11R) || defined (FEATURE_WLAN_CCX) || defined(FEATURE_WLAN_LFR) |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9199 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9200 | /*-------------------------------------------------------------------------- |
| 9201 | \brief sme_getRoamRssiDiff() - get Roam rssi diff |
| 9202 | This is a synchronous call |
| 9203 | \param hHal - The handle returned by macOpen. |
| 9204 | \return v_U16_t - Rssi diff value |
| 9205 | \sa |
| 9206 | --------------------------------------------------------------------------*/ |
| 9207 | v_U8_t sme_getRoamRssiDiff(tHalHandle hHal) |
| 9208 | { |
| 9209 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9210 | return pMac->roam.configParam.RoamRssiDiff; |
| 9211 | } |
| 9212 | |
| 9213 | /*-------------------------------------------------------------------------- |
| 9214 | \brief sme_ChangeRoamScanChannelList() - Change roam scan channel list |
| 9215 | This is a synchronous call |
| 9216 | \param hHal - The handle returned by macOpen. |
| 9217 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9218 | Other status means SME is failed to update |
| 9219 | \sa |
| 9220 | --------------------------------------------------------------------------*/ |
| 9221 | eHalStatus sme_ChangeRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, |
| 9222 | tANI_U8 numChannels) |
| 9223 | { |
| 9224 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9225 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9226 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9227 | tANI_U8 oldChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
Kiet Lam | 600d3ca | 2013-08-31 16:33:32 +0530 | [diff] [blame] | 9228 | tANI_U8 newChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9229 | tANI_U8 i = 0, j = 0; |
| 9230 | |
| 9231 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9232 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9233 | { |
| 9234 | if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
| 9235 | { |
| 9236 | for (i = 0; i < pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; i++) |
| 9237 | { |
| 9238 | j += snprintf(oldChannelList + j, sizeof(oldChannelList) - j," %d", |
| 9239 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]); |
| 9240 | } |
| 9241 | } |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9242 | csrFlushCfgBgScanRoamChannelList(pMac); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9243 | csrCreateBgScanRoamChannelList(pMac, pChannelList, numChannels); |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9244 | sme_SetRoamScanControl(hHal, 1); |
| 9245 | if (NULL != pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9246 | { |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9247 | j = 0; |
| 9248 | for (i = 0; i < pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; i++) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9249 | { |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9250 | j += snprintf(newChannelList + j, sizeof(newChannelList) - j," %d", |
| 9251 | pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9252 | } |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9253 | } |
Varun Reddy Yeturu | 9d4102c | 2013-12-02 15:47:03 -0800 | [diff] [blame] | 9254 | |
| 9255 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 9256 | "LFR runtime successfully set roam scan channels to %s - old value is %s - roam state is %d", |
| 9257 | newChannelList, oldChannelList, |
| 9258 | pMac->roam.neighborRoamInfo.neighborRoamState); |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9259 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9260 | } |
Varun Reddy Yeturu | d0a3f25 | 2013-04-15 21:58:13 -0700 | [diff] [blame] | 9261 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9262 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9263 | { |
| 9264 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); |
| 9265 | } |
| 9266 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9267 | |
| 9268 | return status ; |
| 9269 | } |
| 9270 | |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9271 | |
| 9272 | #ifdef FEATURE_WLAN_CCX_UPLOAD |
| 9273 | /*-------------------------------------------------------------------------- |
| 9274 | \brief sme_SetCcxRoamScanChannelList() - set ccx roam scan channel list |
| 9275 | This is a synchronuous call |
| 9276 | \param hHal - The handle returned by macOpen. |
| 9277 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9278 | Other status means SME is failed to update |
| 9279 | \sa |
| 9280 | --------------------------------------------------------------------------*/ |
| 9281 | eHalStatus sme_SetCcxRoamScanChannelList(tHalHandle hHal, |
| 9282 | tANI_U8 *pChannelList, |
| 9283 | tANI_U8 numChannels) |
| 9284 | { |
| 9285 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9286 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9287 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 9288 | tpCsrChannelInfo currChannelListInfo = &pNeighborRoamInfo->roamChannelInfo.currentChannelListInfo; |
| 9289 | tANI_U8 oldChannelList[WNI_CFG_VALID_CHANNEL_LIST_LEN*2] = {0}; |
| 9290 | tANI_U8 newChannelList[128] = {0}; |
| 9291 | tANI_U8 i = 0, j = 0; |
| 9292 | |
| 9293 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9294 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9295 | { |
| 9296 | if (NULL != currChannelListInfo->ChannelList) |
| 9297 | { |
| 9298 | for (i = 0; i < currChannelListInfo->numOfChannels; i++) |
| 9299 | { |
| 9300 | j += snprintf(oldChannelList + j, sizeof(oldChannelList) - j," %d", |
| 9301 | currChannelListInfo->ChannelList[i]); |
| 9302 | } |
| 9303 | } |
| 9304 | status = csrCreateRoamScanChannelList(pMac, pChannelList, numChannels, csrGetCurrentBand(hHal)); |
| 9305 | |
| 9306 | if ( HAL_STATUS_SUCCESS( status )) |
| 9307 | { |
| 9308 | if (NULL != currChannelListInfo->ChannelList) |
| 9309 | { |
| 9310 | j = 0; |
| 9311 | for (i = 0; i < currChannelListInfo->numOfChannels; i++) |
| 9312 | { |
| 9313 | j += snprintf(newChannelList + j, sizeof(newChannelList) - j," %d", |
| 9314 | currChannelListInfo->ChannelList[i]); |
| 9315 | } |
| 9316 | } |
| 9317 | |
| 9318 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 9319 | "CCX roam scan channel list successfully set to %s - old value is %s - roam state is %d", |
| 9320 | newChannelList, oldChannelList, |
| 9321 | pMac->roam.neighborRoamInfo.neighborRoamState); |
| 9322 | } |
| 9323 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9324 | } |
| 9325 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9326 | if (pMac->roam.configParam.isRoamOffloadScanEnabled) |
| 9327 | { |
| 9328 | csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_UPDATE_CFG, REASON_CHANNEL_LIST_CHANGED); |
| 9329 | } |
| 9330 | #endif |
| 9331 | |
| 9332 | return status ; |
| 9333 | } |
| 9334 | #endif |
| 9335 | |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9336 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9337 | \brief sme_getRoamScanChannelList() - get roam scan channel list |
| 9338 | This is a synchronous call |
| 9339 | \param hHal - The handle returned by macOpen. |
| 9340 | \return eHAL_STATUS_SUCCESS - SME update config successful. |
| 9341 | Other status means SME is failed to update |
| 9342 | \sa |
| 9343 | --------------------------------------------------------------------------*/ |
| 9344 | eHalStatus sme_getRoamScanChannelList(tHalHandle hHal, tANI_U8 *pChannelList, |
| 9345 | tANI_U8 *pNumChannels) |
| 9346 | { |
| 9347 | int i = 0; |
| 9348 | tANI_U8 *pOutPtr = pChannelList; |
| 9349 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9350 | tpCsrNeighborRoamControlInfo pNeighborRoamInfo = &pMac->roam.neighborRoamInfo; |
| 9351 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9352 | |
| 9353 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9354 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9355 | { |
| 9356 | if (NULL == pNeighborRoamInfo->cfgParams.channelInfo.ChannelList) |
| 9357 | { |
| 9358 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_WARN, |
| 9359 | "Roam Scan channel list is NOT yet initialized"); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9360 | *pNumChannels = 0; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9361 | sme_ReleaseGlobalLock( &pMac->sme ); |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9362 | return status; |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9363 | } |
| 9364 | |
| 9365 | *pNumChannels = pNeighborRoamInfo->cfgParams.channelInfo.numOfChannels; |
| 9366 | for (i = 0; i < (*pNumChannels); i++) |
| 9367 | { |
| 9368 | pOutPtr[i] = pNeighborRoamInfo->cfgParams.channelInfo.ChannelList[i]; |
| 9369 | } |
| 9370 | pOutPtr[i] = '\0'; |
| 9371 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9372 | } |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9373 | return status ; |
| 9374 | } |
| 9375 | |
| 9376 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9377 | \brief sme_getIsCcxFeatureEnabled() - get CCX feature enabled or not |
| 9378 | This is a synchronuous call |
| 9379 | \param hHal - The handle returned by macOpen. |
| 9380 | \return TRUE (1) - if the CCX feature is enabled |
| 9381 | FALSE (0) - if feature is disabled (compile or runtime) |
| 9382 | \sa |
| 9383 | --------------------------------------------------------------------------*/ |
| 9384 | tANI_BOOLEAN sme_getIsCcxFeatureEnabled(tHalHandle hHal) |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9385 | { |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9386 | #ifdef FEATURE_WLAN_CCX |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9387 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
Srinivas Girigowda | 5cecb20 | 2013-10-08 09:13:25 -0700 | [diff] [blame] | 9388 | return csrRoamIsCcxIniFeatureEnabled(pMac); |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9389 | #else |
| 9390 | return eANI_BOOLEAN_FALSE; |
| 9391 | #endif |
Srinivas Girigowda | de69741 | 2013-02-14 16:31:48 -0800 | [diff] [blame] | 9392 | } |
| 9393 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9394 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | ad34ca9 | 2013-10-22 10:54:29 -0700 | [diff] [blame] | 9395 | \brief sme_GetWESMode() - get WES Mode |
| 9396 | This is a synchronous call |
| 9397 | \param hHal - The handle returned by macOpen |
| 9398 | \return v_U8_t - WES Mode Enabled(1)/Disabled(0) |
| 9399 | \sa |
| 9400 | --------------------------------------------------------------------------*/ |
| 9401 | v_BOOL_t sme_GetWESMode(tHalHandle hHal) |
| 9402 | { |
| 9403 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9404 | return pMac->roam.configParam.isWESModeEnabled; |
| 9405 | } |
| 9406 | |
| 9407 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | 100eb32 | 2013-03-15 16:48:20 -0700 | [diff] [blame] | 9408 | \brief sme_GetRoamScanControl() - get scan control |
| 9409 | This is a synchronous call |
| 9410 | \param hHal - The handle returned by macOpen. |
| 9411 | \return v_BOOL_t - Enabled(1)/Disabled(0) |
| 9412 | \sa |
| 9413 | --------------------------------------------------------------------------*/ |
| 9414 | v_BOOL_t sme_GetRoamScanControl(tHalHandle hHal) |
| 9415 | { |
| 9416 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9417 | return pMac->roam.configParam.nRoamScanControl; |
| 9418 | } |
| 9419 | #endif |
| 9420 | |
| 9421 | /*-------------------------------------------------------------------------- |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9422 | \brief sme_getIsLfrFeatureEnabled() - get LFR feature enabled or not |
| 9423 | This is a synchronuous call |
| 9424 | \param hHal - The handle returned by macOpen. |
| 9425 | \return TRUE (1) - if the feature is enabled |
| 9426 | FALSE (0) - if feature is disabled (compile or runtime) |
| 9427 | \sa |
| 9428 | --------------------------------------------------------------------------*/ |
| 9429 | tANI_BOOLEAN sme_getIsLfrFeatureEnabled(tHalHandle hHal) |
| 9430 | { |
| 9431 | #ifdef FEATURE_WLAN_LFR |
| 9432 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9433 | return pMac->roam.configParam.isFastRoamIniFeatureEnabled; |
| 9434 | #else |
| 9435 | return eANI_BOOLEAN_FALSE; |
| 9436 | #endif |
| 9437 | } |
Madan Mohan Koyyalamudi | d502607 | 2012-11-30 14:56:21 -0800 | [diff] [blame] | 9438 | |
Srinivas Girigowda | bbd16eb | 2013-03-21 12:34:46 -0700 | [diff] [blame] | 9439 | /*-------------------------------------------------------------------------- |
| 9440 | \brief sme_getIsFtFeatureEnabled() - get FT feature enabled or not |
| 9441 | This is a synchronuous call |
| 9442 | \param hHal - The handle returned by macOpen. |
| 9443 | \return TRUE (1) - if the feature is enabled |
| 9444 | FALSE (0) - if feature is disabled (compile or runtime) |
| 9445 | \sa |
| 9446 | --------------------------------------------------------------------------*/ |
| 9447 | tANI_BOOLEAN sme_getIsFtFeatureEnabled(tHalHandle hHal) |
| 9448 | { |
| 9449 | #ifdef WLAN_FEATURE_VOWIFI_11R |
| 9450 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9451 | return pMac->roam.configParam.isFastTransitionEnabled; |
| 9452 | #else |
| 9453 | return eANI_BOOLEAN_FALSE; |
| 9454 | #endif |
| 9455 | } |
| 9456 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9457 | /* --------------------------------------------------------------------------- |
| 9458 | \fn sme_IsFeatureSupportedByFW |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9459 | |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 9460 | \brief Check if a feature is enabled by FW |
| 9461 | |
| 9462 | \param featEnumValue - Enumeration value from placeHolderInCapBitmap |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9463 | |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 9464 | \- return 1/0 (TRUE/FALSE) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9465 | -------------------------------------------------------------------------*/ |
| 9466 | tANI_U8 sme_IsFeatureSupportedByFW(tANI_U8 featEnumValue) |
| 9467 | { |
| 9468 | return IS_FEATURE_SUPPORTED_BY_FW(featEnumValue); |
| 9469 | } |
Kiet Lam | 0f32042 | 2013-11-21 19:29:17 +0530 | [diff] [blame] | 9470 | |
| 9471 | /* --------------------------------------------------------------------------- |
| 9472 | \fn sme_IsFeatureSupportedByDriver |
| 9473 | \brief Check if a feature is enabled by Driver |
| 9474 | |
| 9475 | \param featEnumValue - Enumeration value from placeHolderInCapBitmap |
| 9476 | \- return 1/0 (TRUE/FALSE) |
| 9477 | -------------------------------------------------------------------------*/ |
| 9478 | |
| 9479 | tANI_U8 sme_IsFeatureSupportedByDriver(tANI_U8 featEnumValue) |
| 9480 | { |
| 9481 | return IS_FEATURE_SUPPORTED_BY_DRIVER(featEnumValue); |
| 9482 | } |
| 9483 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9484 | #ifdef FEATURE_WLAN_TDLS |
Gopichand Nakkala | 79ff85d | 2013-05-27 17:05:29 +0530 | [diff] [blame] | 9485 | |
| 9486 | /* --------------------------------------------------------------------------- |
| 9487 | \fn sme_SendTdlsMgmtFrame |
| 9488 | \brief API to send TDLS management frames. |
| 9489 | |
| 9490 | \param peerMac - peer's Mac Adress. |
| 9491 | \param tdlsLinkEstablishParams - TDLS Peer Link Establishment Parameters |
| 9492 | \- return VOS_STATUS_SUCCES |
| 9493 | -------------------------------------------------------------------------*/ |
| 9494 | VOS_STATUS sme_SendTdlsLinkEstablishParams(tHalHandle hHal, |
| 9495 | tANI_U8 sessionId, |
| 9496 | tSirMacAddr peerMac, |
| 9497 | tCsrTdlsLinkEstablishParams *tdlsLinkEstablishParams) |
| 9498 | { |
| 9499 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9500 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9501 | |
| 9502 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9503 | |
| 9504 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9505 | { |
| 9506 | status = csrTdlsSendLinkEstablishParams(hHal, sessionId, peerMac, tdlsLinkEstablishParams) ; |
| 9507 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9508 | } |
| 9509 | return status ; |
| 9510 | } |
| 9511 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9512 | /* --------------------------------------------------------------------------- |
| 9513 | \fn sme_SendTdlsMgmtFrame |
| 9514 | \brief API to send TDLS management frames. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9515 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9516 | \param peerMac - peer's Mac Adress. |
| 9517 | \param frame_type - Type of TDLS mgmt frame to be sent. |
| 9518 | \param dialog - dialog token used in the frame. |
| 9519 | \param status - status to be incuded in the frame. |
| 9520 | \param buf - additional IEs to be included |
| 9521 | \param len - lenght of additional Ies |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 9522 | \param responder - Tdls request type |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9523 | \- return VOS_STATUS_SUCCES |
| 9524 | -------------------------------------------------------------------------*/ |
| 9525 | VOS_STATUS sme_SendTdlsMgmtFrame(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 9526 | tANI_U8 frame_type, tANI_U8 dialog, tANI_U16 statusCode, tANI_U8 *buf, tANI_U8 len, tANI_U8 responder) |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9527 | { |
| 9528 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9529 | tCsrTdlsSendMgmt sendTdlsReq = {{0}} ; |
| 9530 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9531 | |
| 9532 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9533 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9534 | { |
| 9535 | vos_mem_copy(sendTdlsReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 9536 | sendTdlsReq.frameType = frame_type; |
| 9537 | sendTdlsReq.buf = buf; |
| 9538 | sendTdlsReq.len = len; |
| 9539 | sendTdlsReq.dialog = dialog; |
| 9540 | sendTdlsReq.statusCode = statusCode; |
Hoonki Lee | a34dd89 | 2013-02-05 22:56:02 -0800 | [diff] [blame] | 9541 | sendTdlsReq.responder = responder; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9542 | |
| 9543 | status = csrTdlsSendMgmtReq(hHal, sessionId, &sendTdlsReq) ; |
| 9544 | |
| 9545 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9546 | } |
| 9547 | |
| 9548 | return status ; |
| 9549 | |
| 9550 | } |
| 9551 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | 681989c | 2013-03-06 22:27:48 -0800 | [diff] [blame] | 9552 | \fn sme_ChangeTdlsPeerSta |
| 9553 | \brief API to Update TDLS peer sta parameters. |
| 9554 | |
| 9555 | \param peerMac - peer's Mac Adress. |
| 9556 | \param staParams - Peer Station Parameters |
| 9557 | \- return VOS_STATUS_SUCCES |
| 9558 | -------------------------------------------------------------------------*/ |
| 9559 | VOS_STATUS sme_ChangeTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac, |
| 9560 | tCsrStaParams *pstaParams) |
| 9561 | { |
| 9562 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9563 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9564 | |
| 9565 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9566 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9567 | { |
| 9568 | status = csrTdlsChangePeerSta(hHal, sessionId, peerMac,pstaParams); |
| 9569 | |
| 9570 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9571 | } |
| 9572 | |
| 9573 | return status ; |
| 9574 | |
| 9575 | } |
| 9576 | |
| 9577 | /* --------------------------------------------------------------------------- |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9578 | \fn sme_AddTdlsPeerSta |
| 9579 | \brief API to Add TDLS peer sta entry. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9580 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9581 | \param peerMac - peer's Mac Adress. |
| 9582 | \- return VOS_STATUS_SUCCES |
| 9583 | -------------------------------------------------------------------------*/ |
| 9584 | VOS_STATUS sme_AddTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9585 | { |
| 9586 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9587 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9588 | |
| 9589 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9590 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9591 | { |
| 9592 | status = csrTdlsAddPeerSta(hHal, sessionId, peerMac); |
| 9593 | |
| 9594 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9595 | } |
| 9596 | |
| 9597 | return status ; |
| 9598 | |
| 9599 | } |
| 9600 | /* --------------------------------------------------------------------------- |
| 9601 | \fn sme_DeleteTdlsPeerSta |
| 9602 | \brief API to Delete TDLS peer sta entry. |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 9603 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9604 | \param peerMac - peer's Mac Adress. |
| 9605 | \- return VOS_STATUS_SUCCES |
| 9606 | -------------------------------------------------------------------------*/ |
| 9607 | VOS_STATUS sme_DeleteTdlsPeerSta(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9608 | { |
| 9609 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9610 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9611 | |
| 9612 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9613 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9614 | { |
| 9615 | status = csrTdlsDelPeerSta(hHal, sessionId, peerMac) ; |
| 9616 | |
| 9617 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9618 | } |
| 9619 | |
| 9620 | return status ; |
| 9621 | |
| 9622 | } |
Gopichand Nakkala | 75e7b28 | 2013-03-15 18:37:13 -0700 | [diff] [blame] | 9623 | /* --------------------------------------------------------------------------- |
Gopichand Nakkala | ccd3a38 | 2013-03-19 13:56:10 -0700 | [diff] [blame] | 9624 | \fn sme_SetTdlsPowerSaveProhibited |
| 9625 | \API to set/reset the isTdlsPowerSaveProhibited. |
| 9626 | |
| 9627 | \- return void |
| 9628 | -------------------------------------------------------------------------*/ |
| 9629 | void sme_SetTdlsPowerSaveProhibited(tHalHandle hHal, v_BOOL_t val) |
| 9630 | { |
| 9631 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9632 | |
| 9633 | pMac->isTdlsPowerSaveProhibited = val; |
| 9634 | return; |
| 9635 | } |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9636 | #endif |
Gopichand Nakkala | fe7246d | 2013-06-10 17:43:37 +0530 | [diff] [blame] | 9637 | /* --------------------------------------------------------------------------- |
| 9638 | \fn sme_IsPmcBmps |
| 9639 | \API to Check if PMC state is BMPS. |
| 9640 | |
| 9641 | \- return v_BOOL_t |
| 9642 | -------------------------------------------------------------------------*/ |
| 9643 | v_BOOL_t sme_IsPmcBmps(tHalHandle hHal) |
| 9644 | { |
| 9645 | return (BMPS == pmcGetPmcState(hHal)); |
| 9646 | } |
| 9647 | |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9648 | #ifdef FEATURE_WLAN_TDLS_INTERNAL |
| 9649 | /* |
| 9650 | * SME API to start TDLS discovery Procedure |
| 9651 | */ |
| 9652 | VOS_STATUS sme_StartTdlsDiscoveryReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9653 | { |
| 9654 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 9655 | tCsrTdlsDisRequest disReq = {{0}} ; |
| 9656 | vos_mem_copy(disReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 9657 | status = csrTdlsDiscoveryReq(hHal, sessionId, &disReq) ; |
| 9658 | |
| 9659 | return status ; |
| 9660 | |
| 9661 | } |
| 9662 | |
| 9663 | /* |
| 9664 | * Process TDLS discovery results |
| 9665 | */ |
| 9666 | v_U8_t sme_GetTdlsDiscoveryResult(tHalHandle hHal, |
| 9667 | tSmeTdlsDisResult *disResult, v_U8_t listType) |
| 9668 | { |
| 9669 | tCsrTdlsPeerLinkinfo *peerLinkInfo = NULL ; |
| 9670 | tSirTdlsPeerInfo *peerInfo = NULL ; |
| 9671 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9672 | tCsrTdlsCtxStruct *disInfo = &pMac->tdlsCtx ; |
| 9673 | tDblLinkList *peerList = &disInfo->tdlsPotentialPeerList ; |
| 9674 | tListElem *pEntry = NULL ; |
| 9675 | v_U8_t peerCnt = 0 ; |
| 9676 | |
| 9677 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 9678 | ("TDLS peer count = %d"),disInfo->tdlsPeerCount ) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9679 | pEntry = csrLLPeekHead( peerList, LL_ACCESS_LOCK ); |
| 9680 | while(pEntry) |
| 9681 | { |
| 9682 | peerLinkInfo = GET_BASE_ADDR( pEntry, tCsrTdlsPeerLinkinfo, |
| 9683 | tdlsPeerStaLink) ; |
| 9684 | peerInfo = &peerLinkInfo->tdlsDisPeerInfo ; |
| 9685 | |
| 9686 | switch(listType) |
| 9687 | { |
| 9688 | case TDLS_SETUP_LIST: |
| 9689 | { |
| 9690 | if(TDLS_LINK_SETUP_STATE == peerInfo->tdlsPeerState) |
| 9691 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 9692 | vos_mem_copy(disResult[peerCnt].tdlsPeerMac, |
| 9693 | peerInfo->peerMac, sizeof(tSirMacAddr)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9694 | disResult[peerCnt].tdlsPeerRssi = peerInfo->tdlsPeerRssi ; |
| 9695 | peerCnt++ ; |
| 9696 | } |
| 9697 | break ; |
| 9698 | } |
| 9699 | case TDLS_DIS_LIST: |
| 9700 | { |
Kiet Lam | 64c1b49 | 2013-07-12 13:56:44 +0530 | [diff] [blame] | 9701 | vos_mem_copy(disResult[peerCnt].tdlsPeerMac, |
| 9702 | peerInfo->peerMac, sizeof(tSirMacAddr)); |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9703 | disResult[peerCnt].tdlsPeerRssi = peerInfo->tdlsPeerRssi ; |
| 9704 | peerCnt++ ; |
| 9705 | break ; |
| 9706 | } |
| 9707 | default: |
| 9708 | { |
| 9709 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Kiran Kumar Lokere | 691dde1 | 2013-03-06 17:00:31 -0800 | [diff] [blame] | 9710 | ("unknown list type ")) ; |
Mohit Khanna | 698ba2a | 2012-12-04 15:08:18 -0800 | [diff] [blame] | 9711 | break ; |
| 9712 | } |
| 9713 | } |
| 9714 | |
| 9715 | pEntry = csrLLNext( peerList, pEntry, LL_ACCESS_LOCK) ; |
| 9716 | } |
| 9717 | |
| 9718 | return peerCnt ; |
| 9719 | |
| 9720 | } |
| 9721 | |
| 9722 | /* |
| 9723 | * SME API to start TDLS link setup Procedure. |
| 9724 | */ |
| 9725 | VOS_STATUS sme_StartTdlsLinkSetupReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9726 | { |
| 9727 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 9728 | tCsrTdlsSetupRequest setupReq = {{0}} ; |
| 9729 | vos_mem_copy(setupReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 9730 | status = csrTdlsSetupReq(hHal, sessionId, &setupReq) ; |
| 9731 | return status ; |
| 9732 | |
| 9733 | } |
| 9734 | |
| 9735 | /* |
| 9736 | * SME API to start TDLS link Teardown Procedure. |
| 9737 | */ |
| 9738 | VOS_STATUS sme_StartTdlsLinkTeardownReq(tHalHandle hHal, tANI_U8 sessionId, tSirMacAddr peerMac) |
| 9739 | { |
| 9740 | VOS_STATUS status = VOS_STATUS_SUCCESS; |
| 9741 | tCsrTdlsTeardownRequest teardownReq = {{0}} ; |
| 9742 | vos_mem_copy(teardownReq.peerMac, peerMac, sizeof(tSirMacAddr)) ; |
| 9743 | status = csrTdlsTeardownReq(hHal, sessionId, &teardownReq) ; |
| 9744 | return status ; |
| 9745 | |
| 9746 | } |
| 9747 | |
| 9748 | #endif /* FEATURE_WLAN_TDLS */ |
| 9749 | |
Tushnim Bhattacharyya | 9cdf608 | 2013-04-21 16:33:30 -0700 | [diff] [blame] | 9750 | eHalStatus sme_UpdateDfsSetting(tHalHandle hHal, tANI_U8 fUpdateEnableDFSChnlScan) |
| 9751 | { |
| 9752 | eHalStatus status = eHAL_STATUS_FAILURE; |
| 9753 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9754 | |
| 9755 | smsLog(pMac, LOG2, FL("enter")); |
| 9756 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9757 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9758 | { |
| 9759 | pMac->scan.fEnableDFSChnlScan = fUpdateEnableDFSChnlScan; |
| 9760 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9761 | } |
| 9762 | smsLog(pMac, LOG2, FL("exit status %d"), status); |
| 9763 | |
| 9764 | return (status); |
| 9765 | } |
| 9766 | |
Gopichand Nakkala | e620d5a | 2013-04-26 05:45:57 -0700 | [diff] [blame] | 9767 | /* |
| 9768 | * SME API to enable/disable WLAN driver initiated SSR |
| 9769 | */ |
| 9770 | void sme_UpdateEnableSSR(tHalHandle hHal, tANI_BOOLEAN enableSSR) |
| 9771 | { |
| 9772 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9773 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9774 | |
| 9775 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 9776 | if (HAL_STATUS_SUCCESS(status)) |
| 9777 | { |
| 9778 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_DEBUG, |
| 9779 | "SSR level is changed %d", enableSSR); |
| 9780 | /* not serializing this messsage, as this is only going |
| 9781 | * to set a variable in WDA/WDI |
| 9782 | */ |
| 9783 | WDA_SetEnableSSR(enableSSR); |
| 9784 | sme_ReleaseGlobalLock(&pMac->sme); |
| 9785 | } |
| 9786 | return; |
| 9787 | } |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 9788 | |
| 9789 | /* |
| 9790 | * SME API to determine the channel bonding mode |
| 9791 | */ |
| 9792 | VOS_STATUS sme_SelectCBMode(tHalHandle hHal, eCsrPhyMode eCsrPhyMode, tANI_U8 channel) |
| 9793 | { |
| 9794 | tSmeConfigParams smeConfig; |
| 9795 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9796 | |
| 9797 | if ( |
| 9798 | #ifdef WLAN_FEATURE_11AC |
| 9799 | eCSR_DOT11_MODE_11ac != eCsrPhyMode && |
| 9800 | eCSR_DOT11_MODE_11ac_ONLY != eCsrPhyMode && |
| 9801 | #endif |
| 9802 | eCSR_DOT11_MODE_11n != eCsrPhyMode && |
| 9803 | eCSR_DOT11_MODE_11n_ONLY != eCsrPhyMode |
| 9804 | ) |
| 9805 | { |
| 9806 | return VOS_STATUS_SUCCESS; |
| 9807 | } |
| 9808 | |
| 9809 | /* If channel bonding mode is not required */ |
| 9810 | if ( !pMac->roam.configParam.channelBondingMode5GHz ) { |
| 9811 | return VOS_STATUS_SUCCESS; |
| 9812 | } |
| 9813 | |
| 9814 | vos_mem_zero(&smeConfig, sizeof (tSmeConfigParams)); |
| 9815 | sme_GetConfigParam(pMac, &smeConfig); |
| 9816 | |
| 9817 | #ifdef WLAN_FEATURE_11AC |
| 9818 | if ( eCSR_DOT11_MODE_11ac == eCsrPhyMode || |
| 9819 | eCSR_DOT11_MODE_11ac_ONLY == eCsrPhyMode ) |
| 9820 | { |
| 9821 | if ( channel== 36 || channel == 52 || channel == 100 || |
| 9822 | channel == 116 || channel == 149 ) |
| 9823 | { |
| 9824 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 9825 | PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_LOW - 1; |
| 9826 | } |
| 9827 | else if ( channel == 40 || channel == 56 || channel == 104 || |
| 9828 | channel == 120 || channel == 153 ) |
| 9829 | { |
| 9830 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 9831 | PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_LOW - 1; |
| 9832 | } |
| 9833 | else if ( channel == 44 || channel == 60 || channel == 108 || |
| 9834 | channel == 124 || channel == 157 ) |
| 9835 | { |
| 9836 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 9837 | PHY_QUADRUPLE_CHANNEL_20MHZ_LOW_40MHZ_HIGH -1; |
| 9838 | } |
| 9839 | else if ( channel == 48 || channel == 64 || channel == 112 || |
Leo Chang | d0a4984 | 2013-12-30 11:41:04 -0800 | [diff] [blame] | 9840 | channel == 128 || channel == 144 || channel == 161 ) |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 9841 | { |
| 9842 | smeConfig.csrConfig.channelBondingMode5GHz = |
| 9843 | PHY_QUADRUPLE_CHANNEL_20MHZ_HIGH_40MHZ_HIGH - 1; |
| 9844 | } |
| 9845 | else if ( channel == 165 ) |
| 9846 | { |
| 9847 | smeConfig.csrConfig.channelBondingMode5GHz = 0; |
| 9848 | } |
| 9849 | } |
| 9850 | #endif |
| 9851 | |
| 9852 | if ( eCSR_DOT11_MODE_11n == eCsrPhyMode || |
| 9853 | eCSR_DOT11_MODE_11n_ONLY == eCsrPhyMode ) |
| 9854 | { |
| 9855 | if ( channel== 40 || channel == 48 || channel == 56 || |
| 9856 | channel == 64 || channel == 104 || channel == 112 || |
| 9857 | channel == 120 || channel == 128 || channel == 136 || |
| 9858 | channel == 144 || channel == 153 || channel == 161 ) |
| 9859 | { |
| 9860 | smeConfig.csrConfig.channelBondingMode5GHz = 1; |
| 9861 | } |
| 9862 | else if ( channel== 36 || channel == 44 || channel == 52 || |
| 9863 | channel == 60 || channel == 100 || channel == 108 || |
| 9864 | channel == 116 || channel == 124 || channel == 132 || |
| 9865 | channel == 140 || channel == 149 || channel == 157 ) |
| 9866 | { |
| 9867 | smeConfig.csrConfig.channelBondingMode5GHz = 2; |
| 9868 | } |
| 9869 | else if ( channel == 165 ) |
| 9870 | { |
| 9871 | smeConfig.csrConfig.channelBondingMode5GHz = 0; |
| 9872 | } |
| 9873 | } |
| 9874 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
Jeff Johnson | ce8ad51 | 2013-10-30 12:34:42 -0700 | [diff] [blame] | 9875 | "cbmode selected=%d", smeConfig.csrConfig.channelBondingMode5GHz); |
Ravi Joshi | aeb7d9e | 2013-05-02 12:28:14 -0700 | [diff] [blame] | 9876 | |
| 9877 | sme_UpdateConfig (pMac, &smeConfig); |
| 9878 | return VOS_STATUS_SUCCESS; |
| 9879 | } |
| 9880 | |
Kiran Kumar Lokere | 0ad5cd3 | 2013-06-25 11:26:22 -0700 | [diff] [blame] | 9881 | /*-------------------------------------------------------------------------- |
| 9882 | |
| 9883 | \brief sme_SetCurrDeviceMode() - Sets the current operating device mode. |
| 9884 | \param hHal - The handle returned by macOpen. |
| 9885 | \param currDeviceMode - Current operating device mode. |
| 9886 | --------------------------------------------------------------------------*/ |
| 9887 | |
| 9888 | void sme_SetCurrDeviceMode (tHalHandle hHal, tVOS_CON_MODE currDeviceMode) |
| 9889 | { |
| 9890 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9891 | pMac->sme.currDeviceMode = currDeviceMode; |
| 9892 | return; |
| 9893 | } |
| 9894 | |
Varun Reddy Yeturu | cc661d2 | 2013-05-20 11:47:10 -0700 | [diff] [blame] | 9895 | #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD |
| 9896 | /*-------------------------------------------------------------------------- |
| 9897 | \brief sme_HandoffRequest() - a wrapper function to Request a handoff |
| 9898 | from CSR. |
| 9899 | This is a synchronous call |
| 9900 | \param hHal - The handle returned by macOpen |
| 9901 | \param pHandoffInfo - info provided by HDD with the handoff request (namely: |
| 9902 | BSSID, channel etc.) |
| 9903 | \return eHAL_STATUS_SUCCESS - SME passed the request to CSR successfully. |
| 9904 | Other status means SME is failed to send the request. |
| 9905 | \sa |
| 9906 | --------------------------------------------------------------------------*/ |
| 9907 | |
| 9908 | eHalStatus sme_HandoffRequest(tHalHandle hHal, |
| 9909 | tCsrHandoffRequest *pHandoffInfo) |
| 9910 | { |
| 9911 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9912 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9913 | |
| 9914 | status = sme_AcquireGlobalLock( &pMac->sme ); |
| 9915 | if ( HAL_STATUS_SUCCESS( status ) ) |
| 9916 | { |
| 9917 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 9918 | "%s: invoked", __func__); |
| 9919 | status = csrHandoffRequest(pMac, pHandoffInfo); |
| 9920 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 9921 | } |
| 9922 | |
| 9923 | return status ; |
| 9924 | } |
| 9925 | #endif |
| 9926 | |
Sudhir Sattayappa Kohalli | b1d8c3a | 2013-06-18 14:47:20 -0700 | [diff] [blame] | 9927 | /* |
| 9928 | * SME API to check if there is any infra station or |
| 9929 | * P2P client is connected |
| 9930 | */ |
| 9931 | VOS_STATUS sme_isSta_p2p_clientConnected(tHalHandle hHal) |
| 9932 | { |
| 9933 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 9934 | if(csrIsInfraConnected(pMac)) |
| 9935 | { |
| 9936 | return VOS_STATUS_SUCCESS; |
| 9937 | } |
| 9938 | return VOS_STATUS_E_FAILURE; |
| 9939 | } |
| 9940 | |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 9941 | |
| 9942 | #ifdef FEATURE_WLAN_LPHB |
| 9943 | /* --------------------------------------------------------------------------- |
| 9944 | \fn sme_LPHBConfigReq |
| 9945 | \API to make configuration LPHB within FW. |
| 9946 | \param hHal - The handle returned by macOpen |
| 9947 | \param lphdReq - LPHB request argument by client |
| 9948 | \param pCallbackfn - LPHB timeout notification callback function pointer |
| 9949 | \- return Configuration message posting status, SUCCESS or Fail |
| 9950 | -------------------------------------------------------------------------*/ |
| 9951 | eHalStatus sme_LPHBConfigReq |
| 9952 | ( |
| 9953 | tHalHandle hHal, |
| 9954 | tSirLPHBReq *lphdReq, |
| 9955 | void (*pCallbackfn)(void *pAdapter, void *indParam) |
| 9956 | ) |
| 9957 | { |
| 9958 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 9959 | VOS_STATUS vosStatus = VOS_STATUS_SUCCESS; |
| 9960 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 9961 | vos_msg_t vosMessage; |
| 9962 | |
| 9963 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 9964 | if (eHAL_STATUS_SUCCESS == status) |
| 9965 | { |
| 9966 | if ((LPHB_SET_EN_PARAMS_INDID == lphdReq->cmd) && |
| 9967 | (NULL == pCallbackfn) && |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 9968 | (NULL == pMac->sme.pLphbIndCb)) |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 9969 | { |
| 9970 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 9971 | "%s: Indication Call back did not registered", __func__); |
| 9972 | sme_ReleaseGlobalLock(&pMac->sme); |
| 9973 | return eHAL_STATUS_FAILURE; |
| 9974 | } |
| 9975 | else if (NULL != pCallbackfn) |
| 9976 | { |
Leo Chang | d9df8aa | 2013-09-26 13:32:26 -0700 | [diff] [blame] | 9977 | pMac->sme.pLphbIndCb = pCallbackfn; |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 9978 | } |
| 9979 | |
| 9980 | /* serialize the req through MC thread */ |
| 9981 | vosMessage.bodyptr = lphdReq; |
| 9982 | vosMessage.type = WDA_LPHB_CONF_REQ; |
| 9983 | vosStatus = vos_mq_post_message(VOS_MQ_ID_WDA, &vosMessage); |
| 9984 | if (!VOS_IS_STATUS_SUCCESS(vosStatus)) |
| 9985 | { |
| 9986 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 9987 | "%s: Post Config LPHB MSG fail", __func__); |
| 9988 | status = eHAL_STATUS_FAILURE; |
| 9989 | } |
| 9990 | sme_ReleaseGlobalLock(&pMac->sme); |
| 9991 | } |
| 9992 | |
| 9993 | return(status); |
| 9994 | } |
| 9995 | #endif /* FEATURE_WLAN_LPHB */ |
Sudhir Sattayappa Kohalli | 3762069 | 2013-08-05 14:02:26 -0700 | [diff] [blame] | 9996 | /*-------------------------------------------------------------------------- |
| 9997 | \brief sme_enable_disable_split_scan() - a wrapper function to set the split |
| 9998 | scan parameter. |
| 9999 | This is a synchronous call |
| 10000 | \param hHal - The handle returned by macOpen |
| 10001 | \return NONE. |
| 10002 | \sa |
| 10003 | --------------------------------------------------------------------------*/ |
| 10004 | void sme_enable_disable_split_scan (tHalHandle hHal, tANI_U8 nNumStaChan, |
| 10005 | tANI_U8 nNumP2PChan) |
| 10006 | { |
| 10007 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10008 | |
| 10009 | pMac->roam.configParam.nNumStaChanCombinedConc = nNumStaChan; |
| 10010 | pMac->roam.configParam.nNumP2PChanCombinedConc = nNumP2PChan; |
| 10011 | |
| 10012 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10013 | "%s: SCAN nNumStaChanCombinedConc : %d," |
| 10014 | "nNumP2PChanCombinedConc : %d ", |
| 10015 | __func__, nNumStaChan, nNumP2PChan); |
| 10016 | |
| 10017 | return; |
| 10018 | |
| 10019 | } |
Leo Chang | 9056f46 | 2013-08-01 19:21:11 -0700 | [diff] [blame] | 10020 | |
Yue Ma | b9c86f4 | 2013-08-14 15:59:08 -0700 | [diff] [blame] | 10021 | /* --------------------------------------------------------------------------- |
| 10022 | \fn sme_AddPeriodicTxPtrn |
| 10023 | \brief API to Periodic TX Pattern Offload feature |
| 10024 | \param hHal - The handle returned by macOpen |
| 10025 | \param addPeriodicTxPtrnParams - Pointer to the add pattern structure |
| 10026 | \return eHalStatus |
| 10027 | ---------------------------------------------------------------------------*/ |
| 10028 | eHalStatus sme_AddPeriodicTxPtrn(tHalHandle hHal, tSirAddPeriodicTxPtrn |
| 10029 | *addPeriodicTxPtrnParams) |
| 10030 | { |
| 10031 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10032 | eHalStatus status; |
| 10033 | vos_msg_t msg; |
| 10034 | |
| 10035 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 10036 | { |
| 10037 | msg.type = WDA_ADD_PERIODIC_TX_PTRN_IND; |
| 10038 | msg.bodyptr = addPeriodicTxPtrnParams; |
| 10039 | |
| 10040 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 10041 | { |
| 10042 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 10043 | "to post WDA_ADD_PERIODIC_TX_PTRN_IND to WDA!", |
| 10044 | __func__); |
| 10045 | |
| 10046 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10047 | return eHAL_STATUS_FAILURE; |
| 10048 | } |
| 10049 | |
| 10050 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10051 | return eHAL_STATUS_SUCCESS; |
| 10052 | } |
| 10053 | |
| 10054 | return status; |
| 10055 | } |
| 10056 | |
| 10057 | /* --------------------------------------------------------------------------- |
| 10058 | \fn sme_DelPeriodicTxPtrn |
| 10059 | \brief API to Periodic TX Pattern Offload feature |
| 10060 | \param hHal - The handle returned by macOpen |
| 10061 | \param delPeriodicTxPtrnParams - Pointer to the delete pattern structure |
| 10062 | \return eHalStatus |
| 10063 | ---------------------------------------------------------------------------*/ |
| 10064 | eHalStatus sme_DelPeriodicTxPtrn(tHalHandle hHal, tSirDelPeriodicTxPtrn |
| 10065 | *delPeriodicTxPtrnParams) |
| 10066 | { |
| 10067 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10068 | eHalStatus status; |
| 10069 | vos_msg_t msg; |
| 10070 | |
| 10071 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 10072 | { |
| 10073 | msg.type = WDA_DEL_PERIODIC_TX_PTRN_IND; |
| 10074 | msg.bodyptr = delPeriodicTxPtrnParams; |
| 10075 | |
| 10076 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 10077 | { |
| 10078 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 10079 | "to post WDA_DEL_PERIODIC_TX_PTRN_IND to WDA!", |
| 10080 | __func__); |
| 10081 | |
| 10082 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10083 | return eHAL_STATUS_FAILURE; |
| 10084 | } |
| 10085 | |
| 10086 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10087 | return eHAL_STATUS_SUCCESS; |
| 10088 | } |
| 10089 | |
| 10090 | return status; |
| 10091 | } |
| 10092 | |
Tushnim Bhattacharyya | ad37df1 | 2013-10-02 12:01:33 -0700 | [diff] [blame] | 10093 | void smeGetCommandQStatus( tHalHandle hHal ) |
| 10094 | { |
| 10095 | tSmeCmd *pTempCmd = NULL; |
| 10096 | tListElem *pEntry; |
| 10097 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10098 | |
| 10099 | if (NULL == pMac) |
| 10100 | { |
Kiet Lam | cffc586 | 2013-10-30 16:28:45 +0530 | [diff] [blame] | 10101 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_FATAL, |
| 10102 | "%s: pMac is null", __func__); |
Tushnim Bhattacharyya | ad37df1 | 2013-10-02 12:01:33 -0700 | [diff] [blame] | 10103 | return; |
| 10104 | } |
| 10105 | |
| 10106 | pEntry = csrLLPeekHead( &pMac->sme.smeCmdActiveList, LL_ACCESS_LOCK ); |
| 10107 | if( pEntry ) |
| 10108 | { |
| 10109 | pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); |
| 10110 | } |
| 10111 | smsLog( pMac, LOGE, "Currently smeCmdActiveList has command (0x%X)", |
| 10112 | (pTempCmd) ? pTempCmd->command : eSmeNoCommand ); |
| 10113 | if(pTempCmd) |
| 10114 | { |
| 10115 | if( eSmeCsrCommandMask & pTempCmd->command ) |
| 10116 | { |
| 10117 | //CSR command is stuck. See what the reason code is for that command |
| 10118 | dumpCsrCommandInfo(pMac, pTempCmd); |
| 10119 | } |
| 10120 | } //if(pTempCmd) |
| 10121 | |
| 10122 | smsLog( pMac, LOGE, "Currently smeCmdPendingList has %d commands", |
| 10123 | csrLLCount(&pMac->sme.smeCmdPendingList)); |
| 10124 | |
| 10125 | smsLog( pMac, LOGE, "Currently roamCmdPendingList has %d commands", |
| 10126 | csrLLCount(&pMac->roam.roamCmdPendingList)); |
| 10127 | |
| 10128 | return; |
| 10129 | } |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 10130 | |
| 10131 | #ifdef FEATURE_WLAN_BATCH_SCAN |
| 10132 | /* --------------------------------------------------------------------------- |
| 10133 | \fn sme_SetBatchScanReq |
| 10134 | \brief API to set batch scan request in FW |
| 10135 | \param hHal - The handle returned by macOpen. |
| 10136 | \param pRequest - Pointer to the batch request. |
| 10137 | \param sessionId - session ID |
| 10138 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 10139 | getting set batch scan response from FW |
| 10140 | \param callbackContext - pAdapter context |
| 10141 | \return eHalStatus |
| 10142 | ---------------------------------------------------------------------------*/ |
| 10143 | eHalStatus sme_SetBatchScanReq |
| 10144 | ( |
| 10145 | tHalHandle hHal, tSirSetBatchScanReq *pRequest, tANI_U8 sessionId, |
| 10146 | void (*callbackRoutine) (void *callbackCtx, tSirSetBatchScanRsp *pRsp), |
| 10147 | void *callbackContext |
| 10148 | ) |
| 10149 | { |
| 10150 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10151 | eHalStatus status; |
| 10152 | |
| 10153 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 10154 | { |
| 10155 | status = pmcSetBatchScanReq(hHal, pRequest, sessionId, callbackRoutine, |
| 10156 | callbackContext); |
| 10157 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10158 | } |
| 10159 | |
| 10160 | return status; |
| 10161 | } |
| 10162 | |
| 10163 | /* --------------------------------------------------------------------------- |
Chittajit Mitra | f5413a4 | 2013-10-18 14:20:08 -0700 | [diff] [blame] | 10164 | \fn sme_SendRateUpdateInd |
| 10165 | \brief API to Update rate |
| 10166 | \param hHal - The handle returned by macOpen |
| 10167 | \param rateUpdateParams - Pointer to rate update params |
| 10168 | \return eHalStatus |
| 10169 | ---------------------------------------------------------------------------*/ |
| 10170 | eHalStatus sme_SendRateUpdateInd(tHalHandle hHal, tSirRateUpdateInd *rateUpdateParams) |
| 10171 | { |
| 10172 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10173 | eHalStatus status; |
| 10174 | vos_msg_t msg; |
| 10175 | |
| 10176 | if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) |
| 10177 | { |
| 10178 | msg.type = WDA_RATE_UPDATE_IND; |
| 10179 | msg.bodyptr = rateUpdateParams; |
| 10180 | |
| 10181 | if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) |
| 10182 | { |
| 10183 | VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " |
| 10184 | "to post WDA_SET_RMC_RATE_IND to WDA!", |
| 10185 | __func__); |
| 10186 | |
| 10187 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10188 | return eHAL_STATUS_FAILURE; |
| 10189 | } |
| 10190 | |
| 10191 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10192 | return eHAL_STATUS_SUCCESS; |
| 10193 | } |
| 10194 | |
| 10195 | return status; |
| 10196 | } |
| 10197 | |
| 10198 | /* --------------------------------------------------------------------------- |
Rajeev | 79dbe4c | 2013-10-05 11:03:42 +0530 | [diff] [blame] | 10199 | \fn sme_TriggerBatchScanResultInd |
| 10200 | \brief API to trigger batch scan result indications from FW |
| 10201 | \param hHal - The handle returned by macOpen. |
| 10202 | \param pRequest - Pointer to get batch request. |
| 10203 | \param sessionId - session ID |
| 10204 | \param callbackRoutine - HDD callback which needs to be invoked after |
| 10205 | getting batch scan result indication from FW |
| 10206 | \param callbackContext - pAdapter context |
| 10207 | \return eHalStatus |
| 10208 | ---------------------------------------------------------------------------*/ |
| 10209 | eHalStatus sme_TriggerBatchScanResultInd |
| 10210 | ( |
| 10211 | tHalHandle hHal, tSirTriggerBatchScanResultInd *pRequest, tANI_U8 sessionId, |
| 10212 | void (*callbackRoutine) (void *callbackCtx, void *pRsp), |
| 10213 | void *callbackContext |
| 10214 | ) |
| 10215 | { |
| 10216 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10217 | eHalStatus status; |
| 10218 | |
| 10219 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 10220 | { |
| 10221 | status = pmcTriggerBatchScanResultInd(hHal, pRequest, sessionId, |
| 10222 | callbackRoutine, callbackContext); |
| 10223 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10224 | } |
| 10225 | |
| 10226 | return status; |
| 10227 | } |
| 10228 | |
| 10229 | |
| 10230 | /* --------------------------------------------------------------------------- |
| 10231 | \fn sme_StopBatchScanInd |
| 10232 | \brief API to stop batch scan request in FW |
| 10233 | \param hHal - The handle returned by macOpen. |
| 10234 | \param pRequest - Pointer to the batch request. |
| 10235 | \param sessionId - session ID |
| 10236 | \return eHalStatus |
| 10237 | ---------------------------------------------------------------------------*/ |
| 10238 | eHalStatus sme_StopBatchScanInd |
| 10239 | ( |
| 10240 | tHalHandle hHal, tSirStopBatchScanInd *pRequest, tANI_U8 sessionId |
| 10241 | ) |
| 10242 | { |
| 10243 | tpAniSirGlobal pMac = PMAC_STRUCT( hHal ); |
| 10244 | eHalStatus status; |
| 10245 | |
| 10246 | if ( eHAL_STATUS_SUCCESS == ( status = sme_AcquireGlobalLock( &pMac->sme ))) |
| 10247 | { |
| 10248 | status = pmcStopBatchScanInd(hHal, pRequest, sessionId); |
| 10249 | sme_ReleaseGlobalLock( &pMac->sme ); |
| 10250 | } |
| 10251 | |
| 10252 | return status; |
| 10253 | } |
| 10254 | |
| 10255 | #endif |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 10256 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10257 | |
Leo Chang | 0b0e45a | 2013-12-15 15:18:55 -0800 | [diff] [blame] | 10258 | #ifdef FEATURE_WLAN_CH_AVOID |
| 10259 | /* --------------------------------------------------------------------------- |
| 10260 | \fn sme_AddChAvoidCallback |
| 10261 | \brief Used to plug in callback function |
| 10262 | Which notify channel may not be used with SAP or P2PGO mode. |
| 10263 | Notification come from FW. |
| 10264 | \param hHal |
| 10265 | \param pCallbackfn : callback function pointer should be plugged in |
| 10266 | \- return eHalStatus |
| 10267 | -------------------------------------------------------------------------*/ |
| 10268 | eHalStatus sme_AddChAvoidCallback |
| 10269 | ( |
| 10270 | tHalHandle hHal, |
| 10271 | void (*pCallbackfn)(void *pAdapter, void *indParam) |
| 10272 | ) |
| 10273 | { |
| 10274 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10275 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10276 | |
| 10277 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_INFO, |
| 10278 | "%s: Plug in CH AVOID CB", __func__); |
| 10279 | |
| 10280 | status = sme_AcquireGlobalLock(&pMac->sme); |
| 10281 | if (eHAL_STATUS_SUCCESS == status) |
| 10282 | { |
| 10283 | if (NULL != pCallbackfn) |
| 10284 | { |
| 10285 | pMac->sme.pChAvoidNotificationCb = pCallbackfn; |
| 10286 | } |
| 10287 | sme_ReleaseGlobalLock(&pMac->sme); |
| 10288 | } |
| 10289 | |
| 10290 | return(status); |
| 10291 | } |
| 10292 | #endif /* FEATURE_WLAN_CH_AVOID */ |
| 10293 | |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10294 | |
| 10295 | void activeListCmdTimeoutHandle(void *userData) |
| 10296 | { |
| 10297 | if (NULL == userData) |
| 10298 | return; |
| 10299 | VOS_TRACE(VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR, |
| 10300 | "%s: Active List command timeout Cmd List Count %d", __func__, |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 10301 | csrLLCount(&((tpAniSirGlobal) userData)->sme.smeCmdActiveList) ); |
Kalikinkar Dhara | a498897 | 2013-10-28 13:39:54 -0700 | [diff] [blame] | 10302 | smeGetCommandQStatus((tHalHandle) userData); |
| 10303 | } |
| 10304 | |
Tushnim Bhattacharyya | ed4d0c2 | 2014-01-30 11:56:44 -0800 | [diff] [blame] | 10305 | eHalStatus sme_UpdateConnectDebug(tHalHandle hHal, tANI_U32 set_value) |
| 10306 | { |
| 10307 | eHalStatus status = eHAL_STATUS_SUCCESS; |
| 10308 | tpAniSirGlobal pMac = PMAC_STRUCT(hHal); |
| 10309 | pMac->fEnableDebugLog = set_value; |
| 10310 | return (status); |
| 10311 | } |
| 10312 | |