1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright 2011-2014 Autronica Fire and Security AS
4 * 2011-2014 Arvid Brodin, arvid.brodin@alten.se
6 * include file for HSR and PRP.
12 #include <linux/skbuff.h>
13 #include <linux/netdevice.h>
14 #include <linux/rtnetlink.h>
17 int hsr_add_port(struct hsr_priv *hsr, struct net_device *dev,
18 enum hsr_port_type pt, struct netlink_ext_ack *extack);
19 void hsr_del_port(struct hsr_port *port);
20 bool hsr_port_exists(const struct net_device *dev);
22 static inline struct hsr_port *hsr_port_get_rtnl(const struct net_device *dev)
25 return hsr_port_exists(dev) ?
26 rtnl_dereference(dev->rx_handler_data) : NULL;
29 static inline struct hsr_port *hsr_port_get_rcu(const struct net_device *dev)
31 return hsr_port_exists(dev) ?
32 rcu_dereference(dev->rx_handler_data) : NULL;
35 bool hsr_invalid_dan_ingress_frame(__be16 protocol);
37 #endif /* __HSR_SLAVE_H */