From 79a5edccee33e1fdca38655ce7608d4d70f84063 Mon Sep 17 00:00:00 2001 From: Edayilliam Jayadev Date: Tue, 26 Mar 2019 18:49:27 +0530 Subject: [PATCH] qcacmn: dont send Spectral stop WMI if Spectral scan is not in progress Before sending Spectral stop WMI to FW check whether Spectral scan is in progress. When all vdevs are in down state host driver will send a stop Spectral scan command to FW. In that scenario there is a possibility that stop Spectral scan WMI message may go to FW even though Spectral scan is not active. To prevent this we add a check in stop Spectral scan routine to send WMI message only if scan is in progress. CRs-Fixed: 2424020 Change-Id: I2119935759c40f62df75574b6a29174973f2703f --- target_if/spectral/target_if_spectral.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/target_if/spectral/target_if_spectral.c b/target_if/spectral/target_if_spectral.c index 3c8fed588b47..97124d070ab4 100644 --- a/target_if/spectral/target_if_spectral.c +++ b/target_if/spectral/target_if_spectral.c @@ -1011,6 +1011,23 @@ target_if_sops_stop_spectral_scan(void *arg) struct target_if_spectral *spectral = (struct target_if_spectral *)arg; uint8_t val = 0; int tempret, ret = 0; + uint8_t enabled = 0; + + tempret = target_if_spectral_info_read( + spectral, + TARGET_IF_SPECTRAL_INFO_ENABLED, + &enabled, sizeof(enabled)); + + if (tempret) + /* + * Could not determine if Spectral is enabled. Assume scan is + * not in progress + */ + enabled = 0; + + /* if scan is not enabled, no need to send stop to FW */ + if (!enabled) + return -EPERM; tempret = target_if_spectral_info_write( spectral,