qcacmn: Change Spectral control path to support Agile mode
Modify Spectral control path APIs to support Agile mode. CRs-Fixed: 2450620 Change-Id: Id6cf48c1288b157932ab5ce0535293e466a87783
This commit is contained in:

committed by
nshrivas

parent
d9f04e1c71
commit
8e74a62e72
@@ -81,6 +81,10 @@ static const struct nla_policy spectral_scan_policy[
|
|||||||
.type = NLA_U32},
|
.type = NLA_U32},
|
||||||
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_DEBUG_LEVEL] = {
|
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_DEBUG_LEVEL] = {
|
||||||
.type = NLA_U32},
|
.type = NLA_U32},
|
||||||
|
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FREQUENCY] = {
|
||||||
|
.type = NLA_U32},
|
||||||
|
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_MODE] = {
|
||||||
|
.type = NLA_U32},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void wlan_spectral_intit_config(struct spectral_config *config_req)
|
static void wlan_spectral_intit_config(struct spectral_config *config_req)
|
||||||
@@ -105,6 +109,36 @@ static void wlan_spectral_intit_config(struct spectral_config *config_req)
|
|||||||
config_req->ss_bin_scale = SPECTRAL_PHYERR_PARAM_NOVAL;
|
config_req->ss_bin_scale = SPECTRAL_PHYERR_PARAM_NOVAL;
|
||||||
config_req->ss_dbm_adj = SPECTRAL_PHYERR_PARAM_NOVAL;
|
config_req->ss_dbm_adj = SPECTRAL_PHYERR_PARAM_NOVAL;
|
||||||
config_req->ss_chn_mask = SPECTRAL_PHYERR_PARAM_NOVAL;
|
config_req->ss_chn_mask = SPECTRAL_PHYERR_PARAM_NOVAL;
|
||||||
|
config_req->ss_frequency = SPECTRAL_PHYERR_PARAM_NOVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* convert_spectral_mode_nl_to_internal() - Get Spectral mode
|
||||||
|
* @nl_spectral_mode: Spectral mode in vendor attribute
|
||||||
|
* @mode: Converted Spectral mode
|
||||||
|
*
|
||||||
|
* Return: QDF_STATUS_SUCCESS on success, else QDF_STATUS_E_FAILURE
|
||||||
|
*/
|
||||||
|
static QDF_STATUS
|
||||||
|
convert_spectral_mode_nl_to_internal
|
||||||
|
(enum qca_wlan_vendor_spectral_scan_mode nl_spectral_mode,
|
||||||
|
enum spectral_scan_mode *mode)
|
||||||
|
{
|
||||||
|
switch (nl_spectral_mode) {
|
||||||
|
case QCA_WLAN_VENDOR_SPECTRAL_SCAN_MODE_NORMAL:
|
||||||
|
*mode = SPECTRAL_SCAN_MODE_NORMAL;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case QCA_WLAN_VENDOR_SPECTRAL_SCAN_MODE_AGILE:
|
||||||
|
*mode = SPECTRAL_SCAN_MODE_AGILE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
osif_err("Invalid spectral mode %u", nl_spectral_mode);
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int wlan_cfg80211_spectral_scan_config_and_start(struct wiphy *wiphy,
|
int wlan_cfg80211_spectral_scan_config_and_start(struct wiphy *wiphy,
|
||||||
@@ -128,7 +162,7 @@ int wlan_cfg80211_spectral_scan_config_and_start(struct wiphy *wiphy,
|
|||||||
data,
|
data,
|
||||||
data_len,
|
data_len,
|
||||||
spectral_scan_policy)) {
|
spectral_scan_policy)) {
|
||||||
qdf_print("Invalid Spectral Scan config ATTR");
|
osif_err("Invalid Spectral Scan config ATTR");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,6 +248,18 @@ int wlan_cfg80211_spectral_scan_config_and_start(struct wiphy *wiphy,
|
|||||||
config_req.ss_short_report = nla_get_u32(tb
|
config_req.ss_short_report = nla_get_u32(tb
|
||||||
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_SHORT_REPORT]);
|
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_SHORT_REPORT]);
|
||||||
|
|
||||||
|
if (tb[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FREQUENCY])
|
||||||
|
config_req.ss_frequency = nla_get_u32(tb
|
||||||
|
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FREQUENCY]);
|
||||||
|
|
||||||
|
if (tb[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_MODE]) {
|
||||||
|
status = convert_spectral_mode_nl_to_internal(nla_get_u32(tb
|
||||||
|
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_MODE]), &sscan_mode);
|
||||||
|
|
||||||
|
if (QDF_IS_STATUS_ERROR(status))
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
if (tb[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_DEBUG_LEVEL]) {
|
if (tb[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_DEBUG_LEVEL]) {
|
||||||
spectral_dbg_level = nla_get_u32(tb
|
spectral_dbg_level = nla_get_u32(tb
|
||||||
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_DEBUG_LEVEL]);
|
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_DEBUG_LEVEL]);
|
||||||
@@ -251,7 +297,7 @@ int wlan_cfg80211_spectral_scan_config_and_start(struct wiphy *wiphy,
|
|||||||
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(u64) +
|
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, sizeof(u64) +
|
||||||
NLA_HDRLEN + NLMSG_HDRLEN);
|
NLA_HDRLEN + NLMSG_HDRLEN);
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
qdf_print(" reply skb alloc failed");
|
osif_err(" reply skb alloc failed");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -273,10 +319,29 @@ int wlan_cfg80211_spectral_scan_stop(struct wiphy *wiphy,
|
|||||||
const void *data,
|
const void *data,
|
||||||
int data_len)
|
int data_len)
|
||||||
{
|
{
|
||||||
|
struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX + 1];
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
struct spectral_cp_request sscan_req;
|
struct spectral_cp_request sscan_req;
|
||||||
enum spectral_scan_mode sscan_mode = SPECTRAL_SCAN_MODE_NORMAL;
|
enum spectral_scan_mode sscan_mode = SPECTRAL_SCAN_MODE_NORMAL;
|
||||||
|
|
||||||
|
if (wlan_cfg80211_nla_parse(
|
||||||
|
tb,
|
||||||
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX,
|
||||||
|
data,
|
||||||
|
data_len,
|
||||||
|
spectral_scan_policy)) {
|
||||||
|
osif_err("Invalid Spectral Scan stop ATTR");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tb[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_MODE]) {
|
||||||
|
status = convert_spectral_mode_nl_to_internal(nla_get_u32(tb
|
||||||
|
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_MODE]), &sscan_mode);
|
||||||
|
|
||||||
|
if (QDF_IS_STATUS_ERROR(status))
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
sscan_req.ss_mode = sscan_mode;
|
sscan_req.ss_mode = sscan_mode;
|
||||||
sscan_req.req_id = SPECTRAL_STOP_SCAN;
|
sscan_req.req_id = SPECTRAL_STOP_SCAN;
|
||||||
status = ucfg_spectral_control(pdev, &sscan_req);
|
status = ucfg_spectral_control(pdev, &sscan_req);
|
||||||
@@ -291,6 +356,7 @@ int wlan_cfg80211_spectral_scan_get_config(struct wiphy *wiphy,
|
|||||||
const void *data,
|
const void *data,
|
||||||
int data_len)
|
int data_len)
|
||||||
{
|
{
|
||||||
|
struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX + 1];
|
||||||
struct spectral_config *sconfig;
|
struct spectral_config *sconfig;
|
||||||
uint32_t spectral_dbg_level;
|
uint32_t spectral_dbg_level;
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
@@ -298,12 +364,29 @@ int wlan_cfg80211_spectral_scan_get_config(struct wiphy *wiphy,
|
|||||||
enum spectral_scan_mode sscan_mode = SPECTRAL_SCAN_MODE_NORMAL;
|
enum spectral_scan_mode sscan_mode = SPECTRAL_SCAN_MODE_NORMAL;
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
|
|
||||||
|
if (wlan_cfg80211_nla_parse(
|
||||||
|
tb,
|
||||||
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX,
|
||||||
|
data,
|
||||||
|
data_len,
|
||||||
|
spectral_scan_policy)) {
|
||||||
|
osif_err("Invalid Spectral Scan config ATTR");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tb[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_MODE]) {
|
||||||
|
status = convert_spectral_mode_nl_to_internal(nla_get_u32(tb
|
||||||
|
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_MODE]), &sscan_mode);
|
||||||
|
|
||||||
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, (21 * sizeof(u32)) +
|
if (QDF_IS_STATUS_ERROR(status))
|
||||||
NLA_HDRLEN + NLMSG_HDRLEN);
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, (sizeof(u32) +
|
||||||
|
NLA_HDRLEN) * QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_MAX +
|
||||||
|
NLMSG_HDRLEN);
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
qdf_print(" reply skb alloc failed");
|
osif_err(" reply skb alloc failed");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,7 +454,10 @@ int wlan_cfg80211_spectral_scan_get_config(struct wiphy *wiphy,
|
|||||||
sconfig->ss_fft_period) ||
|
sconfig->ss_fft_period) ||
|
||||||
nla_put_u32(skb,
|
nla_put_u32(skb,
|
||||||
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_SHORT_REPORT,
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_SHORT_REPORT,
|
||||||
sconfig->ss_short_report)) {
|
sconfig->ss_short_report) ||
|
||||||
|
nla_put_u32(skb,
|
||||||
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CONFIG_FREQUENCY,
|
||||||
|
sconfig->ss_frequency)) {
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@@ -399,18 +485,17 @@ int wlan_cfg80211_spectral_scan_get_cap(struct wiphy *wiphy,
|
|||||||
struct spectral_caps *scaps;
|
struct spectral_caps *scaps;
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
struct spectral_cp_request sscan_req;
|
struct spectral_cp_request sscan_req;
|
||||||
enum spectral_scan_mode sscan_mode = SPECTRAL_SCAN_MODE_NORMAL;
|
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
|
|
||||||
sscan_req.ss_mode = sscan_mode;
|
|
||||||
sscan_req.req_id = SPECTRAL_GET_CAPABILITY_INFO;
|
sscan_req.req_id = SPECTRAL_GET_CAPABILITY_INFO;
|
||||||
status = ucfg_spectral_control(pdev, &sscan_req);
|
status = ucfg_spectral_control(pdev, &sscan_req);
|
||||||
scaps = &sscan_req.caps_req.sscan_caps;
|
scaps = &sscan_req.caps_req.sscan_caps;
|
||||||
|
|
||||||
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, 10 * sizeof(u32) +
|
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, (sizeof(u32) +
|
||||||
NLA_HDRLEN + NLMSG_HDRLEN);
|
NLA_HDRLEN) * QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_MAX +
|
||||||
|
NLMSG_HDRLEN);
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
qdf_print(" reply skb alloc failed");
|
osif_err(" reply skb alloc failed");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -474,6 +559,15 @@ int wlan_cfg80211_spectral_scan_get_cap(struct wiphy *wiphy,
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scaps->agile_spectral_cap) {
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = nla_put_flag
|
||||||
|
(skb,
|
||||||
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_AGILE_SPECTRAL);
|
||||||
|
if (ret)
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
qal_devcfg_send_response((qdf_nbuf_t)skb);
|
qal_devcfg_send_response((qdf_nbuf_t)skb);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -491,18 +585,17 @@ int wlan_cfg80211_spectral_scan_get_diag_stats(struct wiphy *wiphy,
|
|||||||
struct spectral_diag_stats *spetcral_diag;
|
struct spectral_diag_stats *spetcral_diag;
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
struct spectral_cp_request sscan_req;
|
struct spectral_cp_request sscan_req;
|
||||||
enum spectral_scan_mode sscan_mode = SPECTRAL_SCAN_MODE_NORMAL;
|
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
|
|
||||||
sscan_req.ss_mode = sscan_mode;
|
|
||||||
sscan_req.req_id = SPECTRAL_GET_DIAG_STATS;
|
sscan_req.req_id = SPECTRAL_GET_DIAG_STATS;
|
||||||
status = ucfg_spectral_control(pdev, &sscan_req);
|
status = ucfg_spectral_control(pdev, &sscan_req);
|
||||||
spetcral_diag = &sscan_req.diag_req.sscan_diag;
|
spetcral_diag = &sscan_req.diag_req.sscan_diag;
|
||||||
|
|
||||||
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, 5 * sizeof(u64) +
|
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, (sizeof(u64) +
|
||||||
NLA_HDRLEN + NLMSG_HDRLEN);
|
NLA_HDRLEN) * QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_DIAG_MAX +
|
||||||
|
NLMSG_HDRLEN);
|
||||||
if (!skb) {
|
if (!skb) {
|
||||||
qdf_print(" reply skb alloc failed");
|
osif_err(" reply skb alloc failed");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -539,17 +632,29 @@ int wlan_cfg80211_spectral_scan_get_status(struct wiphy *wiphy,
|
|||||||
const void *data,
|
const void *data,
|
||||||
int data_len)
|
int data_len)
|
||||||
{
|
{
|
||||||
|
struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_STATUS_MAX + 1];
|
||||||
struct spectral_scan_state sscan_state = { 0 };
|
struct spectral_scan_state sscan_state = { 0 };
|
||||||
struct sk_buff *skb;
|
struct sk_buff *skb;
|
||||||
struct spectral_cp_request sscan_req;
|
struct spectral_cp_request sscan_req;
|
||||||
enum spectral_scan_mode sscan_mode = SPECTRAL_SCAN_MODE_NORMAL;
|
enum spectral_scan_mode sscan_mode = SPECTRAL_SCAN_MODE_NORMAL;
|
||||||
QDF_STATUS status;
|
QDF_STATUS status;
|
||||||
|
|
||||||
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, 2 * sizeof(u32) +
|
if (wlan_cfg80211_nla_parse(
|
||||||
NLA_HDRLEN + NLMSG_HDRLEN);
|
tb,
|
||||||
if (!skb) {
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_STATUS_MAX,
|
||||||
qdf_print(" reply skb alloc failed");
|
data,
|
||||||
return -ENOMEM;
|
data_len,
|
||||||
|
NULL)) {
|
||||||
|
osif_err("Invalid Spectral Scan config ATTR");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tb[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_STATUS_MODE]) {
|
||||||
|
status = convert_spectral_mode_nl_to_internal(nla_get_u32(tb
|
||||||
|
[QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_STATUS_MODE]), &sscan_mode);
|
||||||
|
|
||||||
|
if (QDF_IS_STATUS_ERROR(status))
|
||||||
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sending a request and extracting response from it has to be atomic */
|
/* Sending a request and extracting response from it has to be atomic */
|
||||||
@@ -563,6 +668,13 @@ int wlan_cfg80211_spectral_scan_get_status(struct wiphy *wiphy,
|
|||||||
status = ucfg_spectral_control(pdev, &sscan_req);
|
status = ucfg_spectral_control(pdev, &sscan_req);
|
||||||
sscan_state.is_enabled = sscan_req.status_req.is_enabled;
|
sscan_state.is_enabled = sscan_req.status_req.is_enabled;
|
||||||
|
|
||||||
|
skb = cfg80211_vendor_cmd_alloc_reply_skb(wiphy, 2 * (sizeof(u32) +
|
||||||
|
NLA_HDRLEN) + NLMSG_HDRLEN);
|
||||||
|
if (!skb) {
|
||||||
|
osif_err(" reply skb alloc failed");
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
if (sscan_state.is_enabled)
|
if (sscan_state.is_enabled)
|
||||||
if (nla_put_flag(
|
if (nla_put_flag(
|
||||||
skb,
|
skb,
|
||||||
@@ -575,8 +687,8 @@ int wlan_cfg80211_spectral_scan_get_status(struct wiphy *wiphy,
|
|||||||
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_STATUS_IS_ACTIVE))
|
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_STATUS_IS_ACTIVE))
|
||||||
goto fail;
|
goto fail;
|
||||||
qal_devcfg_send_response((qdf_nbuf_t)skb);
|
qal_devcfg_send_response((qdf_nbuf_t)skb);
|
||||||
return 0;
|
|
||||||
|
|
||||||
|
return 0;
|
||||||
fail:
|
fail:
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@@ -91,10 +91,10 @@ QDF_STATUS wlan_spectral_pdev_obj_destroy_handler(struct wlan_objmgr_pdev *pdev,
|
|||||||
* This function processes the spectral config command
|
* This function processes the spectral config command
|
||||||
* and appropriate handlers are invoked.
|
* and appropriate handlers are invoked.
|
||||||
*
|
*
|
||||||
* Return: 0 success else failure
|
* Return: QDF_STATUS_SUCCESS/QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
int spectral_control_cmn(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS spectral_control_cmn(struct wlan_objmgr_pdev *pdev,
|
||||||
struct spectral_cp_request *sscan_req);
|
struct spectral_cp_request *sscan_req);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* spectral_control_ol(): Offload handler for demultiplexing requests from
|
* spectral_control_ol(): Offload handler for demultiplexing requests from
|
||||||
|
@@ -111,11 +111,11 @@ spectral_register_cfg80211_handlers(struct wlan_objmgr_pdev *pdev)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
QDF_STATUS
|
||||||
spectral_control_cmn(struct wlan_objmgr_pdev *pdev,
|
spectral_control_cmn(struct wlan_objmgr_pdev *pdev,
|
||||||
struct spectral_cp_request *sscan_req)
|
struct spectral_cp_request *sscan_req)
|
||||||
{
|
{
|
||||||
int error = 0;
|
QDF_STATUS status = QDF_STATUS_E_FAILURE;
|
||||||
int temp_debug;
|
int temp_debug;
|
||||||
struct spectral_config sp_out;
|
struct spectral_config sp_out;
|
||||||
struct spectral_config *sp_in;
|
struct spectral_config *sp_in;
|
||||||
@@ -123,288 +123,313 @@ spectral_control_cmn(struct wlan_objmgr_pdev *pdev,
|
|||||||
struct spectral_context *sc;
|
struct spectral_context *sc;
|
||||||
struct wlan_objmgr_vdev *vdev = NULL;
|
struct wlan_objmgr_vdev *vdev = NULL;
|
||||||
uint8_t vdev_rxchainmask = 0;
|
uint8_t vdev_rxchainmask = 0;
|
||||||
|
enum spectral_scan_mode smode = sscan_req->ss_mode;
|
||||||
|
enum spectral_cp_error_code *err;
|
||||||
|
QDF_STATUS ret;
|
||||||
|
|
||||||
if (!pdev) {
|
if (!pdev) {
|
||||||
spectral_err("PDEV is NULL!");
|
spectral_err("PDEV is NULL!");
|
||||||
error = -EINVAL;
|
|
||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
sc = spectral_get_spectral_ctx_from_pdev(pdev);
|
sc = spectral_get_spectral_ctx_from_pdev(pdev);
|
||||||
if (!sc) {
|
if (!sc) {
|
||||||
spectral_err("atf context is NULL!");
|
spectral_err("Spectral context is NULL!");
|
||||||
error = -EINVAL;
|
|
||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (sscan_req->req_id) {
|
switch (sscan_req->req_id) {
|
||||||
case SPECTRAL_SET_CONFIG:
|
case SPECTRAL_SET_CONFIG:
|
||||||
{
|
err = &sscan_req->config_req.sscan_err_code;
|
||||||
sp_in = &sscan_req->config_req.sscan_config;
|
sp_in = &sscan_req->config_req.sscan_config;
|
||||||
if (sp_in->ss_count !=
|
if (sp_in->ss_count != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
SPECTRAL_PHYERR_PARAM_NOVAL) {
|
ret = sc->sptrlc_set_spectral_config
|
||||||
if (sc->sptrlc_set_spectral_config(
|
(pdev,
|
||||||
pdev,
|
SPECTRAL_PARAM_SCAN_COUNT,
|
||||||
SPECTRAL_PARAM_SCAN_COUNT,
|
sp_in->ss_count, smode, err);
|
||||||
sp_in->ss_count))
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
error = -EINVAL;
|
goto bad;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sp_in->ss_fft_period !=
|
if (sp_in->ss_fft_period != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
SPECTRAL_PHYERR_PARAM_NOVAL) {
|
ret = sc->sptrlc_set_spectral_config
|
||||||
if (sc->sptrlc_set_spectral_config(
|
(pdev,
|
||||||
pdev,
|
SPECTRAL_PARAM_FFT_PERIOD,
|
||||||
SPECTRAL_PARAM_FFT_PERIOD,
|
sp_in->ss_fft_period,
|
||||||
sp_in->ss_fft_period))
|
smode, err);
|
||||||
error = -EINVAL;
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
}
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_period != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
if (sp_in->ss_period != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
if (sc->sptrlc_set_spectral_config(
|
ret = sc->sptrlc_set_spectral_config
|
||||||
pdev,
|
(pdev,
|
||||||
SPECTRAL_PARAM_SCAN_PERIOD,
|
SPECTRAL_PARAM_SCAN_PERIOD,
|
||||||
sp_in->ss_period))
|
sp_in->ss_period, smode, err);
|
||||||
error = -EINVAL;
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
}
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_short_report !=
|
if (sp_in->ss_short_report != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
SPECTRAL_PHYERR_PARAM_NOVAL) {
|
ret = sc->sptrlc_set_spectral_config
|
||||||
if (sc->sptrlc_set_spectral_config(
|
(pdev,
|
||||||
pdev,
|
SPECTRAL_PARAM_SHORT_REPORT,
|
||||||
SPECTRAL_PARAM_SHORT_REPORT,
|
(uint32_t)
|
||||||
(uint32_t)
|
sp_in->ss_short_report ? 1 : 0,
|
||||||
(sp_in->ss_short_report ? 1 : 0)))
|
smode, err);
|
||||||
error = -EINVAL;
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
}
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_spectral_pri !=
|
if (sp_in->ss_spectral_pri != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
SPECTRAL_PHYERR_PARAM_NOVAL) {
|
ret = sc->sptrlc_set_spectral_config
|
||||||
if (sc->sptrlc_set_spectral_config(
|
(pdev,
|
||||||
pdev,
|
SPECTRAL_PARAM_SPECT_PRI,
|
||||||
SPECTRAL_PARAM_SPECT_PRI,
|
(uint32_t)
|
||||||
(uint32_t)(sp_in->ss_spectral_pri)))
|
(sp_in->ss_spectral_pri),
|
||||||
error = -EINVAL;
|
smode, err);
|
||||||
}
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_fft_size != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
if (sp_in->ss_fft_size != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
if (sc->sptrlc_set_spectral_config(
|
ret = sc->sptrlc_set_spectral_config
|
||||||
pdev,
|
(pdev,
|
||||||
SPECTRAL_PARAM_FFT_SIZE,
|
SPECTRAL_PARAM_FFT_SIZE,
|
||||||
sp_in->ss_fft_size))
|
sp_in->ss_fft_size,
|
||||||
error = -EINVAL;
|
smode, err);
|
||||||
}
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_gc_ena != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
if (sp_in->ss_gc_ena != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
if (sc->sptrlc_set_spectral_config(
|
ret = sc->sptrlc_set_spectral_config
|
||||||
pdev,
|
(pdev,
|
||||||
SPECTRAL_PARAM_GC_ENA,
|
SPECTRAL_PARAM_GC_ENA,
|
||||||
sp_in->ss_gc_ena))
|
sp_in->ss_gc_ena,
|
||||||
error = -EINVAL;
|
smode, err);
|
||||||
}
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_restart_ena !=
|
if (sp_in->ss_restart_ena != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
SPECTRAL_PHYERR_PARAM_NOVAL) {
|
ret = sc->sptrlc_set_spectral_config
|
||||||
if (sc->sptrlc_set_spectral_config(
|
(pdev,
|
||||||
pdev,
|
SPECTRAL_PARAM_RESTART_ENA,
|
||||||
SPECTRAL_PARAM_RESTART_ENA,
|
sp_in->ss_restart_ena,
|
||||||
sp_in->ss_restart_ena))
|
smode, err);
|
||||||
error = -EINVAL;
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
}
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_noise_floor_ref !=
|
if (sp_in->ss_noise_floor_ref != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
SPECTRAL_PHYERR_PARAM_NOVAL) {
|
ret = sc->sptrlc_set_spectral_config
|
||||||
if (sc->sptrlc_set_spectral_config(
|
(pdev,
|
||||||
pdev,
|
SPECTRAL_PARAM_NOISE_FLOOR_REF,
|
||||||
SPECTRAL_PARAM_NOISE_FLOOR_REF,
|
sp_in->ss_noise_floor_ref,
|
||||||
sp_in->ss_noise_floor_ref))
|
smode, err);
|
||||||
error = -EINVAL;
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
}
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_init_delay !=
|
if (sp_in->ss_init_delay != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
SPECTRAL_PHYERR_PARAM_NOVAL) {
|
ret = sc->sptrlc_set_spectral_config
|
||||||
if (sc->sptrlc_set_spectral_config(
|
(pdev,
|
||||||
pdev,
|
SPECTRAL_PARAM_INIT_DELAY,
|
||||||
SPECTRAL_PARAM_INIT_DELAY,
|
sp_in->ss_init_delay,
|
||||||
sp_in->ss_init_delay))
|
smode, err);
|
||||||
error = -EINVAL;
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
}
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_nb_tone_thr !=
|
if (sp_in->ss_nb_tone_thr != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
SPECTRAL_PHYERR_PARAM_NOVAL) {
|
ret = sc->sptrlc_set_spectral_config
|
||||||
if (sc->sptrlc_set_spectral_config(
|
(pdev,
|
||||||
pdev,
|
SPECTRAL_PARAM_NB_TONE_THR,
|
||||||
SPECTRAL_PARAM_NB_TONE_THR,
|
sp_in->ss_nb_tone_thr,
|
||||||
sp_in->ss_nb_tone_thr))
|
smode, err);
|
||||||
error = -EINVAL;
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
}
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_str_bin_thr !=
|
if (sp_in->ss_str_bin_thr != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
SPECTRAL_PHYERR_PARAM_NOVAL) {
|
ret = sc->sptrlc_set_spectral_config
|
||||||
if (sc->sptrlc_set_spectral_config(
|
(pdev,
|
||||||
pdev,
|
SPECTRAL_PARAM_STR_BIN_THR,
|
||||||
SPECTRAL_PARAM_STR_BIN_THR,
|
sp_in->ss_str_bin_thr,
|
||||||
sp_in->ss_str_bin_thr))
|
smode, err);
|
||||||
error = -EINVAL;
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
}
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_wb_rpt_mode !=
|
if (sp_in->ss_wb_rpt_mode != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
SPECTRAL_PHYERR_PARAM_NOVAL) {
|
ret = sc->sptrlc_set_spectral_config
|
||||||
if (sc->sptrlc_set_spectral_config(
|
(pdev,
|
||||||
pdev,
|
SPECTRAL_PARAM_WB_RPT_MODE,
|
||||||
SPECTRAL_PARAM_WB_RPT_MODE,
|
sp_in->ss_wb_rpt_mode,
|
||||||
sp_in->ss_wb_rpt_mode))
|
smode, err);
|
||||||
error = -EINVAL;
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
}
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_rssi_rpt_mode !=
|
if (sp_in->ss_rssi_rpt_mode != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
SPECTRAL_PHYERR_PARAM_NOVAL) {
|
ret = sc->sptrlc_set_spectral_config
|
||||||
if (sc->sptrlc_set_spectral_config(
|
(pdev,
|
||||||
pdev,
|
SPECTRAL_PARAM_RSSI_RPT_MODE,
|
||||||
SPECTRAL_PARAM_RSSI_RPT_MODE,
|
sp_in->ss_rssi_rpt_mode,
|
||||||
sp_in->ss_rssi_rpt_mode))
|
smode, err);
|
||||||
error = -EINVAL;
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
}
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_rssi_thr != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
if (sp_in->ss_rssi_thr != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
if (sc->sptrlc_set_spectral_config(
|
ret = sc->sptrlc_set_spectral_config
|
||||||
pdev,
|
(pdev,
|
||||||
SPECTRAL_PARAM_RSSI_THR,
|
SPECTRAL_PARAM_RSSI_THR,
|
||||||
sp_in->ss_rssi_thr))
|
sp_in->ss_rssi_thr,
|
||||||
error = -EINVAL;
|
smode, err);
|
||||||
}
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_pwr_format !=
|
if (sp_in->ss_pwr_format != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
SPECTRAL_PHYERR_PARAM_NOVAL) {
|
ret = sc->sptrlc_set_spectral_config
|
||||||
if (sc->sptrlc_set_spectral_config(
|
(pdev,
|
||||||
pdev,
|
SPECTRAL_PARAM_PWR_FORMAT,
|
||||||
SPECTRAL_PARAM_PWR_FORMAT,
|
sp_in->ss_pwr_format,
|
||||||
sp_in->ss_pwr_format))
|
smode, err);
|
||||||
error = -EINVAL;
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
}
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_rpt_mode != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
if (sp_in->ss_rpt_mode != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
if (sc->sptrlc_set_spectral_config(
|
ret = sc->sptrlc_set_spectral_config
|
||||||
pdev,
|
(pdev,
|
||||||
SPECTRAL_PARAM_RPT_MODE,
|
SPECTRAL_PARAM_RPT_MODE,
|
||||||
sp_in->ss_rpt_mode))
|
sp_in->ss_rpt_mode,
|
||||||
error = -EINVAL;
|
smode, err);
|
||||||
}
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_bin_scale !=
|
if (sp_in->ss_bin_scale != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
SPECTRAL_PHYERR_PARAM_NOVAL) {
|
ret = sc->sptrlc_set_spectral_config
|
||||||
if (sc->sptrlc_set_spectral_config(
|
(pdev,
|
||||||
pdev,
|
SPECTRAL_PARAM_BIN_SCALE,
|
||||||
SPECTRAL_PARAM_BIN_SCALE,
|
sp_in->ss_bin_scale,
|
||||||
sp_in->ss_bin_scale))
|
smode, err);
|
||||||
error = -EINVAL;
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
}
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_dbm_adj != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
if (sp_in->ss_dbm_adj != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
if (sc->sptrlc_set_spectral_config(
|
ret = sc->sptrlc_set_spectral_config
|
||||||
pdev,
|
(pdev,
|
||||||
SPECTRAL_PARAM_DBM_ADJ,
|
SPECTRAL_PARAM_DBM_ADJ,
|
||||||
sp_in->ss_dbm_adj))
|
sp_in->ss_dbm_adj,
|
||||||
error = -EINVAL;
|
smode, err);
|
||||||
}
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
if (sp_in->ss_chn_mask != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
if (sp_in->ss_chn_mask != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
/*
|
/*
|
||||||
* Check if any of the inactive Rx antenna
|
* Check if any of the inactive Rx antenna
|
||||||
* chains is set active in spectral chainmask
|
* chains is set active in spectral chainmask
|
||||||
*/
|
*/
|
||||||
vdev = spectral_get_vdev(pdev);
|
vdev = spectral_get_vdev(pdev);
|
||||||
if (!vdev) {
|
if (!vdev)
|
||||||
error = -ENOENT;
|
goto bad;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
vdev_rxchainmask =
|
vdev_rxchainmask =
|
||||||
wlan_vdev_mlme_get_rxchainmask(vdev);
|
wlan_vdev_mlme_get_rxchainmask(vdev);
|
||||||
wlan_objmgr_vdev_release_ref(vdev,
|
wlan_objmgr_vdev_release_ref(vdev,
|
||||||
WLAN_SPECTRAL_ID);
|
WLAN_SPECTRAL_ID);
|
||||||
|
|
||||||
if (!(sp_in->ss_chn_mask & vdev_rxchainmask)) {
|
if (!(sp_in->ss_chn_mask & vdev_rxchainmask)) {
|
||||||
spectral_err("Invalid Spectral Chainmask - Inactive Rx antenna chain cannot be an active spectral chain");
|
spectral_err("Invalid Spectral Chainmask - Inactive Rx antenna chain cannot be an active spectral chain");
|
||||||
error = -EINVAL;
|
goto bad;
|
||||||
break;
|
} else {
|
||||||
} else if (sc->sptrlc_set_spectral_config(
|
ret = sc->sptrlc_set_spectral_config
|
||||||
pdev,
|
(pdev,
|
||||||
SPECTRAL_PARAM_CHN_MASK,
|
SPECTRAL_PARAM_CHN_MASK,
|
||||||
sp_in->ss_chn_mask)) {
|
sp_in->ss_chn_mask,
|
||||||
error = -EINVAL;
|
smode, err);
|
||||||
}
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
|
goto bad;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sp_in->ss_frequency != SPECTRAL_PHYERR_PARAM_NOVAL) {
|
||||||
|
ret = sc->sptrlc_set_spectral_config
|
||||||
|
(pdev,
|
||||||
|
SPECTRAL_PARAM_FREQUENCY,
|
||||||
|
sp_in->ss_frequency,
|
||||||
|
smode, err);
|
||||||
|
if (QDF_IS_STATUS_ERROR(ret))
|
||||||
|
goto bad;
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SPECTRAL_GET_CONFIG:
|
case SPECTRAL_GET_CONFIG:
|
||||||
{
|
sc->sptrlc_get_spectral_config(pdev, &sp_out, smode);
|
||||||
sc->sptrlc_get_spectral_config(pdev, &sp_out);
|
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_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;
|
spectralparams->ss_spectral_pri =
|
||||||
spectralparams->ss_spectral_pri =
|
sp_out.ss_spectral_pri;
|
||||||
sp_out.ss_spectral_pri;
|
spectralparams->ss_fft_size = sp_out.ss_fft_size;
|
||||||
spectralparams->ss_fft_size = sp_out.ss_fft_size;
|
spectralparams->ss_gc_ena = sp_out.ss_gc_ena;
|
||||||
spectralparams->ss_gc_ena = sp_out.ss_gc_ena;
|
spectralparams->ss_restart_ena = sp_out.ss_restart_ena;
|
||||||
spectralparams->ss_restart_ena = sp_out.ss_restart_ena;
|
spectralparams->ss_noise_floor_ref =
|
||||||
spectralparams->ss_noise_floor_ref =
|
sp_out.ss_noise_floor_ref;
|
||||||
sp_out.ss_noise_floor_ref;
|
spectralparams->ss_init_delay = sp_out.ss_init_delay;
|
||||||
spectralparams->ss_init_delay = sp_out.ss_init_delay;
|
spectralparams->ss_nb_tone_thr = sp_out.ss_nb_tone_thr;
|
||||||
spectralparams->ss_nb_tone_thr = sp_out.ss_nb_tone_thr;
|
spectralparams->ss_str_bin_thr = sp_out.ss_str_bin_thr;
|
||||||
spectralparams->ss_str_bin_thr = sp_out.ss_str_bin_thr;
|
spectralparams->ss_wb_rpt_mode = sp_out.ss_wb_rpt_mode;
|
||||||
spectralparams->ss_wb_rpt_mode = sp_out.ss_wb_rpt_mode;
|
spectralparams->ss_rssi_rpt_mode =
|
||||||
spectralparams->ss_rssi_rpt_mode =
|
sp_out.ss_rssi_rpt_mode;
|
||||||
sp_out.ss_rssi_rpt_mode;
|
spectralparams->ss_rssi_thr = sp_out.ss_rssi_thr;
|
||||||
spectralparams->ss_rssi_thr = sp_out.ss_rssi_thr;
|
spectralparams->ss_pwr_format = sp_out.ss_pwr_format;
|
||||||
spectralparams->ss_pwr_format = sp_out.ss_pwr_format;
|
spectralparams->ss_rpt_mode = sp_out.ss_rpt_mode;
|
||||||
spectralparams->ss_rpt_mode = sp_out.ss_rpt_mode;
|
spectralparams->ss_bin_scale = sp_out.ss_bin_scale;
|
||||||
spectralparams->ss_bin_scale = sp_out.ss_bin_scale;
|
spectralparams->ss_dbm_adj = sp_out.ss_dbm_adj;
|
||||||
spectralparams->ss_dbm_adj = sp_out.ss_dbm_adj;
|
spectralparams->ss_chn_mask = sp_out.ss_chn_mask;
|
||||||
spectralparams->ss_chn_mask = sp_out.ss_chn_mask;
|
spectralparams->ss_frequency = sp_out.ss_frequency;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SPECTRAL_IS_ACTIVE:
|
case SPECTRAL_IS_ACTIVE:
|
||||||
{
|
sscan_req->status_req.is_active =
|
||||||
sscan_req->status_req.is_active =
|
sc->sptrlc_is_spectral_active(pdev,
|
||||||
(bool)sc->sptrlc_is_spectral_active(pdev);
|
smode);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SPECTRAL_IS_ENABLED:
|
case SPECTRAL_IS_ENABLED:
|
||||||
{
|
sscan_req->status_req.is_enabled =
|
||||||
sscan_req->status_req.is_enabled =
|
sc->sptrlc_is_spectral_enabled(pdev,
|
||||||
(bool)sc->sptrlc_is_spectral_enabled(pdev);
|
smode);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SPECTRAL_SET_DEBUG_LEVEL:
|
case SPECTRAL_SET_DEBUG_LEVEL:
|
||||||
{
|
temp_debug = sscan_req->debug_req.spectral_dbg_level;
|
||||||
temp_debug = sscan_req->debug_req.spectral_dbg_level;
|
sc->sptrlc_set_debug_level(pdev, temp_debug);
|
||||||
sc->sptrlc_set_debug_level(pdev, temp_debug);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SPECTRAL_GET_DEBUG_LEVEL:
|
case SPECTRAL_GET_DEBUG_LEVEL:
|
||||||
{
|
sscan_req->debug_req.spectral_dbg_level =
|
||||||
sscan_req->debug_req.spectral_dbg_level =
|
sc->sptrlc_get_debug_level(pdev);
|
||||||
(uint32_t)sc->sptrlc_get_debug_level(pdev);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SPECTRAL_ACTIVATE_SCAN:
|
case SPECTRAL_ACTIVATE_SCAN:
|
||||||
{
|
err = &sscan_req->action_req.sscan_err_code;
|
||||||
sc->sptrlc_start_spectral_scan(pdev);
|
sc->sptrlc_start_spectral_scan(pdev, smode, err);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SPECTRAL_STOP_SCAN:
|
case SPECTRAL_STOP_SCAN:
|
||||||
{
|
sc->sptrlc_stop_spectral_scan(pdev, smode);
|
||||||
sc->sptrlc_stop_spectral_scan(pdev);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SPECTRAL_GET_CAPABILITY_INFO:
|
case SPECTRAL_GET_CAPABILITY_INFO:
|
||||||
@@ -431,7 +456,7 @@ spectral_control_cmn(struct wlan_objmgr_pdev *pdev,
|
|||||||
|
|
||||||
vdev = spectral_get_vdev(pdev);
|
vdev = spectral_get_vdev(pdev);
|
||||||
if (!vdev)
|
if (!vdev)
|
||||||
return -ENOENT;
|
goto bad;
|
||||||
|
|
||||||
chan_width = spectral_vdev_get_ch_width(vdev);
|
chan_width = spectral_vdev_get_ch_width(vdev);
|
||||||
wlan_objmgr_vdev_release_ref(vdev, WLAN_SPECTRAL_ID);
|
wlan_objmgr_vdev_release_ref(vdev, WLAN_SPECTRAL_ID);
|
||||||
@@ -442,12 +467,13 @@ spectral_control_cmn(struct wlan_objmgr_pdev *pdev,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
error = -EINVAL;
|
goto bad;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
bad:
|
status = QDF_STATUS_SUCCESS;
|
||||||
return error;
|
bad:
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -122,29 +122,41 @@ struct wmi_spectral_cmd_ops;
|
|||||||
struct spectral_context {
|
struct spectral_context {
|
||||||
struct wlan_objmgr_psoc *psoc_obj;
|
struct wlan_objmgr_psoc *psoc_obj;
|
||||||
struct spectral_legacy_cbacks legacy_cbacks;
|
struct spectral_legacy_cbacks legacy_cbacks;
|
||||||
int (*sptrlc_spectral_control)(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS (*sptrlc_spectral_control)
|
||||||
struct spectral_cp_request *sscan_req);
|
(struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct spectral_cp_request *sscan_req);
|
||||||
int (*sptrlc_ucfg_phyerr_config)(struct wlan_objmgr_pdev *pdev,
|
int (*sptrlc_ucfg_phyerr_config)(struct wlan_objmgr_pdev *pdev,
|
||||||
void *ad);
|
void *ad);
|
||||||
void * (*sptrlc_pdev_spectral_init)(struct wlan_objmgr_pdev *pdev);
|
void * (*sptrlc_pdev_spectral_init)(struct wlan_objmgr_pdev *pdev);
|
||||||
void (*sptrlc_pdev_spectral_deinit)(struct wlan_objmgr_pdev *pdev);
|
void (*sptrlc_pdev_spectral_deinit)(struct wlan_objmgr_pdev *pdev);
|
||||||
int (*sptrlc_set_spectral_config)(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS (*sptrlc_set_spectral_config)
|
||||||
const uint32_t threshtype,
|
(struct wlan_objmgr_pdev *pdev,
|
||||||
const uint32_t value);
|
const uint32_t threshtype,
|
||||||
void (*sptrlc_get_spectral_config)(
|
const uint32_t value,
|
||||||
struct wlan_objmgr_pdev *pdev,
|
const enum spectral_scan_mode smode,
|
||||||
struct spectral_config *sptrl_config);
|
enum spectral_cp_error_code *err);
|
||||||
int (*sptrlc_start_spectral_scan)(struct wlan_objmgr_pdev *pdev);
|
QDF_STATUS (*sptrlc_get_spectral_config)
|
||||||
void (*sptrlc_stop_spectral_scan)(struct wlan_objmgr_pdev *pdev);
|
(struct wlan_objmgr_pdev *pdev,
|
||||||
bool (*sptrlc_is_spectral_active)(struct wlan_objmgr_pdev *pdev);
|
struct spectral_config *sptrl_config,
|
||||||
bool (*sptrlc_is_spectral_enabled)(struct wlan_objmgr_pdev *pdev);
|
const enum spectral_scan_mode smode);
|
||||||
int (*sptrlc_set_debug_level)(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS (*sptrlc_start_spectral_scan)
|
||||||
uint32_t debug_level);
|
(struct wlan_objmgr_pdev *pdev,
|
||||||
|
const enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err);
|
||||||
|
QDF_STATUS (*sptrlc_stop_spectral_scan)(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
bool (*sptrlc_is_spectral_active)(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
bool (*sptrlc_is_spectral_enabled)(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
QDF_STATUS (*sptrlc_set_debug_level)(struct wlan_objmgr_pdev *pdev,
|
||||||
|
uint32_t debug_level);
|
||||||
uint32_t (*sptrlc_get_debug_level)(struct wlan_objmgr_pdev *pdev);
|
uint32_t (*sptrlc_get_debug_level)(struct wlan_objmgr_pdev *pdev);
|
||||||
void (*sptrlc_get_spectral_capinfo)(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS (*sptrlc_get_spectral_capinfo)(struct wlan_objmgr_pdev *pdev,
|
||||||
void *outdata);
|
struct spectral_caps *scaps);
|
||||||
void (*sptrlc_get_spectral_diagstats)(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS (*sptrlc_get_spectral_diagstats)
|
||||||
void *outdata);
|
(struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct spectral_diag_stats *stats);
|
||||||
void (*sptrlc_register_wmi_spectral_cmd_ops)(
|
void (*sptrlc_register_wmi_spectral_cmd_ops)(
|
||||||
struct wlan_objmgr_pdev *pdev,
|
struct wlan_objmgr_pdev *pdev,
|
||||||
struct wmi_spectral_cmd_ops *cmd_ops);
|
struct wmi_spectral_cmd_ops *cmd_ops);
|
||||||
|
@@ -88,6 +88,7 @@
|
|||||||
#define SPECTRAL_SCAN_BIN_SCALE_DEFAULT (1)
|
#define SPECTRAL_SCAN_BIN_SCALE_DEFAULT (1)
|
||||||
#define SPECTRAL_SCAN_DBM_ADJ_DEFAULT (1)
|
#define SPECTRAL_SCAN_DBM_ADJ_DEFAULT (1)
|
||||||
#define SPECTRAL_SCAN_CHN_MASK_DEFAULT (1)
|
#define SPECTRAL_SCAN_CHN_MASK_DEFAULT (1)
|
||||||
|
#define SPECTRAL_SCAN_FREQUENCY_DEFAULT (0)
|
||||||
#endif /* SPECTRAL_USE_EMU_DEFAULTS */
|
#endif /* SPECTRAL_USE_EMU_DEFAULTS */
|
||||||
|
|
||||||
/* The below two definitions apply only to pre-11ac chipsets */
|
/* The below two definitions apply only to pre-11ac chipsets */
|
||||||
|
@@ -37,16 +37,16 @@ void *tgt_get_target_handle(struct wlan_objmgr_pdev *pdev);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* tgt_spectral_control()- handler for demultiplexing requests from higher layer
|
* tgt_spectral_control()- handler for demultiplexing requests from higher layer
|
||||||
* @pdev: reference to global pdev object
|
* @pdev: Reference to global pdev object
|
||||||
* @sscan_req: pointer to Spectral scan request
|
* @sscan_req: pointer to Spectral scan request
|
||||||
*
|
*
|
||||||
* This function processes the spectral config command
|
* This function processes the spectral config command
|
||||||
* and appropriate handlers are invoked.
|
* and appropriate handlers are invoked.
|
||||||
*
|
*
|
||||||
* Return: 0 success else failure
|
* Return: QDF_STATUS_SUCCESS/QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
int tgt_spectral_control(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS tgt_spectral_control(struct wlan_objmgr_pdev *pdev,
|
||||||
struct spectral_cp_request *sscan_req);
|
struct spectral_cp_request *sscan_req);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tgt_pdev_spectral_init() - implementation for spectral init
|
* tgt_pdev_spectral_init() - implementation for spectral init
|
||||||
@@ -67,70 +67,86 @@ void tgt_pdev_spectral_deinit(struct wlan_objmgr_pdev *pdev);
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* tgt_set_spectral_config() - Set spectral config
|
* tgt_set_spectral_config() - Set spectral config
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
* @threshtype: spectral parameter type
|
* @threshtype: spectral parameter type
|
||||||
* @value: value to be configured for the given spectral parameter
|
* @value: Value to be configured for the given spectral parameter
|
||||||
|
* @smode: Spectral scan mode
|
||||||
|
* @err: Spectral control path error code
|
||||||
*
|
*
|
||||||
* Implementation for setting spectral config
|
* Implementation for setting spectral config
|
||||||
*
|
*
|
||||||
* Return: 0 on success else failure
|
* Return: QDF_STATUS_SUCCESS on success, else QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
int tgt_set_spectral_config(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS tgt_set_spectral_config(struct wlan_objmgr_pdev *pdev,
|
||||||
const u_int32_t threshtype,
|
const u_int32_t threshtype,
|
||||||
const u_int32_t value);
|
const u_int32_t value,
|
||||||
|
const enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tgt_get_spectral_config() - Get spectral configuration
|
* tgt_get_spectral_config() - Get spectral configuration
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
* @param: Pointer to spectral_config structure in which the configuration
|
* @param: Pointer to spectral_config structure in which the configuration
|
||||||
* should be returned
|
* should be returned
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Implementation for getting the current spectral configuration
|
* Implementation for getting the current spectral configuration
|
||||||
*
|
*
|
||||||
* Return: None
|
* Return: QDF_STATUS_SUCCESS on success, else QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
void tgt_get_spectral_config(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS tgt_get_spectral_config(struct wlan_objmgr_pdev *pdev,
|
||||||
struct spectral_config *sptrl_config);
|
struct spectral_config *sptrl_config,
|
||||||
|
const enum spectral_scan_mode smode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tgt_start_spectral_scan() - Start spectral scan
|
* tgt_start_spectral_scan() - Start spectral scan
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
|
* @smode: Spectral scan mode
|
||||||
|
* @res: Spectral control path error code
|
||||||
*
|
*
|
||||||
* Implementation for starting spectral scan
|
* Implementation for starting spectral scan
|
||||||
*
|
*
|
||||||
* Return: 0 in case of success, -1 on failure
|
* Return: QDF_STATUS_SUCCESS on success, else QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
int tgt_start_spectral_scan(struct wlan_objmgr_pdev *pdev);
|
QDF_STATUS tgt_start_spectral_scan(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tgt_stop_spectral_scan() - Stop spectral scan
|
* tgt_stop_spectral_scan() - Stop spectral scan
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Implementation for stop spectral scan
|
* Implementation for stop spectral scan
|
||||||
*
|
*
|
||||||
* Return: None
|
* Return: QDF_STATUS_SUCCESS on success, else QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
void tgt_stop_spectral_scan(struct wlan_objmgr_pdev *pdev);
|
QDF_STATUS tgt_stop_spectral_scan(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tgt_is_spectral_active() - Get whether Spectral is active
|
* tgt_is_spectral_active() - Get whether Spectral is active
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Implementation to get whether Spectral is active
|
* Implementation to get whether Spectral is active
|
||||||
*
|
*
|
||||||
* Return: True if Spectral is active, false if Spectral is not active
|
* Return: True if Spectral is active, false if Spectral is not active
|
||||||
*/
|
*/
|
||||||
bool tgt_is_spectral_active(struct wlan_objmgr_pdev *pdev);
|
bool tgt_is_spectral_active(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tgt_is_spectral_enabled() - Get whether Spectral is active
|
* tgt_is_spectral_enabled() - Get whether Spectral is active
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Implementation to get whether Spectral is active
|
* Implementation to get whether Spectral is active
|
||||||
*
|
*
|
||||||
* Return: True if Spectral is active, false if Spectral is not active
|
* Return: True if Spectral is active, false if Spectral is not active
|
||||||
*/
|
*/
|
||||||
bool tgt_is_spectral_enabled(struct wlan_objmgr_pdev *pdev);
|
bool tgt_is_spectral_enabled(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tgt_set_debug_level() - Set debug level for Spectral
|
* tgt_set_debug_level() - Set debug level for Spectral
|
||||||
@@ -139,9 +155,10 @@ bool tgt_is_spectral_enabled(struct wlan_objmgr_pdev *pdev);
|
|||||||
*
|
*
|
||||||
* Implementation to set the debug level for Spectral
|
* Implementation to set the debug level for Spectral
|
||||||
*
|
*
|
||||||
* Return: 0 in case of success
|
* Return: QDF_STATUS_SUCCESS on success, else QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
int tgt_set_debug_level(struct wlan_objmgr_pdev *pdev, u_int32_t debug_level);
|
QDF_STATUS tgt_set_debug_level(struct wlan_objmgr_pdev *pdev,
|
||||||
|
u_int32_t debug_level);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tgt_get_debug_level() - Get debug level for Spectral
|
* tgt_get_debug_level() - Get debug level for Spectral
|
||||||
@@ -156,24 +173,26 @@ uint32_t tgt_get_debug_level(struct wlan_objmgr_pdev *pdev);
|
|||||||
/**
|
/**
|
||||||
* tgt_get_spectral_capinfo() - Get Spectral capability information
|
* tgt_get_spectral_capinfo() - Get Spectral capability information
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
* @outdata: Buffer into which data should be copied
|
* @scaps: Buffer into which data should be copied
|
||||||
*
|
*
|
||||||
* Implementation to get the spectral capability information
|
* Implementation to get the spectral capability information
|
||||||
*
|
*
|
||||||
* Return: void
|
* Return: QDF_STATUS_SUCCESS on success, else QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
void tgt_get_spectral_capinfo(struct wlan_objmgr_pdev *pdev, void *outdata);
|
QDF_STATUS tgt_get_spectral_capinfo(struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct spectral_caps *scaps);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tgt_get_spectral_diagstats() - Get Spectral diagnostic statistics
|
* tgt_get_spectral_diagstats() - Get Spectral diagnostic statistics
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
* @outdata: Buffer into which data should be copied
|
* @stats: Buffer into which data should be copied
|
||||||
*
|
*
|
||||||
* Implementation to get the spectral diagnostic statistics
|
* Implementation to get the spectral diagnostic statistics
|
||||||
*
|
*
|
||||||
* Return: void
|
* Return: QDF_STATUS_SUCCESS on success, else QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
void tgt_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev, void *outdata);
|
QDF_STATUS tgt_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct spectral_diag_stats *stats);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* tgt_register_wmi_spectral_cmd_ops() - Register wmi_spectral_cmd_ops
|
* tgt_register_wmi_spectral_cmd_ops() - Register wmi_spectral_cmd_ops
|
||||||
|
@@ -46,7 +46,7 @@ tgt_get_target_handle(struct wlan_objmgr_pdev *pdev)
|
|||||||
return ps->psptrl_target_handle;
|
return ps->psptrl_target_handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
QDF_STATUS
|
||||||
tgt_spectral_control(
|
tgt_spectral_control(
|
||||||
struct wlan_objmgr_pdev *pdev,
|
struct wlan_objmgr_pdev *pdev,
|
||||||
struct spectral_cp_request *sscan_req)
|
struct spectral_cp_request *sscan_req)
|
||||||
@@ -84,71 +84,79 @@ tgt_pdev_spectral_deinit(struct wlan_objmgr_pdev *pdev)
|
|||||||
psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_pdev_spectral_deinit(pdev);
|
psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_pdev_spectral_deinit(pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
QDF_STATUS
|
||||||
tgt_set_spectral_config(
|
tgt_set_spectral_config(struct wlan_objmgr_pdev *pdev,
|
||||||
struct wlan_objmgr_pdev *pdev,
|
const u_int32_t threshtype, const u_int32_t value,
|
||||||
const u_int32_t threshtype, const u_int32_t value)
|
const enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err)
|
||||||
{
|
{
|
||||||
struct wlan_objmgr_psoc *psoc = NULL;
|
struct wlan_objmgr_psoc *psoc = NULL;
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
psoc = wlan_pdev_get_psoc(pdev);
|
||||||
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_set_spectral_config(
|
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_set_spectral_config(
|
||||||
pdev, threshtype, value);
|
pdev, threshtype, value, smode, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
QDF_STATUS
|
||||||
tgt_get_spectral_config(
|
tgt_get_spectral_config(struct wlan_objmgr_pdev *pdev,
|
||||||
struct wlan_objmgr_pdev *pdev,
|
struct spectral_config *sptrl_config,
|
||||||
struct spectral_config *sptrl_config)
|
const enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
struct wlan_objmgr_psoc *psoc = NULL;
|
struct wlan_objmgr_psoc *psoc = NULL;
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
psoc = wlan_pdev_get_psoc(pdev);
|
||||||
psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_spectral_config(
|
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_spectral_config(
|
||||||
pdev,
|
pdev,
|
||||||
sptrl_config);
|
sptrl_config,
|
||||||
|
smode);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
QDF_STATUS
|
||||||
tgt_start_spectral_scan(struct wlan_objmgr_pdev *pdev)
|
tgt_start_spectral_scan(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err)
|
||||||
{
|
{
|
||||||
struct wlan_objmgr_psoc *psoc = NULL;
|
struct wlan_objmgr_psoc *psoc = NULL;
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
psoc = wlan_pdev_get_psoc(pdev);
|
||||||
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_start_spectral_scan(
|
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_start_spectral_scan(
|
||||||
pdev);
|
pdev, smode, err);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
QDF_STATUS
|
||||||
tgt_stop_spectral_scan(struct wlan_objmgr_pdev *pdev)
|
tgt_stop_spectral_scan(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
struct wlan_objmgr_psoc *psoc = NULL;
|
struct wlan_objmgr_psoc *psoc = NULL;
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
psoc = wlan_pdev_get_psoc(pdev);
|
||||||
psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_stop_spectral_scan(pdev);
|
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_stop_spectral_scan(
|
||||||
|
pdev, smode);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
tgt_is_spectral_active(struct wlan_objmgr_pdev *pdev)
|
tgt_is_spectral_active(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
struct wlan_objmgr_psoc *psoc = NULL;
|
struct wlan_objmgr_psoc *psoc = NULL;
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
psoc = wlan_pdev_get_psoc(pdev);
|
||||||
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_is_spectral_active(
|
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_is_spectral_active(
|
||||||
pdev);
|
pdev, smode);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
tgt_is_spectral_enabled(struct wlan_objmgr_pdev *pdev)
|
tgt_is_spectral_enabled(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
struct wlan_objmgr_psoc *psoc = NULL;
|
struct wlan_objmgr_psoc *psoc = NULL;
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
psoc = wlan_pdev_get_psoc(pdev);
|
||||||
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_is_spectral_enabled(
|
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_is_spectral_enabled(
|
||||||
pdev);
|
pdev, smode);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
QDF_STATUS
|
||||||
tgt_set_debug_level(struct wlan_objmgr_pdev *pdev, u_int32_t debug_level)
|
tgt_set_debug_level(struct wlan_objmgr_pdev *pdev, u_int32_t debug_level)
|
||||||
{
|
{
|
||||||
struct wlan_objmgr_psoc *psoc = NULL;
|
struct wlan_objmgr_psoc *psoc = NULL;
|
||||||
@@ -168,24 +176,26 @@ tgt_get_debug_level(struct wlan_objmgr_pdev *pdev)
|
|||||||
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_debug_level(pdev);
|
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_debug_level(pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
QDF_STATUS
|
||||||
tgt_get_spectral_capinfo(struct wlan_objmgr_pdev *pdev, void *outdata)
|
tgt_get_spectral_capinfo(struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct spectral_caps *scaps)
|
||||||
{
|
{
|
||||||
struct wlan_objmgr_psoc *psoc = NULL;
|
struct wlan_objmgr_psoc *psoc = NULL;
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
psoc = wlan_pdev_get_psoc(pdev);
|
||||||
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_spectral_capinfo(
|
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_spectral_capinfo(
|
||||||
pdev, outdata);
|
pdev, scaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
QDF_STATUS
|
||||||
tgt_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev, void *outdata)
|
tgt_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct spectral_diag_stats *stats)
|
||||||
{
|
{
|
||||||
struct wlan_objmgr_psoc *psoc = NULL;
|
struct wlan_objmgr_psoc *psoc = NULL;
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
psoc = wlan_pdev_get_psoc(pdev);
|
||||||
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_spectral_diagstats(
|
return psoc->soc_cb.tx_ops.sptrl_tx_ops.sptrlto_get_spectral_diagstats(
|
||||||
pdev, outdata);
|
pdev, stats);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@@ -189,20 +189,28 @@ target_if_send_vdev_spectral_enable_cmd(struct target_if_spectral *spectral,
|
|||||||
* target_if_spectral_info_init_defaults() - Helper function to load defaults
|
* target_if_spectral_info_init_defaults() - Helper function to load defaults
|
||||||
* for Spectral information (parameters and state) into cache.
|
* for Spectral information (parameters and state) into cache.
|
||||||
* @spectral: Pointer to Spectral target_if internal private data
|
* @spectral: Pointer to Spectral target_if internal private data
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* It is assumed that the caller has obtained the requisite lock if applicable.
|
* It is assumed that the caller has obtained the requisite lock if applicable.
|
||||||
* Note that this is currently treated as a temporary function. Ideally, we
|
* Note that this is currently treated as a temporary function. Ideally, we
|
||||||
* would like to get defaults from the firmware.
|
* would like to get defaults from the firmware.
|
||||||
*
|
*
|
||||||
* Return: QDF_STATUS_SUCCESS on success, negative error code on failure
|
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE on failure
|
||||||
*/
|
*/
|
||||||
static int
|
static QDF_STATUS
|
||||||
target_if_spectral_info_init_defaults(struct target_if_spectral *spectral)
|
target_if_spectral_info_init_defaults(struct target_if_spectral *spectral,
|
||||||
|
enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
struct target_if_spectral_param_state_info *info =
|
struct target_if_spectral_param_state_info *info;
|
||||||
&spectral->param_info;
|
|
||||||
struct wlan_objmgr_vdev *vdev = NULL;
|
struct wlan_objmgr_vdev *vdev = NULL;
|
||||||
|
|
||||||
|
if (smode >= SPECTRAL_SCAN_MODE_MAX) {
|
||||||
|
spectral_err("Invalid Spectral mode %u", smode);
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
info = &spectral->param_info[smode];
|
||||||
|
|
||||||
/* State */
|
/* State */
|
||||||
info->osps_cache.osc_spectral_active = SPECTRAL_SCAN_ACTIVE_DEFAULT;
|
info->osps_cache.osc_spectral_active = SPECTRAL_SCAN_ACTIVE_DEFAULT;
|
||||||
|
|
||||||
@@ -275,6 +283,9 @@ target_if_spectral_info_init_defaults(struct target_if_spectral *spectral)
|
|||||||
info->osps_cache.osc_params.ss_fft_period =
|
info->osps_cache.osc_params.ss_fft_period =
|
||||||
SPECTRAL_SCAN_FFT_PERIOD_DEFAULT;
|
SPECTRAL_SCAN_FFT_PERIOD_DEFAULT;
|
||||||
|
|
||||||
|
info->osps_cache.osc_params.ss_frequency =
|
||||||
|
SPECTRAL_SCAN_FREQUENCY_DEFAULT;
|
||||||
|
|
||||||
/* The cache is now valid */
|
/* The cache is now valid */
|
||||||
info->osps_cache.osc_is_valid = 1;
|
info->osps_cache.osc_is_valid = 1;
|
||||||
|
|
||||||
@@ -433,6 +444,7 @@ target_if_log_read_spectral_params_catch_validate(
|
|||||||
/**
|
/**
|
||||||
* target_if_spectral_info_read() - Read spectral information from the cache.
|
* target_if_spectral_info_read() - Read spectral information from the cache.
|
||||||
* @spectral: Pointer to Spectral target_if internal private data
|
* @spectral: Pointer to Spectral target_if internal private data
|
||||||
|
* @smode: Spectral scan mode
|
||||||
* @specifier: target_if_spectral_info enumeration specifying which
|
* @specifier: target_if_spectral_info enumeration specifying which
|
||||||
* information is required
|
* information is required
|
||||||
* @output: Void output pointer into which the information will be read
|
* @output: Void output pointer into which the information will be read
|
||||||
@@ -445,6 +457,7 @@ target_if_log_read_spectral_params_catch_validate(
|
|||||||
static int
|
static int
|
||||||
target_if_spectral_info_read(
|
target_if_spectral_info_read(
|
||||||
struct target_if_spectral *spectral,
|
struct target_if_spectral *spectral,
|
||||||
|
enum spectral_scan_mode smode,
|
||||||
enum target_if_spectral_info specifier,
|
enum target_if_spectral_info specifier,
|
||||||
void *output, int output_len)
|
void *output, int output_len)
|
||||||
{
|
{
|
||||||
@@ -453,11 +466,16 @@ target_if_spectral_info_read(
|
|||||||
* WMI reads for defaults, non-cacheable information, etc
|
* WMI reads for defaults, non-cacheable information, etc
|
||||||
* if required.
|
* if required.
|
||||||
*/
|
*/
|
||||||
struct target_if_spectral_param_state_info *info =
|
struct target_if_spectral_param_state_info *info;
|
||||||
&spectral->param_info;
|
|
||||||
int is_cacheable = 0;
|
int is_cacheable = 0;
|
||||||
int init_def_retval = 0;
|
int init_def_retval = 0;
|
||||||
|
|
||||||
|
if (smode >= SPECTRAL_SCAN_MODE_MAX) {
|
||||||
|
spectral_err("Invalid Spectral mode %u", smode);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
info = &spectral->param_info[smode];
|
||||||
|
|
||||||
if (!output)
|
if (!output)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@@ -539,7 +557,8 @@ target_if_spectral_info_read(
|
|||||||
* If WMI Reads are implemented to fetch defaults/non-cacheable info,
|
* If WMI Reads are implemented to fetch defaults/non-cacheable info,
|
||||||
* then the below implementation will change
|
* then the below implementation will change
|
||||||
*/
|
*/
|
||||||
init_def_retval = target_if_spectral_info_init_defaults(spectral);
|
init_def_retval =
|
||||||
|
target_if_spectral_info_init_defaults(spectral, smode);
|
||||||
if (init_def_retval != QDF_STATUS_SUCCESS) {
|
if (init_def_retval != QDF_STATUS_SUCCESS) {
|
||||||
qdf_spin_unlock(&info->osps_lock);
|
qdf_spin_unlock(&info->osps_lock);
|
||||||
if (init_def_retval == QDF_STATUS_E_NOENT)
|
if (init_def_retval == QDF_STATUS_E_NOENT)
|
||||||
@@ -672,6 +691,7 @@ target_if_log_write_spectral_params(
|
|||||||
* target_if_spectral_info_write() - Write Spectral information to the
|
* target_if_spectral_info_write() - Write Spectral information to the
|
||||||
* firmware, and update cache
|
* firmware, and update cache
|
||||||
* @spectral: Pointer to Spectral target_if internal private data
|
* @spectral: Pointer to Spectral target_if internal private data
|
||||||
|
* @smode: Spectral scan mode
|
||||||
* @specifier: target_if_spectral_info enumeration specifying which
|
* @specifier: target_if_spectral_info enumeration specifying which
|
||||||
* information is involved
|
* information is involved
|
||||||
* @input: void input pointer containing the information to be written
|
* @input: void input pointer containing the information to be written
|
||||||
@@ -685,15 +705,21 @@ target_if_log_write_spectral_params(
|
|||||||
static int
|
static int
|
||||||
target_if_spectral_info_write(
|
target_if_spectral_info_write(
|
||||||
struct target_if_spectral *spectral,
|
struct target_if_spectral *spectral,
|
||||||
|
enum spectral_scan_mode smode,
|
||||||
enum target_if_spectral_info specifier,
|
enum target_if_spectral_info specifier,
|
||||||
void *input, int input_len)
|
void *input, int input_len)
|
||||||
{
|
{
|
||||||
struct target_if_spectral_param_state_info *info =
|
struct target_if_spectral_param_state_info *info;
|
||||||
&spectral->param_info;
|
|
||||||
int ret;
|
int ret;
|
||||||
uint8_t *pval = NULL;
|
uint8_t *pval = NULL;
|
||||||
struct spectral_config *param = NULL;
|
struct spectral_config *param = NULL;
|
||||||
|
|
||||||
|
if (smode >= SPECTRAL_SCAN_MODE_MAX) {
|
||||||
|
spectral_err("Invalid Spectral mode %u", smode);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
info = &spectral->param_info[smode];
|
||||||
|
|
||||||
if (!input)
|
if (!input)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
@@ -884,13 +910,14 @@ target_if_spectral_get_rxfilter(void *arg)
|
|||||||
/**
|
/**
|
||||||
* target_if_sops_is_spectral_active() - Get whether Spectral is active
|
* target_if_sops_is_spectral_active() - Get whether Spectral is active
|
||||||
* @arg: Pointer to handle for Spectral target_if internal private data
|
* @arg: Pointer to handle for Spectral target_if internal private data
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Function to check whether Spectral is active
|
* Function to check whether Spectral is active
|
||||||
*
|
*
|
||||||
* Return: True if Spectral is active, false if Spectral is not active
|
* Return: True if Spectral is active, false if Spectral is not active
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
target_if_sops_is_spectral_active(void *arg)
|
target_if_sops_is_spectral_active(void *arg, enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
struct target_if_spectral *spectral = (struct target_if_spectral *)arg;
|
struct target_if_spectral *spectral = (struct target_if_spectral *)arg;
|
||||||
uint8_t val = 0;
|
uint8_t val = 0;
|
||||||
@@ -898,6 +925,7 @@ target_if_sops_is_spectral_active(void *arg)
|
|||||||
|
|
||||||
ret = target_if_spectral_info_read(
|
ret = target_if_spectral_info_read(
|
||||||
spectral,
|
spectral,
|
||||||
|
smode,
|
||||||
TARGET_IF_SPECTRAL_INFO_ACTIVE,
|
TARGET_IF_SPECTRAL_INFO_ACTIVE,
|
||||||
&val, sizeof(val));
|
&val, sizeof(val));
|
||||||
|
|
||||||
@@ -917,13 +945,14 @@ target_if_sops_is_spectral_active(void *arg)
|
|||||||
/**
|
/**
|
||||||
* target_if_sops_is_spectral_enabled() - Get whether Spectral is enabled
|
* target_if_sops_is_spectral_enabled() - Get whether Spectral is enabled
|
||||||
* @arg: Pointer to handle for Spectral target_if internal private data
|
* @arg: Pointer to handle for Spectral target_if internal private data
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Function to check whether Spectral is enabled
|
* Function to check whether Spectral is enabled
|
||||||
*
|
*
|
||||||
* Return: True if Spectral is enabled, false if Spectral is not enabled
|
* Return: True if Spectral is enabled, false if Spectral is not enabled
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
target_if_sops_is_spectral_enabled(void *arg)
|
target_if_sops_is_spectral_enabled(void *arg, enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
struct target_if_spectral *spectral = (struct target_if_spectral *)arg;
|
struct target_if_spectral *spectral = (struct target_if_spectral *)arg;
|
||||||
uint8_t val = 0;
|
uint8_t val = 0;
|
||||||
@@ -931,6 +960,7 @@ target_if_sops_is_spectral_enabled(void *arg)
|
|||||||
|
|
||||||
ret = target_if_spectral_info_read(
|
ret = target_if_spectral_info_read(
|
||||||
spectral,
|
spectral,
|
||||||
|
smode,
|
||||||
TARGET_IF_SPECTRAL_INFO_ENABLED,
|
TARGET_IF_SPECTRAL_INFO_ENABLED,
|
||||||
&val, sizeof(val));
|
&val, sizeof(val));
|
||||||
|
|
||||||
@@ -950,13 +980,16 @@ target_if_sops_is_spectral_enabled(void *arg)
|
|||||||
/**
|
/**
|
||||||
* target_if_sops_start_spectral_scan() - Start Spectral scan
|
* target_if_sops_start_spectral_scan() - Start Spectral scan
|
||||||
* @arg: Pointer to handle for Spectral target_if internal private data
|
* @arg: Pointer to handle for Spectral target_if internal private data
|
||||||
|
* @smode: Spectral scan mode
|
||||||
|
* @err: Spectral error code
|
||||||
*
|
*
|
||||||
* Function to start spectral scan
|
* Function to start spectral scan
|
||||||
*
|
*
|
||||||
* Return: 0 on success else failure
|
* Return: 0 on success else failure
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
target_if_sops_start_spectral_scan(void *arg)
|
target_if_sops_start_spectral_scan(void *arg, enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err)
|
||||||
{
|
{
|
||||||
struct target_if_spectral *spectral = (struct target_if_spectral *)arg;
|
struct target_if_spectral *spectral = (struct target_if_spectral *)arg;
|
||||||
uint8_t val = 1;
|
uint8_t val = 1;
|
||||||
@@ -965,6 +998,7 @@ target_if_sops_start_spectral_scan(void *arg)
|
|||||||
|
|
||||||
ret = target_if_spectral_info_read(
|
ret = target_if_spectral_info_read(
|
||||||
spectral,
|
spectral,
|
||||||
|
smode,
|
||||||
TARGET_IF_SPECTRAL_INFO_ENABLED,
|
TARGET_IF_SPECTRAL_INFO_ENABLED,
|
||||||
&enabled, sizeof(enabled));
|
&enabled, sizeof(enabled));
|
||||||
|
|
||||||
@@ -979,6 +1013,7 @@ target_if_sops_start_spectral_scan(void *arg)
|
|||||||
if (!enabled) {
|
if (!enabled) {
|
||||||
ret = target_if_spectral_info_write(
|
ret = target_if_spectral_info_write(
|
||||||
spectral,
|
spectral,
|
||||||
|
smode,
|
||||||
TARGET_IF_SPECTRAL_INFO_ENABLED,
|
TARGET_IF_SPECTRAL_INFO_ENABLED,
|
||||||
&val, sizeof(val));
|
&val, sizeof(val));
|
||||||
|
|
||||||
@@ -988,6 +1023,7 @@ target_if_sops_start_spectral_scan(void *arg)
|
|||||||
|
|
||||||
ret = target_if_spectral_info_write(
|
ret = target_if_spectral_info_write(
|
||||||
spectral,
|
spectral,
|
||||||
|
smode,
|
||||||
TARGET_IF_SPECTRAL_INFO_ACTIVE,
|
TARGET_IF_SPECTRAL_INFO_ACTIVE,
|
||||||
&val, sizeof(val));
|
&val, sizeof(val));
|
||||||
|
|
||||||
@@ -1000,13 +1036,14 @@ target_if_sops_start_spectral_scan(void *arg)
|
|||||||
/**
|
/**
|
||||||
* target_if_sops_stop_spectral_scan() - Stop Spectral scan
|
* target_if_sops_stop_spectral_scan() - Stop Spectral scan
|
||||||
* @arg: Pointer to handle for Spectral target_if internal private data
|
* @arg: Pointer to handle for Spectral target_if internal private data
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Function to stop spectral scan
|
* Function to stop spectral scan
|
||||||
*
|
*
|
||||||
* Return: 0 on success else failure
|
* Return: 0 on success else failure
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
target_if_sops_stop_spectral_scan(void *arg)
|
target_if_sops_stop_spectral_scan(void *arg, enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
struct target_if_spectral *spectral = (struct target_if_spectral *)arg;
|
struct target_if_spectral *spectral = (struct target_if_spectral *)arg;
|
||||||
uint8_t val = 0;
|
uint8_t val = 0;
|
||||||
@@ -1015,6 +1052,7 @@ target_if_sops_stop_spectral_scan(void *arg)
|
|||||||
|
|
||||||
tempret = target_if_spectral_info_read(
|
tempret = target_if_spectral_info_read(
|
||||||
spectral,
|
spectral,
|
||||||
|
smode,
|
||||||
TARGET_IF_SPECTRAL_INFO_ENABLED,
|
TARGET_IF_SPECTRAL_INFO_ENABLED,
|
||||||
&enabled, sizeof(enabled));
|
&enabled, sizeof(enabled));
|
||||||
|
|
||||||
@@ -1031,6 +1069,7 @@ target_if_sops_stop_spectral_scan(void *arg)
|
|||||||
|
|
||||||
tempret = target_if_spectral_info_write(
|
tempret = target_if_spectral_info_write(
|
||||||
spectral,
|
spectral,
|
||||||
|
smode,
|
||||||
TARGET_IF_SPECTRAL_INFO_ACTIVE,
|
TARGET_IF_SPECTRAL_INFO_ACTIVE,
|
||||||
&val, sizeof(val));
|
&val, sizeof(val));
|
||||||
|
|
||||||
@@ -1039,6 +1078,7 @@ target_if_sops_stop_spectral_scan(void *arg)
|
|||||||
|
|
||||||
tempret = target_if_spectral_info_write(
|
tempret = target_if_spectral_info_write(
|
||||||
spectral,
|
spectral,
|
||||||
|
smode,
|
||||||
TARGET_IF_SPECTRAL_INFO_ENABLED,
|
TARGET_IF_SPECTRAL_INFO_ENABLED,
|
||||||
&val, sizeof(val));
|
&val, sizeof(val));
|
||||||
|
|
||||||
@@ -1198,6 +1238,7 @@ target_if_spectral_get_ctl_noisefloor(void *arg)
|
|||||||
* parameters
|
* parameters
|
||||||
* @arg: Pointer to handle for Spectral target_if internal private data
|
* @arg: Pointer to handle for Spectral target_if internal private data
|
||||||
* @params: Spectral parameters
|
* @params: Spectral parameters
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Function to configure spectral parameters
|
* Function to configure spectral parameters
|
||||||
*
|
*
|
||||||
@@ -1205,12 +1246,14 @@ target_if_spectral_get_ctl_noisefloor(void *arg)
|
|||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
target_if_spectral_sops_configure_params(
|
target_if_spectral_sops_configure_params(
|
||||||
void *arg, struct spectral_config *params)
|
void *arg, struct spectral_config *params,
|
||||||
|
enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
struct target_if_spectral *spectral = (struct target_if_spectral *)arg;
|
struct target_if_spectral *spectral = (struct target_if_spectral *)arg;
|
||||||
|
|
||||||
return target_if_spectral_info_write(
|
return target_if_spectral_info_write(
|
||||||
spectral,
|
spectral,
|
||||||
|
smode,
|
||||||
TARGET_IF_SPECTRAL_INFO_PARAMS,
|
TARGET_IF_SPECTRAL_INFO_PARAMS,
|
||||||
params, sizeof(*params));
|
params, sizeof(*params));
|
||||||
}
|
}
|
||||||
@@ -1220,18 +1263,21 @@ target_if_spectral_sops_configure_params(
|
|||||||
* parameters
|
* parameters
|
||||||
* @arg: Pointer to handle for Spectral target_if internal private data
|
* @arg: Pointer to handle for Spectral target_if internal private data
|
||||||
* @params: Pointer to buffer into which Spectral parameters should be copied
|
* @params: Pointer to buffer into which Spectral parameters should be copied
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Function to get the configured spectral parameters
|
* Function to get the configured spectral parameters
|
||||||
*
|
*
|
||||||
* Return: 0 on success else failure
|
* Return: 0 on success else failure
|
||||||
*/
|
*/
|
||||||
uint32_t
|
uint32_t
|
||||||
target_if_spectral_sops_get_params(void *arg, struct spectral_config *params)
|
target_if_spectral_sops_get_params(void *arg, struct spectral_config *params,
|
||||||
|
enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
struct target_if_spectral *spectral = (struct target_if_spectral *)arg;
|
struct target_if_spectral *spectral = (struct target_if_spectral *)arg;
|
||||||
|
|
||||||
return target_if_spectral_info_read(
|
return target_if_spectral_info_read(
|
||||||
spectral,
|
spectral,
|
||||||
|
smode,
|
||||||
TARGET_IF_SPECTRAL_INFO_PARAMS,
|
TARGET_IF_SPECTRAL_INFO_PARAMS,
|
||||||
params, sizeof(*params));
|
params, sizeof(*params));
|
||||||
}
|
}
|
||||||
@@ -1525,28 +1571,29 @@ null_get_rxfilter(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t
|
static uint32_t
|
||||||
null_is_spectral_active(void *arg)
|
null_is_spectral_active(void *arg, enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
spectral_ops_not_registered("is_spectral_active");
|
spectral_ops_not_registered("is_spectral_active");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t
|
static uint32_t
|
||||||
null_is_spectral_enabled(void *arg)
|
null_is_spectral_enabled(void *arg, enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
spectral_ops_not_registered("is_spectral_enabled");
|
spectral_ops_not_registered("is_spectral_enabled");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t
|
static uint32_t
|
||||||
null_start_spectral_scan(void *arg)
|
null_start_spectral_scan(void *arg, enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err)
|
||||||
{
|
{
|
||||||
spectral_ops_not_registered("start_spectral_scan");
|
spectral_ops_not_registered("start_spectral_scan");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t
|
static uint32_t
|
||||||
null_stop_spectral_scan(void *arg)
|
null_stop_spectral_scan(void *arg, enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
spectral_ops_not_registered("stop_spectral_scan");
|
spectral_ops_not_registered("stop_spectral_scan");
|
||||||
return 1;
|
return 1;
|
||||||
@@ -1574,14 +1621,16 @@ null_get_ext_noisefloor(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t
|
static uint32_t
|
||||||
null_configure_spectral(void *arg, struct spectral_config *params)
|
null_configure_spectral(void *arg, struct spectral_config *params,
|
||||||
|
enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
spectral_ops_not_registered("configure_spectral");
|
spectral_ops_not_registered("configure_spectral");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint32_t
|
static uint32_t
|
||||||
null_get_spectral_config(void *arg, struct spectral_config *params)
|
null_get_spectral_config(void *arg, struct spectral_config *params,
|
||||||
|
enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
spectral_ops_not_registered("get_spectral_config");
|
spectral_ops_not_registered("get_spectral_config");
|
||||||
return 0;
|
return 0;
|
||||||
@@ -1821,10 +1870,13 @@ target_if_spectral_detach_simulation(struct target_if_spectral *spectral)
|
|||||||
static void
|
static void
|
||||||
target_if_spectral_detach(struct target_if_spectral *spectral)
|
target_if_spectral_detach(struct target_if_spectral *spectral)
|
||||||
{
|
{
|
||||||
|
enum spectral_scan_mode smode = SPECTRAL_SCAN_MODE_NORMAL;
|
||||||
spectral_info("spectral detach");
|
spectral_info("spectral detach");
|
||||||
|
|
||||||
if (spectral) {
|
if (spectral) {
|
||||||
qdf_spinlock_destroy(&spectral->param_info.osps_lock);
|
for (; smode < SPECTRAL_SCAN_MODE_MAX; smode++)
|
||||||
|
qdf_spinlock_destroy
|
||||||
|
(&spectral->param_info[smode].osps_lock);
|
||||||
|
|
||||||
target_if_spectral_detach_simulation(spectral);
|
target_if_spectral_detach_simulation(spectral);
|
||||||
|
|
||||||
@@ -1883,6 +1935,7 @@ target_if_pdev_spectral_init(struct wlan_objmgr_pdev *pdev)
|
|||||||
uint32_t target_revision;
|
uint32_t target_revision;
|
||||||
struct wlan_objmgr_psoc *psoc;
|
struct wlan_objmgr_psoc *psoc;
|
||||||
struct wlan_lmac_if_target_tx_ops *tx_ops;
|
struct wlan_lmac_if_target_tx_ops *tx_ops;
|
||||||
|
enum spectral_scan_mode smode = SPECTRAL_SCAN_MODE_NORMAL;
|
||||||
|
|
||||||
if (!pdev) {
|
if (!pdev) {
|
||||||
spectral_err("SPECTRAL: pdev is NULL!");
|
spectral_err("SPECTRAL: pdev is NULL!");
|
||||||
@@ -1982,7 +2035,6 @@ target_if_pdev_spectral_init(struct wlan_objmgr_pdev *pdev)
|
|||||||
spectral->fft_size_max = SPECTRAL_PARAM_FFT_SIZE_MAX_GEN2;
|
spectral->fft_size_max = SPECTRAL_PARAM_FFT_SIZE_MAX_GEN2;
|
||||||
}
|
}
|
||||||
|
|
||||||
spectral->params_valid = false;
|
|
||||||
/* Init spectral capability */
|
/* Init spectral capability */
|
||||||
if (target_if_init_spectral_capability(spectral) !=
|
if (target_if_init_spectral_capability(spectral) !=
|
||||||
QDF_STATUS_SUCCESS) {
|
QDF_STATUS_SUCCESS) {
|
||||||
@@ -1994,8 +2046,12 @@ target_if_pdev_spectral_init(struct wlan_objmgr_pdev *pdev)
|
|||||||
|
|
||||||
target_if_init_spectral_ops(spectral);
|
target_if_init_spectral_ops(spectral);
|
||||||
|
|
||||||
qdf_spinlock_create(&spectral->param_info.osps_lock);
|
/* Spectral mode specific init */
|
||||||
spectral->param_info.osps_cache.osc_is_valid = 0;
|
for (; smode < SPECTRAL_SCAN_MODE_MAX; smode++) {
|
||||||
|
spectral->params_valid[smode] = false;
|
||||||
|
qdf_spinlock_create(&spectral->param_info[smode].osps_lock);
|
||||||
|
spectral->param_info[smode].osps_cache.osc_is_valid = 0;
|
||||||
|
}
|
||||||
|
|
||||||
target_if_spectral_register_funcs(spectral, &spectral_ops);
|
target_if_spectral_register_funcs(spectral, &spectral_ops);
|
||||||
|
|
||||||
@@ -2063,107 +2119,122 @@ target_if_pdev_spectral_deinit(struct wlan_objmgr_pdev *pdev)
|
|||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
* @threshtype: config type
|
* @threshtype: config type
|
||||||
* @value: config value
|
* @value: config value
|
||||||
|
* @smode: Spectral scan mode
|
||||||
|
* @err: Spectral error code
|
||||||
*
|
*
|
||||||
* API to set spectral configurations
|
* API to set spectral configurations
|
||||||
*
|
*
|
||||||
* Return: 0 on success else failure
|
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE on failure
|
||||||
*/
|
*/
|
||||||
int
|
QDF_STATUS
|
||||||
target_if_set_spectral_config(struct wlan_objmgr_pdev *pdev,
|
target_if_set_spectral_config(struct wlan_objmgr_pdev *pdev,
|
||||||
const uint32_t threshtype, const uint32_t value)
|
const uint32_t threshtype, const uint32_t value,
|
||||||
|
const enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err)
|
||||||
{
|
{
|
||||||
struct spectral_config params;
|
struct spectral_config params;
|
||||||
struct target_if_spectral_ops *p_sops = NULL;
|
struct target_if_spectral_ops *p_sops = NULL;
|
||||||
struct target_if_spectral *spectral = NULL;
|
struct target_if_spectral *spectral = NULL;
|
||||||
|
struct spectral_config *sparams;
|
||||||
|
|
||||||
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
||||||
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
|
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
|
||||||
if (!spectral) {
|
if (!spectral) {
|
||||||
spectral_err("spectral object is NULL");
|
spectral_err("spectral object is NULL");
|
||||||
return -EPERM;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!spectral->params_valid) {
|
if (smode >= SPECTRAL_SCAN_MODE_MAX) {
|
||||||
|
spectral_err("Invalid Spectral mode %u", smode);
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
sparams = &spectral->params[smode];
|
||||||
|
|
||||||
|
if (!spectral->params_valid[smode]) {
|
||||||
target_if_spectral_info_read(spectral,
|
target_if_spectral_info_read(spectral,
|
||||||
|
smode,
|
||||||
TARGET_IF_SPECTRAL_INFO_PARAMS,
|
TARGET_IF_SPECTRAL_INFO_PARAMS,
|
||||||
&spectral->params,
|
&spectral->params[smode],
|
||||||
sizeof(spectral->params));
|
sizeof(spectral->params[smode]));
|
||||||
spectral->params_valid = true;
|
spectral->params_valid[smode] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (threshtype) {
|
switch (threshtype) {
|
||||||
case SPECTRAL_PARAM_FFT_PERIOD:
|
case SPECTRAL_PARAM_FFT_PERIOD:
|
||||||
spectral->params.ss_fft_period = value;
|
sparams->ss_fft_period = value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_SCAN_PERIOD:
|
case SPECTRAL_PARAM_SCAN_PERIOD:
|
||||||
spectral->params.ss_period = value;
|
sparams->ss_period = value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_SCAN_COUNT:
|
case SPECTRAL_PARAM_SCAN_COUNT:
|
||||||
spectral->params.ss_count = value;
|
sparams->ss_count = value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_SHORT_REPORT:
|
case SPECTRAL_PARAM_SHORT_REPORT:
|
||||||
spectral->params.ss_short_report = (!!value) ? true : false;
|
sparams->ss_short_report = (!!value) ? true : false;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_SPECT_PRI:
|
case SPECTRAL_PARAM_SPECT_PRI:
|
||||||
spectral->params.ss_spectral_pri = (!!value) ? true : false;
|
sparams->ss_spectral_pri = (!!value) ? true : false;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_FFT_SIZE:
|
case SPECTRAL_PARAM_FFT_SIZE:
|
||||||
if ((value < spectral->fft_size_min) ||
|
if ((value < spectral->fft_size_min) ||
|
||||||
(value > spectral->fft_size_max))
|
(value > spectral->fft_size_max))
|
||||||
return -EINVAL;
|
return QDF_STATUS_E_FAILURE;
|
||||||
spectral->params.ss_fft_size = value;
|
sparams->ss_fft_size = value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_GC_ENA:
|
case SPECTRAL_PARAM_GC_ENA:
|
||||||
spectral->params.ss_gc_ena = !!value;
|
sparams->ss_gc_ena = !!value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_RESTART_ENA:
|
case SPECTRAL_PARAM_RESTART_ENA:
|
||||||
spectral->params.ss_restart_ena = !!value;
|
sparams->ss_restart_ena = !!value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_NOISE_FLOOR_REF:
|
case SPECTRAL_PARAM_NOISE_FLOOR_REF:
|
||||||
spectral->params.ss_noise_floor_ref = value;
|
sparams->ss_noise_floor_ref = value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_INIT_DELAY:
|
case SPECTRAL_PARAM_INIT_DELAY:
|
||||||
spectral->params.ss_init_delay = value;
|
sparams->ss_init_delay = value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_NB_TONE_THR:
|
case SPECTRAL_PARAM_NB_TONE_THR:
|
||||||
spectral->params.ss_nb_tone_thr = value;
|
sparams->ss_nb_tone_thr = value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_STR_BIN_THR:
|
case SPECTRAL_PARAM_STR_BIN_THR:
|
||||||
spectral->params.ss_str_bin_thr = value;
|
sparams->ss_str_bin_thr = value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_WB_RPT_MODE:
|
case SPECTRAL_PARAM_WB_RPT_MODE:
|
||||||
spectral->params.ss_wb_rpt_mode = !!value;
|
sparams->ss_wb_rpt_mode = !!value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_RSSI_RPT_MODE:
|
case SPECTRAL_PARAM_RSSI_RPT_MODE:
|
||||||
spectral->params.ss_rssi_rpt_mode = !!value;
|
sparams->ss_rssi_rpt_mode = !!value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_RSSI_THR:
|
case SPECTRAL_PARAM_RSSI_THR:
|
||||||
spectral->params.ss_rssi_thr = value;
|
sparams->ss_rssi_thr = value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_PWR_FORMAT:
|
case SPECTRAL_PARAM_PWR_FORMAT:
|
||||||
spectral->params.ss_pwr_format = !!value;
|
sparams->ss_pwr_format = !!value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_RPT_MODE:
|
case SPECTRAL_PARAM_RPT_MODE:
|
||||||
if ((value < SPECTRAL_PARAM_RPT_MODE_MIN) ||
|
if ((value < SPECTRAL_PARAM_RPT_MODE_MIN) ||
|
||||||
(value > SPECTRAL_PARAM_RPT_MODE_MAX))
|
(value > SPECTRAL_PARAM_RPT_MODE_MAX))
|
||||||
return -EINVAL;
|
return QDF_STATUS_E_FAILURE;
|
||||||
spectral->params.ss_rpt_mode = value;
|
sparams->ss_rpt_mode = value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_BIN_SCALE:
|
case SPECTRAL_PARAM_BIN_SCALE:
|
||||||
spectral->params.ss_bin_scale = value;
|
sparams->ss_bin_scale = value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_DBM_ADJ:
|
case SPECTRAL_PARAM_DBM_ADJ:
|
||||||
spectral->params.ss_dbm_adj = !!value;
|
sparams->ss_dbm_adj = !!value;
|
||||||
break;
|
break;
|
||||||
case SPECTRAL_PARAM_CHN_MASK:
|
case SPECTRAL_PARAM_CHN_MASK:
|
||||||
spectral->params.ss_chn_mask = value;
|
sparams->ss_chn_mask = value;
|
||||||
|
break;
|
||||||
|
case SPECTRAL_PARAM_FREQUENCY:
|
||||||
|
sparams->ss_frequency = value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
p_sops->configure_spectral(spectral, &spectral->params);
|
p_sops->configure_spectral(spectral, sparams, smode);
|
||||||
/* only to validate the writes */
|
/* only to validate the writes */
|
||||||
p_sops->get_spectral_config(spectral, ¶ms);
|
p_sops->get_spectral_config(spectral, ¶ms, smode);
|
||||||
return 0;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2255,14 +2326,16 @@ target_if_init_upper_lower_flags(struct target_if_spectral *spectral)
|
|||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
* @param: Pointer to spectral_config structure in which the configuration
|
* @param: Pointer to spectral_config structure in which the configuration
|
||||||
* should be returned
|
* should be returned
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* API to get the current spectral configuration
|
* API to get the current spectral configuration
|
||||||
*
|
*
|
||||||
* Return: None
|
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE on failure
|
||||||
*/
|
*/
|
||||||
void
|
QDF_STATUS
|
||||||
target_if_get_spectral_config(struct wlan_objmgr_pdev *pdev,
|
target_if_get_spectral_config(struct wlan_objmgr_pdev *pdev,
|
||||||
struct spectral_config *param)
|
struct spectral_config *param,
|
||||||
|
enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
struct target_if_spectral_ops *p_sops = NULL;
|
struct target_if_spectral_ops *p_sops = NULL;
|
||||||
struct target_if_spectral *spectral = NULL;
|
struct target_if_spectral *spectral = NULL;
|
||||||
@@ -2270,8 +2343,15 @@ target_if_get_spectral_config(struct wlan_objmgr_pdev *pdev,
|
|||||||
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
||||||
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
|
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
|
||||||
|
|
||||||
|
if (smode >= SPECTRAL_SCAN_MODE_MAX) {
|
||||||
|
spectral_err("Invalid Spectral mode %u", smode);
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
qdf_mem_zero(param, sizeof(struct spectral_config));
|
qdf_mem_zero(param, sizeof(struct spectral_config));
|
||||||
p_sops->get_spectral_config(spectral, param);
|
p_sops->get_spectral_config(spectral, param, smode);
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2279,6 +2359,8 @@ target_if_get_spectral_config(struct wlan_objmgr_pdev *pdev,
|
|||||||
* parameters
|
* parameters
|
||||||
* @spectral: Pointer to Spectral target_if internal private data
|
* @spectral: Pointer to Spectral target_if internal private data
|
||||||
* @spectral_params: Pointer to Spectral parameters
|
* @spectral_params: Pointer to Spectral parameters
|
||||||
|
* @smode: Spectral scan mode
|
||||||
|
* @err: Spectral error code
|
||||||
*
|
*
|
||||||
* Enable use of desired Spectral parameters by configuring them into HW, and
|
* Enable use of desired Spectral parameters by configuring them into HW, and
|
||||||
* starting Spectral scan
|
* starting Spectral scan
|
||||||
@@ -2287,7 +2369,9 @@ target_if_get_spectral_config(struct wlan_objmgr_pdev *pdev,
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
target_if_spectral_scan_enable_params(struct target_if_spectral *spectral,
|
target_if_spectral_scan_enable_params(struct target_if_spectral *spectral,
|
||||||
struct spectral_config *spectral_params)
|
struct spectral_config *spectral_params,
|
||||||
|
enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err)
|
||||||
{
|
{
|
||||||
int extension_channel = 0;
|
int extension_channel = 0;
|
||||||
int current_channel = 0;
|
int current_channel = 0;
|
||||||
@@ -2295,14 +2379,19 @@ target_if_spectral_scan_enable_params(struct target_if_spectral *spectral,
|
|||||||
struct wlan_objmgr_vdev *vdev = NULL;
|
struct wlan_objmgr_vdev *vdev = NULL;
|
||||||
|
|
||||||
if (!spectral) {
|
if (!spectral) {
|
||||||
spectral_err("SPECTRAL : Spectral is NULL");
|
spectral_err("Spectral LMAC object is NULL");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (smode >= SPECTRAL_SCAN_MODE_MAX) {
|
||||||
|
spectral_err("Invalid Spectral mode %u", smode);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
|
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
|
||||||
|
|
||||||
if (!p_sops) {
|
if (!p_sops) {
|
||||||
spectral_err("SPECTRAL : p_sops is NULL");
|
spectral_err("p_sops is NULL");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2328,12 +2417,12 @@ target_if_spectral_scan_enable_params(struct target_if_spectral *spectral,
|
|||||||
spectral->rb_edge_extrabins = 0;
|
spectral->rb_edge_extrabins = 0;
|
||||||
|
|
||||||
if (spectral->is_lb_edge_extrabins_format &&
|
if (spectral->is_lb_edge_extrabins_format &&
|
||||||
spectral->params.ss_rpt_mode == 2) {
|
spectral->params[smode].ss_rpt_mode == 2) {
|
||||||
spectral->lb_edge_extrabins = 4;
|
spectral->lb_edge_extrabins = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spectral->is_rb_edge_extrabins_format &&
|
if (spectral->is_rb_edge_extrabins_format &&
|
||||||
spectral->params.ss_rpt_mode == 2) {
|
spectral->params[smode].ss_rpt_mode == 2) {
|
||||||
spectral->rb_edge_extrabins = 4;
|
spectral->rb_edge_extrabins = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2342,13 +2431,13 @@ target_if_spectral_scan_enable_params(struct target_if_spectral *spectral,
|
|||||||
|
|
||||||
spectral->spectral_numbins =
|
spectral->spectral_numbins =
|
||||||
target_if_get_fft_bin_count(
|
target_if_get_fft_bin_count(
|
||||||
spectral->params.ss_fft_size);
|
spectral->params[smode].ss_fft_size);
|
||||||
spectral->spectral_fft_len =
|
spectral->spectral_fft_len =
|
||||||
target_if_get_fft_bin_count(
|
target_if_get_fft_bin_count(
|
||||||
spectral->params.ss_fft_size);
|
spectral->params[smode].ss_fft_size);
|
||||||
spectral->spectral_data_len =
|
spectral->spectral_data_len =
|
||||||
target_if_get_fft_bin_count(
|
target_if_get_fft_bin_count(
|
||||||
spectral->params.ss_fft_size);
|
spectral->params[smode].ss_fft_size);
|
||||||
/*
|
/*
|
||||||
* Initialize classifier params to be sent to user
|
* Initialize classifier params to be sent to user
|
||||||
* space classifier
|
* space classifier
|
||||||
@@ -2362,13 +2451,13 @@ target_if_spectral_scan_enable_params(struct target_if_spectral *spectral,
|
|||||||
spectral->sc_spectral_20_40_mode = 1;
|
spectral->sc_spectral_20_40_mode = 1;
|
||||||
spectral->spectral_numbins =
|
spectral->spectral_numbins =
|
||||||
target_if_get_fft_bin_count(
|
target_if_get_fft_bin_count(
|
||||||
spectral->params.ss_fft_size);
|
spectral->params[smode].ss_fft_size);
|
||||||
spectral->spectral_fft_len =
|
spectral->spectral_fft_len =
|
||||||
target_if_get_fft_bin_count(
|
target_if_get_fft_bin_count(
|
||||||
spectral->params.ss_fft_size);
|
spectral->params[smode].ss_fft_size);
|
||||||
spectral->spectral_data_len =
|
spectral->spectral_data_len =
|
||||||
target_if_get_fft_bin_count(
|
target_if_get_fft_bin_count(
|
||||||
spectral->params.ss_fft_size);
|
spectral->params[smode].ss_fft_size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize classifier params to be sent to user
|
* Initialize classifier params to be sent to user
|
||||||
@@ -2392,13 +2481,13 @@ target_if_spectral_scan_enable_params(struct target_if_spectral *spectral,
|
|||||||
spectral->sc_spectral_20_40_mode = 0;
|
spectral->sc_spectral_20_40_mode = 0;
|
||||||
spectral->spectral_numbins =
|
spectral->spectral_numbins =
|
||||||
target_if_get_fft_bin_count(
|
target_if_get_fft_bin_count(
|
||||||
spectral->params.ss_fft_size);
|
spectral->params[smode].ss_fft_size);
|
||||||
spectral->spectral_fft_len =
|
spectral->spectral_fft_len =
|
||||||
target_if_get_fft_bin_count(
|
target_if_get_fft_bin_count(
|
||||||
spectral->params.ss_fft_size);
|
spectral->params[smode].ss_fft_size);
|
||||||
spectral->spectral_data_len =
|
spectral->spectral_data_len =
|
||||||
target_if_get_fft_bin_count(
|
target_if_get_fft_bin_count(
|
||||||
spectral->params.ss_fft_size);
|
spectral->params[smode].ss_fft_size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize classifier params to be sent to user
|
* Initialize classifier params to be sent to user
|
||||||
@@ -2433,13 +2522,13 @@ target_if_spectral_scan_enable_params(struct target_if_spectral *spectral,
|
|||||||
spectral->sc_spectral_20_40_mode = 0;
|
spectral->sc_spectral_20_40_mode = 0;
|
||||||
spectral->spectral_numbins =
|
spectral->spectral_numbins =
|
||||||
target_if_get_fft_bin_count(
|
target_if_get_fft_bin_count(
|
||||||
spectral->params.ss_fft_size);
|
spectral->params[smode].ss_fft_size);
|
||||||
spectral->spectral_fft_len =
|
spectral->spectral_fft_len =
|
||||||
target_if_get_fft_bin_count(
|
target_if_get_fft_bin_count(
|
||||||
spectral->params.ss_fft_size);
|
spectral->params[smode].ss_fft_size);
|
||||||
spectral->spectral_data_len =
|
spectral->spectral_data_len =
|
||||||
target_if_get_fft_bin_count(
|
target_if_get_fft_bin_count(
|
||||||
spectral->params.ss_fft_size);
|
spectral->params[smode].ss_fft_size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize classifier params to be sent to user
|
* Initialize classifier params to be sent to user
|
||||||
@@ -2558,73 +2647,82 @@ target_if_spectral_scan_enable_params(struct target_if_spectral *spectral,
|
|||||||
spectral->classify_scan = 0;
|
spectral->classify_scan = 0;
|
||||||
spectral->num_spectral_data = 0;
|
spectral->num_spectral_data = 0;
|
||||||
|
|
||||||
if (!p_sops->is_spectral_active(spectral)) {
|
if (!p_sops->is_spectral_active(spectral, smode)) {
|
||||||
p_sops->configure_spectral(spectral, spectral_params);
|
p_sops->configure_spectral(spectral, spectral_params, smode);
|
||||||
p_sops->start_spectral_scan(spectral);
|
p_sops->start_spectral_scan(spectral, smode, err);
|
||||||
spectral->timestamp_war_offset = 0;
|
spectral->timestamp_war_offset = 0;
|
||||||
spectral->last_fft_timestamp = 0;
|
spectral->last_fft_timestamp = 0;
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get current spectral configuration */
|
/* get current spectral configuration */
|
||||||
p_sops->get_spectral_config(spectral, &spectral->params);
|
p_sops->get_spectral_config(spectral, &spectral->params[smode], smode);
|
||||||
|
|
||||||
target_if_init_upper_lower_flags(spectral);
|
target_if_init_upper_lower_flags(spectral);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
QDF_STATUS
|
||||||
* target_if_start_spectral_scan() - Start spectral scan
|
target_if_start_spectral_scan(struct wlan_objmgr_pdev *pdev,
|
||||||
* @pdev: Pointer to pdev object
|
const enum spectral_scan_mode smode,
|
||||||
*
|
enum spectral_cp_error_code *err)
|
||||||
* API to start spectral scan
|
|
||||||
*
|
|
||||||
* Return: 0 in case of success, -1 on failure
|
|
||||||
*/
|
|
||||||
int
|
|
||||||
target_if_start_spectral_scan(struct wlan_objmgr_pdev *pdev)
|
|
||||||
{
|
{
|
||||||
struct target_if_spectral_ops *p_sops = NULL;
|
struct target_if_spectral_ops *p_sops = NULL;
|
||||||
struct target_if_spectral *spectral = NULL;
|
struct target_if_spectral *spectral = NULL;
|
||||||
|
|
||||||
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
||||||
if (!spectral) {
|
if (!spectral) {
|
||||||
spectral_err("SPECTRAL : Spectral LMAC object is NUll");
|
spectral_err("Spectral LMAC object is NUll");
|
||||||
return -EPERM;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (smode >= SPECTRAL_SCAN_MODE_MAX) {
|
||||||
|
spectral_err("Invalid Spectral mode %u", smode);
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
|
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
|
||||||
|
|
||||||
if (!spectral->params_valid) {
|
if (!spectral->params_valid[smode]) {
|
||||||
target_if_spectral_info_read(spectral,
|
target_if_spectral_info_read(spectral,
|
||||||
|
smode,
|
||||||
TARGET_IF_SPECTRAL_INFO_PARAMS,
|
TARGET_IF_SPECTRAL_INFO_PARAMS,
|
||||||
&spectral->params,
|
&spectral->params[smode],
|
||||||
sizeof(spectral->params));
|
sizeof(spectral->params[smode]));
|
||||||
spectral->params_valid = true;
|
spectral->params_valid[smode] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
qdf_spin_lock(&spectral->spectral_lock);
|
qdf_spin_lock(&spectral->spectral_lock);
|
||||||
target_if_spectral_scan_enable_params(spectral, &spectral->params);
|
target_if_spectral_scan_enable_params(spectral,
|
||||||
|
&spectral->params[smode], smode,
|
||||||
|
err);
|
||||||
qdf_spin_unlock(&spectral->spectral_lock);
|
qdf_spin_unlock(&spectral->spectral_lock);
|
||||||
|
|
||||||
return 0;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
QDF_STATUS
|
||||||
target_if_stop_spectral_scan(struct wlan_objmgr_pdev *pdev)
|
target_if_stop_spectral_scan(struct wlan_objmgr_pdev *pdev,
|
||||||
|
const enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
struct target_if_spectral_ops *p_sops = NULL;
|
struct target_if_spectral_ops *p_sops = NULL;
|
||||||
struct target_if_spectral *spectral = NULL;
|
struct target_if_spectral *spectral = NULL;
|
||||||
|
|
||||||
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
||||||
if (!spectral) {
|
if (!spectral) {
|
||||||
spectral_err("SPECTRAL : Spectral LMAC object is NUll ");
|
spectral_err("Spectral LMAC object is NUll ");
|
||||||
return;
|
return QDF_STATUS_E_FAILURE;
|
||||||
}
|
}
|
||||||
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
|
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
|
||||||
|
|
||||||
|
if (smode >= SPECTRAL_SCAN_MODE_MAX) {
|
||||||
|
spectral_err("Invalid Spectral mode %u", smode);
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
qdf_spin_lock(&spectral->spectral_lock);
|
qdf_spin_lock(&spectral->spectral_lock);
|
||||||
p_sops->stop_spectral_scan(spectral);
|
p_sops->stop_spectral_scan(spectral, smode);
|
||||||
if (spectral->classify_scan) {
|
if (spectral->classify_scan) {
|
||||||
/* TODO : Check if this logic is necessary */
|
/* TODO : Check if this logic is necessary */
|
||||||
spectral->detects_control_channel = 0;
|
spectral->detects_control_channel = 0;
|
||||||
@@ -2638,44 +2736,62 @@ target_if_stop_spectral_scan(struct wlan_objmgr_pdev *pdev)
|
|||||||
spectral->sc_spectral_scan = 0;
|
spectral->sc_spectral_scan = 0;
|
||||||
|
|
||||||
qdf_spin_unlock(&spectral->spectral_lock);
|
qdf_spin_unlock(&spectral->spectral_lock);
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_is_spectral_active() - Get whether Spectral is active
|
* target_if_is_spectral_active() - Get whether Spectral is active
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* API to get whether Spectral is active
|
* API to get whether Spectral is active
|
||||||
*
|
*
|
||||||
* Return: True if Spectral is active, false if Spectral is not active
|
* Return: True if Spectral is active, false if Spectral is not active
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
target_if_is_spectral_active(struct wlan_objmgr_pdev *pdev)
|
target_if_is_spectral_active(struct wlan_objmgr_pdev *pdev,
|
||||||
|
const enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
struct target_if_spectral *spectral = NULL;
|
struct target_if_spectral *spectral = NULL;
|
||||||
struct target_if_spectral_ops *p_sops = NULL;
|
struct target_if_spectral_ops *p_sops = NULL;
|
||||||
|
|
||||||
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
||||||
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
|
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
|
||||||
return p_sops->is_spectral_active(spectral);
|
|
||||||
|
if (smode >= SPECTRAL_SCAN_MODE_MAX) {
|
||||||
|
spectral_err("Invalid Spectral mode %u", smode);
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return p_sops->is_spectral_active(spectral, smode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_is_spectral_enabled() - Get whether Spectral is enabled
|
* target_if_is_spectral_enabled() - Get whether Spectral is enabled
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* API to get whether Spectral is enabled
|
* API to get whether Spectral is enabled
|
||||||
*
|
*
|
||||||
* Return: True if Spectral is enabled, false if Spectral is not enabled
|
* Return: True if Spectral is enabled, false if Spectral is not enabled
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
target_if_is_spectral_enabled(struct wlan_objmgr_pdev *pdev)
|
target_if_is_spectral_enabled(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode)
|
||||||
{
|
{
|
||||||
struct target_if_spectral *spectral = NULL;
|
struct target_if_spectral *spectral = NULL;
|
||||||
struct target_if_spectral_ops *p_sops = NULL;
|
struct target_if_spectral_ops *p_sops = NULL;
|
||||||
|
|
||||||
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
||||||
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
|
p_sops = GET_TARGET_IF_SPECTRAL_OPS(spectral);
|
||||||
return p_sops->is_spectral_enabled(spectral);
|
|
||||||
|
if (smode >= SPECTRAL_SCAN_MODE_MAX) {
|
||||||
|
spectral_err("Invalid Spectral mode %u", smode);
|
||||||
|
return QDF_STATUS_E_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return p_sops->is_spectral_enabled(spectral, smode);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2685,13 +2801,14 @@ target_if_is_spectral_enabled(struct wlan_objmgr_pdev *pdev)
|
|||||||
*
|
*
|
||||||
* API to set the debug level for Spectral
|
* API to set the debug level for Spectral
|
||||||
*
|
*
|
||||||
* Return: 0 in case of success
|
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE on failure
|
||||||
*/
|
*/
|
||||||
int
|
QDF_STATUS
|
||||||
target_if_set_debug_level(struct wlan_objmgr_pdev *pdev, uint32_t debug_level)
|
target_if_set_debug_level(struct wlan_objmgr_pdev *pdev, uint32_t debug_level)
|
||||||
{
|
{
|
||||||
spectral_debug_level = (DEBUG_SPECTRAL << debug_level);
|
spectral_debug_level = (DEBUG_SPECTRAL << debug_level);
|
||||||
return 0;
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -2711,39 +2828,45 @@ target_if_get_debug_level(struct wlan_objmgr_pdev *pdev)
|
|||||||
/**
|
/**
|
||||||
* target_if_get_spectral_capinfo() - Get Spectral capability information
|
* target_if_get_spectral_capinfo() - Get Spectral capability information
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
* @outdata: Buffer into which data should be copied
|
* @scaps: Buffer into which data should be copied
|
||||||
*
|
*
|
||||||
* API to get the spectral capability information
|
* API to get the spectral capability information
|
||||||
*
|
*
|
||||||
* Return: void
|
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE on failure
|
||||||
*/
|
*/
|
||||||
void
|
QDF_STATUS
|
||||||
target_if_get_spectral_capinfo(struct wlan_objmgr_pdev *pdev, void *outdata)
|
target_if_get_spectral_capinfo(struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct spectral_caps *scaps)
|
||||||
{
|
{
|
||||||
struct target_if_spectral *spectral = NULL;
|
struct target_if_spectral *spectral = NULL;
|
||||||
|
|
||||||
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
||||||
qdf_mem_copy(outdata, &spectral->capability,
|
qdf_mem_copy(scaps, &spectral->capability,
|
||||||
sizeof(struct spectral_caps));
|
sizeof(struct spectral_caps));
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_get_spectral_diagstats() - Get Spectral diagnostic statistics
|
* target_if_get_spectral_diagstats() - Get Spectral diagnostic statistics
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
* @outdata: Buffer into which data should be copied
|
* @stats: Buffer into which data should be copied
|
||||||
*
|
*
|
||||||
* API to get the spectral diagnostic statistics
|
* API to get the spectral diagnostic statistics
|
||||||
*
|
*
|
||||||
* Return: void
|
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_FAILURE on failure
|
||||||
*/
|
*/
|
||||||
void
|
QDF_STATUS
|
||||||
target_if_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev, void *outdata)
|
target_if_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct spectral_diag_stats *stats)
|
||||||
{
|
{
|
||||||
struct target_if_spectral *spectral = NULL;
|
struct target_if_spectral *spectral = NULL;
|
||||||
|
|
||||||
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
||||||
qdf_mem_copy(outdata, &spectral->diag_stats,
|
qdf_mem_copy(stats, &spectral->diag_stats,
|
||||||
sizeof(struct spectral_diag_stats));
|
sizeof(struct spectral_diag_stats));
|
||||||
|
|
||||||
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -523,19 +523,26 @@ struct target_if_spectral_ops {
|
|||||||
void *arg, enum spectral_capability_type type);
|
void *arg, enum spectral_capability_type type);
|
||||||
uint32_t (*set_rxfilter)(void *arg, int rxfilter);
|
uint32_t (*set_rxfilter)(void *arg, int rxfilter);
|
||||||
uint32_t (*get_rxfilter)(void *arg);
|
uint32_t (*get_rxfilter)(void *arg);
|
||||||
uint32_t (*is_spectral_active)(void *arg);
|
uint32_t (*is_spectral_active)(void *arg,
|
||||||
uint32_t (*is_spectral_enabled)(void *arg);
|
enum spectral_scan_mode smode);
|
||||||
uint32_t (*start_spectral_scan)(void *arg);
|
uint32_t (*is_spectral_enabled)(void *arg,
|
||||||
uint32_t (*stop_spectral_scan)(void *arg);
|
enum spectral_scan_mode smode);
|
||||||
|
uint32_t (*start_spectral_scan)(void *arg,
|
||||||
|
enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err);
|
||||||
|
uint32_t (*stop_spectral_scan)(void *arg,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
uint32_t (*get_extension_channel)(void *arg);
|
uint32_t (*get_extension_channel)(void *arg);
|
||||||
int8_t (*get_ctl_noisefloor)(void *arg);
|
int8_t (*get_ctl_noisefloor)(void *arg);
|
||||||
int8_t (*get_ext_noisefloor)(void *arg);
|
int8_t (*get_ext_noisefloor)(void *arg);
|
||||||
uint32_t (*configure_spectral)(
|
uint32_t (*configure_spectral)(
|
||||||
void *arg,
|
void *arg,
|
||||||
struct spectral_config *params);
|
struct spectral_config *params,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
uint32_t (*get_spectral_config)(
|
uint32_t (*get_spectral_config)(
|
||||||
void *arg,
|
void *arg,
|
||||||
struct spectral_config *params);
|
struct spectral_config *params,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
uint32_t (*get_ent_spectral_mask)(void *arg);
|
uint32_t (*get_ent_spectral_mask)(void *arg);
|
||||||
uint32_t (*get_mac_address)(void *arg, char *addr);
|
uint32_t (*get_mac_address)(void *arg, char *addr);
|
||||||
uint32_t (*get_current_channel)(void *arg);
|
uint32_t (*get_current_channel)(void *arg);
|
||||||
@@ -849,8 +856,8 @@ struct target_if_spectral {
|
|||||||
int spectral_sent_msg;
|
int spectral_sent_msg;
|
||||||
int classify_scan;
|
int classify_scan;
|
||||||
qdf_timer_t classify_timer;
|
qdf_timer_t classify_timer;
|
||||||
struct spectral_config params;
|
struct spectral_config params[SPECTRAL_SCAN_MODE_MAX];
|
||||||
bool params_valid;
|
bool params_valid[SPECTRAL_SCAN_MODE_MAX];
|
||||||
struct spectral_classifier_params classifier_params;
|
struct spectral_classifier_params classifier_params;
|
||||||
int last_capture_time;
|
int last_capture_time;
|
||||||
int num_spectral_data;
|
int num_spectral_data;
|
||||||
@@ -877,7 +884,8 @@ struct target_if_spectral {
|
|||||||
*noise_pwr_chain_ext[HOST_MAX_ANTENNA];
|
*noise_pwr_chain_ext[HOST_MAX_ANTENNA];
|
||||||
uint64_t tsf64;
|
uint64_t tsf64;
|
||||||
#if ATH_PERF_PWR_OFFLOAD
|
#if ATH_PERF_PWR_OFFLOAD
|
||||||
struct target_if_spectral_param_state_info param_info;
|
struct target_if_spectral_param_state_info
|
||||||
|
param_info[SPECTRAL_SCAN_MODE_MAX];
|
||||||
#endif
|
#endif
|
||||||
uint32_t ch_width;
|
uint32_t ch_width;
|
||||||
struct spectral_diag_stats diag_stats;
|
struct spectral_diag_stats diag_stats;
|
||||||
@@ -1091,12 +1099,14 @@ void target_if_spectral_send_intf_found_msg(
|
|||||||
/**
|
/**
|
||||||
* target_if_stop_spectral_scan() - Stop spectral scan
|
* target_if_stop_spectral_scan() - Stop spectral scan
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* API to stop the current on-going spectral scan
|
* API to stop the current on-going spectral scan
|
||||||
*
|
*
|
||||||
* Return: None
|
* Return: QDF_STATUS_SUCCESS in case of success, else QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
void target_if_stop_spectral_scan(struct wlan_objmgr_pdev *pdev);
|
QDF_STATUS target_if_stop_spectral_scan(struct wlan_objmgr_pdev *pdev,
|
||||||
|
const enum spectral_scan_mode smode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_spectral_get_vdev() - Get pointer to vdev to be used for Spectral
|
* target_if_spectral_get_vdev() - Get pointer to vdev to be used for Spectral
|
||||||
@@ -1170,6 +1180,7 @@ int target_if_spectral_dump_phyerr_data_gen2(
|
|||||||
/**
|
/**
|
||||||
* target_if_dump_fft_report_gen3() - Dump FFT Report for gen3
|
* target_if_dump_fft_report_gen3() - Dump FFT Report for gen3
|
||||||
* @spectral: Pointer to Spectral object
|
* @spectral: Pointer to Spectral object
|
||||||
|
* @smode: Spectral scan mode
|
||||||
* @p_fft_report: Pointer to fft report
|
* @p_fft_report: Pointer to fft report
|
||||||
* @p_sfft: Pointer to search fft report
|
* @p_sfft: Pointer to search fft report
|
||||||
*
|
*
|
||||||
@@ -1178,8 +1189,9 @@ int target_if_spectral_dump_phyerr_data_gen2(
|
|||||||
* Return: Success/Failure
|
* Return: Success/Failure
|
||||||
*/
|
*/
|
||||||
int target_if_dump_fft_report_gen3(struct target_if_spectral *spectral,
|
int target_if_dump_fft_report_gen3(struct target_if_spectral *spectral,
|
||||||
struct spectral_phyerr_fft_report_gen3 *p_fft_report,
|
enum spectral_scan_mode smode,
|
||||||
struct spectral_search_fft_info_gen3 *p_sfft);
|
struct spectral_phyerr_fft_report_gen3 *p_fft_report,
|
||||||
|
struct spectral_search_fft_info_gen3 *p_sfft);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_dbg_print_samp_msg() - Print contents of SAMP Message
|
* target_if_dbg_print_samp_msg() - Print contents of SAMP Message
|
||||||
@@ -1314,6 +1326,7 @@ void target_if_spectral_set_rxchainmask(struct wlan_objmgr_pdev *pdev,
|
|||||||
{
|
{
|
||||||
struct wlan_objmgr_psoc *psoc = NULL;
|
struct wlan_objmgr_psoc *psoc = NULL;
|
||||||
struct target_if_spectral *spectral = NULL;
|
struct target_if_spectral *spectral = NULL;
|
||||||
|
enum spectral_scan_mode smode = SPECTRAL_SCAN_MODE_NORMAL;
|
||||||
|
|
||||||
psoc = wlan_pdev_get_psoc(pdev);
|
psoc = wlan_pdev_get_psoc(pdev);
|
||||||
if (!psoc) {
|
if (!psoc) {
|
||||||
@@ -1321,6 +1334,11 @@ void target_if_spectral_set_rxchainmask(struct wlan_objmgr_pdev *pdev,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (smode >= SPECTRAL_SCAN_MODE_MAX) {
|
||||||
|
spectral_err("Invalid Spectral mode %u", smode);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (psoc->soc_cb.rx_ops.sptrl_rx_ops.
|
if (psoc->soc_cb.rx_ops.sptrl_rx_ops.
|
||||||
sptrlro_spectral_is_feature_disabled(psoc)) {
|
sptrlro_spectral_is_feature_disabled(psoc)) {
|
||||||
spectral_info("Spectral is disabled");
|
spectral_info("Spectral is disabled");
|
||||||
@@ -1328,7 +1346,9 @@ void target_if_spectral_set_rxchainmask(struct wlan_objmgr_pdev *pdev,
|
|||||||
}
|
}
|
||||||
|
|
||||||
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
spectral = get_target_if_spectral_handle_from_pdev(pdev);
|
||||||
spectral->params.ss_chn_mask = spectral_rx_chainmask;
|
/* set chainmask for all the modes */
|
||||||
|
for (; smode < SPECTRAL_SCAN_MODE_MAX; smode++)
|
||||||
|
spectral->params[smode].ss_chn_mask = spectral_rx_chainmask;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1520,42 +1540,52 @@ target_if_160mhz_delivery_state_change(struct target_if_spectral *spectral,
|
|||||||
/**
|
/**
|
||||||
* target_if_sops_is_spectral_enabled() - Get whether Spectral is enabled
|
* target_if_sops_is_spectral_enabled() - Get whether Spectral is enabled
|
||||||
* @arg: Pointer to handle for Spectral target_if internal private data
|
* @arg: Pointer to handle for Spectral target_if internal private data
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Function to check whether Spectral is enabled
|
* Function to check whether Spectral is enabled
|
||||||
*
|
*
|
||||||
* Return: True if Spectral is enabled, false if Spectral is not enabled
|
* Return: True if Spectral is enabled, false if Spectral is not enabled
|
||||||
*/
|
*/
|
||||||
uint32_t target_if_sops_is_spectral_enabled(void *arg);
|
uint32_t target_if_sops_is_spectral_enabled(void *arg,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_sops_is_spectral_active() - Get whether Spectral is active
|
* target_if_sops_is_spectral_active() - Get whether Spectral is active
|
||||||
* @arg: Pointer to handle for Spectral target_if internal private data
|
* @arg: Pointer to handle for Spectral target_if internal private data
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Function to check whether Spectral is active
|
* Function to check whether Spectral is active
|
||||||
*
|
*
|
||||||
* Return: True if Spectral is active, false if Spectral is not active
|
* Return: True if Spectral is active, false if Spectral is not active
|
||||||
*/
|
*/
|
||||||
uint32_t target_if_sops_is_spectral_active(void *arg);
|
uint32_t target_if_sops_is_spectral_active(void *arg,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_sops_start_spectral_scan() - Start Spectral scan
|
* target_if_sops_start_spectral_scan() - Start Spectral scan
|
||||||
* @arg: Pointer to handle for Spectral target_if internal private data
|
* @arg: Pointer to handle for Spectral target_if internal private data
|
||||||
|
* @smode: Spectral scan mode
|
||||||
|
* @err: Pointer to error code
|
||||||
*
|
*
|
||||||
* Function to start spectral scan
|
* Function to start spectral scan
|
||||||
*
|
*
|
||||||
* Return: 0 on success else failure
|
* Return: 0 on success else failure
|
||||||
*/
|
*/
|
||||||
uint32_t target_if_sops_start_spectral_scan(void *arg);
|
uint32_t target_if_sops_start_spectral_scan(void *arg,
|
||||||
|
enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_sops_stop_spectral_scan() - Stop Spectral scan
|
* target_if_sops_stop_spectral_scan() - Stop Spectral scan
|
||||||
* @arg: Pointer to handle for Spectral target_if internal private data
|
* @arg: Pointer to handle for Spectral target_if internal private data
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Function to stop spectral scan
|
* Function to stop spectral scan
|
||||||
*
|
*
|
||||||
* Return: 0 in case of success, -1 on failure
|
* Return: 0 in case of success, -1 on failure
|
||||||
*/
|
*/
|
||||||
uint32_t target_if_sops_stop_spectral_scan(void *arg);
|
uint32_t target_if_sops_stop_spectral_scan(void *arg,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_spectral_get_extension_channel() - Get the current Extension
|
* target_if_spectral_get_extension_channel() - Get the current Extension
|
||||||
@@ -1652,11 +1682,13 @@ uint32_t target_if_spectral_set_rxfilter(void *arg, int rxfilter);
|
|||||||
* parameters
|
* parameters
|
||||||
* @arg: Pointer to handle for Spectral target_if internal private data
|
* @arg: Pointer to handle for Spectral target_if internal private data
|
||||||
* @params: Spectral parameters
|
* @params: Spectral parameters
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Return: 0 in case of success, -1 on failure
|
* Return: 0 in case of success, -1 on failure
|
||||||
*/
|
*/
|
||||||
uint32_t target_if_spectral_sops_configure_params(
|
uint32_t target_if_spectral_sops_configure_params(
|
||||||
void *arg, struct spectral_config *params);
|
void *arg, struct spectral_config *params,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_spectral_get_rxfilter() - Get the current RX Filter settings
|
* target_if_spectral_get_rxfilter() - Get the current RX Filter settings
|
||||||
@@ -1683,14 +1715,18 @@ void target_if_pdev_spectral_deinit(struct wlan_objmgr_pdev *pdev);
|
|||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
* @threshtype: config type
|
* @threshtype: config type
|
||||||
* @value: config value
|
* @value: config value
|
||||||
|
* @smode: Spectral scan mode
|
||||||
|
* @err: Pointer to Spectral error code
|
||||||
*
|
*
|
||||||
* API to set spectral configurations
|
* API to set spectral configurations
|
||||||
*
|
*
|
||||||
* Return: 0 in case of success, -1 on failure
|
* Return: QDF_STATUS_SUCCESS in case of success, else QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
int target_if_set_spectral_config(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS target_if_set_spectral_config(struct wlan_objmgr_pdev *pdev,
|
||||||
const uint32_t threshtype,
|
const uint32_t threshtype,
|
||||||
const uint32_t value);
|
const uint32_t value,
|
||||||
|
const enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_pdev_spectral_init() - Initialize target_if Spectral
|
* target_if_pdev_spectral_init() - Initialize target_if Spectral
|
||||||
@@ -1707,11 +1743,13 @@ void *target_if_pdev_spectral_init(struct wlan_objmgr_pdev *pdev);
|
|||||||
* parameters
|
* parameters
|
||||||
* @arg: Pointer to handle for Spectral target_if internal private data
|
* @arg: Pointer to handle for Spectral target_if internal private data
|
||||||
* @params: Pointer to buffer into which Spectral parameters should be copied
|
* @params: Pointer to buffer into which Spectral parameters should be copied
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Return: 0 in case of success, -1 on failure
|
* Return: 0 in case of success, -1 on failure
|
||||||
*/
|
*/
|
||||||
uint32_t target_if_spectral_sops_get_params(
|
uint32_t target_if_spectral_sops_get_params(
|
||||||
void *arg, struct spectral_config *params);
|
void *arg, struct spectral_config *params,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_init_spectral_capability() - Initialize Spectral capability
|
* target_if_init_spectral_capability() - Initialize Spectral capability
|
||||||
@@ -1727,31 +1765,39 @@ target_if_init_spectral_capability(struct target_if_spectral *spectral);
|
|||||||
/**
|
/**
|
||||||
* target_if_start_spectral_scan() - Start spectral scan
|
* target_if_start_spectral_scan() - Start spectral scan
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
|
* @smode: Spectral scan mode
|
||||||
|
* @err: Spectral error code
|
||||||
*
|
*
|
||||||
* API to start spectral scan
|
* API to start spectral scan
|
||||||
*
|
*
|
||||||
* Return: 0 in case of success, -1 on failure
|
* Return: QDF_STATUS_SUCCESS in case of success, else QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
int target_if_start_spectral_scan(struct wlan_objmgr_pdev *pdev);
|
QDF_STATUS target_if_start_spectral_scan(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_get_spectral_config() - Get spectral configuration
|
* target_if_get_spectral_config() - Get spectral configuration
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
* @param: Pointer to spectral_config structure in which the configuration
|
* @param: Pointer to spectral_config structure in which the configuration
|
||||||
* should be returned
|
* should be returned
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* API to get the current spectral configuration
|
* API to get the current spectral configuration
|
||||||
*
|
*
|
||||||
* Return: 0 in case of success, -1 on failure
|
* Return: QDF_STATUS_SUCCESS in case of success, else QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
void target_if_get_spectral_config(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS target_if_get_spectral_config(struct wlan_objmgr_pdev *pdev,
|
||||||
struct spectral_config *param);
|
struct spectral_config *param,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_spectral_scan_enable_params() - Enable use of desired Spectral
|
* target_if_spectral_scan_enable_params() - Enable use of desired Spectral
|
||||||
* parameters
|
* parameters
|
||||||
* @spectral: Pointer to Spectral target_if internal private data
|
* @spectral: Pointer to Spectral target_if internal private data
|
||||||
* @spectral_params: Pointer to Spectral parameters
|
* @spectral_params: Pointer to Spectral parameters
|
||||||
|
* @smode: Spectral scan mode
|
||||||
|
* @err: Spectral error code
|
||||||
*
|
*
|
||||||
* Enable use of desired Spectral parameters by configuring them into HW, and
|
* Enable use of desired Spectral parameters by configuring them into HW, and
|
||||||
* starting Spectral scan
|
* starting Spectral scan
|
||||||
@@ -1759,32 +1805,40 @@ void target_if_get_spectral_config(struct wlan_objmgr_pdev *pdev,
|
|||||||
* Return: 0 on success, 1 on failure
|
* Return: 0 on success, 1 on failure
|
||||||
*/
|
*/
|
||||||
int target_if_spectral_scan_enable_params(
|
int target_if_spectral_scan_enable_params(
|
||||||
struct target_if_spectral *spectral, struct spectral_config *spectral_params);
|
struct target_if_spectral *spectral,
|
||||||
|
struct spectral_config *spectral_params,
|
||||||
|
enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_is_spectral_active() - Get whether Spectral is active
|
* target_if_is_spectral_active() - Get whether Spectral is active
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Return: True if Spectral is active, false if Spectral is not active
|
* Return: True if Spectral is active, false if Spectral is not active
|
||||||
*/
|
*/
|
||||||
bool target_if_is_spectral_active(struct wlan_objmgr_pdev *pdev);
|
bool target_if_is_spectral_active(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_is_spectral_enabled() - Get whether Spectral is enabled
|
* target_if_is_spectral_enabled() - Get whether Spectral is enabled
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
|
* @smode: Spectral scan mode
|
||||||
*
|
*
|
||||||
* Return: True if Spectral is enabled, false if Spectral is not enabled
|
* Return: True if Spectral is enabled, false if Spectral is not enabled
|
||||||
*/
|
*/
|
||||||
bool target_if_is_spectral_enabled(struct wlan_objmgr_pdev *pdev);
|
bool target_if_is_spectral_enabled(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_set_debug_level() - Set debug level for Spectral
|
* target_if_set_debug_level() - Set debug level for Spectral
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
* @debug_level: Debug level
|
* @debug_level: Debug level
|
||||||
*
|
*
|
||||||
* Return: 0 in case of success
|
* Return: QDF_STATUS_SUCCESS in case of success, else QDF_STATUS_E_FAILURE
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
int target_if_set_debug_level(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS target_if_set_debug_level(struct wlan_objmgr_pdev *pdev,
|
||||||
uint32_t debug_level);
|
uint32_t debug_level);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1799,24 +1853,23 @@ uint32_t target_if_get_debug_level(struct wlan_objmgr_pdev *pdev);
|
|||||||
/**
|
/**
|
||||||
* target_if_get_spectral_capinfo() - Get Spectral capability information
|
* target_if_get_spectral_capinfo() - Get Spectral capability information
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
* @outdata: Buffer into which data should be copied
|
* @scaps: Buffer into which data should be copied
|
||||||
*
|
*
|
||||||
* Return: void
|
* Return: QDF_STATUS_SUCCESS in case of success, else QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
void target_if_get_spectral_capinfo(
|
QDF_STATUS target_if_get_spectral_capinfo(struct wlan_objmgr_pdev *pdev,
|
||||||
struct wlan_objmgr_pdev *pdev,
|
struct spectral_caps *scaps);
|
||||||
void *outdata);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* target_if_get_spectral_diagstats() - Get Spectral diagnostic statistics
|
* target_if_get_spectral_diagstats() - Get Spectral diagnostic statistics
|
||||||
* @pdev: Pointer to pdev object
|
* @pdev: Pointer to pdev object
|
||||||
* @outdata: Buffer into which data should be copied
|
* @stats: Buffer into which data should be copied
|
||||||
*
|
*
|
||||||
* Return: void
|
* Return: QDF_STATUS_SUCCESS in case of success, else QDF_STATUS_E_FAILURE
|
||||||
*/
|
*/
|
||||||
void target_if_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS target_if_get_spectral_diagstats(struct wlan_objmgr_pdev *pdev,
|
||||||
void *outdata);
|
struct spectral_diag_stats *stats);
|
||||||
|
|
||||||
void target_if_register_wmi_spectral_cmd_ops(
|
void target_if_register_wmi_spectral_cmd_ops(
|
||||||
struct wlan_objmgr_pdev *pdev,
|
struct wlan_objmgr_pdev *pdev,
|
||||||
|
@@ -854,13 +854,13 @@ target_if_process_phyerr_gen2(struct target_if_spectral *spectral,
|
|||||||
* This is marked for future enhancements.
|
* This is marked for future enhancements.
|
||||||
*/
|
*/
|
||||||
chn_idx_highest_enabled =
|
chn_idx_highest_enabled =
|
||||||
((spectral->params.ss_chn_mask & 0x8) ? 3 :
|
((spectral->params[params.smode].ss_chn_mask & 0x8) ? 3 :
|
||||||
(spectral->params.ss_chn_mask & 0x4) ? 2 :
|
(spectral->params[params.smode].ss_chn_mask & 0x4) ? 2 :
|
||||||
(spectral->params.ss_chn_mask & 0x2) ? 1 : 0);
|
(spectral->params[params.smode].ss_chn_mask & 0x2) ? 1 : 0);
|
||||||
chn_idx_lowest_enabled =
|
chn_idx_lowest_enabled =
|
||||||
((spectral->params.ss_chn_mask & 0x1) ? 0 :
|
((spectral->params[params.smode].ss_chn_mask & 0x1) ? 0 :
|
||||||
(spectral->params.ss_chn_mask & 0x2) ? 1 :
|
(spectral->params[params.smode].ss_chn_mask & 0x2) ? 1 :
|
||||||
(spectral->params.ss_chn_mask & 0x4) ? 2 : 3);
|
(spectral->params[params.smode].ss_chn_mask & 0x4) ? 2 : 3);
|
||||||
control_rssi = (uint8_t)
|
control_rssi = (uint8_t)
|
||||||
p_rfqual->pc_rssi_info[chn_idx_highest_enabled].rssi_pri20;
|
p_rfqual->pc_rssi_info[chn_idx_highest_enabled].rssi_pri20;
|
||||||
extension_rssi = (uint8_t)
|
extension_rssi = (uint8_t)
|
||||||
@@ -1176,6 +1176,7 @@ target_if_process_sfft_report_gen3(
|
|||||||
|
|
||||||
int
|
int
|
||||||
target_if_dump_fft_report_gen3(struct target_if_spectral *spectral,
|
target_if_dump_fft_report_gen3(struct target_if_spectral *spectral,
|
||||||
|
enum spectral_scan_mode smode,
|
||||||
struct spectral_phyerr_fft_report_gen3 *p_fft_report,
|
struct spectral_phyerr_fft_report_gen3 *p_fft_report,
|
||||||
struct spectral_search_fft_info_gen3 *p_sfft)
|
struct spectral_search_fft_info_gen3 *p_sfft)
|
||||||
{
|
{
|
||||||
@@ -1188,7 +1189,7 @@ target_if_dump_fft_report_gen3(struct target_if_spectral *spectral,
|
|||||||
int fft_bin_len_adj = 0;
|
int fft_bin_len_adj = 0;
|
||||||
int fft_bin_len_inband_tfer = 0;
|
int fft_bin_len_inband_tfer = 0;
|
||||||
|
|
||||||
if ((spectral->params.ss_rpt_mode == 1) &&
|
if ((spectral->params[smode].ss_rpt_mode == 1) &&
|
||||||
spectral->null_fftbin_adj) {
|
spectral->null_fftbin_adj) {
|
||||||
/* fft_bin_len_adj is intentionally left at 0. */
|
/* fft_bin_len_adj is intentionally left at 0. */
|
||||||
fft_bin_len_to_dump = 0;
|
fft_bin_len_to_dump = 0;
|
||||||
@@ -1210,7 +1211,7 @@ target_if_dump_fft_report_gen3(struct target_if_spectral *spectral,
|
|||||||
} else
|
} else
|
||||||
fft_bin_len_adj = fft_bin_len;
|
fft_bin_len_adj = fft_bin_len;
|
||||||
|
|
||||||
if ((spectral->params.ss_rpt_mode == 2) &&
|
if ((spectral->params[smode].ss_rpt_mode == 2) &&
|
||||||
spectral->inband_fftbin_size_adj) {
|
spectral->inband_fftbin_size_adj) {
|
||||||
fft_bin_len_adj >>= 1;
|
fft_bin_len_adj >>= 1;
|
||||||
fft_bin_len_inband_tfer = fft_bin_len >> 1;
|
fft_bin_len_inband_tfer = fft_bin_len >> 1;
|
||||||
@@ -1233,10 +1234,10 @@ target_if_dump_fft_report_gen3(struct target_if_spectral *spectral,
|
|||||||
fft_bin_len,
|
fft_bin_len,
|
||||||
fft_bin_len);
|
fft_bin_len);
|
||||||
|
|
||||||
if ((spectral->params.ss_rpt_mode == 1) &&
|
if ((spectral->params[smode].ss_rpt_mode == 1) &&
|
||||||
spectral->null_fftbin_adj)
|
spectral->null_fftbin_adj)
|
||||||
spectral_debug("WAR: Considering number of FFT bins as 0");
|
spectral_debug("WAR: Considering number of FFT bins as 0");
|
||||||
else if ((spectral->params.ss_rpt_mode == 2) &&
|
else if ((spectral->params[smode].ss_rpt_mode == 2) &&
|
||||||
spectral->inband_fftbin_size_adj) {
|
spectral->inband_fftbin_size_adj) {
|
||||||
spectral_debug("FW fftbins actually transferred (in-band report mode) "
|
spectral_debug("FW fftbins actually transferred (in-band report mode) "
|
||||||
"%d(0x%x)",
|
"%d(0x%x)",
|
||||||
@@ -1544,7 +1545,32 @@ target_if_consume_spectral_report_gen3(
|
|||||||
|
|
||||||
report_len = (fft_hdr_length + 8);
|
report_len = (fft_hdr_length + 8);
|
||||||
|
|
||||||
if ((spectral->params.ss_rpt_mode == 1) &&
|
target_if_process_sfft_report_gen3(p_fft_report, p_sfft);
|
||||||
|
/* It is expected to have same detector id for
|
||||||
|
* summary and fft report
|
||||||
|
*/
|
||||||
|
if (detector_id != p_sfft->fft_detector_id) {
|
||||||
|
spectral_err_rl
|
||||||
|
("Different detid in ssummary(%u) and sfft(%u)",
|
||||||
|
detector_id, p_sfft->fft_detector_id);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (detector_id > SPECTRAL_DETECTOR_AGILE) {
|
||||||
|
spectral->diag_stats.spectral_invalid_detector_id++;
|
||||||
|
spectral_err("Invalid detector id %u, expected is 0/2",
|
||||||
|
detector_id);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = target_if_get_spectral_mode(detector_id, ¶ms.smode);
|
||||||
|
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||||
|
spectral_err_rl("Failed to get mode from detid= %u",
|
||||||
|
detector_id);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((spectral->params[params.smode].ss_rpt_mode == 1) &&
|
||||||
spectral->null_fftbin_adj) {
|
spectral->null_fftbin_adj) {
|
||||||
/*
|
/*
|
||||||
* No FFT bins are expected. Explicitly set FFT bin
|
* No FFT bins are expected. Explicitly set FFT bin
|
||||||
@@ -1569,31 +1595,12 @@ target_if_consume_spectral_report_gen3(
|
|||||||
*/
|
*/
|
||||||
fft_bin_len >>= 2;
|
fft_bin_len >>= 2;
|
||||||
}
|
}
|
||||||
if ((spectral->params.ss_rpt_mode == 2) &&
|
if ((spectral->params[params.smode].ss_rpt_mode == 2) &&
|
||||||
spectral->inband_fftbin_size_adj) {
|
spectral->inband_fftbin_size_adj) {
|
||||||
fft_bin_len >>= 1;
|
fft_bin_len >>= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
target_if_process_sfft_report_gen3(p_fft_report, p_sfft);
|
|
||||||
/* It is expected to have same detector id for
|
|
||||||
* summary and fft report
|
|
||||||
*/
|
|
||||||
if (detector_id != p_sfft->fft_detector_id) {
|
|
||||||
spectral_err_rl
|
|
||||||
("Different detid in ssummary(%u) and sfft(%u)",
|
|
||||||
detector_id, p_sfft->fft_detector_id);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
detector_id = p_sfft->fft_detector_id;
|
|
||||||
ret = target_if_get_spectral_mode(detector_id, ¶ms.smode);
|
|
||||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
|
||||||
spectral_err_rl("Failed to get mode from detid= %u",
|
|
||||||
detector_id);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (report->reset_delay) {
|
if (report->reset_delay) {
|
||||||
spectral->timestamp_war_offset += (report->reset_delay +
|
spectral->timestamp_war_offset += (report->reset_delay +
|
||||||
spectral->last_fft_timestamp);
|
spectral->last_fft_timestamp);
|
||||||
@@ -1602,13 +1609,6 @@ target_if_consume_spectral_report_gen3(
|
|||||||
spectral->last_fft_timestamp = p_sfft->timestamp;
|
spectral->last_fft_timestamp = p_sfft->timestamp;
|
||||||
tsf64 += spectral->timestamp_war_offset;
|
tsf64 += spectral->timestamp_war_offset;
|
||||||
|
|
||||||
if (detector_id > SPECTRAL_DETECTOR_AGILE) {
|
|
||||||
spectral->diag_stats.spectral_invalid_detector_id++;
|
|
||||||
spectral_err("Invalid detector id %u, expected is 0/2",
|
|
||||||
detector_id);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Take care of state transitions for 160 MHz and 80p80 */
|
/* Take care of state transitions for 160 MHz and 80p80 */
|
||||||
if (spectral->ch_width == CH_WIDTH_160MHZ) {
|
if (spectral->ch_width == CH_WIDTH_160MHZ) {
|
||||||
ret = target_if_160mhz_delivery_state_change(
|
ret = target_if_160mhz_delivery_state_change(
|
||||||
@@ -1619,7 +1619,7 @@ target_if_consume_spectral_report_gen3(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (spectral_debug_level & (DEBUG_SPECTRAL2 | DEBUG_SPECTRAL4))
|
if (spectral_debug_level & (DEBUG_SPECTRAL2 | DEBUG_SPECTRAL4))
|
||||||
target_if_dump_fft_report_gen3(spectral,
|
target_if_dump_fft_report_gen3(spectral, params.smode,
|
||||||
p_fft_report, p_sfft);
|
p_fft_report, p_sfft);
|
||||||
|
|
||||||
params.rssi = rssi;
|
params.rssi = rssi;
|
||||||
@@ -1686,7 +1686,32 @@ target_if_consume_spectral_report_gen3(
|
|||||||
|
|
||||||
report_len = (fft_hdr_length + 8);
|
report_len = (fft_hdr_length + 8);
|
||||||
|
|
||||||
if ((spectral->params.ss_rpt_mode == 1) &&
|
target_if_process_sfft_report_gen3(p_fft_report, p_sfft);
|
||||||
|
/* It is expected to have same detector id for
|
||||||
|
* summary and fft report
|
||||||
|
*/
|
||||||
|
if (detector_id != p_sfft->fft_detector_id) {
|
||||||
|
spectral_err_rl
|
||||||
|
("Different detid in ssummary(%u) and sfft(%u)",
|
||||||
|
detector_id, p_sfft->fft_detector_id);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (detector_id > SPECTRAL_DETECTOR_AGILE) {
|
||||||
|
spectral->diag_stats.spectral_invalid_detector_id++;
|
||||||
|
spectral_err("Invalid detector id %u, expected is 1",
|
||||||
|
detector_id);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = target_if_get_spectral_mode(detector_id, ¶ms.smode);
|
||||||
|
if (QDF_IS_STATUS_ERROR(ret)) {
|
||||||
|
spectral_err("Failed to get mode from detid= %u",
|
||||||
|
detector_id);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((spectral->params[params.smode].ss_rpt_mode == 1) &&
|
||||||
spectral->null_fftbin_adj) {
|
spectral->null_fftbin_adj) {
|
||||||
/*
|
/*
|
||||||
* No FFT bins are expected. Explicitly set FFT bin
|
* No FFT bins are expected. Explicitly set FFT bin
|
||||||
@@ -1712,37 +1737,12 @@ target_if_consume_spectral_report_gen3(
|
|||||||
fft_bin_len >>= 2;
|
fft_bin_len >>= 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((spectral->params.ss_rpt_mode == 2) &&
|
if ((spectral->params[params.smode].ss_rpt_mode == 2) &&
|
||||||
spectral->inband_fftbin_size_adj) {
|
spectral->inband_fftbin_size_adj) {
|
||||||
fft_bin_len >>= 1;
|
fft_bin_len >>= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
target_if_process_sfft_report_gen3(p_fft_report, p_sfft);
|
|
||||||
if (detector_id > SPECTRAL_DETECTOR_AGILE) {
|
|
||||||
spectral->diag_stats.spectral_invalid_detector_id++;
|
|
||||||
spectral_err("Invalid detector id %u, expected is 1",
|
|
||||||
detector_id);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* It is expected to have same detector id for
|
|
||||||
* summary and fft report
|
|
||||||
*/
|
|
||||||
if (detector_id != p_sfft->fft_detector_id) {
|
|
||||||
spectral_err_rl
|
|
||||||
("Different detid in ssummary(%u) and sfft(%u)",
|
|
||||||
detector_id, p_sfft->fft_detector_id);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
detector_id = p_sfft->fft_detector_id;
|
|
||||||
ret = target_if_get_spectral_mode(detector_id, ¶ms.smode);
|
|
||||||
if (QDF_IS_STATUS_ERROR(ret)) {
|
|
||||||
spectral_err("Failed to get mode from detid= %u",
|
|
||||||
detector_id);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Take care of state transitions for 160 MHz and 80p80 */
|
/* Take care of state transitions for 160 MHz and 80p80 */
|
||||||
if (spectral->ch_width == CH_WIDTH_160MHZ) {
|
if (spectral->ch_width == CH_WIDTH_160MHZ) {
|
||||||
ret = target_if_160mhz_delivery_state_change(
|
ret = target_if_160mhz_delivery_state_change(
|
||||||
@@ -1752,9 +1752,9 @@ target_if_consume_spectral_report_gen3(
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (spectral_debug_level &
|
if (spectral_debug_level & (DEBUG_SPECTRAL2 | DEBUG_SPECTRAL4))
|
||||||
(DEBUG_SPECTRAL2 | DEBUG_SPECTRAL4))
|
target_if_dump_fft_report_gen3(spectral, params.smode,
|
||||||
target_if_dump_fft_report_gen3(spectral, p_fft_report, p_sfft);
|
p_fft_report, p_sfft);
|
||||||
|
|
||||||
params.vhtop_ch_freq_seg1 = 0;
|
params.vhtop_ch_freq_seg1 = 0;
|
||||||
params.vhtop_ch_freq_seg2 = 0;
|
params.vhtop_ch_freq_seg2 = 0;
|
||||||
|
@@ -519,23 +519,36 @@ struct wmi_spectral_cmd_ops;
|
|||||||
struct wlan_lmac_if_sptrl_tx_ops {
|
struct wlan_lmac_if_sptrl_tx_ops {
|
||||||
void *(*sptrlto_pdev_spectral_init)(struct wlan_objmgr_pdev *pdev);
|
void *(*sptrlto_pdev_spectral_init)(struct wlan_objmgr_pdev *pdev);
|
||||||
void (*sptrlto_pdev_spectral_deinit)(struct wlan_objmgr_pdev *pdev);
|
void (*sptrlto_pdev_spectral_deinit)(struct wlan_objmgr_pdev *pdev);
|
||||||
int (*sptrlto_set_spectral_config)(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS (*sptrlto_set_spectral_config)
|
||||||
const u_int32_t threshtype,
|
(struct wlan_objmgr_pdev *pdev,
|
||||||
const u_int32_t value);
|
const u_int32_t threshtype,
|
||||||
void (*sptrlto_get_spectral_config)(struct wlan_objmgr_pdev *pdev,
|
const u_int32_t value,
|
||||||
struct spectral_config *sptrl_config
|
const enum spectral_scan_mode smode,
|
||||||
);
|
enum spectral_cp_error_code *err);
|
||||||
int (*sptrlto_start_spectral_scan)(struct wlan_objmgr_pdev *pdev);
|
QDF_STATUS (*sptrlto_get_spectral_config)
|
||||||
void (*sptrlto_stop_spectral_scan)(struct wlan_objmgr_pdev *pdev);
|
(struct wlan_objmgr_pdev *pdev,
|
||||||
bool (*sptrlto_is_spectral_active)(struct wlan_objmgr_pdev *pdev);
|
struct spectral_config *sptrl_config,
|
||||||
bool (*sptrlto_is_spectral_enabled)(struct wlan_objmgr_pdev *pdev);
|
enum spectral_scan_mode smode);
|
||||||
int (*sptrlto_set_debug_level)(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS (*sptrlto_start_spectral_scan)
|
||||||
u_int32_t debug_level);
|
(struct wlan_objmgr_pdev *pdev,
|
||||||
|
const enum spectral_scan_mode smode,
|
||||||
|
enum spectral_cp_error_code *err);
|
||||||
|
QDF_STATUS (*sptrlto_stop_spectral_scan)
|
||||||
|
(struct wlan_objmgr_pdev *pdev,
|
||||||
|
const enum spectral_scan_mode smode);
|
||||||
|
bool (*sptrlto_is_spectral_active)(struct wlan_objmgr_pdev *pdev,
|
||||||
|
const enum spectral_scan_mode smode);
|
||||||
|
bool (*sptrlto_is_spectral_enabled)(struct wlan_objmgr_pdev *pdev,
|
||||||
|
enum spectral_scan_mode smode);
|
||||||
|
QDF_STATUS (*sptrlto_set_debug_level)(struct wlan_objmgr_pdev *pdev,
|
||||||
|
u_int32_t debug_level);
|
||||||
u_int32_t (*sptrlto_get_debug_level)(struct wlan_objmgr_pdev *pdev);
|
u_int32_t (*sptrlto_get_debug_level)(struct wlan_objmgr_pdev *pdev);
|
||||||
void (*sptrlto_get_spectral_capinfo)(struct wlan_objmgr_pdev *pdev,
|
QDF_STATUS (*sptrlto_get_spectral_capinfo)
|
||||||
void *outdata);
|
(struct wlan_objmgr_pdev *pdev,
|
||||||
void (*sptrlto_get_spectral_diagstats)(struct wlan_objmgr_pdev *pdev,
|
struct spectral_caps *scaps);
|
||||||
void *outdata);
|
QDF_STATUS (*sptrlto_get_spectral_diagstats)
|
||||||
|
(struct wlan_objmgr_pdev *pdev,
|
||||||
|
struct spectral_diag_stats *stats);
|
||||||
void (*sptrlto_register_wmi_spectral_cmd_ops)(
|
void (*sptrlto_register_wmi_spectral_cmd_ops)(
|
||||||
struct wlan_objmgr_pdev *pdev,
|
struct wlan_objmgr_pdev *pdev,
|
||||||
struct wmi_spectral_cmd_ops *cmd_ops);
|
struct wmi_spectral_cmd_ops *cmd_ops);
|
||||||
|
Reference in New Issue
Block a user