diff --git a/core/cds/src/cds_api.c b/core/cds/src/cds_api.c index 26642ce9ddd7..dea481a7fabd 100644 --- a/core/cds/src/cds_api.c +++ b/core/cds/src/cds_api.c @@ -860,6 +860,7 @@ QDF_STATUS cds_pre_enable(void) if ((!cds_is_fw_down()) && (!cds_is_self_recovery_enabled())) QDF_BUG(0); + wma_wmi_stop(); htc_stop(gp_cds_context->htc_ctx); return QDF_STATUS_E_FAILURE; } @@ -867,6 +868,7 @@ QDF_STATUS cds_pre_enable(void) if (cdp_pdev_post_attach(soc, gp_cds_context->pdev_txrx_ctx)) { QDF_TRACE(QDF_MODULE_ID_QDF, QDF_TRACE_LEVEL_FATAL, "Failed to attach pdev"); + wma_wmi_stop(); htc_stop(gp_cds_context->htc_ctx); QDF_ASSERT(0); return QDF_STATUS_E_FAILURE; @@ -1123,6 +1125,7 @@ QDF_STATUS cds_post_disable(void) hif_reset_soc(hif_ctx); if (gp_cds_context->htc_ctx) { + wma_wmi_stop(); htc_stop(gp_cds_context->htc_ctx); } diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h index 20cd538236dc..5c1ea4f5e870 100644 --- a/core/wma/inc/wma_api.h +++ b/core/wma/inc/wma_api.h @@ -337,4 +337,11 @@ QDF_STATUS wma_set_vc_mode_config(void *wma_handle, QDF_STATUS wma_process_dhcp_ind(WMA_HANDLE wma_handle, tAniDHCPInd *ta_dhcp_ind); +/** + * wma_wmi_stop() - send wmi stop cmd + * + * Return: None + */ +void wma_wmi_stop(void); + #endif diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 007ae354775d..a6ce9686b356 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -2884,6 +2884,32 @@ void wma_vdev_deinit(struct wma_txrx_node *vdev) vdev->is_waiting_for_key = false; } +/** + * wma_wmi_stop() - generic function to block WMI commands + * @return: None + */ +void wma_wmi_stop(void) +{ + tp_wma_handle wma_handle; + + wma_handle = cds_get_context(QDF_MODULE_ID_WMA); + if (wma_handle == NULL) { + QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_INFO, + "wma_handle is NULL\n"); + return; + } + wmi_stop(wma_handle->wmi_handle); +} + +/** + * wma_open() - Allocate wma context and initialize it. + * @cds_context: cds context + * @wma_tgt_cfg_cb: tgt config callback fun + * @radar_ind_cb: dfs radar indication callback + * @cds_cfg: mac parameters + * + * Return: 0 on success, errno on failure + */ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc, wma_tgt_cfg_cb tgt_cfg_cb, struct cds_config_info *cds_cfg,