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
This commit is contained in:
Subrat Dash 2020-05-15 07:50:19 +05:30 • committed by nshrivas
commit 94bf91fc2b
2 changed files with 23 additions and 0 deletions

View file

@ -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

View file

@ -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;