diff options
author | Murali Karicheri <m-karicheri2@ti.com> | 2019-04-05 13:31:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-06 18:32:21 -0700 |
commit | fc4ecaeebd26c77d463c898d9dd3edee234e371c (patch) | |
tree | 3114abdabf9661b7cd77c162f2d5a254f46b7091 /net/hsr/hsr_main.h | |
parent | 0e7623bdf34fff6587f96c27132aebe8c585631d (diff) | |
download | blackbird-op-linux-fc4ecaeebd26c77d463c898d9dd3edee234e371c.tar.gz blackbird-op-linux-fc4ecaeebd26c77d463c898d9dd3edee234e371c.zip |
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 <m-karicheri2@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/hsr/hsr_main.h')
-rw-r--r-- | net/hsr/hsr_main.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 */ |