summaryrefslogtreecommitdiff
path: root/net/hsr/hsr_main.h
diff options
context:
space:
mode:
authorMurali Karicheri <m-karicheri2@ti.com>2020-07-22 10:40:18 -0400
committerDavid S. Miller <davem@davemloft.net>2020-07-27 12:20:40 -0700
commit28e458e097f32af4f89f02e078a6d6b4ea7a52ed (patch)
tree77e4b61fcb34a537551c17b09a9af5deb79b5d18 /net/hsr/hsr_main.h
parent121c33b07b3127f501b366bc23d2a590e2f2b8ef (diff)
net: hsr: introduce protocol specific function pointers
As a preparatory patch to introduce support for PRP protocol, add a protocol ops ptr in the private hsr structure to hold function pointers as some of the functions at protocol level packet handling is different for HSR vs PRP. It is expected that PRP will add its of set of functions for protocol handling. Modify existing hsr_announce() function to call proto_ops->send_sv_frame() to send supervision frame for HSR. This is expected to be different for PRP. So introduce a ops function ptr, send_sv_frame() for the same and initialize it to send_hsr_supervsion_frame(). Modify hsr_announce() to call proto_ops->send_sv_frame(). 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.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/hsr/hsr_main.h b/net/hsr/hsr_main.h
index 8cf10d67d5f9..671270115a50 100644
--- a/net/hsr/hsr_main.h
+++ b/net/hsr/hsr_main.h
@@ -140,6 +140,11 @@ enum hsr_version {
PRP_V1,
};
+struct hsr_proto_ops {
+ /* format and send supervision frame */
+ void (*send_sv_frame)(struct hsr_port *port, unsigned long *interval);
+};
+
struct hsr_priv {
struct rcu_head rcu_head;
struct list_head ports;
@@ -153,6 +158,7 @@ struct hsr_priv {
enum hsr_version prot_version; /* Indicate if HSRv0, HSRv1 or PRPv1 */
spinlock_t seqnr_lock; /* locking for sequence_nr */
spinlock_t list_lock; /* locking for node list */
+ struct hsr_proto_ops *proto_ops;
unsigned char sup_multicast_addr[ETH_ALEN];
#ifdef CONFIG_DEBUG_FS
struct dentry *node_tbl_root;