diff --git a/os_if/linux/spectral/src/wlan_cfg80211_spectral.c b/os_if/linux/spectral/src/wlan_cfg80211_spectral.c index 1e41fd81b5..87dd32d886 100644 --- a/os_if/linux/spectral/src/wlan_cfg80211_spectral.c +++ b/os_if/linux/spectral/src/wlan_cfg80211_spectral.c @@ -775,6 +775,37 @@ int wlan_cfg80211_spectral_scan_get_cap(struct wiphy *wiphy, if (ret) 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); return 0; diff --git a/spectral/dispatcher/inc/spectral_ioctl.h b/spectral/dispatcher/inc/spectral_ioctl.h index 7ed01ae046..4616cf1fa6 100644 --- a/spectral/dispatcher/inc/spectral_ioctl.h +++ b/spectral/dispatcher/inc/spectral_ioctl.h @@ -284,6 +284,11 @@ 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 + * @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 { uint8_t phydiag_cap; @@ -300,6 +305,11 @@ struct spectral_caps { bool agile_spectral_cap; bool agile_spectral_cap_160; 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) diff --git a/target_if/spectral/target_if_spectral.c b/target_if/spectral/target_if_spectral.c index e6ccaeb670..b3345bda84 100644 --- a/target_if/spectral/target_if_spectral.c +++ b/target_if/spectral/target_if_spectral.c @@ -1444,16 +1444,9 @@ target_if_init_spectral_param_properties(struct target_if_spectral *spectral) 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 -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_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; } @@ -2326,7 +2330,7 @@ target_if_pdev_spectral_init(struct wlan_objmgr_pdev *pdev) target_if_init_spectral_param_properties(spectral); /* Init spectral capability */ - if (target_if_init_spectral_capability(spectral) != + if (target_if_init_spectral_capability(spectral, target_type) != QDF_STATUS_SUCCESS) { qdf_mem_free(spectral); return NULL; diff --git a/target_if/spectral/target_if_spectral.h b/target_if/spectral/target_if_spectral.h index a6312d359f..56eaa409b7 100644 --- a/target_if/spectral/target_if_spectral.h +++ b/target_if/spectral/target_if_spectral.h @@ -2014,14 +2014,17 @@ uint32_t target_if_spectral_sops_get_params( /** * target_if_init_spectral_capability() - Initialize Spectral capability + * * @spectral: Pointer to Spectral target_if internal private data + * @target_type: target type * * This is a workaround. * * Return: 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