Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* Copyright 2011-2014 Autronica Fire and Security AS
0003  *
0004  *  2011-2014 Arvid Brodin, arvid.brodin@alten.se
0005  *
0006  * include file for HSR and PRP.
0007  */
0008 
0009 #ifndef __HSR_SLAVE_H
0010 #define __HSR_SLAVE_H
0011 
0012 #include <linux/skbuff.h>
0013 #include <linux/netdevice.h>
0014 #include <linux/rtnetlink.h>
0015 #include "hsr_main.h"
0016 
0017 int hsr_add_port(struct hsr_priv *hsr, struct net_device *dev,
0018          enum hsr_port_type pt, struct netlink_ext_ack *extack);
0019 void hsr_del_port(struct hsr_port *port);
0020 bool hsr_port_exists(const struct net_device *dev);
0021 
0022 static inline struct hsr_port *hsr_port_get_rtnl(const struct net_device *dev)
0023 {
0024     ASSERT_RTNL();
0025     return hsr_port_exists(dev) ?
0026                 rtnl_dereference(dev->rx_handler_data) : NULL;
0027 }
0028 
0029 static inline struct hsr_port *hsr_port_get_rcu(const struct net_device *dev)
0030 {
0031     return hsr_port_exists(dev) ?
0032                 rcu_dereference(dev->rx_handler_data) : NULL;
0033 }
0034 
0035 bool hsr_invalid_dan_ingress_frame(__be16 protocol);
0036 
0037 #endif /* __HSR_SLAVE_H */