qcacmn: Add APIs to check Spectral feature is disabled

Add utility APIs to check Spectral scan is disabled for
a given pdev/psoc/mode.

CRs-Fixed: 2840317
Change-Id: I6820cfc056c697434a138ddf9d8d93b5796a4722
This commit is contained in:
Edayilliam Jayadev
2020-12-17 12:16:49 +05:30
committed by snandini
vanhempi 3e679f9176
commit b3affda43a
5 muutettua tiedostoa jossa 170 lisäystä ja 11 poistoa

Näytä tiedosto

@@ -29,12 +29,42 @@ struct spectral_wmi_ops;
struct spectral_tgt_ops; struct spectral_tgt_ops;
/** /**
* wlan_spectral_is_feature_disabled() - Check if spectral feature is disabled * wlan_spectral_is_feature_disabled_pdev() - Check if spectral feature
* @psoc - the physical device object. * is disabled for a given pdev
* @pdev - pointer to pdev
* *
* Return : true if spectral is disabled, else false. * Return : true if spectral is disabled, else false.
*/ */
bool wlan_spectral_is_feature_disabled(struct wlan_objmgr_psoc *psoc); bool wlan_spectral_is_feature_disabled_pdev(struct wlan_objmgr_pdev *pdev);
/**
* wlan_spectral_is_feature_disabled_ini() - Check if spectral feature
* is disabled in INI
* @psoc - pointer to psoc
*
* Return : true if spectral is disabled, else false.
*/
bool wlan_spectral_is_feature_disabled_ini(struct wlan_objmgr_psoc *psoc);
/**
* wlan_spectral_is_feature_disabled_psoc() - Check if spectral feature
* is disabled for a given psoc
* @psoc - pointer to psoc
*
* Return : true if spectral is disabled, else false.
*/
bool wlan_spectral_is_feature_disabled_psoc(struct wlan_objmgr_psoc *psoc);
/**
* wlan_spectral_is_mode_disabled_pdev() - Check if a given spectral mode
* is disabled for a given pdev
* @pdev - pointer to pdev
* @smode - spectral scan mode
*
* Return : true if spectral mode is disabled, else false.
*/
bool wlan_spectral_is_mode_disabled_pdev(struct wlan_objmgr_pdev *pdev,
enum spectral_scan_mode smode);
/** /**
* wlan_spectral_init() - API to init spectral component * wlan_spectral_init() - API to init spectral component

Näytä tiedosto

@@ -23,17 +23,79 @@
#include <wlan_spectral_tgt_api.h> #include <wlan_spectral_tgt_api.h>
#include <cfg_ucfg_api.h> #include <cfg_ucfg_api.h>
bool wlan_spectral_is_feature_disabled(struct wlan_objmgr_psoc *psoc) bool wlan_spectral_is_mode_disabled_pdev(struct wlan_objmgr_pdev *pdev,
enum spectral_scan_mode smode)
{
bool spectral_mode_disable;
if (!pdev) {
spectral_err("pdev is NULL!");
return true;
}
switch (smode) {
case SPECTRAL_SCAN_MODE_NORMAL:
spectral_mode_disable = wlan_pdev_nif_feat_ext_cap_get(
pdev, WLAN_PDEV_FEXT_NORMAL_SPECTRAL_SCAN_DIS);
break;
case SPECTRAL_SCAN_MODE_AGILE:
spectral_mode_disable = wlan_pdev_nif_feat_ext_cap_get(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_DIS) &&
wlan_pdev_nif_feat_ext_cap_get(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_160_DIS) &&
wlan_pdev_nif_feat_ext_cap_get(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_80P80_DIS);
break;
default:
spectral_err("Invalid Spectral scan mode %d", smode);
spectral_mode_disable = true;
break;
}
return spectral_mode_disable;
}
bool
wlan_spectral_is_feature_disabled_ini(struct wlan_objmgr_psoc *psoc)
{ {
if (!psoc) { if (!psoc) {
spectral_err("PSOC is NULL!"); spectral_err("PSOC is NULL!");
return true; return true;
} }
if (wlan_psoc_nif_feat_cap_get(psoc, WLAN_SOC_F_SPECTRAL_INI_DISABLE)) return wlan_psoc_nif_feat_cap_get(psoc,
return true; WLAN_SOC_F_SPECTRAL_INI_DISABLE);
}
return false; bool
wlan_spectral_is_feature_disabled_psoc(struct wlan_objmgr_psoc *psoc)
{
if (!psoc) {
spectral_err("psoc is NULL!");
return true;
}
return wlan_spectral_is_feature_disabled_ini(psoc);
}
bool
wlan_spectral_is_feature_disabled_pdev(struct wlan_objmgr_pdev *pdev)
{
enum spectral_scan_mode smode;
if (!pdev) {
spectral_err("pdev is NULL!");
return true;
}
smode = SPECTRAL_SCAN_MODE_NORMAL;
for (; smode < SPECTRAL_SCAN_MODE_MAX; smode++)
if (!wlan_spectral_is_mode_disabled_pdev(pdev, smode))
return false;
return true;
} }
QDF_STATUS QDF_STATUS
@@ -247,8 +309,10 @@ wlan_lmac_if_sptrl_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
sptrl_rx_ops->sptrlro_vdev_get_ch_width = spectral_vdev_get_ch_width; sptrl_rx_ops->sptrlro_vdev_get_ch_width = spectral_vdev_get_ch_width;
sptrl_rx_ops->sptrlro_vdev_get_sec20chan_freq_mhz = sptrl_rx_ops->sptrlro_vdev_get_sec20chan_freq_mhz =
spectral_vdev_get_sec20chan_freq_mhz; spectral_vdev_get_sec20chan_freq_mhz;
sptrl_rx_ops->sptrlro_spectral_is_feature_disabled = sptrl_rx_ops->sptrlro_spectral_is_feature_disabled_pdev =
wlan_spectral_is_feature_disabled; wlan_spectral_is_feature_disabled_pdev;
sptrl_rx_ops->sptrlro_spectral_is_feature_disabled_psoc =
wlan_spectral_is_feature_disabled_psoc;
} }
QDF_STATUS QDF_STATUS

Näytä tiedosto

@@ -231,12 +231,31 @@ static QDF_STATUS
target_if_spectral_init_pdev_feature_cap_per_mode(struct wlan_objmgr_pdev *pdev, target_if_spectral_init_pdev_feature_cap_per_mode(struct wlan_objmgr_pdev *pdev,
enum spectral_scan_mode smode) enum spectral_scan_mode smode)
{ {
struct wlan_objmgr_psoc *psoc;
bool normal_mode_disable; bool normal_mode_disable;
struct target_if_spectral_agile_mode_cap agile_cap = { 0 }; struct target_if_spectral_agile_mode_cap agile_cap = { 0 };
QDF_STATUS status; QDF_STATUS status;
if (!pdev) {
spectral_err("pdev is null");
return QDF_STATUS_E_INVAL;
}
psoc = wlan_pdev_get_psoc(pdev);
if (!psoc) {
spectral_err("psoc is null");
return QDF_STATUS_E_INVAL;
}
switch (smode) { switch (smode) {
case SPECTRAL_SCAN_MODE_NORMAL: case SPECTRAL_SCAN_MODE_NORMAL:
if (target_if_spectral_is_feature_disabled_psoc(psoc)) {
wlan_pdev_nif_feat_ext_cap_set(
pdev, WLAN_PDEV_FEXT_NORMAL_SPECTRAL_SCAN_DIS);
return QDF_STATUS_SUCCESS;
}
status = target_if_spectral_get_normal_mode_cap( status = target_if_spectral_get_normal_mode_cap(
pdev, &normal_mode_disable); pdev, &normal_mode_disable);
if (QDF_IS_STATUS_ERROR(status)) { if (QDF_IS_STATUS_ERROR(status)) {
@@ -253,6 +272,16 @@ target_if_spectral_init_pdev_feature_cap_per_mode(struct wlan_objmgr_pdev *pdev,
break; break;
case SPECTRAL_SCAN_MODE_AGILE: case SPECTRAL_SCAN_MODE_AGILE:
if (target_if_spectral_is_feature_disabled_psoc(psoc)) {
wlan_pdev_nif_feat_ext_cap_set(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_DIS);
wlan_pdev_nif_feat_ext_cap_set(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_160_DIS);
wlan_pdev_nif_feat_ext_cap_set(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_80P80_DIS);
return QDF_STATUS_SUCCESS;
}
status = target_if_spectral_get_agile_mode_cap( status = target_if_spectral_get_agile_mode_cap(
pdev, &agile_cap); pdev, &agile_cap);
if (QDF_IS_STATUS_ERROR(status)) { if (QDF_IS_STATUS_ERROR(status)) {

Näytä tiedosto

@@ -1657,6 +1657,37 @@ int target_if_vdev_get_sec20chan_freq_mhz(
sptrlro_vdev_get_sec20chan_freq_mhz(vdev, sec20chan_freq); sptrlro_vdev_get_sec20chan_freq_mhz(vdev, sec20chan_freq);
} }
/**
* target_if_spectral_is_feature_disabled_psoc() - Check if Spectral feature is
* disabled for a given psoc
* @psoc: Pointer to psoc
*
* Return: true or false
*/
static inline
bool target_if_spectral_is_feature_disabled_psoc(struct wlan_objmgr_psoc *psoc)
{
struct wlan_lmac_if_rx_ops *rx_ops;
if (!psoc) {
spectral_err("psoc is NULL");
return true;
}
rx_ops = wlan_psoc_get_lmac_if_rxops(psoc);
if (!rx_ops) {
spectral_err("rx_ops is null");
return true;
}
if (rx_ops->sptrl_rx_ops.
sptrlro_spectral_is_feature_disabled_psoc)
return rx_ops->sptrl_rx_ops.
sptrlro_spectral_is_feature_disabled_psoc(psoc);
return true;
}
/** /**
* target_if_spectral_set_rxchainmask() - Set Spectral Rx chainmask * target_if_spectral_set_rxchainmask() - Set Spectral Rx chainmask
* @pdev: Pointer to pdev * @pdev: Pointer to pdev

Näytä tiedosto

@@ -1393,7 +1393,10 @@ struct wlan_lmac_if_cfr_rx_ops {
* @sptrlro_get_psoc_target_handle: Get Spectral handle for psoc target * @sptrlro_get_psoc_target_handle: Get Spectral handle for psoc target
* private data * private data
* @sptrlro_vdev_get_chan_freq_seg2: Get secondary 80 center frequency * @sptrlro_vdev_get_chan_freq_seg2: Get secondary 80 center frequency
* @sptrlro_spectral_is_feature_disabled: Check if spectral feature is disabled * @sptrlro_spectral_is_feature_disabled_pdev: Check if spectral feature is
* disabled for a given pdev
* @sptrlro_spectral_is_feature_disabled_psoc: Check if spectral feature is
* disabled for a given psoc
*/ */
struct wlan_lmac_if_sptrl_rx_ops { struct wlan_lmac_if_sptrl_rx_ops {
void * (*sptrlro_get_pdev_target_handle)(struct wlan_objmgr_pdev *pdev); void * (*sptrlro_get_pdev_target_handle)(struct wlan_objmgr_pdev *pdev);
@@ -1406,7 +1409,9 @@ struct wlan_lmac_if_sptrl_rx_ops {
int (*sptrlro_vdev_get_sec20chan_freq_mhz)( int (*sptrlro_vdev_get_sec20chan_freq_mhz)(
struct wlan_objmgr_vdev *vdev, struct wlan_objmgr_vdev *vdev,
uint16_t *sec20chan_freq); uint16_t *sec20chan_freq);
bool (*sptrlro_spectral_is_feature_disabled)( bool (*sptrlro_spectral_is_feature_disabled_pdev)(
struct wlan_objmgr_pdev *pdev);
bool (*sptrlro_spectral_is_feature_disabled_psoc)(
struct wlan_objmgr_psoc *psoc); struct wlan_objmgr_psoc *psoc);
}; };
#endif /* WLAN_CONV_SPECTRAL_ENABLE */ #endif /* WLAN_CONV_SPECTRAL_ENABLE */