[PATCH] wifi: ath11k: support HTT extended receive rate debug stats

Karthik M quic_karm at quicinc.com
Tue Jun 13 00:12:12 PDT 2023


ATH11K_DBG_HTT_EXT_STATS_PDEV_RX_RATE_EXT  =  30

HTT stats, HTT_RX_PDEV_RATE_EXT_STATS has the rx stats info of
the extended 80MHz, mainly 80+80 and 160MHz modes.

Usage:
echo 30 > /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats_type
cat /sys/kernel/debug/ieee80211/phyx/ath11k/htt_stats

HTT_RX_PDEV_RATE_EXT_STATS_TLV:
rssi_mcast = -70
rssi_mgmt = 6
rssi_chain_ext[0] =  0:128, 1:128, 2:128, 3:128,
rssi_chain_ext[1] =  0:128, 1:128, 2:128, 3:128,
rssi_chain_ext[2] =  0:128, 1:128, 2:128, 3:128,
rssi_chain_ext[3] =  0:128, 1:128, 2:128, 3:128,
rssi_chain_ext[4] =  0:128, 1:128, 2:128, 3:128,
rssi_chain_ext[5] =  0:128, 1:128, 2:128, 3:128,
rssi_chain_ext[6] =  0:128, 1:128, 2:128, 3:128,
rssi_chain_ext[7] =  0:128, 1:128, 2:128, 3:128,

rx_per_chain_rssi_ext_in_dbm[0] =  0:0, 1:0, 2:0, 3:0,
rx_per_chain_rssi_ext_in_dbm[1] =  0:0, 1:0, 2:0, 3:0,
rx_per_chain_rssi_ext_in_dbm[2] =  0:0, 1:0, 2:0, 3:0,
rx_per_chain_rssi_ext_in_dbm[3] =  0:0, 1:0, 2:0, 3:0,
rx_per_chain_rssi_ext_in_dbm[4] =  0:-128, 1:-128, 2:-128, 3:-128,
rx_per_chain_rssi_ext_in_dbm[5] =  0:-128, 1:-128, 2:-128, 3:-128,
rx_per_chain_rssi_ext_in_dbm[6] =  0:-128, 1:-128, 2:-128, 3:-128,
rx_per_chain_rssi_ext_in_dbm[7] =  0:-128, 1:-128, 2:-128, 3:-128,
rx_mcs_ext =  0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11: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0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0,
rx_11ax_dl_ofdma_mcs_ext =  0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0,

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.9.0.1-01184-QCAHKSWPL_SILICONZ-1

Signed-off-by: Sathishkumar Muruganandam <quic_murugana at quicinc.com>
Signed-off-by: Karthik M <quic_karm at quicinc.com>
---
 drivers/net/wireless/ath/ath11k/debugfs.h     |  1 +
 .../wireless/ath/ath11k/debugfs_htt_stats.c   | 91 +++++++++++++++++++
 .../wireless/ath/ath11k/debugfs_htt_stats.h   | 40 ++++++++
 3 files changed, 132 insertions(+)

diff --git a/drivers/net/wireless/ath/ath11k/debugfs.h b/drivers/net/wireless/ath/ath11k/debugfs.h
index 3af0169f6cf2..00da0c06b4a0 100644
--- a/drivers/net/wireless/ath/ath11k/debugfs.h
+++ b/drivers/net/wireless/ath/ath11k/debugfs.h
@@ -39,6 +39,7 @@ enum ath11k_dbg_htt_ext_stats_type {
 	ATH11K_DBG_HTT_EXT_STATS_PDEV_OBSS_PD_STATS	    =  23,
 	ATH11K_DBG_HTT_EXT_STATS_RING_BACKPRESSURE_STATS    =  24,
 	ATH11K_DBG_HTT_EXT_STATS_PEER_CTRL_PATH_TXRX_STATS  =  29,
+	ATH11K_DBG_HTT_EXT_STATS_PDEV_RX_RATE_EXT           =  30,
 	ATH11K_DBG_HTT_EXT_STATS_PDEV_TX_RATE_TXBF_STATS    =  31,
 	ATH11K_DBG_HTT_EXT_STATS_TXBF_OFDMA		    =  32,
 	ATH11K_DBG_HTT_EXT_PHY_COUNTERS_AND_PHY_STATS	    =  37,
diff --git a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c
index b3efca6bd7dd..ee094197c70e 100644
--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c
+++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.c
@@ -2879,6 +2879,94 @@ static inline void htt_print_tx_pdev_rate_stats_tlv(const void *tag_buf,
 	stats_req->buf_len = len;
 }
 
+static void htt_print_rx_pdev_rate_ext_stats_tlv(const void *tag_buf,
+						 struct debug_htt_stats_req *stats_req)
+{
+	const struct htt_rx_pdev_rate_ext_stats_tlv *htt_stats_buf = tag_buf;
+	u8 *buf = stats_req->buf;
+	u32 len = stats_req->buf_len;
+	u32 buf_len = ATH11K_HTT_STATS_BUF_SIZE;
+	u8 i, j;
+
+	len += scnprintf(buf + len, buf_len - len,
+			 "HTT_RX_PDEV_RATE_EXT_STATS_TLV:\n");
+	len += scnprintf(buf + len, buf_len - len, "rssi_mcast = %d\n",
+			 htt_stats_buf->rssi_mcast);
+	len += scnprintf(buf + len, buf_len - len, "rssi_mgmt = %d\n",
+			 htt_stats_buf->rssi_mgmt);
+
+	for (j = 0; j < HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS; j++) {
+		len += scnprintf(buf + len, buf_len - len,
+				 "\nrssi_chain_ext[%u] = ", j);
+		PRINT_ARRAY_TO_BUF(buf, len,
+				   htt_stats_buf->rssi_chain_ext[j],
+				   NULL,
+				   HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS,
+				   "\n");
+	}
+
+	for (j = 0; j < HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS; j++) {
+		len += scnprintf(buf + len, buf_len - len,
+				 "\nrx_per_chain_rssi_ext_in_dbm[%u] = ", j);
+		for (i = 0; i < HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS; i++)
+			len += scnprintf(buf + len,
+					 ATH11K_HTT_STATS_BUF_SIZE - len,
+					 " %u:%d,",
+					 i,
+					 htt_stats_buf->rx_per_chain_rssi_ext_in_dbm[j][i]);
+		len += scnprintf(buf + len,
+				 ATH11K_HTT_STATS_BUF_SIZE - len,
+				 "\n");
+	}
+
+	PRINT_ARRAY_TO_BUF(buf, len, htt_stats_buf->rx_mcs_ext,
+			   "\nrx_mcs_ext",
+			   HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT, "\n");
+
+	PRINT_ARRAY_TO_BUF(buf, len, htt_stats_buf->rx_stbc_ext,
+			   "\nrx_stbc_ext",
+			   HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT, "\n");
+
+	for (j = 0; j < HTT_RX_PDEV_STATS_NUM_GI_COUNTERS; j++) {
+		len += scnprintf(buf + len, buf_len - len,
+				 "\nrx_gi_ext[%u] = ", j);
+		PRINT_ARRAY_TO_BUF(buf, len, htt_stats_buf->rx_gi_ext[j],
+				   NULL,
+				   HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT,
+				   "\n");
+	}
+
+	PRINT_ARRAY_TO_BUF(buf, len, htt_stats_buf->ul_ofdma_rx_mcs_ext,
+			   "\nul_ofdma_rx_mcs_ext",
+			   HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT, "\n");
+
+	for (j = 0; j < HTT_RX_PDEV_STATS_NUM_GI_COUNTERS; j++) {
+		len += scnprintf(buf + len, buf_len - len,
+				 "\nul_ofdma_rx_gi_ext[%u] = ", j);
+		PRINT_ARRAY_TO_BUF(buf, len,
+				   htt_stats_buf->ul_ofdma_rx_gi_ext[j],
+				   NULL,
+				   HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT,
+				   "\n");
+	}
+
+	PRINT_ARRAY_TO_BUF(buf, len, htt_stats_buf->rx_11ax_su_txbf_mcs_ext,
+			   "\nrx_11ax_su_txbf_mcs_ext",
+			   HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT, "\n");
+
+	PRINT_ARRAY_TO_BUF(buf, len, htt_stats_buf->rx_11ax_mu_txbf_mcs_ext,
+			   "\nrx_11ax_mu_txbf_mcs_ext",
+			   HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT, "\n");
+
+	PRINT_ARRAY_TO_BUF(buf, len, htt_stats_buf->rx_11ax_dl_ofdma_mcs_ext,
+			   "\nrx_11ax_dl_ofdma_mcs_ext",
+			   HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT, "\n");
+
+	len += scnprintf(buf + len, buf_len - len, "\n");
+
+	stats_req->buf_len = len;
+}
+
 static inline void htt_print_rx_pdev_rate_stats_tlv(const void *tag_buf,
 						    struct debug_htt_stats_req *stats_req)
 {
@@ -4428,6 +4516,9 @@ static int ath11k_dbg_htt_ext_stats_parse(struct ath11k_base *ab,
 	case HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG:
 		htt_print_peer_ctrl_path_txrx_stats_tlv(tag_buf, stats_req);
 		break;
+	case HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG:
+		htt_print_rx_pdev_rate_ext_stats_tlv(tag_buf, stats_req);
+		break;
 	default:
 		break;
 	}
diff --git a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h
index 2b97cbbd28cb..ce692fb3f357 100644
--- a/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h
+++ b/drivers/net/wireless/ath/ath11k/debugfs_htt_stats.h
@@ -104,6 +104,7 @@ enum htt_tlv_tag_t {
 	HTT_STATS_HW_WAR_TAG				    = 89,
 	HTT_STATS_RING_BACKPRESSURE_STATS_TAG		    = 90,
 	HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG		    = 101,
+	HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG                = 103,
 	HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG		    = 108,
 	HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG		    = 113,
 	HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG		    = 114,
@@ -442,6 +443,12 @@ enum htt_stats_param_type {
 #define HTT_TX_PEER_STATS_NUM_MCS_COUNTERS        12
 #define HTT_TX_PEER_STATS_NUM_GI_COUNTERS          4
 #define HTT_TX_PEER_STATS_NUM_DCM_COUNTERS         5
+/* HTT_TX_PEER_STATS_NUM_BW_COUNTERS:
+ * bw index 0: rssi_pri20_chain0
+ * bw index 1: rssi_ext20_chain0
+ * bw index 2: rssi_ext40_low20_chain0
+ * bw index 3: rssi_ext40_high20_chain0
+ */
 #define HTT_TX_PEER_STATS_NUM_BW_COUNTERS          4
 #define HTT_TX_PEER_STATS_NUM_SPATIAL_STREAMS      8
 #define HTT_TX_PEER_STATS_NUM_PREAMBLE_TYPES       HTT_STATS_PREAM_COUNT
@@ -1986,4 +1993,37 @@ static inline int ath11k_debugfs_htt_stats_req(struct ath11k *ar)
 
 #endif /* CONFIG_ATH11K_DEBUGFS */
 
+/* == PDEV RX RATE EXT STATS == */
+#define HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT 14
+/* HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS:
+ * bw index 4 (bw ext index 0): rssi_ext80_low20_chain0
+ * bw index 5 (bw ext index 1): rssi_ext80_low_high20_chain0
+ * bw index 6 (bw ext index 2): rssi_ext80_high_low20_chain0
+ * bw index 7 (bw ext index 3): rssi_ext80_high20_chain0
+ */
+#define HTT_RX_PEER_STATS_NUM_BW_EXT_COUNTERS 4
+#define HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS 4
+
+struct htt_rx_pdev_rate_ext_stats_tlv {
+	u8 rssi_chain_ext[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS]
+			 [HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS];
+	/* units = dB above noise floor */
+	s8 rx_per_chain_rssi_ext_in_dbm[HTT_RX_PDEV_STATS_NUM_SPATIAL_STREAMS]
+				       [HTT_RX_PDEV_STATS_NUM_BW_EXT_COUNTERS];
+	/* rx mcast signal strength value in dBm unit */
+	s32 rssi_mcast;
+	/* rx mgmt packet signal strength value in dBm unit */
+	s32 rssi_mgmt;
+	u32 rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
+	u32 rx_stbc_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
+	u32 rx_gi_ext[HTT_RX_PDEV_STATS_NUM_GI_COUNTERS]
+		     [HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
+	u32 ul_ofdma_rx_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
+	u32 ul_ofdma_rx_gi_ext[HTT_TX_PDEV_STATS_NUM_GI_COUNTERS]
+			      [HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
+	u32 rx_11ax_su_txbf_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
+	u32 rx_11ax_mu_txbf_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
+	u32 rx_11ax_dl_ofdma_mcs_ext[HTT_RX_PDEV_STATS_NUM_MCS_COUNTERS_EXT];
+};
+
 #endif
-- 
2.17.1




More information about the ath11k mailing list