From 065e48fb63404a95a117cf9e7f6eaec9846417ae Mon Sep 17 00:00:00 2001 From: Shashikala Prabhu Date: Mon, 13 Jul 2020 13:02:46 +0530 Subject: [PATCH] qcacmn: Add wrapper function to get host pdev_id from tgt_pdev_id Add wrapper function to get host pdev id from target pdev id. Change-Id: I4628955569d741765efc515949909d9ea358e54a CRs-Fixed: 2711423 --- wmi/inc/wmi_unified_api.h | 16 ++++++++++++++++ wmi/src/wmi_unified_api.c | 17 +++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index 1a1ca9bd24..f8ad57b191 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -3875,6 +3875,22 @@ QDF_STATUS wmi_convert_pdev_id_host_to_target(wmi_unified_t wmi_handle, uint32_t host_pdev_id, uint32_t *target_pdev_id); +#ifndef CNSS_GENL +/** + * wmi_convert_pdev_id_target_to_host() - Convert pdev_id from target to host + * defines. For legacy there is not conversion required. Just return pdev_id as + * it is. + * @wmi_handle: wmi handle + * @target_pdev_id: target pdev_id to be converted. + * @host_pdev_id: Output host pdev id. + * + * Return: QDF_STATUS + */ +QDF_STATUS wmi_convert_pdev_id_target_to_host(wmi_unified_t wmi_handle, + uint32_t target_pdev_id, + uint32_t *host_pdev_id); +#endif + /** * wmi_unified_send_bss_color_change_enable_cmd() - WMI function to send bss * color change enable to FW. diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index 1599d73dc7..8e9e730b38 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -3131,6 +3131,23 @@ QDF_STATUS wmi_convert_pdev_id_host_to_target(wmi_unified_t wmi_handle, return QDF_STATUS_E_FAILURE; } +#ifndef CNSS_GENL +QDF_STATUS wmi_convert_pdev_id_target_to_host(wmi_unified_t wmi_handle, + uint32_t target_pdev_id, + uint32_t *host_pdev_id) +{ + if (wmi_handle->ops->convert_pdev_id_target_to_host) { + *host_pdev_id = + wmi_handle->ops->convert_pdev_id_target_to_host( + wmi_handle, + target_pdev_id); + return QDF_STATUS_SUCCESS; + } + + return QDF_STATUS_E_FAILURE; +} +#endif + QDF_STATUS wmi_unified_send_bss_color_change_enable_cmd(wmi_unified_t wmi_handle, uint32_t vdev_id,