net: hsr: introduce protocol specific function pointers
authorMurali Karicheri <m-karicheri2@ti.com>
Wed, 22 Jul 2020 14:40:18 +0000 (10:40 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Jul 2020 19:20:40 +0000 (12:20 -0700)
commit28e458e097f32af4f89f02e078a6d6b4ea7a52ed
tree77e4b61fcb34a537551c17b09a9af5deb79b5d18
parent121c33b07b3127f501b366bc23d2a590e2f2b8ef
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>
net/hsr/hsr_device.c
net/hsr/hsr_main.h