Linux Audio

Check our new training course

Yocto / OpenEmbedded training

Mar 24-27, 2025, special US time zones
Register
Loading...
v4.17
 
 1/* Copyright 2011-2014 Autronica Fire and Security AS
 2 *
 3 * This program is free software; you can redistribute it and/or modify it
 4 * under the terms of the GNU General Public License as published by the Free
 5 * Software Foundation; either version 2 of the License, or (at your option)
 6 * any later version.
 7 *
 8 * Author(s):
 9 *	2011-2014 Arvid Brodin, arvid.brodin@alten.se
 
 
10 */
11
12#ifndef __HSR_SLAVE_H
13#define __HSR_SLAVE_H
14
15#include <linux/skbuff.h>
16#include <linux/netdevice.h>
17#include <linux/rtnetlink.h>
18#include "hsr_main.h"
19
20int hsr_add_port(struct hsr_priv *hsr, struct net_device *dev,
21		 enum hsr_port_type pt);
22void hsr_del_port(struct hsr_port *port);
23bool hsr_port_exists(const struct net_device *dev);
24
25static inline struct hsr_port *hsr_port_get_rtnl(const struct net_device *dev)
26{
27	ASSERT_RTNL();
28	return hsr_port_exists(dev) ?
29				rtnl_dereference(dev->rx_handler_data) : NULL;
30}
31
32static inline struct hsr_port *hsr_port_get_rcu(const struct net_device *dev)
33{
34	return hsr_port_exists(dev) ?
35				rcu_dereference(dev->rx_handler_data) : NULL;
36}
 
 
37
38#endif /* __HSR_SLAVE_H */
v6.9.4
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/* Copyright 2011-2014 Autronica Fire and Security AS
 3 *
 
 
 
 
 
 
 4 *	2011-2014 Arvid Brodin, arvid.brodin@alten.se
 5 *
 6 * include file for HSR and PRP.
 7 */
 8
 9#ifndef __HSR_SLAVE_H
10#define __HSR_SLAVE_H
11
12#include <linux/skbuff.h>
13#include <linux/netdevice.h>
14#include <linux/rtnetlink.h>
15#include "hsr_main.h"
16
17int hsr_add_port(struct hsr_priv *hsr, struct net_device *dev,
18		 enum hsr_port_type pt, struct netlink_ext_ack *extack);
19void hsr_del_port(struct hsr_port *port);
20bool hsr_port_exists(const struct net_device *dev);
21
22static inline struct hsr_port *hsr_port_get_rtnl(const struct net_device *dev)
23{
24	ASSERT_RTNL();
25	return hsr_port_exists(dev) ?
26				rtnl_dereference(dev->rx_handler_data) : NULL;
27}
28
29static inline struct hsr_port *hsr_port_get_rcu(const struct net_device *dev)
30{
31	return hsr_port_exists(dev) ?
32				rcu_dereference(dev->rx_handler_data) : NULL;
33}
34
35bool hsr_invalid_dan_ingress_frame(__be16 protocol);
36
37#endif /* __HSR_SLAVE_H */