[net-next RFC PATCH v3 08/14] net: dsa: tag_qca: add define for handling MIB packet

From: Ansuel Smith
Date: Fri Dec 10 2021 - 21:03:00 EST


Add struct to correctly parse a mib Ethernet packet.

Signed-off-by: Ansuel Smith <ansuelsmth@xxxxxxxxx>
---
include/linux/dsa/tag_qca.h | 17 +++++++++++++++++
1 file changed, 17 insertions(+)

diff --git a/include/linux/dsa/tag_qca.h b/include/linux/dsa/tag_qca.h
index 578a4aeafd92..f3369b939107 100644
--- a/include/linux/dsa/tag_qca.h
+++ b/include/linux/dsa/tag_qca.h
@@ -59,4 +59,21 @@ struct mdio_ethhdr {
u16 hdr; /* qca hdr */
} __packed;

+enum mdio_cmd {
+ MDIO_WRITE = 0x0,
+ MDIO_READ
+};
+
+struct mib_ethhdr {
+ u32 data[3]; /* first 3 mib counter */
+ __be16 hdr; /* qca hdr */
+} __packed;
+
+struct tag_qca_priv {
+ void (*rw_reg_ack_handler)(struct dsa_port *dp,
+ struct sk_buff *skb);
+ void (*mib_autocast_handler)(struct dsa_port *dp,
+ struct sk_buff *skb);
+};
+
#endif /* __TAG_QCA_H */
--
2.32.0