From 60d18029b6ca0f0a3e46c89746c36f2b0ac30af5 Mon Sep 17 00:00:00 2001 From: Adil Saeed Musthafa Date: Mon, 13 Apr 2020 23:51:03 -0700 Subject: [PATCH] qcacmn: Add API to check if WMI is blocked or not Add API to check if WMI commands have been blocked Change-Id: I675b102b74d607332acf8a417c0c94955cbd5ecd CRs-Fixed: 2662158 --- wmi/inc/wmi_unified_api.h | 9 +++++++++ wmi/src/wmi_unified.c | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 1335c11b0a..a1608c98d1 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -469,6 +469,15 @@ wmi_stop(wmi_unified_t wmi_handle); int wmi_start(wmi_unified_t wmi_handle); +/** + * wmi_is_blocked() - generic function to check if WMI is blocked + * @wmi_handle: handle to WMI. + * + * @Return: true, if blocked, false if not blocked + */ +bool +wmi_is_blocked(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 d26908fa72..5c9ee76e93 100644 --- a/wmi/src/wmi_unified.c +++ b/wmi/src/wmi_unified.c @@ -3196,6 +3196,18 @@ wmi_start(wmi_unified_t wmi_handle) return 0; } +/** + * wmi_is_blocked() - generic function to check if WMI is blocked + * @wmi_handle: handle to WMI. + * + * @Return: true, if blocked, false if not blocked + */ +bool +wmi_is_blocked(wmi_unified_t wmi_handle) +{ + return (!(!wmi_handle->wmi_stopinprogress)); +} + /** * API to flush all the previous packets associated with the wmi endpoint *