Browse Source

qcacmn: Add a qdf counter for qmi stats requests

Add a qdf counter to know number of qmi stats requests. Reset the
counter when WoW is exited.

Change-Id: Ie0c51fbd6eb2e7530dba01912443e7fc85726e52
CRs-Fixed: 2539999
Alan Chen 5 years ago
parent
commit
b2bc55909c
3 changed files with 8 additions and 0 deletions
  1. 1 0
      wmi/inc/wmi_unified_priv.h
  2. 5 0
      wmi/src/wmi_unified.c
  3. 2 0
      wmi/src/wmi_unified_tlv.c

+ 1 - 0
wmi/inc/wmi_unified_priv.h

@@ -2135,6 +2135,7 @@ struct wmi_unified {
 #endif /*WMI_EXT_DBG*/
 	uint32_t *cmd_pdev_id_map;
 	uint32_t *evt_pdev_id_map;
+	qdf_atomic_t num_stats_over_qmi;
 };
 
 #define WMI_MAX_RADIOS 3

+ 5 - 0
wmi/src/wmi_unified.c

@@ -36,6 +36,7 @@
 #include <linux/debugfs.h>
 
 #ifdef WMI_EXT_DBG
+#include "qdf_atomic.h"
 
 /**
  * wmi_ext_dbg_msg_enqueue() - enqueue wmi message
@@ -1688,6 +1689,7 @@ QDF_STATUS wmi_unified_cmd_send_over_qmi(struct wmi_unified *wmi_handle,
 				    uint32_t cmd_id)
 {
 	QDF_STATUS status;
+	int32_t ret;
 
 	if (!qdf_nbuf_push_head(buf, sizeof(WMI_CMD_HDR))) {
 		wmi_err("Failed to send cmd %x, no memory", cmd_id);
@@ -1705,6 +1707,8 @@ QDF_STATUS wmi_unified_cmd_send_over_qmi(struct wmi_unified *wmi_handle,
 		qdf_nbuf_pull_head(buf, sizeof(WMI_CMD_HDR));
 		wmi_warn("WMI send on QMI failed. Retrying WMI on HTC");
 	} else {
+		ret = qdf_atomic_inc_return(&wmi_handle->num_stats_over_qmi);
+		wmi_debug("num stats over qmi: %d", ret);
 		wmi_buf_free(buf);
 	}
 
@@ -2635,6 +2639,7 @@ void *wmi_unified_attach(void *scn_handle,
 	soc->scn_handle = scn_handle;
 	qdf_atomic_init(&wmi_handle->pending_cmds);
 	qdf_atomic_init(&wmi_handle->is_target_suspended);
+	qdf_atomic_init(&wmi_handle->num_stats_over_qmi);
 	wmi_runtime_pm_init(wmi_handle);
 	qdf_spinlock_create(&wmi_handle->eventq_lock);
 	qdf_nbuf_queue_init(&wmi_handle->event_queue);

+ 2 - 0
wmi/src/wmi_unified_tlv.c

@@ -625,6 +625,8 @@ static QDF_STATUS wmi_unified_cmd_send_pm_chk(struct wmi_unified *wmi_handle,
 			return QDF_STATUS_SUCCESS;
 	}
 
+	qdf_atomic_set(&wmi_handle->num_stats_over_qmi, 0);
+
 	return wmi_unified_cmd_send(wmi_handle, buf, buflen, cmd_id);
 }
 #else