From 62cd6803a7068ea755c7951e3de048b4ae486937 Mon Sep 17 00:00:00 2001 From: Jeff Johnson Date: Fri, 20 Jul 2018 12:38:25 -0700 Subject: [PATCH] qcacld-3.0: Remove tHalStopType There are multiple places where a tHalStopType parameter is passed but unused. This is a historical artifact, so remove all instances of it. Change-Id: Iebcbbac580495a376b7456b3a2901f33c2474f83 CRs-Fixed: 2283460 --- core/cds/src/cds_api.c | 8 ++-- core/mac/inc/mac_init_api.h | 16 +++++++- core/mac/inc/sir_types.h | 6 --- core/mac/src/sys/common/src/wlan_qct_sys.c | 6 +-- .../sys/legacy/src/system/src/mac_init_api.c | 17 ++------ core/sme/inc/csr_internal.h | 2 +- core/sme/inc/sme_api.h | 17 +++++++- core/sme/src/common/sme_api.c | 39 ++++++------------- core/sme/src/csr/csr_api_roam.c | 2 +- core/wma/inc/wma_api.h | 9 ++++- core/wma/src/wma_main.c | 9 +---- 11 files changed, 64 insertions(+), 67 deletions(-) diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 6cc16e942719..a563285e9519 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -930,14 +930,14 @@ err_soc_target_detach: /* NOOP */ err_sme_stop: - sme_stop(gp_cds_context->mac_context, HAL_STOP_TYPE_SYS_RESET); + sme_stop(gp_cds_context->mac_context); err_mac_stop: - mac_stop(gp_cds_context->mac_context, HAL_STOP_TYPE_SYS_RESET); + mac_stop(gp_cds_context->mac_context); err_wma_stop: qdf_event_reset(&gp_cds_context->wma_complete_event); - qdf_status = wma_stop(HAL_STOP_TYPE_RF_KILL); + qdf_status = wma_stop(); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { cds_err("Failed to stop wma"); QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); @@ -984,7 +984,7 @@ QDF_STATUS cds_disable(struct wlan_objmgr_psoc *psoc) dispatcher_psoc_disable(psoc); } - qdf_status = wma_stop(HAL_STOP_TYPE_RF_KILL); + qdf_status = wma_stop(); if (!QDF_IS_STATUS_SUCCESS(qdf_status)) { cds_err("Failed to stop wma"); diff --git a/core/mac/inc/mac_init_api.h b/core/mac/inc/mac_init_api.h index 5d872826af26..edd00d56b44b 100644 --- a/core/mac/inc/mac_init_api.h +++ b/core/mac/inc/mac_init_api.h @@ -33,7 +33,21 @@ #include "sir_types.h" QDF_STATUS mac_start(tHalHandle hHal, void *pHalMacStartParams); -QDF_STATUS mac_stop(tHalHandle hHal, tHalStopType stopType); + +/** + * mac_stop() - Stop all MAC modules + * @mac_handle: Opaque handle to the MAC context + * + * This function is called to stop MAC. This function will stop all + * the mac modules. + * + * Return: QDF_STATUS_SUCCESS if the MAC was successfully stopped. Any + * other value means that there was an issue with stopping the + * MAC, but the caller should still consider the MAC to be + * stopped. + */ +QDF_STATUS mac_stop(mac_handle_t mac_handle); + QDF_STATUS mac_open(struct wlan_objmgr_psoc *psoc, tHalHandle *pHalHandle, hdd_handle_t hdd_handle, struct cds_config_info *cds_cfg); QDF_STATUS mac_close(tHalHandle hHal); diff --git a/core/mac/inc/sir_types.h b/core/mac/inc/sir_types.h index d48c7726e07c..1e3b73d52ce7 100644 --- a/core/mac/inc/sir_types.h +++ b/core/mac/inc/sir_types.h @@ -71,12 +71,6 @@ typedef mac_handle_t tHalHandle; struct opaque_hdd_handle; typedef struct opaque_hdd_handle *hdd_handle_t; -typedef enum { - HAL_STOP_TYPE_SYS_RESET, - HAL_STOP_TYPE_SYS_DEEP_SLEEP, - HAL_STOP_TYPE_RF_KILL, -} tHalStopType; - #define HAL_NUM_ASSOC_STA 32 #define HAL_NUM_STA 41 diff --git a/core/mac/src/sys/common/src/wlan_qct_sys.c b/core/mac/src/sys/common/src/wlan_qct_sys.c index 0282f1e739fa..a2cf8f2df5b1 100644 --- a/core/mac/src/sys/common/src/wlan_qct_sys.c +++ b/core/mac/src/sys/common/src/wlan_qct_sys.c @@ -163,11 +163,9 @@ static QDF_STATUS sys_mc_process_msg(struct scheduler_msg *pMsg) "%s: Invalid hHal", __func__); break; } - qdf_status = sme_stop(hHal, - HAL_STOP_TYPE_SYS_DEEP_SLEEP); + qdf_status = sme_stop(hHal); QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); - qdf_status = mac_stop(hHal, - HAL_STOP_TYPE_SYS_DEEP_SLEEP); + qdf_status = mac_stop(hHal); QDF_ASSERT(QDF_IS_STATUS_SUCCESS(qdf_status)); ((sys_rsp_cb) pMsg->callback)(pMsg->bodyptr); qdf_status = QDF_STATUS_SUCCESS; diff --git a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c index af041c3dcc30..5d41df2fa6a0 100644 --- a/core/mac/src/sys/legacy/src/system/src/mac_init_api.c +++ b/core/mac/src/sys/legacy/src/system/src/mac_init_api.c @@ -62,21 +62,12 @@ QDF_STATUS mac_start(tHalHandle hHal, void *pHalMacStartParams) return status; } -/** ------------------------------------------------------------- - \fn mac_stop - \brief this function will be called from HDD to stop MAC. This function will stop all the mac modules. - \ memory with global context will only be initialized not freed here. - \param tHalHandle hHal - \param tHalStopType - \return QDF_STATUS - -------------------------------------------------------------*/ - -QDF_STATUS mac_stop(tHalHandle hHal, tHalStopType stopType) +QDF_STATUS mac_stop(mac_handle_t mac_handle) { - tpAniSirGlobal pMac = (tpAniSirGlobal) hHal; + tpAniSirGlobal mac = MAC_CONTEXT(mac_handle); - pe_stop(pMac); - cfg_cleanup(pMac); + pe_stop(mac); + cfg_cleanup(mac); return QDF_STATUS_SUCCESS; } diff --git a/core/sme/inc/csr_internal.h b/core/sme/inc/csr_internal.h index a5b5c0c3cb56..26816ed0df9f 100644 --- a/core/sme/inc/csr_internal.h +++ b/core/sme/inc/csr_internal.h @@ -1223,7 +1223,7 @@ QDF_STATUS csr_open(tpAniSirGlobal pMac); QDF_STATUS csr_init_chan_list(tpAniSirGlobal mac, uint8_t *alpha2); QDF_STATUS csr_close(tpAniSirGlobal pMac); QDF_STATUS csr_start(tpAniSirGlobal pMac); -QDF_STATUS csr_stop(tpAniSirGlobal pMac, tHalStopType stopType); +QDF_STATUS csr_stop(tpAniSirGlobal pMac); QDF_STATUS csr_ready(tpAniSirGlobal pMac); #ifdef FEATURE_WLAN_WAPI diff --git a/core/sme/inc/sme_api.h b/core/sme/inc/sme_api.h index a384c1e7c92b..30c8f0715407 100644 --- a/core/sme/inc/sme_api.h +++ b/core/sme/inc/sme_api.h @@ -288,7 +288,22 @@ QDF_STATUS sme_init_chan_list(tHalHandle hal, uint8_t *alpha2, enum country_src cc_src); QDF_STATUS sme_close(tHalHandle hHal); QDF_STATUS sme_start(tHalHandle hHal); -QDF_STATUS sme_stop(tHalHandle hHal, tHalStopType stopType); + +/** + * sme_stop() - Stop all SME modules and put them at idle state + * @mac_handle: Opaque handle to the MAC context + * + * The function stops each module in SME. Upon return, all modules are + * at idle state ready to start. + * + * This is a synchronous call + * + * Return: QDF_STATUS_SUCCESS if SME is stopped. Other status means + * SME failed to stop one or more modules but caller should + * still consider SME is stopped. + */ +QDF_STATUS sme_stop(mac_handle_t mac_handle); + /* * sme_open_session() - Open a session for given persona * diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c index b6f40af91bd1..afabd5c2ee88 100644 --- a/core/sme/src/common/sme_api.c +++ b/core/sme/src/common/sme_api.c @@ -2446,42 +2446,27 @@ static QDF_STATUS sme_process_nss_update_resp(tpAniSirGlobal mac, uint8_t *msg) return QDF_STATUS_SUCCESS; } -/* - * sme_stop() - Stop all SME modules and put them at idle state - * - * The function stops each module in SME, PMC, CSR, etc. . Upon - * return, all modules are at idle state ready to start. - * This is a synchronous call - * - * hHal - The handle returned by mac_open - * tHalStopType - reason for stopping - * Return QDF_STATUS_SUCCESS - SME is stopped. - * Other status means SME is failed to stop but caller should still - * consider SME is stopped. - */ -QDF_STATUS sme_stop(tHalHandle hHal, tHalStopType stopType) +QDF_STATUS sme_stop(mac_handle_t mac_handle) { - QDF_STATUS status = QDF_STATUS_E_FAILURE; - QDF_STATUS fail_status = QDF_STATUS_SUCCESS; - tpAniSirGlobal pMac = PMAC_STRUCT(hHal); + QDF_STATUS status; + QDF_STATUS ret_status = QDF_STATUS_SUCCESS; + tpAniSirGlobal mac = MAC_CONTEXT(mac_handle); - status = rrm_stop(pMac); - if (!QDF_IS_STATUS_SUCCESS(status)) { + status = rrm_stop(mac); + if (QDF_IS_STATUS_ERROR(status)) { + ret_status = status; sme_err("rrm_stop failed with status: %d", status); } - status = csr_stop(pMac, stopType); - if (!QDF_IS_STATUS_SUCCESS(status)) { + status = csr_stop(mac); + if (QDF_IS_STATUS_ERROR(status)) { + ret_status = status; sme_err("csr_stop failed with status: %d", status); - fail_status = status; } - if (!QDF_IS_STATUS_SUCCESS(fail_status)) - status = fail_status; + mac->sme.state = SME_STATE_STOP; - pMac->sme.state = SME_STATE_STOP; - - return status; + return ret_status; } /* diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 11e3184c67fb..158c3b9f39bc 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -1211,7 +1211,7 @@ QDF_STATUS csr_start(tpAniSirGlobal pMac) return status; } -QDF_STATUS csr_stop(tpAniSirGlobal pMac, tHalStopType stopType) +QDF_STATUS csr_stop(tpAniSirGlobal pMac) { uint32_t sessionId; diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index badc36730511..8d79161dc37e 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -102,7 +102,14 @@ QDF_STATUS wma_mc_process_handler(struct scheduler_msg *msg); QDF_STATUS wma_start(void); -QDF_STATUS wma_stop(uint8_t reason); +/** + * wma_stop() - wma stop function. + * + * Performs all of the operations required to stop the WMA layer + * + * Return: QDF_STATUS_SUCCESS on success, QDF Error on failure + */ +QDF_STATUS wma_stop(void); QDF_STATUS wma_close(void); diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 1c5ea5ec6d4e..735f2debd678 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -4388,14 +4388,7 @@ end: return qdf_status; } -/** - * wma_stop() - wma stop function. - * cleanup timers and suspend target. - * @reason: reason for wma_stop. - * - * Return: 0 on success, QDF Error on failure - */ -QDF_STATUS wma_stop(uint8_t reason) +QDF_STATUS wma_stop(void) { tp_wma_handle wma_handle; QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;