Эх сурвалжийг харах

qcacmn: Add wmi wrapper function to get target pdev id from host

Add wmi wrapper function to convert host pdev id to target  pdev id.

Change-Id: I3824a7556bf0b740d069602e9ee5a572c427c49c
CRs-Fixed: 2316715
Shashikala Prabhu 6 жил өмнө
parent
commit
70da943414

+ 9 - 2
target_if/dfs/src/target_if_dfs_full_offload.c

@@ -198,6 +198,7 @@ QDF_STATUS target_process_bang_radar_cmd(
 	struct wmi_unit_test_cmd wmi_utest;
 	int i;
 	wmi_unified_t wmi_handle;
+	uint32_t target_pdev_id = 0;
 
 	if (!pdev) {
 		target_if_err("null pdev");
@@ -220,8 +221,14 @@ QDF_STATUS target_process_bang_radar_cmd(
 	 * Host to Target  conversion for pdev id required
 	 * before we send a wmi unit test command
 	 */
-	wmi_utest.args[IDX_PDEV_ID] = wmi_handle->ops->
-		convert_pdev_id_host_to_target(pdev->pdev_objmgr.wlan_pdev_id);
+	if (wmi_convert_pdev_id_host_to_target(
+				wmi_handle, pdev->pdev_objmgr.wlan_pdev_id,
+				&target_pdev_id) != QDF_STATUS_SUCCESS) {
+		target_if_err("failed to convert host pdev id to target");
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	wmi_utest.args[IDX_PDEV_ID] = target_pdev_id;
 
 	status = wmi_unified_unit_test_cmd(wmi_handle, &wmi_utest);
 	if (QDF_IS_STATUS_ERROR(status))

+ 14 - 0
wmi/inc/wmi_unified_api.h

@@ -2487,4 +2487,18 @@ void wmi_process_fw_event_worker_thread_ctx(struct wmi_unified *wmi_handle,
 QDF_STATUS wmi_unified_send_obss_spatial_reuse_set_cmd(void *wmi_handle,
 	struct wmi_host_obss_spatial_reuse_set_param *obss_spatial_reuse_param);
 #endif /* OBSS_PD */
+
+/**
+ * wmi_convert_pdev_id_host_to_target() - Convert pdev_id from host to target
+ * defines. For legacy there is not conversion required. Just return pdev_id as
+ * it is.
+ * @wmi_hdl: wmi handle
+ * @host_pdev_id: host pdev_id to be converted.
+ * @target_pdev_id: Output target pdev id.
+ *
+ * Return: QDF_STATUS
+ */
+QDF_STATUS wmi_convert_pdev_id_host_to_target(void *wmi_hdl,
+					      uint32_t host_pdev_id,
+					      uint32_t *target_pdev_id);
 #endif /* _WMI_UNIFIED_API_H_ */

+ 16 - 0
wmi/src/wmi_unified_api.c

@@ -7539,3 +7539,19 @@ wmi_unified_send_obss_spatial_reuse_set_cmd(void *wmi_hdl,
 	return QDF_STATUS_E_FAILURE;
 }
 #endif
+
+QDF_STATUS wmi_convert_pdev_id_host_to_target(void *wmi_hdl,
+					      uint32_t host_pdev_id,
+					      uint32_t *target_pdev_id)
+{
+	wmi_unified_t wmi_handle = (wmi_unified_t)wmi_hdl;
+
+	if (wmi_handle->ops->convert_pdev_id_host_to_target) {
+		*target_pdev_id =
+			wmi_handle->ops->convert_pdev_id_host_to_target(
+					host_pdev_id);
+		return QDF_STATUS_SUCCESS;
+	}
+
+	return QDF_STATUS_E_FAILURE;
+}

+ 1 - 1
wmi/src/wmi_unified_dfs_api.c

@@ -71,5 +71,5 @@ QDF_STATUS wmi_extract_wlan_radar_event_info(void *wmi_hdl,
 
 	return QDF_STATUS_E_FAILURE;
 }
-#endif
 qdf_export_symbol(wmi_extract_dfs_radar_detection_event);
+#endif