From 9c0ec6c2d868b753f22096c7515bbcdad3478154 Mon Sep 17 00:00:00 2001 From: Manoj Ekbote Date: Tue, 29 Oct 2019 23:05:09 -0700 Subject: [PATCH] qcacmn: Add API to allow WMI commands Add API to restart sending WMI commands after they have been stopped using wmi_stop() API. Change-Id: Id65e5d1310cd7076ca47c6e7e19221492c10a868 --- wmi/inc/wmi_unified_api.h | 8 ++++++++ wmi/src/wmi_unified.c | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index dafb2e638e04..74d9b60ca88b 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -442,6 +442,14 @@ void wmi_set_tgt_assert(wmi_unified_t wmi_handle, bool val); int wmi_stop(wmi_unified_t wmi_handle); +/** + * generic function to start unified WMI command + * @param wmi_handle : handle to WMI. + * @return 0 on success and -ve on failure. + */ +int +wmi_start(wmi_unified_t wmi_handle); + /** * API to flush all the previous packets associated with the wmi endpoint * diff --git a/wmi/src/wmi_unified.c b/wmi/src/wmi_unified.c index cdb39a8fed60..f509dfa64e41 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -1770,7 +1770,8 @@ QDF_STATUS wmi_unified_cmd_send_fl(wmi_unified_t wmi_handle, wmi_buf_t buf, } if (wmi_handle->wmi_stopinprogress) { - wmi_nofl_err("%s:%d, WMI stop in progress", func, line); + wmi_nofl_err("%s:%d, WMI stop in progress, wmi_handle:%pK", + func, line, wmi_handle); return QDF_STATUS_E_INVAL; } @@ -3129,6 +3130,21 @@ wmi_stop(wmi_unified_t wmi_handle) return 0; } +/** + * wmi_start() - generic function to allow unified WMI command + * @wmi_handle: handle to WMI. + * + * @Return: success always. + */ +int +wmi_start(wmi_unified_t wmi_handle) +{ + QDF_TRACE(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_INFO, + "WMI Start"); + wmi_handle->wmi_stopinprogress = 0; + return 0; +} + /** * API to flush all the previous packets associated with the wmi endpoint *