فهرست منبع

qcacmn: Add CDP ops to get SAWF stats from telemetry agent

The telemetry agent on certain intervals needs to pull the
SAWF stats from the driver.

Add CDP ops to pull the SAWF stats from the driver.

CRs-Fixed: 3210834
Change-Id: Ibc27059ff13b33acc4e71d3174a0415756dcfc5e
Vivek 3 سال پیش
والد
کامیت
f64cf6e11b
3فایلهای تغییر یافته به همراه82 افزوده شده و 0 حذف شده
  1. 14 0
      dp/inc/cdp_txrx_ops.h
  2. 65 0
      dp/inc/cdp_txrx_sawf.h
  3. 3 0
      dp/wifi3.0/dp_main.c

+ 14 - 0
dp/inc/cdp_txrx_ops.h

@@ -2074,6 +2074,20 @@ struct cdp_sawf_ops {
 	(*txrx_sawf_set_sla_params)(uint32_t num_pkt, uint32_t time_secs);
 	QDF_STATUS
 	(*txrx_sawf_init_telemtery_params)(void);
+	QDF_STATUS
+	(*telemetry_get_throughput_stats)(void *arg, uint64_t *in_bytes,
+					  uint64_t *in_cnt, uint64_t *tx_bytes,
+					  uint64_t *tx_cnt, uint8_t tid,
+					  uint8_t msduq);
+	QDF_STATUS
+	(*telemetry_get_mpdu_stats)(void *arg, uint64_t *svc_int_pass,
+				    uint64_t *svc_int_fail,
+				    uint64_t *burst_pass, uint64_t *burst_fail,
+				    uint8_t tid, uint8_t msduq);
+	QDF_STATUS
+	(*telemetry_get_drop_stats)(void *arg, uint64_t *pass, uint64_t *drop,
+				    uint64_t *drop_ttl, uint8_t tid,
+				    uint8_t msduq);
 #endif
 };
 #endif

+ 65 - 0
dp/inc/cdp_txrx_sawf.h

@@ -19,6 +19,9 @@
 #ifndef _CDP_TXRX_SAWF_H_
 #define _CDP_TXRX_SAWF_H_
 
+#include <cdp_txrx_cmn_struct.h>
+#include <cdp_txrx_cmn.h>
+
 static inline QDF_STATUS
 cdp_sawf_peer_svcid_map(ol_txrx_soc_handle soc,
 			uint8_t *mac, uint8_t svc_id)
@@ -247,6 +250,68 @@ cdp_sawf_init_telemtery_params(ol_txrx_soc_handle soc)
 	return soc->ops->sawf_ops->txrx_sawf_init_telemtery_params();
 }
 
+static inline QDF_STATUS
+cdp_get_throughput_stats(ol_txrx_soc_handle soc, void *arg,
+			 uint64_t *in_bytes, uint64_t *in_cnt,
+			 uint64_t *tx_bytes, uint64_t *tx_cnt,
+			 uint8_t tid, uint8_t msduq)
+{
+	if (!soc || !soc->ops) {
+		dp_cdp_debug("Invalid Instance");
+		QDF_BUG(0);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (!soc->ops->sawf_ops ||
+	    !soc->ops->sawf_ops->telemetry_get_throughput_stats)
+		return QDF_STATUS_E_FAILURE;
+
+	return soc->ops->sawf_ops->telemetry_get_throughput_stats(
+			arg, in_bytes, in_cnt, tx_bytes,
+			tx_cnt, tid, msduq);
+}
+
+static inline QDF_STATUS
+cdp_get_mpdu_stats(ol_txrx_soc_handle soc, void *arg,
+		   uint64_t *svc_int_pass, uint64_t *svc_int_fail,
+		   uint64_t *burst_pass, uint64_t *burst_fail,
+		   uint8_t tid, uint8_t msduq)
+{
+	if (!soc || !soc->ops) {
+		dp_cdp_debug("Invalid Instance");
+		QDF_BUG(0);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (!soc->ops->sawf_ops ||
+	    !soc->ops->sawf_ops->telemetry_get_mpdu_stats)
+		return QDF_STATUS_E_FAILURE;
+
+	return soc->ops->sawf_ops->telemetry_get_mpdu_stats(
+			arg, svc_int_pass, svc_int_fail, burst_pass,
+			burst_fail, tid, msduq);
+}
+
+static inline QDF_STATUS
+cdp_get_drop_stats(ol_txrx_soc_handle soc, void *arg,
+		   uint64_t *pass, uint64_t *drop,
+		   uint64_t *drop_ttl,
+		   uint8_t tid, uint8_t msduq)
+{
+	if (!soc || !soc->ops) {
+		dp_cdp_debug("Invalid Instance");
+		QDF_BUG(0);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	if (!soc->ops->sawf_ops ||
+	    !soc->ops->sawf_ops->telemetry_get_drop_stats)
+		return QDF_STATUS_E_FAILURE;
+
+	return soc->ops->sawf_ops->telemetry_get_drop_stats(
+			arg, pass, drop, drop_ttl, tid, msduq);
+}
+
 #else
 static inline QDF_STATUS
 cdp_get_peer_sawf_delay_stats(ol_txrx_soc_handle soc, uint32_t svc_id,

+ 3 - 0
dp/wifi3.0/dp_main.c

@@ -12793,6 +12793,9 @@ static struct cdp_sawf_ops dp_ops_sawf = {
 	.txrx_sawf_set_mov_avg_params = dp_sawf_set_mov_avg_params,
 	.txrx_sawf_set_sla_params = dp_sawf_set_sla_params,
 	.txrx_sawf_init_telemtery_params = dp_sawf_init_telemetry_params,
+	.telemetry_get_throughput_stats = dp_sawf_get_tx_stats,
+	.telemetry_get_mpdu_stats = dp_sawf_get_mpdu_sched_stats,
+	.telemetry_get_drop_stats = dp_sawf_get_drop_stats,
 #endif
 };
 #endif