qcacmn: Add Host support for Spectral FFT recapture

Add support to receive the fft_recapture arg value
from spectraltool, handle the FFT recapture config and
pass this to FW. The recapture feature must be
enabled only for spectral scan period > 52 us and
Normal Spectral scans.

Change-Id: Ied637704d25bb15bff2139a215da7481d4f80e4f
CRs-Fixed: 3140890
这个提交包含在:
Jhalak Naik
2022-03-07 19:58:56 +05:30
提交者 Madan Koyyalamudi
父节点 b64b200ff8
当前提交 055dfbe881
修改 5 个文件,包含 52 行新增17 行删除

查看文件

@@ -7700,6 +7700,13 @@ enum qca_wlan_vendor_attr_spectral_scan {
* for the current operating bandwidth. * for the current operating bandwidth.
*/ */
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_BANDWIDTH = 30, QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_BANDWIDTH = 30,
/* Spectral FFT recapture flag attribute, to enable/disable FFT
* recapture. Recapture can only be enabled for Scan period greater
* than 52us.
* If this attribute is enabled, re-triggers will be enabled in uCode
* when AGC gain changes.
*/
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FFT_RECAPTURE = 31,
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_AFTER_LAST, QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_AFTER_LAST,
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX = QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX =

查看文件

@@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -93,6 +94,8 @@ const struct nla_policy spectral_scan_policy[
.type = NLA_U8}, .type = NLA_U8},
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_BANDWIDTH] = { [QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_BANDWIDTH] = {
.type = NLA_U8}, .type = NLA_U8},
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FFT_RECAPTURE] = {
.type = NLA_U32},
}; };
const struct nla_policy spectral_scan_get_status_policy[ const struct nla_policy spectral_scan_get_status_policy[
@@ -107,6 +110,7 @@ const struct nla_policy spectral_scan_get_status_policy[
static void wlan_spectral_intit_config(struct spectral_config *config_req) static void wlan_spectral_intit_config(struct spectral_config *config_req)
{ {
config_req->ss_period = SPECTRAL_PHYERR_PARAM_NOVAL; config_req->ss_period = SPECTRAL_PHYERR_PARAM_NOVAL;
config_req->ss_recapture = SPECTRAL_PHYERR_PARAM_NOVAL;
config_req->ss_count = SPECTRAL_PHYERR_PARAM_NOVAL; config_req->ss_count = SPECTRAL_PHYERR_PARAM_NOVAL;
config_req->ss_fft_period = SPECTRAL_PHYERR_PARAM_NOVAL; config_req->ss_fft_period = SPECTRAL_PHYERR_PARAM_NOVAL;
config_req->ss_short_report = SPECTRAL_PHYERR_PARAM_NOVAL; config_req->ss_short_report = SPECTRAL_PHYERR_PARAM_NOVAL;
@@ -397,6 +401,10 @@ int wlan_cfg80211_spectral_scan_config_and_start(struct wiphy *wiphy,
config_req.ss_period = nla_get_u32(tb config_req.ss_period = nla_get_u32(tb
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_SCAN_PERIOD]); [QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_SCAN_PERIOD]);
if (tb[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FFT_RECAPTURE])
config_req.ss_recapture = nla_get_u32(tb
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FFT_RECAPTURE]);
if (tb[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_PRIORITY]) if (tb[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_PRIORITY])
config_req.ss_spectral_pri = nla_get_u32(tb config_req.ss_spectral_pri = nla_get_u32(tb
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_PRIORITY]); [QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_PRIORITY]);
@@ -806,7 +814,10 @@ int wlan_cfg80211_spectral_scan_get_config(struct wiphy *wiphy,
sconfig->ss_frequency.cfreq2) || sconfig->ss_frequency.cfreq2) ||
nla_put_u8(skb, nla_put_u8(skb,
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_BANDWIDTH, QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_BANDWIDTH,
sscan_bw_nl)) sscan_bw_nl) ||
nla_put_u32(skb,
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FFT_RECAPTURE,
sconfig->ss_recapture))
goto fail; goto fail;

查看文件

@@ -1,5 +1,6 @@
/* /*
* Copyright (c) 2011,2017-2021 The Linux Foundation. All rights reserved. * Copyright (c) 2011,2017-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
* *
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
@@ -162,6 +163,15 @@ spectral_control_cmn(struct wlan_objmgr_pdev *pdev,
goto bad; goto bad;
} }
if (sp_in->ss_recapture != SPECTRAL_PHYERR_PARAM_NOVAL) {
param.id = SPECTRAL_PARAM_FFT_RECAPTURE;
param.value = sp_in->ss_recapture;
ret = sc->sptrlc_set_spectral_config
(pdev, &param, smode, err);
if (QDF_IS_STATUS_ERROR(ret))
goto bad;
}
if (sp_in->ss_short_report != SPECTRAL_PHYERR_PARAM_NOVAL) { if (sp_in->ss_short_report != SPECTRAL_PHYERR_PARAM_NOVAL) {
param.id = SPECTRAL_PARAM_SHORT_REPORT; param.id = SPECTRAL_PARAM_SHORT_REPORT;
param.value = (uint32_t)sp_in->ss_short_report ? 1 : 0; param.value = (uint32_t)sp_in->ss_short_report ? 1 : 0;
@@ -359,6 +369,7 @@ spectral_control_cmn(struct wlan_objmgr_pdev *pdev,
spectralparams = &sscan_req->config_req.sscan_config; spectralparams = &sscan_req->config_req.sscan_config;
spectralparams->ss_fft_period = sp_out.ss_fft_period; spectralparams->ss_fft_period = sp_out.ss_fft_period;
spectralparams->ss_period = sp_out.ss_period; spectralparams->ss_period = sp_out.ss_period;
spectralparams->ss_recapture = sp_out.ss_recapture;
spectralparams->ss_count = sp_out.ss_count; spectralparams->ss_count = sp_out.ss_count;
spectralparams->ss_short_report = spectralparams->ss_short_report =
sp_out.ss_short_report; sp_out.ss_short_report;

查看文件

@@ -70,6 +70,7 @@
enum spectral_params { enum spectral_params {
SPECTRAL_PARAM_FFT_PERIOD, SPECTRAL_PARAM_FFT_PERIOD,
SPECTRAL_PARAM_SCAN_PERIOD, SPECTRAL_PARAM_SCAN_PERIOD,
SPECTRAL_PARAM_FFT_RECAPTURE,
SPECTRAL_PARAM_SCAN_COUNT, SPECTRAL_PARAM_SCAN_COUNT,
SPECTRAL_PARAM_SHORT_REPORT, SPECTRAL_PARAM_SHORT_REPORT,
SPECTRAL_PARAM_SPECT_PRI, SPECTRAL_PARAM_SPECT_PRI,

查看文件

@@ -1775,17 +1775,6 @@ target_if_sops_stop_spectral_scan(void *arg, enum spectral_scan_mode smode)
p_sops->configure_spectral(spectral, sparams, smode); p_sops->configure_spectral(spectral, sparams, smode);
} }
if (ret == 0 && smode == SPECTRAL_SCAN_MODE_NORMAL) {
struct target_if_spectral_ops *p_sops;
struct spectral_config *sparams;
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
sparams = &spectral->params[smode];
sparams->ss_recapture = false;
p_sops->configure_spectral(spectral, sparams, smode);
}
return ret; return ret;
} }
@@ -4431,12 +4420,28 @@ _target_if_set_spectral_config(struct target_if_spectral *spectral,
break; break;
case SPECTRAL_PARAM_SCAN_PERIOD: case SPECTRAL_PARAM_SCAN_PERIOD:
sparams->ss_period = param->value; sparams->ss_period = param->value;
if ((sparams->ss_period >= if (sparams->ss_recapture && ((sparams->ss_period <
SPECTRAL_RECAPTURE_SCAN_PERIOD_THRESHOLD) && SPECTRAL_RECAPTURE_SCAN_PERIOD_THRESHOLD) ||
(smode == SPECTRAL_SCAN_MODE_NORMAL)) (smode == SPECTRAL_SCAN_MODE_AGILE))) {
sparams->ss_recapture = true;
else
sparams->ss_recapture = false; sparams->ss_recapture = false;
spectral_err("FFT recapture cannot be enabled due to scan period: %d us or spectral scan mode: %d",
sparams->ss_period, smode);
}
break;
case SPECTRAL_PARAM_FFT_RECAPTURE:
if (param->value) {
if (sparams->ss_period >=
SPECTRAL_RECAPTURE_SCAN_PERIOD_THRESHOLD &&
smode == SPECTRAL_SCAN_MODE_NORMAL) {
sparams->ss_recapture = true;
} else {
spectral_err("FFT recapture cannot be enabled due to scan period: %d us or spectral scan mode: %d",
sparams->ss_period, smode);
sparams->ss_recapture = false;
}
} else {
sparams->ss_recapture = false;
}
break; break;
case SPECTRAL_PARAM_SCAN_COUNT: case SPECTRAL_PARAM_SCAN_COUNT:
sparams->ss_count = param->value; sparams->ss_count = param->value;