qcacmn: Add Spectral detector count in capability info

Populate number of Spectral detectors per BW in the
Spectral capability vendor command response.

CRs-Fixed: 2659587
Change-Id: I2eba5df02a5f70556d65e689aece1f0fbd8bba93
This commit is contained in:
Edayilliam Jayadev
2020-04-08 12:58:55 +05:30
committed by nshrivas
parent 6fe8fb5880
commit f76792f311
4 changed files with 59 additions and 11 deletions

View File

@@ -775,6 +775,37 @@ int wlan_cfg80211_spectral_scan_get_cap(struct wiphy *wiphy,
if (ret) if (ret)
goto fail; goto fail;
} }
if (nla_put_u32(
skb,
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_NUM_DETECTORS_20_MHZ,
scaps->num_detectors_20mhz))
goto fail;
if (nla_put_u32(
skb,
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_NUM_DETECTORS_40_MHZ,
scaps->num_detectors_40mhz))
goto fail;
if (nla_put_u32(
skb,
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_NUM_DETECTORS_80_MHZ,
scaps->num_detectors_80mhz))
goto fail;
if (nla_put_u32(
skb,
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_NUM_DETECTORS_160_MHZ,
scaps->num_detectors_160mhz))
goto fail;
if (nla_put_u32(
skb,
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_NUM_DETECTORS_80P80_MHZ,
scaps->num_detectors_80p80mhz))
goto fail;
wlan_cfg80211_qal_devcfg_send_response((qdf_nbuf_t)skb); wlan_cfg80211_qal_devcfg_send_response((qdf_nbuf_t)skb);
return 0; return 0;

View File

@@ -284,6 +284,11 @@ struct spectral_config {
* @agile_spectral_cap: agile Spectral capability for 20/40/80 * @agile_spectral_cap: agile Spectral capability for 20/40/80
* @agile_spectral_cap_160: agile Spectral capability for 160 MHz * @agile_spectral_cap_160: agile Spectral capability for 160 MHz
* @agile_spectral_cap_80p80: agile Spectral capability for 80p80 * @agile_spectral_cap_80p80: agile Spectral capability for 80p80
* @num_detectors_20mhz: number of Spectral detectors in 20 MHz
* @num_detectors_40mhz: number of Spectral detectors in 40 MHz
* @num_detectors_80mhz: number of Spectral detectors in 80 MHz
* @num_detectors_160mhz: number of Spectral detectors in 160 MHz
* @num_detectors_80p80mhz: number of Spectral detectors in 80p80 MHz
*/ */
struct spectral_caps { struct spectral_caps {
uint8_t phydiag_cap; uint8_t phydiag_cap;
@@ -300,6 +305,11 @@ struct spectral_caps {
bool agile_spectral_cap; bool agile_spectral_cap;
bool agile_spectral_cap_160; bool agile_spectral_cap_160;
bool agile_spectral_cap_80p80; bool agile_spectral_cap_80p80;
uint32_t num_detectors_20mhz;
uint32_t num_detectors_40mhz;
uint32_t num_detectors_80mhz;
uint32_t num_detectors_160mhz;
uint32_t num_detectors_80p80mhz;
}; };
#define SPECTRAL_IOCTL_PARAM_NOVAL (65535) #define SPECTRAL_IOCTL_PARAM_NOVAL (65535)

View File

@@ -1444,16 +1444,9 @@ target_if_init_spectral_param_properties(struct target_if_spectral *spectral)
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
/**
* target_if_init_spectral_capability() - Initialize Spectral capability
* @spectral: Pointer to Spectral target_if internal private data
*
* This is a workaround.
*
* Return: QDF_STATUS
*/
QDF_STATUS QDF_STATUS
target_if_init_spectral_capability(struct target_if_spectral *spectral) target_if_init_spectral_capability(struct target_if_spectral *spectral,
uint32_t target_type)
{ {
struct wlan_objmgr_psoc *psoc; struct wlan_objmgr_psoc *psoc;
struct wlan_objmgr_pdev *pdev; struct wlan_objmgr_pdev *pdev;
@@ -1541,6 +1534,17 @@ target_if_init_spectral_capability(struct target_if_spectral *spectral)
} }
} }
pcap->num_detectors_20mhz = 1;
pcap->num_detectors_40mhz = 1;
pcap->num_detectors_80mhz = 1;
if (target_type == TARGET_TYPE_QCN9000) {
pcap->num_detectors_160mhz = 1;
pcap->num_detectors_80p80mhz = 1;
} else {
pcap->num_detectors_160mhz = 2;
pcap->num_detectors_80p80mhz = 2;
}
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
@@ -2326,7 +2330,7 @@ target_if_pdev_spectral_init(struct wlan_objmgr_pdev *pdev)
target_if_init_spectral_param_properties(spectral); target_if_init_spectral_param_properties(spectral);
/* Init spectral capability */ /* Init spectral capability */
if (target_if_init_spectral_capability(spectral) != if (target_if_init_spectral_capability(spectral, target_type) !=
QDF_STATUS_SUCCESS) { QDF_STATUS_SUCCESS) {
qdf_mem_free(spectral); qdf_mem_free(spectral);
return NULL; return NULL;

View File

@@ -2014,14 +2014,17 @@ uint32_t target_if_spectral_sops_get_params(
/** /**
* target_if_init_spectral_capability() - Initialize Spectral capability * target_if_init_spectral_capability() - Initialize Spectral capability
*
* @spectral: Pointer to Spectral target_if internal private data * @spectral: Pointer to Spectral target_if internal private data
* @target_type: target type
* *
* This is a workaround. * This is a workaround.
* *
* Return: QDF_STATUS * Return: QDF_STATUS
*/ */
QDF_STATUS QDF_STATUS
target_if_init_spectral_capability(struct target_if_spectral *spectral); target_if_init_spectral_capability(struct target_if_spectral *spectral,
uint32_t target_type);
/** /**
* target_if_start_spectral_scan() - Start spectral scan * target_if_start_spectral_scan() - Start spectral scan