[qca-edma] Add stats support for per-precedence stats

Add support for per-precedence counters for ingress/egress packets

Change-Id: I230a5e1cee5ea17ae57ade48d1f8984a3e583147
Signed-off-by: Rakesh Nair <ranair@codeaurora.org>
diff --git a/edma.h b/edma.h
index f58f7fe..330d261 100644
--- a/edma.h
+++ b/edma.h
@@ -89,6 +89,9 @@
 /* tpd word 3 bit 18-28 */
 #define EDMA_TPD_PORT_BITMAP_SHIFT 18
 
+/* tpd word 3 bit 29-31 */
+#define EDMA_TPD_PRIO_SHIFT 29
+
 #define EDMA_TPD_FROM_CPU_SHIFT 25
 
 #define EDMA_FROM_CPU_MASK 0x80
@@ -179,6 +182,16 @@
 
 #define EDMA_GMAC_NO_MDIO_PHY	PHY_MAX_ADDR
 
+#define EDMA_PRECEDENCE_MAX 8
+
+#define EDMA_AC_BK 0	/* Access Category: Background */
+#define EDMA_AC_BE 1	/* Access Category: Best Effort */
+#define EDMA_AC_VI 2	/* Access Category: Video */
+#define EDMA_AC_VO 3	/* Access Category: Voice */
+#define EDMA_AC_MAX 4
+
+#define EDMA_DSCP2AC_INPUT_PARAMS_MAX 2
+
 extern int ssdk_rfs_ipct_rule_set(__be32 ip_src, __be32 ip_dst,
 				  __be16 sport, __be16 dport,
 				  uint8_t proto, u16 loadbalance, bool action);
@@ -234,6 +247,10 @@
 	u64 rx_q7_byte;
 	u64 tx_desc_error;
 	u64 rx_alloc_fail_ctr;
+	u64 tx_prec[EDMA_PRECEDENCE_MAX];
+	u64 rx_prec[EDMA_PRECEDENCE_MAX];
+	u64 rx_ac[EDMA_AC_MAX];
+	u64 tx_ac[EDMA_AC_MAX];
 };
 
 struct edma_mdio_data {
@@ -465,4 +482,14 @@
 void edma_change_rx_coalesce(int usecs);
 void edma_get_tx_rx_coalesce(u32 *reg_val);
 void edma_clear_irq_status(void);
+
+int edma_dscp2ac_mapping_update(struct ctl_table *table, int write,
+				void __user *buffer, size_t *lenp,
+				loff_t *ppos);
+int edma_per_prec_stats_enable_handler(struct ctl_table *table, int write,
+				       void __user *buffer, size_t *lenp,
+				       loff_t *ppos);
+int edma_prec_stats_reset_handler(struct ctl_table *table, int write,
+				  void __user *buffer, size_t *lenp,
+				  loff_t *ppos);
 #endif /* _EDMA_H_ */