diff --git a/target_if/cfr/src/target_if_cfr.c b/target_if/cfr/src/target_if_cfr.c index 99464a59e5..7c13d29b9e 100644 --- a/target_if/cfr/src/target_if_cfr.c +++ b/target_if/cfr/src/target_if_cfr.c @@ -315,6 +315,11 @@ static QDF_STATUS target_if_cfr_init_target(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } + cfr_psoc->is_cfr_pdev_id_soc = + wmi_service_enabled(wmi_handle, + wmi_service_cfr_capture_pdev_id_soc); + cfr_debug("is_cfr_pdev_id_soc %d", cfr_psoc->is_cfr_pdev_id_soc); + status = cfr_enh_init_pdev(psoc, pdev); if (target == TARGET_TYPE_QCA6490) cfr_pdev->chip_type = CFR_CAPTURE_RADIO_HSP; @@ -482,7 +487,7 @@ target_if_cfr_deinit_pdev(struct wlan_objmgr_psoc *psoc, #endif #ifdef WLAN_ENH_CFR_ENABLE -#if defined(QCA_WIFI_QCA6490) +#if defined(QCA_WIFI_QCA6490) || defined(QCA_WIFI_KIWI) static uint8_t target_if_cfr_get_mac_id(struct wlan_objmgr_pdev *pdev) { struct wlan_objmgr_vdev *vdev; @@ -532,12 +537,7 @@ static uint8_t target_if_cfr_get_mac_id(struct wlan_objmgr_pdev *pdev) return mac_id; } -static uint8_t target_if_cfr_get_pdev_id(struct wlan_objmgr_pdev *pdev) -{ - return target_if_cfr_get_mac_id(pdev); -} -#elif defined(QCA_WIFI_KIWI) -static uint8_t target_if_cfr_get_pdev_id(struct wlan_objmgr_pdev *pdev) +static uint8_t target_if_cfr_get_pdev_id_soc(struct wlan_objmgr_pdev *pdev) { /* Host and FW have agreement about using fixed pdev id for * CFR on HMT, FW will get correct mac id if host pass soc @@ -547,6 +547,42 @@ static uint8_t target_if_cfr_get_pdev_id(struct wlan_objmgr_pdev *pdev) */ return WMI_HOST_PDEV_ID_SOC; } + +static uint8_t target_if_cfr_get_pdev_id(struct wlan_objmgr_pdev *pdev) +{ + struct wlan_objmgr_psoc *psoc; + struct psoc_cfr *cfr_psoc; + uint8_t pdev_id = 0; + + if (!pdev) { + cfr_err("null pdev"); + return pdev_id; + } + + psoc = wlan_pdev_get_psoc(pdev); + if (!psoc) { + cfr_err("null psoc"); + return pdev_id; + } + + cfr_psoc = wlan_objmgr_psoc_get_comp_private_obj(psoc, + WLAN_UMAC_COMP_CFR); + + if (!cfr_psoc) { + cfr_err("null psoc cfr"); + return pdev_id; + } + + if (cfr_psoc->is_cfr_pdev_id_soc) + pdev_id = target_if_cfr_get_pdev_id_soc(pdev); + else + pdev_id = target_if_cfr_get_mac_id(pdev); + + cfr_debug("is_cfr_pdev_id_soc %d, pdev_id %d", + cfr_psoc->is_cfr_pdev_id_soc, pdev_id); + + return pdev_id; +} #else static uint8_t target_if_cfr_get_pdev_id(struct wlan_objmgr_pdev *pdev) { diff --git a/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h b/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h index 717208a779..81a98b6a35 100644 --- a/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h +++ b/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h @@ -263,6 +263,7 @@ struct cfr_capture_params { * struct psoc_cfr - private psoc object for cfr * @psoc_obj: pointer to psoc object * @is_cfr_capable: flag to determine if cfr is enabled or not + * @is_cfr_pdev_id_soc: flag to send cfr request with PDEV_ID_SOC * @is_cap_interval_mode_sel_support: flag to determine if target supports both * capture_count and capture_duration modes * with a nob provided to configure @@ -272,6 +273,7 @@ struct cfr_capture_params { struct psoc_cfr { struct wlan_objmgr_psoc *psoc_obj; uint8_t is_cfr_capable; + uint8_t is_cfr_pdev_id_soc; #ifdef WLAN_ENH_CFR_ENABLE uint8_t is_cap_interval_mode_sel_support; uint8_t is_mo_marking_support; diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 5eef834efe..d52a86375d 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -6280,6 +6280,7 @@ typedef enum { wmi_service_wpa3_sha384_roam_support, wmi_service_multiple_vdev_restart_bmap, wmi_service_v1a_v1b_supported, + wmi_service_cfr_capture_pdev_id_soc, wmi_services_max, } wmi_conv_service_ids; #define WMI_SERVICE_UNAVAILABLE 0xFFFF diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 4bfd31d73d..8d45550af7 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -21667,6 +21667,8 @@ static void populate_tlv_service(uint32_t *wmi_service) wmi_service[wmi_service_ul_ru26_allowed] = WMI_SERVICE_UL_RU26_ALLOWED; wmi_service[wmi_service_cfr_capture_support] = WMI_SERVICE_CFR_CAPTURE_SUPPORT; + wmi_service[wmi_service_cfr_capture_pdev_id_soc] = + WMI_SERVICE_CFR_CAPTURE_PDEV_ID_SOC; wmi_service[wmi_service_bcast_twt_support] = WMI_SERVICE_BROADCAST_TWT; wmi_service[wmi_service_wpa3_ft_sae_support] =