diff options
| author | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2015-06-04 20:09:12 +0530 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2015-06-04 20:10:09 +0530 |
| commit | 267710f1e7b617641ff20eb5f03f5ac72884cc6f (patch) | |
| tree | 7e33833ee0fad035702837b32d447c9c5c8a0368 | |
| parent | 9701a83cee3a95438daa9499bb7bc5177bd68b2c (diff) | |
| parent | 87090ffc9dc99d39d498d3efb06bd7e8e652fada (diff) | |
Release 4.0.10.111 QCACLD WLAN Driver
Merge remote-tracking branch 'origin/caf/caf-wlan/master' into HEAD
* origin/caf/caf-wlan/master:
Cafstaging Release 4.0.10.111
qcacld: Fix issue in setting max number of TDLS peers
qcacld: Do not remove TDLS peers if deauth is not from AP
qcacld: Add debug code to rootcause command timeout issue.
qcacld: Revert HDD abort scan timeout to 2 seconds
qcacld-2.0: Add NULL check for ack_cb
Revert "qcacld: Send auth resp if auth req is rx in connected state"
qcacld-2.0: Fix memory layering violation in sme add/del tx pattern
Change-Id: I26f96bd482a96eb51e55495d7c768df47f03b3f0
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_main.h | 2 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_assoc.c | 4 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_cfg80211.c | 2 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_debugfs.c | 2 | ||||
| -rwxr-xr-x | CORE/HDD/src/wlan_hdd_main.c | 8 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_tdls.c | 11 | ||||
| -rw-r--r-- | CORE/MAC/inc/qwlan_version.h | 5 | ||||
| -rw-r--r-- | CORE/MAC/inc/sirApi.h | 3 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessAuthFrame.c | 42 | ||||
| -rw-r--r-- | CORE/MAC/src/pe/lim/limProcessDeauthFrame.c | 7 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.c | 14 | ||||
| -rw-r--r-- | CORE/SERVICES/WMA/wma.h | 1 | ||||
| -rw-r--r-- | CORE/SME/src/sme_common/sme_Api.c | 165 |
13 files changed, 158 insertions, 108 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_main.h b/CORE/HDD/inc/wlan_hdd_main.h index 619d3da31b01..1e5ecad99b9b 100644 --- a/CORE/HDD/inc/wlan_hdd_main.h +++ b/CORE/HDD/inc/wlan_hdd_main.h @@ -115,7 +115,7 @@ This value should be larger than the timeout used by WDI to wait for a response from WCNSS */ #define WLAN_WAIT_TIME_SESSIONOPENCLOSE 15000 -#define WLAN_WAIT_TIME_ABORTSCAN (SIR_HW_DEF_SCAN_MAX_DURATION + 1000) +#define WLAN_WAIT_TIME_ABORTSCAN 2000 #define WLAN_WAIT_TIME_EXTSCAN 1000 #define WLAN_WAIT_TIME_LL_STATS 5000 diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c index ff2790e2bc20..887c0594ba70 100644 --- a/CORE/HDD/src/wlan_hdd_assoc.c +++ b/CORE/HDD/src/wlan_hdd_assoc.c @@ -2905,7 +2905,7 @@ hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, } case eCSR_ROAM_RESULT_DELETE_TDLS_PEER: { - for ( staIdx = 0; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++ ) + for (staIdx = 0; staIdx < pHddCtx->max_num_tdls_sta; staIdx++) { if ((pHddCtx->tdlsConnInfo[staIdx].sessionId == pRoamInfo->sessionId) && pRoamInfo->staId == pHddCtx->tdlsConnInfo[staIdx].staId) @@ -2949,7 +2949,7 @@ hdd_RoamTdlsStatusUpdateHandler(hdd_adapter_t *pAdapter, case eCSR_ROAM_RESULT_DELETE_ALL_TDLS_PEER_IND: { /* 0 staIdx is assigned to AP we dont want to touch that */ - for ( staIdx = 0; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++ ) + for (staIdx = 0; staIdx < pHddCtx->max_num_tdls_sta; staIdx++) { if ((pHddCtx->tdlsConnInfo[staIdx].sessionId == pRoamInfo->sessionId) && pHddCtx->tdlsConnInfo[staIdx].staId) diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c index 0f84e56aebd2..ddfcdeb25622 100644 --- a/CORE/HDD/src/wlan_hdd_cfg80211.c +++ b/CORE/HDD/src/wlan_hdd_cfg80211.c @@ -14798,7 +14798,7 @@ static int __wlan_hdd_cfg80211_disconnect( struct wiphy *wiphy, #ifdef FEATURE_WLAN_TDLS /* First clean up the tdls peers if any */ - for (staIdx = 0 ; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++) { + for (staIdx = 0 ; staIdx < pHddCtx->max_num_tdls_sta; staIdx++) { if ((pHddCtx->tdlsConnInfo[staIdx].sessionId == pAdapter->sessionId) && (pHddCtx->tdlsConnInfo[staIdx].staId)) { uint8 *mac; diff --git a/CORE/HDD/src/wlan_hdd_debugfs.c b/CORE/HDD/src/wlan_hdd_debugfs.c index bc9d0e81be3f..e48231b81934 100644 --- a/CORE/HDD/src/wlan_hdd_debugfs.c +++ b/CORE/HDD/src/wlan_hdd_debugfs.c @@ -327,6 +327,7 @@ static ssize_t wcnss_patterngen_write(struct file *file, goto failure; } vos_mem_free(cmd); + vos_mem_free(delPeriodicTxPtrnParams); return count; } @@ -405,6 +406,7 @@ static ssize_t wcnss_patterngen_write(struct file *file, goto failure; } vos_mem_free(cmd); + vos_mem_free(addPeriodicTxPtrnParams); return count; failure: diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c index 025e85bc75de..7f4fbe50dc97 100755 --- a/CORE/HDD/src/wlan_hdd_main.c +++ b/CORE/HDD/src/wlan_hdd_main.c @@ -6230,14 +6230,6 @@ static void hdd_update_tgt_services(hdd_context_t *hdd_ctx, { cfg_ini->fEnableTDLSSleepSta = FALSE; } - if (cfg_ini->fEnableTDLSSleepSta || cfg_ini->fEnableTDLSBufferSta) - { - /* Adjust max TDLS sta number if self is either sleep STA or buf STA */ - hdd_ctx->max_num_tdls_sta = HDD_MAX_NUM_TDLS_STA_P_UAPSD; - hddLog(VOS_TRACE_LEVEL_INFO_HIGH, - "%s: P-UAPSD: sleep or buffer sta enabled, max_tdls_peer_# = %d", - __func__, hdd_ctx->max_num_tdls_sta); - } #endif pMac->beacon_offload = cfg->beacon_offload; #ifdef WLAN_FEATURE_ROAM_OFFLOAD diff --git a/CORE/HDD/src/wlan_hdd_tdls.c b/CORE/HDD/src/wlan_hdd_tdls.c index 8b64dc31058d..4b2f5d385f49 100644 --- a/CORE/HDD/src/wlan_hdd_tdls.c +++ b/CORE/HDD/src/wlan_hdd_tdls.c @@ -727,9 +727,16 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) pHddCtx->tdls_scan_ctxt.reject = 0; pHddCtx->tdls_scan_ctxt.scan_request = NULL; - pHddCtx->max_num_tdls_sta = HDD_MAX_NUM_TDLS_STA; + if (pHddCtx->cfg_ini->fEnableTDLSSleepSta || + pHddCtx->cfg_ini->fEnableTDLSBufferSta) + pHddCtx->max_num_tdls_sta = HDD_MAX_NUM_TDLS_STA_P_UAPSD; + else + pHddCtx->max_num_tdls_sta = HDD_MAX_NUM_TDLS_STA; + + hddLog(VOS_TRACE_LEVEL_INFO_HIGH, FL("max_num_tdls_sta: %d"), + pHddCtx->max_num_tdls_sta); - for (staIdx = 0; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++) + for (staIdx = 0; staIdx < pHddCtx->max_num_tdls_sta; staIdx++) { pHddCtx->tdlsConnInfo[staIdx].staId = 0; pHddCtx->tdlsConnInfo[staIdx].sessionId = 255; diff --git a/CORE/MAC/inc/qwlan_version.h b/CORE/MAC/inc/qwlan_version.h index bc40112412c6..8b53b46868bd 100644 --- a/CORE/MAC/inc/qwlan_version.h +++ b/CORE/MAC/inc/qwlan_version.h @@ -1,4 +1,5 @@ /* + * Copyright (c) 2012-2015 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. @@ -42,9 +43,9 @@ BRIEF DESCRIPTION: #define QWLAN_VERSION_MINOR 0 #define QWLAN_VERSION_PATCH 10 #define QWLAN_VERSION_EXTRA "" -#define QWLAN_VERSION_BUILD 110 +#define QWLAN_VERSION_BUILD 111 -#define QWLAN_VERSIONSTR "4.0.10.110" +#define QWLAN_VERSIONSTR "4.0.10.111" #define AR6320_REV1_VERSION 0x5000000 diff --git a/CORE/MAC/inc/sirApi.h b/CORE/MAC/inc/sirApi.h index 0ccf40c2ee2f..c2f87a02308f 100644 --- a/CORE/MAC/inc/sirApi.h +++ b/CORE/MAC/inc/sirApi.h @@ -60,9 +60,6 @@ #define P2P_SEARCH_DWELL_TIME_INCREASE 20 #define P2P_SOCIAL_CHANNELS 3 -// Maximum scan duration before timeout -#define SIR_HW_DEF_SCAN_MAX_DURATION 30000 /* 30 secs */ - /* Max number of channels are 165, but to access 165th element of array, *array of 166 is required. */ diff --git a/CORE/MAC/src/pe/lim/limProcessAuthFrame.c b/CORE/MAC/src/pe/lim/limProcessAuthFrame.c index 64b13380783c..d5ee42e3a2f4 100644 --- a/CORE/MAC/src/pe/lim/limProcessAuthFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessAuthFrame.c @@ -587,11 +587,13 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse /* pStaDS != NULL and isConnected = 1 means the STA is already * connected, But SAP received the Auth from that station. - * For non PMF connection send Auth response frame. + * For non PMF connection send Deauth frame as STA will retry + * to connect back. * - * For PMF connection the AP should modify the state of - * the existing association until the SA-Query procedure - * determines that the original SA is invalid. + * For PMF connection the AP should not tear down or otherwise + * modify the state of the existing association until the + * SA-Query procedure determines that the original SA is + * invalid. */ if (isConnected #ifdef WLAN_FEATURE_11W @@ -599,14 +601,15 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse #endif ) { - authFrame.authAlgoNumber = - pRxAuthFrameBody->authAlgoNumber; - authFrame.authTransactionSeqNumber = - pRxAuthFrameBody->authTransactionSeqNumber + 1; - authFrame.authStatusCode = eSIR_MAC_SUCCESS_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC, psessionEntry); - return; + limLog(pMac, LOGE, + FL("STA is already connected but received auth frame" + "Send the Deauth and lim Delete Station Context" + "(staId: %d, assocId: %d) "), + pStaDs->staIndex, assocId); + limSendDeauthMgmtFrame(pMac, eSIR_MAC_UNSPEC_FAILURE_REASON, + (tANI_U8 *) pHdr->sa, psessionEntry, FALSE); + limTriggerSTAdeletion(pMac, pStaDs, psessionEntry); + return; } } @@ -662,14 +665,13 @@ limProcessAuthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession pse #endif ) { - authFrame.authAlgoNumber = - pRxAuthFrameBody->authAlgoNumber; - authFrame.authTransactionSeqNumber = - pRxAuthFrameBody->authTransactionSeqNumber + 1; - authFrame.authStatusCode = eSIR_MAC_SUCCESS_STATUS; - limSendAuthMgmtFrame(pMac, &authFrame, pHdr->sa, - LIM_NO_WEP_IN_FC, psessionEntry); - return; + PELOGE(limLog(pMac, LOGE, + FL("lim Delete Station Context (staId: %d, assocId: %d) "), + pStaDs->staIndex, assocId);) + limSendDeauthMgmtFrame(pMac, + eSIR_MAC_UNSPEC_FAILURE_REASON, (tANI_U8 *) pAuthNode->peerMacAddr, psessionEntry, FALSE); + limTriggerSTAdeletion(pMac, pStaDs, psessionEntry); + return; } } else diff --git a/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c b/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c index f7a730120c16..0579d5507f80 100644 --- a/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c +++ b/CORE/MAC/src/pe/lim/limProcessDeauthFrame.c @@ -410,8 +410,11 @@ limProcessDeauthFrame(tpAniSirGlobal pMac, tANI_U8 *pRxPacketInfo, tpPESession p } else { - - limDeleteTDLSPeers(pMac, psessionEntry); + /* Delete all the TDLS peers only if Deauth + * is received from the AP + */ + if (IS_CURRENT_BSSID(pMac, pHdr->sa, psessionEntry)) + limDeleteTDLSPeers(pMac, psessionEntry); #endif /** * This could be Deauthentication frame from diff --git a/CORE/SERVICES/WMA/wma.c b/CORE/SERVICES/WMA/wma.c index db5cc49f2b40..8c8c97d87f6d 100644 --- a/CORE/SERVICES/WMA/wma.c +++ b/CORE/SERVICES/WMA/wma.c @@ -7591,7 +7591,7 @@ VOS_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle, cmd->idle_time = WMA_SCAN_IDLE_TIME_DEFAULT; /* Large timeout value for full scan cycle, 30 seconds */ - cmd->max_scan_time = SIR_HW_DEF_SCAN_MAX_DURATION; + cmd->max_scan_time = WMA_HW_DEF_SCAN_MAX_DURATION; /* do not add OFDM rates in 11B mode */ if (scan_req->dot11mode != WNI_CFG_DOT11_MODE_11B) @@ -8153,7 +8153,7 @@ VOS_STATUS wma_start_scan(tp_wma_handle wma_handle, if (msg_type == WDA_START_SCAN_OFFLOAD_REQ) { /* Start the timer for scan completion */ vos_status = vos_timer_start(&wma_handle->wma_scan_comp_timer, - SIR_HW_DEF_SCAN_MAX_DURATION); + WMA_HW_DEF_SCAN_MAX_DURATION); if (vos_status != VOS_STATUS_SUCCESS ) { WMA_LOGE("Failed to start the scan completion timer"); vos_status = VOS_STATUS_E_FAILURE; @@ -9346,7 +9346,7 @@ v_VOID_t wma_roam_scan_fill_scan_params(tp_wma_handle wma_handle, VOS_MAX(scan_params->dwell_time_active / roam_req->nProbes, 1) : 0; scan_params->probe_spacing_time = 0; scan_params->probe_delay = 0; - scan_params->max_scan_time = SIR_HW_DEF_SCAN_MAX_DURATION; /* 30 seconds for full scan cycle */ + scan_params->max_scan_time = WMA_HW_DEF_SCAN_MAX_DURATION; /* 30 seconds for full scan cycle */ scan_params->idle_time = scan_params->min_rest_time; scan_params->n_probes = roam_req->nProbes; if (roam_req->allowDFSChannelRoam == SIR_ROAMING_DFS_CHANNEL_DISABLED) { @@ -9378,7 +9378,7 @@ v_VOID_t wma_roam_scan_fill_scan_params(tp_wma_handle wma_handle, scan_params->repeat_probe_time = 0; scan_params->probe_spacing_time = 0; scan_params->probe_delay = 0; - scan_params->max_scan_time = SIR_HW_DEF_SCAN_MAX_DURATION; + scan_params->max_scan_time = WMA_HW_DEF_SCAN_MAX_DURATION; scan_params->idle_time = scan_params->min_rest_time; scan_params->burst_duration = 0; scan_params->n_probes = 0; @@ -20763,8 +20763,12 @@ static void wma_data_tx_ack_work_handler(struct work_struct *ack_work) WMA_LOGD("Data Tx Ack Cb Status %d", work->status); /* Call the Ack Cb registered by UMAC */ - ack_cb((tpAniSirGlobal)(wma_handle->mac_context), + if (ack_cb) + ack_cb((tpAniSirGlobal)(wma_handle->mac_context), work->status ? 0 : 1); + else + WMA_LOGE("Data Tx Ack Cb is NULL"); + wma_handle->umac_data_ota_ack_cb = NULL; wma_handle->last_umac_data_nbuf = NULL; adf_os_mem_free(work); diff --git a/CORE/SERVICES/WMA/wma.h b/CORE/SERVICES/WMA/wma.h index 6fa6cc682ca1..5d49d20dca7c 100644 --- a/CORE/SERVICES/WMA/wma.h +++ b/CORE/SERVICES/WMA/wma.h @@ -142,6 +142,7 @@ #define WMA_HOST_ROAM_SCAN_REQID_PREFIX 0xA800 /* Prefix used by scan requestor id on host */ #define WMA_HOST_SCAN_REQUESTOR_ID_PREFIX 0xA000 +#define WMA_HW_DEF_SCAN_MAX_DURATION 30000 /* 30 secs */ /* Max offchannel duration */ #define WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS (3) diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c index 0d7268ee9cae..833387ba030d 100644 --- a/CORE/SME/src/sme_common/sme_Api.c +++ b/CORE/SME/src/sme_common/sme_Api.c @@ -406,7 +406,8 @@ tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac ) /* reset when free list is available */ smeCommandQueueFull = 0; } - else { + else + { int idx = 1; //Cannot change pRetCmd here since it needs to return later. @@ -444,22 +445,30 @@ tSmeCmd *smeGetCommandBuffer( tpAniSirGlobal pMac ) } pEntry = csrLLNext( &pMac->sme.smeCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); } - /* Increament static variable so that it prints pending command only once*/ - smeCommandQueueFull++; csrLLUnlock(&pMac->sme.smeCmdPendingList); + idx = 1; //There may be some more command in CSR's own pending queue csrLLLock(&pMac->roam.roamCmdPendingList); pEntry = csrLLPeekHead( &pMac->roam.roamCmdPendingList, LL_ACCESS_NOLOCK ); - while(pEntry) + while(pEntry && !smeCommandQueueFull) { pTempCmd = GET_BASE_ADDR( pEntry, tSmeCmd, Link ); - smsLog( pMac, LOGE, "Out of command buffer.... CSR pending command #%d (0x%X)", - idx++, pTempCmd->command ); + /* Print only 1st five commands from CSR pending queue */ + if (idx <= 5) + smsLog( pMac, LOGE, + "Out of command buffer.... CSR roamCmdPendingList command #%d (0x%X)", + idx, pTempCmd->command ); + idx++; dumpCsrCommandInfo(pMac, pTempCmd); pEntry = csrLLNext( &pMac->roam.roamCmdPendingList, pEntry, LL_ACCESS_NOLOCK ); } + /* Increament static variable so that it prints pending command only once*/ + smeCommandQueueFull++; csrLLUnlock(&pMac->roam.roamCmdPendingList); + + /* panic with out-of-command */ + VOS_BUG(0); } /* memset to zero */ @@ -872,6 +881,8 @@ sme_process_cmd: { //Force this command to wake up the chip csrLLInsertHead( &pMac->sme.smeCmdActiveList, &pPmcCmd->Link, LL_ACCESS_NOLOCK ); + MTRACE(vos_trace(VOS_MODULE_ID_SME, + TRACE_CODE_SME_COMMAND, pPmcCmd->sessionId, pPmcCmd->command)); csrLLUnlock( &pMac->sme.smeCmdActiveList ); /* Handle PS Offload Case Separately */ if(pMac->psOffloadEnabled) @@ -12328,76 +12339,106 @@ void sme_enable_disable_split_scan (tHalHandle hHal, tANI_U8 nNumStaChan, } -/* --------------------------------------------------------------------------- - \fn sme_AddPeriodicTxPtrn - \brief API to Periodic TX Pattern Offload feature - \param hHal - The handle returned by macOpen - \param addPeriodicTxPtrnParams - Pointer to the add pattern structure - \return eHalStatus - ---------------------------------------------------------------------------*/ -eHalStatus sme_AddPeriodicTxPtrn(tHalHandle hHal, tSirAddPeriodicTxPtrn - *addPeriodicTxPtrnParams) +/** + * sme_AddPeriodicTxPtrn() - Add Periodic TX Pattern + * @hal: global hal handle + * @addPeriodicTxPtrnParams: request message + * + * Return: eHalStatus enumeration + */ +eHalStatus +sme_AddPeriodicTxPtrn(tHalHandle hal, + struct sSirAddPeriodicTxPtrn *addPeriodicTxPtrnParams) { - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - eHalStatus status; - vos_msg_t msg; + eHalStatus status = eHAL_STATUS_SUCCESS; + VOS_STATUS vos_status = VOS_STATUS_SUCCESS; + tpAniSirGlobal mac = PMAC_STRUCT(hal); + struct sSirAddPeriodicTxPtrn *req_msg; + vos_msg_t msg; - if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) - { - msg.type = WDA_ADD_PERIODIC_TX_PTRN_IND; - msg.bodyptr = addPeriodicTxPtrnParams; + smsLog(mac, LOG1, FL("enter")); - if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) - { - VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " - "to post WDA_ADD_PERIODIC_TX_PTRN_IND to WDA!", - __func__); + req_msg = vos_mem_malloc(sizeof(*req_msg)); + if (!req_msg) { + smsLog(mac, LOGE, FL("vos_mem_malloc failed")); + return eHAL_STATUS_FAILED_ALLOC; + } - sme_ReleaseGlobalLock(&pMac->sme); - return eHAL_STATUS_FAILURE; - } + *req_msg = *addPeriodicTxPtrnParams; - sme_ReleaseGlobalLock(&pMac->sme); - return eHAL_STATUS_SUCCESS; - } + status = sme_AcquireGlobalLock(&mac->sme); + if (status != eHAL_STATUS_SUCCESS) { + smsLog(mac, LOGE, + FL("sme_AcquireGlobalLock failed!(status=%d)"), + status); + vos_mem_free(req_msg); + return status; + } - return status; + /* Serialize the req through MC thread */ + msg.bodyptr = req_msg; + msg.type = WDA_ADD_PERIODIC_TX_PTRN_IND; + vos_status = vos_mq_post_message(VOS_MQ_ID_WDA, &msg); + if (!VOS_IS_STATUS_SUCCESS(vos_status)) { + smsLog(mac, LOGE, + FL("vos_mq_post_message failed!(err=%d)"), + vos_status); + vos_mem_free(req_msg); + status = eHAL_STATUS_FAILURE; + } + sme_ReleaseGlobalLock(&mac->sme); + return status; } -/* --------------------------------------------------------------------------- - \fn sme_DelPeriodicTxPtrn - \brief API to Periodic TX Pattern Offload feature - \param hHal - The handle returned by macOpen - \param delPeriodicTxPtrnParams - Pointer to the delete pattern structure - \return eHalStatus - ---------------------------------------------------------------------------*/ -eHalStatus sme_DelPeriodicTxPtrn(tHalHandle hHal, tSirDelPeriodicTxPtrn - *delPeriodicTxPtrnParams) +/** + * sme_DelPeriodicTxPtrn() - Delete Periodic TX Pattern + * @hal: global hal handle + * @delPeriodicTxPtrnParams: request message + * + * Return: eHalStatus enumeration + */ +eHalStatus +sme_DelPeriodicTxPtrn(tHalHandle hal, + struct sSirDelPeriodicTxPtrn *delPeriodicTxPtrnParams) { - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); - eHalStatus status; - vos_msg_t msg; + eHalStatus status = eHAL_STATUS_SUCCESS; + VOS_STATUS vos_status = VOS_STATUS_SUCCESS; + tpAniSirGlobal mac = PMAC_STRUCT(hal); + struct sSirDelPeriodicTxPtrn *req_msg; + vos_msg_t msg; - if (eHAL_STATUS_SUCCESS == (status = sme_AcquireGlobalLock(&pMac->sme))) - { - msg.type = WDA_DEL_PERIODIC_TX_PTRN_IND; - msg.bodyptr = delPeriodicTxPtrnParams; + smsLog(mac, LOG1, FL("enter")); - if (!VOS_IS_STATUS_SUCCESS(vos_mq_post_message(VOS_MODULE_ID_WDA, &msg))) - { - VOS_TRACE( VOS_MODULE_ID_SME, VOS_TRACE_LEVEL_ERROR,"%s: Not able " - "to post WDA_DEL_PERIODIC_TX_PTRN_IND to WDA!", - __func__); + req_msg = vos_mem_malloc(sizeof(*req_msg)); + if (!req_msg) { + smsLog(mac, LOGE, FL("vos_mem_malloc failed")); + return eHAL_STATUS_FAILED_ALLOC; + } - sme_ReleaseGlobalLock(&pMac->sme); - return eHAL_STATUS_FAILURE; - } + *req_msg = *delPeriodicTxPtrnParams; - sme_ReleaseGlobalLock(&pMac->sme); - return eHAL_STATUS_SUCCESS; - } + status = sme_AcquireGlobalLock(&mac->sme); + if (status != eHAL_STATUS_SUCCESS) { + smsLog(mac, LOGE, + FL("sme_AcquireGlobalLock failed!(status=%d)"), + status); + vos_mem_free(req_msg); + return status; + } - return status; + /* Serialize the req through MC thread */ + msg.bodyptr = req_msg; + msg.type = WDA_DEL_PERIODIC_TX_PTRN_IND; + vos_status = vos_mq_post_message(VOS_MQ_ID_WDA, &msg); + if (!VOS_IS_STATUS_SUCCESS(vos_status)) { + smsLog(mac, LOGE, + FL("vos_mq_post_message failed!(err=%d)"), + vos_status); + vos_mem_free(req_msg); + status = eHAL_STATUS_FAILURE; + } + sme_ReleaseGlobalLock(&mac->sme); + return status; } void smeGetCommandQStatus( tHalHandle hHal ) |
