Pārlūkot izejas kodu

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
Subrat Dash 5 gadi atpakaļ
vecāks
revīzija
94bf91fc2b
2 mainītis faili ar 23 papildinājumiem un 0 dzēšanām
  1. 6 0
      wmi/inc/wmi_unified_param.h
  2. 17 0
      wmi/src/wmi_unified_tlv.c

+ 6 - 0
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

+ 17 - 0
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;