qcacmn: Skip init/deinit/config if Spectral is disabled

If Spectral scan is disabled(agile and normal mode disabled)
skip init/deinit of Spectral module. Also avoid user requests
to configure/start/stop scan. If either agile or normal mode
is disabled block user requests for that mode alone.

CRs-Fixed: 2840335
Change-Id: I81148e5580fe4bf991b97cd086c8e3a9ca78e77d
This commit is contained in:
Edayilliam Jayadev
2020-12-17 12:26:28 +05:30
committed by snandini
orang tua b3affda43a
melakukan 80a12b81ed
5 mengubah file dengan 86 tambahan dan 44 penghapusan

Melihat File

@@ -496,16 +496,21 @@ QDF_STATUS
wlan_spectral_psoc_obj_create_handler(struct wlan_objmgr_psoc *psoc, void *arg)
{
struct spectral_context *sc = NULL;
QDF_STATUS status;
if (!psoc) {
spectral_err("PSOC is NULL");
return QDF_STATUS_E_FAILURE;
}
if (cfg_get(psoc, CFG_SPECTRAL_DISABLE)) {
wlan_psoc_nif_feat_cap_set(psoc,
WLAN_SOC_F_SPECTRAL_INI_DISABLE);
spectral_info("Spectral is disabled");
status = wlan_spectral_init_psoc_feature_cap(psoc);
if (QDF_IS_STATUS_ERROR(status)) {
spectral_err("Failed to intitialize spectral pdev feature caps");
return QDF_STATUS_E_FAILURE;
}
if (wlan_spectral_is_feature_disabled_psoc(psoc)) {
spectral_info("Spectral feature is disabled");
return QDF_STATUS_COMP_DISABLED;
}
@@ -535,8 +540,8 @@ wlan_spectral_psoc_obj_destroy_handler(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_E_FAILURE;
}
if (wlan_spectral_is_feature_disabled(psoc)) {
spectral_info("Spectral is disabled");
if (wlan_spectral_is_feature_disabled_psoc(psoc)) {
spectral_info("Spectral feature is disabled");
return QDF_STATUS_COMP_DISABLED;
}
@@ -560,14 +565,21 @@ wlan_spectral_pdev_obj_create_handler(struct wlan_objmgr_pdev *pdev, void *arg)
struct pdev_spectral *ps = NULL;
struct spectral_context *sc = NULL;
void *target_handle = NULL;
QDF_STATUS status;
if (!pdev) {
spectral_err("PDEV is NULL");
return QDF_STATUS_E_FAILURE;
}
if (wlan_spectral_is_feature_disabled(wlan_pdev_get_psoc(pdev))) {
spectral_info("Spectral is disabled");
status = wlan_spectral_init_pdev_feature_caps(pdev);
if (QDF_IS_STATUS_ERROR(status)) {
spectral_err("Failed to intitialize spectral pdev feature caps");
return QDF_STATUS_E_FAILURE;
}
if (wlan_spectral_is_feature_disabled_pdev(pdev)) {
spectral_info("Spectral feature is disabled");
return QDF_STATUS_COMP_DISABLED;
}
@@ -615,8 +627,8 @@ wlan_spectral_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev,
return QDF_STATUS_E_FAILURE;
}
if (wlan_spectral_is_feature_disabled(wlan_pdev_get_psoc(pdev))) {
spectral_info("Spectral is disabled");
if (wlan_spectral_is_feature_disabled_pdev(pdev)) {
spectral_info("Spectral feature is disabled");
return QDF_STATUS_COMP_DISABLED;
}