1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #ifndef _BR_PRIVATE_MRP_H_
4 #define _BR_PRIVATE_MRP_H_
6 #include "br_private.h"
7 #include <uapi/linux/mrp_bridge.h>
10 /* list of mrp instances */
11 struct list_head __rcu list
;
13 struct net_bridge_port __rcu
*p_port
;
14 struct net_bridge_port __rcu
*s_port
;
19 enum br_mrp_ring_role_type ring_role
;
20 u8 ring_role_offloaded
;
21 enum br_mrp_ring_state_type ring_state
;
24 struct delayed_work test_work
;
26 unsigned long test_end
;
37 int br_mrp_add(struct net_bridge
*br
, struct br_mrp_instance
*instance
);
38 int br_mrp_del(struct net_bridge
*br
, struct br_mrp_instance
*instance
);
39 int br_mrp_set_port_state(struct net_bridge_port
*p
,
40 enum br_mrp_port_state_type state
);
41 int br_mrp_set_port_role(struct net_bridge_port
*p
,
42 enum br_mrp_port_role_type role
);
43 int br_mrp_set_ring_state(struct net_bridge
*br
,
44 struct br_mrp_ring_state
*state
);
45 int br_mrp_set_ring_role(struct net_bridge
*br
, struct br_mrp_ring_role
*role
);
46 int br_mrp_start_test(struct net_bridge
*br
, struct br_mrp_start_test
*test
);
48 /* br_mrp_switchdev.c */
49 int br_mrp_switchdev_add(struct net_bridge
*br
, struct br_mrp
*mrp
);
50 int br_mrp_switchdev_del(struct net_bridge
*br
, struct br_mrp
*mrp
);
51 int br_mrp_switchdev_set_ring_role(struct net_bridge
*br
, struct br_mrp
*mrp
,
52 enum br_mrp_ring_role_type role
);
53 int br_mrp_switchdev_set_ring_state(struct net_bridge
*br
, struct br_mrp
*mrp
,
54 enum br_mrp_ring_state_type state
);
55 int br_mrp_switchdev_send_ring_test(struct net_bridge
*br
, struct br_mrp
*mrp
,
56 u32 interval
, u8 max_miss
, u32 period
,
58 int br_mrp_port_switchdev_set_state(struct net_bridge_port
*p
,
59 enum br_mrp_port_state_type state
);
60 int br_mrp_port_switchdev_set_role(struct net_bridge_port
*p
,
61 enum br_mrp_port_role_type role
);
63 /* br_mrp_netlink.c */
64 int br_mrp_port_open(struct net_device
*dev
, u8 loc
);
66 #endif /* _BR_PRIVATE_MRP_H */