qcacmn: Add INI support to disable spectral feature
Add INI support to disable spectral feature and do not process the spectral user commands if spectral feature is disabled. Change-Id: Id353131675454652d59fd5d5f8fd3d732a07b777 Acked-by: Shashikala Prabhu <pshashik@codeaurora.org> CRs-Fixed: 2343947
This commit is contained in:

committed by
nshrivas

parent
779d274148
commit
7eb2d08e3b
@@ -27,12 +27,14 @@
|
|||||||
#include "cfg_dp.h"
|
#include "cfg_dp.h"
|
||||||
#include <wlan_extscan_cfg.h>
|
#include <wlan_extscan_cfg.h>
|
||||||
#include "cfg_green_ap_params.h"
|
#include "cfg_green_ap_params.h"
|
||||||
|
#include <cfg_spectral.h>
|
||||||
|
|
||||||
#define CFG_CONVERGED_ALL \
|
#define CFG_CONVERGED_ALL \
|
||||||
CFG_SCAN_ALL \
|
CFG_SCAN_ALL \
|
||||||
CFG_DP \
|
CFG_DP \
|
||||||
CFG_EXTSCAN_ALL \
|
CFG_EXTSCAN_ALL \
|
||||||
CFG_GREEN_AP_ALL
|
CFG_GREEN_AP_ALL \
|
||||||
|
CFG_SPECTRAL_ALL
|
||||||
|
|
||||||
#endif /* __CFG_CONVERGED_H */
|
#endif /* __CFG_CONVERGED_H */
|
||||||
|
|
||||||
|
@@ -706,9 +706,6 @@ QDF_STATUS dispatcher_init(void)
|
|||||||
if (QDF_STATUS_SUCCESS != dispatcher_splitmac_init())
|
if (QDF_STATUS_SUCCESS != dispatcher_splitmac_init())
|
||||||
goto splitmac_init_fail;
|
goto splitmac_init_fail;
|
||||||
|
|
||||||
if (QDF_STATUS_SUCCESS != dispatcher_spectral_init())
|
|
||||||
goto spectral_init_fail;
|
|
||||||
|
|
||||||
if (QDF_STATUS_SUCCESS != dispatcher_fd_init())
|
if (QDF_STATUS_SUCCESS != dispatcher_fd_init())
|
||||||
goto fd_init_fail;
|
goto fd_init_fail;
|
||||||
|
|
||||||
@@ -721,6 +718,9 @@ QDF_STATUS dispatcher_init(void)
|
|||||||
if (QDF_IS_STATUS_ERROR(cfg_dispatcher_init()))
|
if (QDF_IS_STATUS_ERROR(cfg_dispatcher_init()))
|
||||||
goto cfg_init_fail;
|
goto cfg_init_fail;
|
||||||
|
|
||||||
|
if (QDF_STATUS_SUCCESS != dispatcher_spectral_init())
|
||||||
|
goto spectral_init_fail;
|
||||||
|
|
||||||
if (QDF_STATUS_SUCCESS != wlan_vdev_mlme_init())
|
if (QDF_STATUS_SUCCESS != wlan_vdev_mlme_init())
|
||||||
goto vdev_mlme_init_fail;
|
goto vdev_mlme_init_fail;
|
||||||
|
|
||||||
@@ -737,6 +737,8 @@ QDF_STATUS dispatcher_init(void)
|
|||||||
scheduler_init_fail:
|
scheduler_init_fail:
|
||||||
wlan_vdev_mlme_deinit();
|
wlan_vdev_mlme_deinit();
|
||||||
vdev_mlme_init_fail:
|
vdev_mlme_init_fail:
|
||||||
|
dispatcher_spectral_deinit();
|
||||||
|
spectral_init_fail:
|
||||||
cfg_dispatcher_deinit();
|
cfg_dispatcher_deinit();
|
||||||
cfg_init_fail:
|
cfg_init_fail:
|
||||||
dispatcher_ftm_deinit();
|
dispatcher_ftm_deinit();
|
||||||
@@ -745,8 +747,6 @@ ftm_init_fail:
|
|||||||
green_ap_init_fail:
|
green_ap_init_fail:
|
||||||
dispatcher_fd_deinit();
|
dispatcher_fd_deinit();
|
||||||
fd_init_fail:
|
fd_init_fail:
|
||||||
dispatcher_spectral_deinit();
|
|
||||||
spectral_init_fail:
|
|
||||||
dispatcher_splitmac_deinit();
|
dispatcher_splitmac_deinit();
|
||||||
splitmac_init_fail:
|
splitmac_init_fail:
|
||||||
dispatcher_deinit_son();
|
dispatcher_deinit_son();
|
||||||
@@ -991,10 +991,13 @@ qdf_export_symbol(dispatcher_psoc_disable);
|
|||||||
|
|
||||||
QDF_STATUS dispatcher_pdev_open(struct wlan_objmgr_pdev *pdev)
|
QDF_STATUS dispatcher_pdev_open(struct wlan_objmgr_pdev *pdev)
|
||||||
{
|
{
|
||||||
|
QDF_STATUS status;
|
||||||
|
|
||||||
if (QDF_STATUS_SUCCESS != dispatcher_regulatory_pdev_open(pdev))
|
if (QDF_STATUS_SUCCESS != dispatcher_regulatory_pdev_open(pdev))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (QDF_STATUS_SUCCESS != dispatcher_spectral_pdev_open(pdev))
|
status = dispatcher_spectral_pdev_open(pdev);
|
||||||
|
if (status != QDF_STATUS_SUCCESS && status != QDF_STATUS_COMP_DISABLED)
|
||||||
goto spectral_pdev_open_fail;
|
goto spectral_pdev_open_fail;
|
||||||
|
|
||||||
if (QDF_STATUS_SUCCESS != wlan_mgmt_txrx_pdev_open(pdev))
|
if (QDF_STATUS_SUCCESS != wlan_mgmt_txrx_pdev_open(pdev))
|
||||||
|
@@ -30,6 +30,8 @@ INCS += -I$(obj)/$(DEPTH)/cmn_dev/spectral/core
|
|||||||
INCS += -I$(obj)/$(DEPTH)/component_dev/direct_attach/spectral/core
|
INCS += -I$(obj)/$(DEPTH)/component_dev/direct_attach/spectral/core
|
||||||
INCS += -I$(obj)/$(DEPTH)/cmn_dev/target_if/direct_buf_rx/inc
|
INCS += -I$(obj)/$(DEPTH)/cmn_dev/target_if/direct_buf_rx/inc
|
||||||
INCS += -I$(obj)/$(DEPTH)/cmn_dev/wbuff/inc
|
INCS += -I$(obj)/$(DEPTH)/cmn_dev/wbuff/inc
|
||||||
|
INCS += -I$(obj)/$(DEPTH)/cmn_dev/cfg/inc
|
||||||
|
INCS += -I$(obj)/$(DEPTH)/ini_cfg/inc/
|
||||||
|
|
||||||
ifeq ($(WLAN_CONV_CRYPTO_SUPPORTED), 1)
|
ifeq ($(WLAN_CONV_CRYPTO_SUPPORTED), 1)
|
||||||
INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/crypto/inc
|
INCS += -I$(obj)/$(DEPTH)/cmn_dev/umac/cmn_services/crypto/inc
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <wlan_spectral_public_structs.h>
|
#include <wlan_spectral_public_structs.h>
|
||||||
#include <wlan_cfg80211_spectral.h>
|
#include <wlan_cfg80211_spectral.h>
|
||||||
|
#include <cfg_ucfg_api.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* spectral_get_vdev() - Get pointer to vdev to be used for Spectral
|
* spectral_get_vdev() - Get pointer to vdev to be used for Spectral
|
||||||
@@ -550,6 +551,13 @@ wlan_spectral_psoc_obj_create_handler(struct wlan_objmgr_psoc *psoc, void *arg)
|
|||||||
spectral_err("PSOC is NULL");
|
spectral_err("PSOC is NULL");
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cfg_get(psoc, CFG_SPECTRAL_DISABLE)) {
|
||||||
|
wlan_psoc_nif_feat_cap_set(psoc, WLAN_SOC_F_SPECTRAL_DISABLE);
|
||||||
|
spectral_info("Spectral is disabled");
|
||||||
|
return QDF_STATUS_COMP_DISABLED;
|
||||||
|
}
|
||||||
|
|
||||||
sc = (struct spectral_context *)
|
sc = (struct spectral_context *)
|
||||||
qdf_mem_malloc(sizeof(struct spectral_context));
|
qdf_mem_malloc(sizeof(struct spectral_context));
|
||||||
if (!sc) {
|
if (!sc) {
|
||||||
@@ -578,6 +586,12 @@ wlan_spectral_psoc_obj_destroy_handler(struct wlan_objmgr_psoc *psoc,
|
|||||||
spectral_err("PSOC is NULL");
|
spectral_err("PSOC is NULL");
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wlan_spectral_is_feature_disabled(psoc)) {
|
||||||
|
spectral_info("Spectral is disabled");
|
||||||
|
return QDF_STATUS_COMP_DISABLED;
|
||||||
|
}
|
||||||
|
|
||||||
sc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
sc = wlan_objmgr_psoc_get_comp_private_obj(psoc,
|
||||||
WLAN_UMAC_COMP_SPECTRAL);
|
WLAN_UMAC_COMP_SPECTRAL);
|
||||||
if (sc) {
|
if (sc) {
|
||||||
@@ -603,6 +617,12 @@ wlan_spectral_pdev_obj_create_handler(struct wlan_objmgr_pdev *pdev, void *arg)
|
|||||||
spectral_err("PDEV is NULL");
|
spectral_err("PDEV is NULL");
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wlan_spectral_is_feature_disabled(wlan_pdev_get_psoc(pdev))) {
|
||||||
|
spectral_info("Spectral is disabled");
|
||||||
|
return QDF_STATUS_COMP_DISABLED;
|
||||||
|
}
|
||||||
|
|
||||||
ps = (struct pdev_spectral *)
|
ps = (struct pdev_spectral *)
|
||||||
qdf_mem_malloc(sizeof(struct pdev_spectral));
|
qdf_mem_malloc(sizeof(struct pdev_spectral));
|
||||||
if (!ps) {
|
if (!ps) {
|
||||||
@@ -647,6 +667,12 @@ wlan_spectral_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev,
|
|||||||
spectral_err("PDEV is NULL");
|
spectral_err("PDEV is NULL");
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wlan_spectral_is_feature_disabled(wlan_pdev_get_psoc(pdev))) {
|
||||||
|
spectral_info("Spectral is disabled");
|
||||||
|
return QDF_STATUS_COMP_DISABLED;
|
||||||
|
}
|
||||||
|
|
||||||
sc = spectral_get_spectral_ctx_from_pdev(pdev);
|
sc = spectral_get_spectral_ctx_from_pdev(pdev);
|
||||||
if (!sc) {
|
if (!sc) {
|
||||||
spectral_err("Spectral context is NULL!");
|
spectral_err("Spectral context is NULL!");
|
||||||
|
49
spectral/dispatcher/inc/cfg_spectral.h
Normal file
49
spectral/dispatcher/inc/cfg_spectral.h
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018 The Linux Foundation. All rights reserved.
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, and/or distribute this software for
|
||||||
|
* any purpose with or without fee is hereby granted, provided that the
|
||||||
|
* above copyright notice and this permission notice appear in all
|
||||||
|
* copies.
|
||||||
|
*
|
||||||
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
||||||
|
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
||||||
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
||||||
|
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
||||||
|
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
||||||
|
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* DOC: This file contains centralized cfg definitions of Spectral component
|
||||||
|
*/
|
||||||
|
#ifndef __CONFIG_SPECTRAL_H
|
||||||
|
#define __CONFIG_SPECTRAL_H
|
||||||
|
|
||||||
|
/*
|
||||||
|
* <ini>
|
||||||
|
* spectral_disable - disable spectral feature
|
||||||
|
* @Min: 0
|
||||||
|
* @Max: 1
|
||||||
|
* @Default: 0
|
||||||
|
*
|
||||||
|
* This ini is used to disable spectral feature.
|
||||||
|
*
|
||||||
|
* Related: None
|
||||||
|
*
|
||||||
|
* Supported Feature: Spectral
|
||||||
|
*
|
||||||
|
* Usage: External
|
||||||
|
*
|
||||||
|
* </ini>
|
||||||
|
*/
|
||||||
|
#define CFG_SPECTRAL_DISABLE \
|
||||||
|
CFG_INI_BOOL("spectral_disable", false, \
|
||||||
|
"Spectral disable")
|
||||||
|
|
||||||
|
#define CFG_SPECTRAL_ALL \
|
||||||
|
CFG(CFG_SPECTRAL_DISABLE)
|
||||||
|
|
||||||
|
#endif
|
@@ -27,6 +27,14 @@
|
|||||||
struct direct_buf_rx_data;
|
struct direct_buf_rx_data;
|
||||||
struct wmi_spectral_cmd_ops;
|
struct wmi_spectral_cmd_ops;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* wlan_spectral_is_feature_disabled() - Check if spectral feature is disabled
|
||||||
|
* @psoc - the physical device object.
|
||||||
|
*
|
||||||
|
* Return : true if spectral is disabled, else false.
|
||||||
|
*/
|
||||||
|
bool wlan_spectral_is_feature_disabled(struct wlan_objmgr_psoc *psoc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wlan_spectral_init() - API to init spectral component
|
* wlan_spectral_init() - API to init spectral component
|
||||||
*
|
*
|
||||||
|
@@ -294,7 +294,7 @@ tgt_spectral_register_to_dbr(struct wlan_objmgr_pdev *pdev)
|
|||||||
(pdev, 0,
|
(pdev, 0,
|
||||||
spectral_dbr_event_handler);
|
spectral_dbr_event_handler);
|
||||||
|
|
||||||
return QDF_STATUS_E_FAILURE;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
QDF_STATUS
|
QDF_STATUS
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
#include "../../core/spectral_cmn_api_i.h"
|
#include "../../core/spectral_cmn_api_i.h"
|
||||||
#include <wlan_spectral_utils_api.h>
|
#include <wlan_spectral_utils_api.h>
|
||||||
#include <qdf_module.h>
|
#include <qdf_module.h>
|
||||||
|
#include <cfg_ucfg_api.h>
|
||||||
|
|
||||||
int
|
int
|
||||||
ucfg_spectral_control(struct wlan_objmgr_pdev *pdev,
|
ucfg_spectral_control(struct wlan_objmgr_pdev *pdev,
|
||||||
@@ -34,6 +35,12 @@ ucfg_spectral_control(struct wlan_objmgr_pdev *pdev,
|
|||||||
spectral_err("PDEV is NULL!");
|
spectral_err("PDEV is NULL!");
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wlan_spectral_is_feature_disabled(wlan_pdev_get_psoc(pdev))) {
|
||||||
|
spectral_info("Spectral is disabled");
|
||||||
|
return -EPERM;
|
||||||
|
}
|
||||||
|
|
||||||
sc = spectral_get_spectral_ctx_from_pdev(pdev);
|
sc = spectral_get_spectral_ctx_from_pdev(pdev);
|
||||||
if (!sc) {
|
if (!sc) {
|
||||||
spectral_err("spectral context is NULL!");
|
spectral_err("spectral context is NULL!");
|
||||||
|
@@ -21,6 +21,20 @@
|
|||||||
#include <qdf_module.h>
|
#include <qdf_module.h>
|
||||||
#include "../../core/spectral_cmn_api_i.h"
|
#include "../../core/spectral_cmn_api_i.h"
|
||||||
#include <wlan_spectral_tgt_api.h>
|
#include <wlan_spectral_tgt_api.h>
|
||||||
|
#include <cfg_ucfg_api.h>
|
||||||
|
|
||||||
|
bool wlan_spectral_is_feature_disabled(struct wlan_objmgr_psoc *psoc)
|
||||||
|
{
|
||||||
|
if (!psoc) {
|
||||||
|
spectral_err("PSOC is NULL!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (wlan_psoc_nif_feat_cap_get(psoc, WLAN_SOC_F_SPECTRAL_DISABLE))
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QDF_STATUS
|
QDF_STATUS
|
||||||
wlan_spectral_init(void)
|
wlan_spectral_init(void)
|
||||||
@@ -215,7 +229,11 @@ QDF_STATUS spectral_pdev_open(struct wlan_objmgr_pdev *pdev)
|
|||||||
{
|
{
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
|
|
||||||
status = tgt_spectral_register_to_dbr(pdev);
|
if (wlan_spectral_is_feature_disabled(wlan_pdev_get_psoc(pdev))) {
|
||||||
|
spectral_info("Spectral is disabled");
|
||||||
|
return QDF_STATUS_COMP_DISABLED;
|
||||||
|
}
|
||||||
|
|
||||||
|
status = tgt_spectral_register_to_dbr(pdev);
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@@ -181,6 +181,8 @@
|
|||||||
#define WLAN_SOC_F_HOST_80211_ENABLE 0x00400000
|
#define WLAN_SOC_F_HOST_80211_ENABLE 0x00400000
|
||||||
/* MBSS IE enable */
|
/* MBSS IE enable */
|
||||||
#define WLAN_SOC_F_MBSS_IE_ENABLE 0x00800000
|
#define WLAN_SOC_F_MBSS_IE_ENABLE 0x00800000
|
||||||
|
/* Spectral disable */
|
||||||
|
#define WLAN_SOC_F_SPECTRAL_DISABLE 0x01000000
|
||||||
|
|
||||||
/* PSOC op flags */
|
/* PSOC op flags */
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user