qcacmn: Populate and expose 320MHz spectral capabilities

Populate and expose the following 320MHz spectral capabilities.
  - Agile spectral scan support for 320MHz mode.
  - Number of detectors used for spectral scan in 320MHz mode.

Change-Id: Ibea77d4ec8b1d9322ef82d1d48236836ffad24ec
CRs-Fixed: 3053059
Tento commit je obsažen v:
Shiva Krishna Pittala
2021-10-08 18:35:15 +05:30
odevzdal Madan Koyyalamudi
rodič 4c00b017c8
revize de13832745
6 změnil soubory, kde provedl 89 přidání a 4 odebrání

Zobrazit soubor

@@ -938,6 +938,16 @@ int wlan_cfg80211_spectral_scan_get_cap(struct wiphy *wiphy,
if (ret)
goto fail;
}
if (scaps->agile_spectral_cap_320) {
int ret;
ret = nla_put_flag
(skb,
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_AGILE_SPECTRAL_320);
if (ret)
goto fail;
}
if (nla_put_u32(
skb,
@@ -969,6 +979,12 @@ int wlan_cfg80211_spectral_scan_get_cap(struct wiphy *wiphy,
scaps->num_detectors_80p80mhz))
goto fail;
if (nla_put_u32(
skb,
QCA_WLAN_VENDOR_ATTR_SPECTRAL_SCAN_CAP_NUM_DETECTORS_320_MHZ,
scaps->num_detectors_320mhz))
goto fail;
wlan_cfg80211_qal_devcfg_send_response((qdf_nbuf_t)skb);
return 0;

Zobrazit soubor

@@ -354,7 +354,7 @@ struct spectral_config {
* @agile_spectral_cap: agile Spectral capability for 20/40/80
* @agile_spectral_cap_160: agile Spectral capability for 160 MHz
* @agile_spectral_cap_80p80: agile Spectral capability for 80p80
* @agile_spectral_cap_320: agile Spectral capability for 320
* @agile_spectral_cap_320: agile Spectral capability for 320 MHz
* @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

Zobrazit soubor

@@ -45,7 +45,9 @@ bool wlan_spectral_is_mode_disabled_pdev(struct wlan_objmgr_pdev *pdev,
wlan_pdev_nif_feat_ext_cap_get(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_160_DIS) &&
wlan_pdev_nif_feat_ext_cap_get(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_80P80_DIS);
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_80P80_DIS) &&
wlan_pdev_nif_feat_ext_cap_get(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_320_DIS);
break;
default:

Zobrazit soubor

@@ -228,6 +228,8 @@ target_if_spectral_get_agile_mode_cap(
agile_cap->agile_spectral_cap = false;
agile_cap->agile_spectral_cap_160 = false;
agile_cap->agile_spectral_cap_80p80 = false;
agile_cap->agile_spectral_cap_320 = false;
return QDF_STATUS_SUCCESS;
}
@@ -259,6 +261,7 @@ target_if_spectral_get_agile_mode_cap(
table->cap_list[i].supports_aSpectral;
agile_cap->agile_spectral_cap_160 |=
table->cap_list[i].supports_aSpectral_160;
agile_cap->agile_spectral_cap_320 |= 0;
}
agile_cap->agile_spectral_cap_80p80 = agile_cap->agile_spectral_cap_160;
@@ -327,6 +330,8 @@ target_if_spectral_init_pdev_feature_cap_per_mode(struct wlan_objmgr_pdev *pdev,
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_160_DIS);
wlan_pdev_nif_feat_ext_cap_set(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_80P80_DIS);
wlan_pdev_nif_feat_ext_cap_set(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_320_DIS);
return QDF_STATUS_SUCCESS;
}
@@ -358,6 +363,13 @@ target_if_spectral_init_pdev_feature_cap_per_mode(struct wlan_objmgr_pdev *pdev,
wlan_pdev_nif_feat_ext_cap_clear(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_80P80_DIS);
if (!agile_cap.agile_spectral_cap_320)
wlan_pdev_nif_feat_ext_cap_set(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_320_DIS);
else
wlan_pdev_nif_feat_ext_cap_clear(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_320_DIS);
break;
default:
@@ -2428,6 +2440,8 @@ target_if_init_spectral_capability(struct target_if_spectral *spectral,
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_160_DIS);
pcap->agile_spectral_cap_80p80 = !wlan_pdev_nif_feat_ext_cap_get(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_80P80_DIS);
pcap->agile_spectral_cap_320 = !wlan_pdev_nif_feat_ext_cap_get(
pdev, WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_320_DIS);
if (scaling_params) {
for (param_idx = 0; param_idx < num_bin_scaling_params;
@@ -2457,9 +2471,15 @@ target_if_init_spectral_capability(struct target_if_spectral *spectral,
target_type == TARGET_TYPE_QCA6490) {
pcap->num_detectors_160mhz = 1;
pcap->num_detectors_80p80mhz = 1;
pcap->num_detectors_320mhz = 0;
} else if (is_spectral_arch_beryllium(target_type)) {
pcap->num_detectors_160mhz = 1;
pcap->num_detectors_80p80mhz = 0;
pcap->num_detectors_320mhz = 1;
} else {
pcap->num_detectors_160mhz = 2;
pcap->num_detectors_80p80mhz = 2;
pcap->num_detectors_320mhz = 0;
}
status = target_if_populate_supported_sscan_bws(spectral, target_type);
@@ -4813,6 +4833,49 @@ target_if_get_spectral_config(struct wlan_objmgr_pdev *pdev,
return QDF_STATUS_SUCCESS;
}
#ifdef WLAN_FEATURE_11BE
/**
* target_if_spectral_get_num_detectors_for_higher_bws() - Get number of
* Spectral detectors for higher bandwidths
* @spectral: Pointer to target if Spectral object
* @ch_width: channel width
* @num_detectors: Pointer to the variable to store number of Spectral detectors
*
* API to get number of Spectral detectors used for scan in the given channel
* width.
*
* Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_INVAL on failure
*/
static QDF_STATUS
target_if_spectral_get_num_detectors_for_higher_bws(
struct target_if_spectral *spectral,
enum phy_ch_width ch_width,
uint32_t *num_detectors)
{
switch (ch_width) {
case CH_WIDTH_320MHZ:
*num_detectors = spectral->capability.num_detectors_320mhz;
break;
default:
spectral_err("Unsupported channel width %d", ch_width);
return QDF_STATUS_E_INVAL;
}
return QDF_STATUS_SUCCESS;
}
#else
static QDF_STATUS
target_if_spectral_get_num_detectors_for_higher_bws(
struct target_if_spectral *spectral,
enum phy_ch_width ch_width,
uint32_t *num_detectors)
{
spectral_err("Unsupported channel width %d", ch_width);
return QDF_STATUS_E_INVAL;
}
#endif
/**
* target_if_spectral_get_num_detectors() - Get number of Spectral detectors
* @spectral: Pointer to target if Spectral object
@@ -4866,8 +4929,8 @@ target_if_spectral_get_num_detectors(struct target_if_spectral *spectral,
break;
default:
spectral_err("Unsupported channel width %d", ch_width);
return QDF_STATUS_E_INVAL;
return target_if_spectral_get_num_detectors_for_higher_bws(
spectral, ch_width, num_detectors);
}
return QDF_STATUS_SUCCESS;

Zobrazit soubor

@@ -1563,11 +1563,13 @@ struct target_if_samp_msg_params {
* @agile_spectral_cap: agile Spectral scan capability for 20/40/80 MHz
* @agile_spectral_cap_160: agile Spectral scan capability for 160 MHz
* @agile_spectral_cap_80p80: agile Spectral scan capability for 80+80 MHz
* @agile_spectral_cap_320: agile Spectral scan capability for 320 MHz
*/
struct target_if_spectral_agile_mode_cap {
bool agile_spectral_cap;
bool agile_spectral_cap_160;
bool agile_spectral_cap_80p80;
bool agile_spectral_cap_320;
};
#ifdef WLAN_CONV_SPECTRAL_ENABLE

Zobrazit soubor

@@ -107,6 +107,8 @@
#define WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_160_DIS 0x00000040
/* agile Spectral scan support disable for 80+80 MHz */
#define WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_80P80_DIS 0x00000080
/* agile Spectral scan support disable for 320 MHz */
#define WLAN_PDEV_FEXT_AGILE_SPECTRAL_SCAN_320_DIS 0x00000100
/* PDEV op flags */
/* Enable htrate for wep and tkip */