From fc4ecaeebd26c77d463c898d9dd3edee234e371c Mon Sep 17 00:00:00 2001 From: Murali Karicheri Date: Fri, 5 Apr 2019 13:31:35 -0400 Subject: net: hsr: add debugfs support for display node list This adds a debugfs interface to allow display the nodes learned by the hsr master. Signed-off-by: Murali Karicheri Signed-off-by: David S. Miller --- net/hsr/hsr_main.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'net/hsr/hsr_main.h') diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h index 1e49675ca186..778213f07fe0 100644 --- a/net/hsr/hsr_main.h +++ b/net/hsr/hsr_main.h @@ -163,6 +163,10 @@ struct hsr_priv { u8 prot_version; /* Indicate if HSRv0 or HSRv1. */ spinlock_t seqnr_lock; /* locking for sequence_nr */ unsigned char sup_multicast_addr[ETH_ALEN]; +#ifdef CONFIG_DEBUG_FS + struct dentry *node_tbl_root; + struct dentry *node_tbl_file; +#endif }; #define hsr_for_each_port(hsr, port) \ @@ -179,4 +183,17 @@ static inline u16 hsr_get_skb_sequence_nr(struct sk_buff *skb) return ntohs(hsr_ethhdr->hsr_tag.sequence_nr); } +#if IS_ENABLED(CONFIG_DEBUG_FS) +int hsr_prp_debugfs_init(struct hsr_priv *priv); +void hsr_prp_debugfs_term(struct hsr_priv *priv); +#else +static inline int hsr_prp_debugfs_init(struct hsr_priv *priv) +{ + return 0; +} + +static inline void hsr_prp_debugfs_term(struct hsr_priv *priv) +{} +#endif + #endif /* __HSR_PRIVATE_H */ -- cgit v1.2.3