From 2bef7708b16203e080ab26ae335a971c9e2c7bf8 Mon Sep 17 00:00:00 2001 From: Shiva Krishna Pittala Date: Wed, 14 Sep 2022 15:45:11 +0530 Subject: [PATCH] qcacmn: Stop the spectral scan at the end of last report in finite scan In the case of finite Spectral scan, the spectral scan will be stopped in the target once the requested count of spectral reports got generated. The Host will not be notified of this stop scan. To synchronize the Host data structures in accordance with the target, we explicitly stop the scan once the last report is received. In the current implementation, the stop_scan() is called at the beginning of the last report processing and we continue processing the last report. As part of the last report processing, we could access the data structures that were reset during the stop_scan(). To fix this, stop the spectral scan at the end of the last report processing. Change-Id: Iecfa4e72ccbedae77ee2a57e9283910e980121d5 CRs-Fixed: 3287136 --- .../spectral/target_if_spectral_phyerr.c | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/target_if/spectral/target_if_spectral_phyerr.c b/target_if/spectral/target_if_spectral_phyerr.c index 7cdddf6c32..98102ba327 100644 --- a/target_if/spectral/target_if_spectral_phyerr.c +++ b/target_if/spectral/target_if_spectral_phyerr.c @@ -3496,22 +3496,6 @@ target_if_consume_spectral_report_gen3( goto fail_no_print; } - ret = target_if_spectral_is_finite_scan(spectral, spectral_mode, - &finite_scan); - if (QDF_IS_STATUS_ERROR(ret)) { - spectral_err_rl("Failed to check scan is finite"); - goto fail; - } - - if (finite_scan) { - ret = target_if_spectral_finite_scan_update(spectral, - spectral_mode); - if (QDF_IS_STATUS_ERROR(ret)) { - spectral_err_rl("Failed to update scan count"); - goto fail; - } - } - /* Validate and Process the search FFT report */ ret = target_if_process_sfft_report_gen3( data, p_sfft, @@ -3589,8 +3573,24 @@ target_if_consume_spectral_report_gen3( goto fail; } + ret = target_if_spectral_is_finite_scan(spectral, spectral_mode, + &finite_scan); + if (QDF_IS_STATUS_ERROR(ret)) { + spectral_err_rl("Failed to check scan is finite"); + goto fail; + } + + if (finite_scan) { + ret = target_if_spectral_finite_scan_update(spectral, + spectral_mode); + if (QDF_IS_STATUS_ERROR(ret)) { + spectral_err_rl("Failed to update scan count"); + goto fail; + } + } + return 0; - fail: +fail: spectral_err_rl("Error while processing Spectral report"); fail_no_print: if (spectral_mode != SPECTRAL_SCAN_MODE_INVALID)