浏览代码

qca-wifi: support for tx capture stats

added debug stats for tx capture

Change-Id: Id5f9206b0996607419ce0d90ea2ff54c42b51026
nobelj 5 年之前
父节点
当前提交
826fd86990
共有 2 个文件被更改,包括 69 次插入1 次删除
  1. 47 0
      dp/wifi3.0/dp_tx_capture.c
  2. 22 1
      dp/wifi3.0/dp_tx_capture.h

+ 47 - 0
dp/wifi3.0/dp_tx_capture.c

@@ -59,6 +59,53 @@
 	SEQ_SEG_BIT(SEQ_SEG(_seqarr, (_seqno)), (_seqno))
 
 #ifdef WLAN_TX_PKT_CAPTURE_ENH
+
+/*
+ * dp_tx_capture_htt_frame_counter: increment counter for htt_frame_type
+ * pdev: DP pdev handle
+ * htt_frame_type: htt frame type received from fw
+ *
+ * return: void
+ */
+void dp_tx_capture_htt_frame_counter(struct dp_pdev *pdev,
+				     uint32_t htt_frame_type)
+{
+	if (htt_frame_type >= TX_CAP_HTT_MAX_FTYPE)
+		return;
+
+	pdev->tx_capture.htt_frame_type[htt_frame_type]++;
+}
+
+/*
+ * dp_tx_cature_stats: print tx capture stats
+ * @pdev: DP PDEV handle
+ *
+ * return: void
+ */
+void dp_print_pdev_tx_capture_stats(struct dp_pdev *pdev)
+{
+	struct dp_pdev_tx_capture *ptr_tx_cap;
+	uint8_t i = 0, j = 0;
+
+	ptr_tx_cap = &(pdev->tx_capture);
+
+	DP_PRINT_STATS("tx capture stats\n");
+	for (i = 0; i < TXCAP_MAX_TYPE; i++) {
+		for (j = 0; j < TXCAP_MAX_SUBTYPE; j++) {
+			if (ptr_tx_cap->ctl_mgmt_q[i][j].qlen)
+				DP_PRINT_STATS(" ctl_mgmt_q[%d][%d] = queue_len[%d]\n",
+				       i, j, ptr_tx_cap->ctl_mgmt_q[i][j].qlen);
+		}
+	}
+
+	for (i = 0; i < TX_CAP_HTT_MAX_FTYPE; i++) {
+		if (!ptr_tx_cap->htt_frame_type[i])
+			continue;
+		DP_PRINT_STATS(" sgen htt frame type[%d] = %d",
+			       i, ptr_tx_cap->htt_frame_type[i]);
+	}
+}
+
 /**
  * dp_peer_or_pdev_tx_cap_enabled - Returns status of tx_cap_enabled
  * based on global per-pdev setting or per-peer setting

+ 22 - 1
dp/wifi3.0/dp_tx_capture.h

@@ -15,7 +15,6 @@
  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  * PERFORMANCE OF THIS SOFTWARE.
  */
-
 #ifndef _DP_TX_CAPTURE_H_
 #define _DP_TX_CAPTURE_H_
 
@@ -29,10 +28,13 @@ struct dp_vdev;
 struct dp_peer;
 struct dp_tx_desc_s;
 
+#define TX_CAP_HTT_MAX_FTYPE 19
+
 #define TXCAP_MAX_TYPE \
 	((IEEE80211_FC0_TYPE_CTL >> IEEE80211_FC0_TYPE_SHIFT) + 1)
 #define TXCAP_MAX_SUBTYPE \
 	((IEEE80211_FC0_SUBTYPE_MASK >> IEEE80211_FC0_SUBTYPE_SHIFT) + 1)
+
 struct dp_pdev_tx_capture {
 	/* For deferred PPDU status processing */
 	qdf_spinlock_t ppdu_stats_lock;
@@ -55,6 +57,7 @@ struct dp_pdev_tx_capture {
 	qdf_nbuf_queue_t ctl_mgmt_q[TXCAP_MAX_TYPE][TXCAP_MAX_SUBTYPE];
 	qdf_spinlock_t ctl_mgmt_lock[TXCAP_MAX_TYPE][TXCAP_MAX_SUBTYPE];
 	qdf_spinlock_t config_lock;
+	uint32_t htt_frame_type[TX_CAP_HTT_MAX_FTYPE];
 };
 
 /* Tx TID */
@@ -220,5 +223,23 @@ void dp_tx_ppdu_stats_process(void *context);
 void dp_ppdu_desc_deliver(struct dp_pdev *pdev,
 			  struct ppdu_info *ppdu_info);
 
+/*
+ * dp_tx_capture_htt_frame_counter: increment counter for htt_frame_type
+ * pdev: DP pdev handle
+ * htt_frame_type: htt frame type received from fw
+ *
+ * return: void
+ */
+void dp_tx_capture_htt_frame_counter(struct dp_pdev *pdev,
+				     uint32_t htt_frame_type);
+
+/*
+ * dp_print_pdev_tx_capture_stats: print tx capture stats
+ * @pdev: DP PDEV handle
+ *
+ * return: void
+ */
+void dp_print_pdev_tx_capture_stats(struct dp_pdev *pdev);
+
 #endif
 #endif