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
10 #include <linux/skbuff.h>
11 #include <linux/netdevice.h>
12 #include <linux/rtnetlink.h>
15 int hsr_add_port(struct hsr_priv *hsr, struct net_device *dev,
16 enum hsr_port_type pt);
17 void hsr_del_port(struct hsr_port *port);
18 bool hsr_port_exists(const struct net_device *dev);
20 static inline struct hsr_port *hsr_port_get_rtnl(const struct net_device *dev)
23 return hsr_port_exists(dev) ?
24 rtnl_dereference(dev->rx_handler_data) : NULL;
27 static inline struct hsr_port *hsr_port_get_rcu(const struct net_device *dev)
29 return hsr_port_exists(dev) ?
30 rcu_dereference(dev->rx_handler_data) : NULL;
33 #endif /* __HSR_SLAVE_H */