Browse Source

qcacmn: Add counters for wdi messages

Add counters to account for wdi messages from firmware.

Change-Id: I1c12d42ac4d385d2ed27f6eff84dd2fcfd540ab1
CRs-Fixed: 2365971
Venkata Sharath Chandra Manchala 6 years ago
parent
commit
69a0ed394a
4 changed files with 22 additions and 4 deletions
  1. 12 1
      dp/inc/cdp_txrx_stats_struct.h
  2. 0 2
      dp/wifi3.0/dp_htt.c
  3. 9 1
      dp/wifi3.0/dp_main.c
  4. 1 0
      dp/wifi3.0/dp_wdi_event.c

+ 12 - 1
dp/inc/cdp_txrx_stats_struct.h

@@ -26,7 +26,9 @@
 #ifndef CONFIG_WIN
 #include <wlan_defs.h>
 #endif
-
+#if defined(WDI_EVENT_ENABLE) && defined(CONFIG_MCL)
+#include <wdi_event.h>
+#endif
 #define TXRX_STATS_LEVEL_OFF   0
 #define TXRX_STATS_LEVEL_BASIC 1
 #define TXRX_STATS_LEVEL_FULL  2
@@ -105,6 +107,12 @@
  */
 #define CDP_PPDU_STATS_MAX_TAG 14
 
+#ifdef CONFIG_MCL
+#define CDP_WDI_NUM_EVENTS WDI_NUM_EVENTS
+#else
+#define CDP_WDI_NUM_EVENTS 22
+#endif
+
 /* Different Packet Types */
 enum cdp_packet_type {
 	DOT11_A = 0,
@@ -1054,6 +1062,9 @@ struct cdp_pdev_stats {
 
 	struct cdp_htt_tx_pdev_stats  htt_tx_pdev_stats;
 	struct cdp_htt_rx_pdev_stats  htt_rx_pdev_stats;
+
+	/* Received wdi messages from fw */
+	uint32_t wdi_event[CDP_WDI_NUM_EVENTS];
 };
 
 #ifndef BIG_ENDIAN_HOST

+ 0 - 2
dp/wifi3.0/dp_htt.c

@@ -2947,7 +2947,6 @@ dp_ppdu_stats_ind_handler(struct htt_soc *soc,
 	u_int8_t pdev_id;
 	bool free_buf;
 	qdf_nbuf_set_pktlen(htt_t2h_msg, HTT_T2H_MAX_MSG_SIZE);
-	dp_debug("received HTT_T2H_MSG_TYPE_PPDU_STATS_IND");
 	pdev_id = HTT_T2H_PPDU_STATS_PDEV_ID_GET(*msg_word);
 	pdev_id = DP_HW2SW_MACID(pdev_id);
 	free_buf = dp_txrx_ppdu_stats_handler(soc->dp_soc, pdev_id,
@@ -2983,7 +2982,6 @@ dp_pktlog_msg_handler(struct htt_soc *soc,
 	uint8_t pdev_id;
 	uint32_t *pl_hdr;
 
-	dp_debug("received HTT_T2H_MSG_TYPE_PKTLOG");
 	pdev_id = HTT_T2H_PKTLOG_PDEV_ID_GET(*msg_word);
 	pdev_id = DP_HW2SW_MACID(pdev_id);
 	pl_hdr = (msg_word + 1);

+ 9 - 1
dp/wifi3.0/dp_main.c

@@ -81,6 +81,7 @@ static void dp_ppdu_ring_cfg(struct dp_pdev *pdev);
 #define DP_INTR_POLL_TIMER_MS	10
 /* Generic AST entry aging timer value */
 #define DP_AST_AGING_TIMER_DEFAULT_MS	1000
+
 /* WDS AST entry aging timer value */
 #define DP_WDS_AST_AGING_TIMER_DEFAULT_MS	120000
 #define DP_WDS_AST_AGING_TIMER_CNT \
@@ -89,6 +90,7 @@ static void dp_ppdu_ring_cfg(struct dp_pdev *pdev);
 #define DP_NSS_LENGTH (6*SS_COUNT)
 #define DP_MU_GROUP_SHOW 16
 #define DP_MU_GROUP_LENGTH (6 * DP_MU_GROUP_SHOW)
+
 #define DP_RXDMA_ERR_LENGTH (6*HAL_RXDMA_ERR_MAX)
 #define DP_MAX_INT_CONTEXTS_STRING_LENGTH (6 * WLAN_CFG_INT_NUM_CONTEXTS)
 #define DP_REO_ERR_LENGTH (6*HAL_REO_ERR_MAX)
@@ -6278,7 +6280,7 @@ static void dp_get_device_stats(void *handle,
 static inline void
 dp_print_pdev_tx_stats(struct dp_pdev *pdev)
 {
-	uint8_t index = 0;
+	uint8_t i = 0, index = 0;
 
 	DP_PRINT_STATS("PDEV Tx Stats:\n");
 	DP_PRINT_STATS("Received From Stack:");
@@ -6406,6 +6408,12 @@ dp_print_pdev_tx_stats(struct dp_pdev *pdev)
 				pdev->stats.ppdu_stats_counter[index]);
 	}
 
+	for (i = 0; i < CDP_WDI_NUM_EVENTS; i++) {
+		if (!pdev->stats.wdi_event[i])
+			DP_PRINT_STATS("Wdi msgs received from fw[%d]:%d",
+				       i, pdev->stats.wdi_event[i]);
+	}
+
 }
 
 /**

+ 1 - 0
dp/wifi3.0/dp_wdi_event.c

@@ -138,6 +138,7 @@ dp_wdi_event_handler(
 	 */
 	event_index = event - WDI_EVENT_BASE;
 
+	DP_STATS_INC(txrx_pdev, wdi_event[event_index], 1);
 	wdi_sub = txrx_pdev->wdi_event_list[event_index];
 
 	/* Find the subscriber */