Parcourir la source

qcacmn: classify qmi/wmi for WMI_REQUEST_STATS_CMDID

Classify qmi/wmi by request type, only TYPE_STATION_STATS
is designed to be sent by qmi so far.  other type will
continue go with wmi.

Change-Id: Ibaee99c0a9d59b0db634e84f3c0b6e40b65a185d
CRs-Fixed: 3077792
Jingxiang Ge il y a 3 ans
Parent
commit
b966b27c3f

+ 4 - 1
wmi/inc/wmi_unified_api.h

@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2013-2021 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -361,6 +362,7 @@ static inline int wmi_process_qmi_fw_event(void *wmi_cb_ctx, void *buf, int len)
  * @buf: wmi command buffer
  * @buflen: wmi command buffer length
  * @cmd_id: WMI cmd id
+ * @is_qmi_send_support:send by qmi is supported
  *
  * Note, it is NOT safe to access buf after calling this function!
  *
@@ -368,7 +370,8 @@ static inline int wmi_process_qmi_fw_event(void *wmi_cb_ctx, void *buf, int len)
  */
 QDF_STATUS wmi_unified_cmd_send_pm_chk(struct wmi_unified *wmi_handle,
 				       wmi_buf_t buf, uint32_t buflen,
-				       uint32_t cmd_id);
+				       uint32_t cmd_id,
+				       bool is_qmi_send_support);
 
 /**
  * wmi_unified_register_event() - WMI event handler

+ 2 - 0
wmi/inc/wmi_unified_param.h

@@ -765,12 +765,14 @@ typedef struct {
  * @vdev_id: vdev id
  * @pdev_id: pdev_id
  * @wmi_host_inst_rssi_args: Instantaneous rssi stats args
+ * @is_qmi_send_support: support to send by qmi or not
  */
 struct stats_request_params {
 	uint32_t stats_id;
 	uint8_t vdev_id;
 	uint8_t pdev_id;
 	wmi_host_inst_rssi_args rssi_args;
+	bool is_qmi_send_support;
 };
 
 /**

+ 7 - 3
wmi/src/wmi_unified_cp_stats_tlv.c

@@ -402,6 +402,7 @@ send_stats_request_cmd_tlv(wmi_unified_t wmi_handle,
 	wmi_request_stats_cmd_fixed_param *cmd;
 	wmi_buf_t buf;
 	uint16_t len = sizeof(wmi_request_stats_cmd_fixed_param);
+	bool is_qmi_send_support;
 
 	buf = wmi_buf_alloc(wmi_handle, len);
 	if (!buf)
@@ -417,15 +418,18 @@ send_stats_request_cmd_tlv(wmi_unified_t wmi_handle,
 	cmd->pdev_id = wmi_handle->ops->convert_pdev_id_host_to_target(
 							wmi_handle,
 							param->pdev_id);
+	is_qmi_send_support = param->is_qmi_send_support;
 
 	WMI_CHAR_ARRAY_TO_MAC_ADDR(macaddr, &cmd->peer_macaddr);
 
-	wmi_debug("STATS REQ STATS_ID:%d VDEV_ID:%d PDEV_ID:%d-->",
-		 cmd->stats_id, cmd->vdev_id, cmd->pdev_id);
+	wmi_debug("STATS REQ STATS_ID:%d VDEV_ID:%d PDEV_ID:%d, is_qmi_send_support %d",
+		  cmd->stats_id, cmd->vdev_id, cmd->pdev_id,
+		  is_qmi_send_support);
 
 	wmi_mtrace(WMI_REQUEST_STATS_CMDID, cmd->vdev_id, 0);
 	ret = wmi_unified_cmd_send_pm_chk(wmi_handle, buf, len,
-					  WMI_REQUEST_STATS_CMDID);
+					  WMI_REQUEST_STATS_CMDID,
+					  is_qmi_send_support);
 
 	if (ret) {
 		wmi_err("Failed to send stats request to fw =%d", ret);

+ 8 - 3
wmi/src/wmi_unified_tlv.c

@@ -750,8 +750,12 @@ qdf_export_symbol(wmi_mtrace);
 
 QDF_STATUS wmi_unified_cmd_send_pm_chk(struct wmi_unified *wmi_handle,
 				       wmi_buf_t buf,
-				       uint32_t buflen, uint32_t cmd_id)
+				       uint32_t buflen, uint32_t cmd_id,
+				       bool is_qmi_send_support)
 {
+	if (!is_qmi_send_support)
+		goto send_over_wmi;
+
 	if (!wmi_is_qmi_stats_enabled(wmi_handle))
 		goto send_over_wmi;
 
@@ -5562,7 +5566,7 @@ static QDF_STATUS send_process_ll_stats_get_cmd_tlv(wmi_unified_t wmi_handle,
 
 	wmi_mtrace(WMI_REQUEST_LINK_STATS_CMDID, cmd->vdev_id, 0);
 	ret = wmi_unified_cmd_send_pm_chk(wmi_handle, buf, len,
-					  WMI_REQUEST_LINK_STATS_CMDID);
+					  WMI_REQUEST_LINK_STATS_CMDID, true);
 	if (ret) {
 		wmi_buf_free(buf);
 		return QDF_STATUS_E_FAILURE;
@@ -5645,7 +5649,8 @@ static QDF_STATUS send_unified_ll_stats_get_sta_cmd_tlv(
 	} else {
 		ret = wmi_unified_cmd_send_pm_chk(
 					wmi_handle, buf, len,
-					WMI_REQUEST_UNIFIED_LL_GET_STA_CMDID);
+					WMI_REQUEST_UNIFIED_LL_GET_STA_CMDID,
+					true);
 	}
 
 	if (QDF_IS_STATUS_ERROR(ret)) {