From 94bf91fc2b3375d02293f2c6d31d0b7e9f0b2a12 Mon Sep 17 00:00:00 2001 From: Subrat Dash Date: Fri, 15 May 2020 07:50:19 +0530 Subject: [PATCH] qcacmn: Add support to send pdev id in the oem data wmi cmd The FW API is updated for pdev_id in the fixed param. The pdev_vdev_flag is used to indicate whether the command is meant for pdev or vdev. The pdev_vdev_flag should be set to 1 for pdev command and 0 for vdev command. CRs-Fixed: 2693893 Change-Id: I99aabb9b73fd44d746342dfc1741fc6585c0863c --- wmi/inc/wmi_unified_param.h | 6 ++++++ wmi/src/wmi_unified_tlv.c | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 9cf14ecef4e8..5231c9f7db8f 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -672,11 +672,17 @@ struct channel_param { * struct oem_data - oem data to be sent to firmware * @vdev_id: Unique identifier assigned to the vdev * @data_len: len of data + * @pdev_id: pdev id to identify the pdev + * @pdev_vdev_flag: 0 when vdev is valid, 1 when pdev is valid + * @is_host_pdev_id: 1 for host pdev id, 0 otherwise * @data: the pointer to the buffer containing data */ struct oem_data { uint8_t vdev_id; size_t data_len; + uint8_t pdev_id; + bool pdev_vdev_flag; + bool is_host_pdev_id; uint8_t *data; }; #endif diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 1056eb0259c5..25d3618f1290 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -5600,10 +5600,12 @@ static QDF_STATUS send_start_oemv2_data_cmd_tlv(wmi_unified_t wmi_handle, { QDF_STATUS ret; wmi_oem_data_cmd_fixed_param *cmd; + struct wmi_ops *ops; wmi_buf_t buf; uint16_t len = sizeof(*cmd); uint16_t oem_data_len_aligned; uint8_t *buf_ptr; + uint32_t pdev_id = oem_data->pdev_id; if (!oem_data || !oem_data->data) { wmi_err_rl("oem data is not valid"); @@ -5631,8 +5633,23 @@ static QDF_STATUS send_start_oemv2_data_cmd_tlv(wmi_unified_t wmi_handle, WMITLV_TAG_STRUC_wmi_oem_data_cmd_fixed_param, WMITLV_GET_STRUCT_TLVLEN(wmi_oem_data_cmd_fixed_param)); + if (oem_data->pdev_vdev_flag) { + ops = wmi_handle->ops; + if (oem_data->is_host_pdev_id) + pdev_id = + ops->convert_host_pdev_id_to_target(wmi_handle, + pdev_id); + else + pdev_id = + ops->convert_pdev_id_host_to_target(wmi_handle, + pdev_id); + } + cmd->vdev_id = oem_data->vdev_id; cmd->data_len = oem_data->data_len; + cmd->pdev_vdev_flag = oem_data->pdev_vdev_flag; + cmd->pdev_id = pdev_id; + buf_ptr += sizeof(*cmd); WMITLV_SET_HDR(buf_ptr, WMITLV_TAG_ARRAY_BYTE, oem_data_len_aligned); buf_ptr += WMI_TLV_HDR_SIZE;