From ec05e794034e0080f25064b155abffc31e6b4b8b Mon Sep 17 00:00:00 2001 From: Shiva Krishna Pittala Date: Sun, 11 Apr 2021 15:01:19 +0530 Subject: [PATCH] qcacmn: Print an error message when Agile spectral frequency is 0 When agile spectral frequency is 0 and user tries to start agile spectral scan, 'A parameter is not initialized' message is thrown from user space but that message is not enough to identify that agile spectral frequency is not initialized. To address this, print an error message from driver when Agile spectral frequency is 0. CRs-Fixed: 2921000 Change-Id: Ibbb144a57774ad274b31015c7a04aa6097daf09f --- target_if/spectral/target_if_spectral.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/target_if/spectral/target_if_spectral.c b/target_if/spectral/target_if_spectral.c index 89cd126eff..6ae4748133 100644 --- a/target_if/spectral/target_if_spectral.c +++ b/target_if/spectral/target_if_spectral.c @@ -4833,11 +4833,16 @@ target_if_start_spectral_scan(struct wlan_objmgr_pdev *pdev, op_ch_width = ch_width[SPECTRAL_SCAN_MODE_NORMAL]; agile_ch_width = ch_width[SPECTRAL_SCAN_MODE_AGILE]; - if (!spectral->params[smode].ss_frequency.cfreq1 || - (agile_ch_width == CH_WIDTH_80P80MHZ && - !spectral->params[smode].ss_frequency.cfreq2)) { + if (!spectral->params[smode].ss_frequency.cfreq1) { *err = SPECTRAL_SCAN_ERR_PARAM_NOT_INITIALIZED; qdf_spin_unlock(&spectral->spectral_lock); + spectral_err("Agile Spectral cfreq1 is 0"); + return QDF_STATUS_E_FAILURE; + } else if (agile_ch_width == CH_WIDTH_80P80MHZ && + !spectral->params[smode].ss_frequency.cfreq2) { + *err = SPECTRAL_SCAN_ERR_PARAM_NOT_INITIALIZED; + qdf_spin_unlock(&spectral->spectral_lock); + spectral_err("Agile Spectral cfreq2 is 0"); return QDF_STATUS_E_FAILURE; }