11 #include <linux/kernel.h>
12 #include <linux/types.h>
13 #include <linux/module.h>
15 #include <linux/errno.h>
16 #include <linux/netdevice.h>
18 #include <linux/if_team.h>
34 if (active_port != port)
39 static bool ab_transmit(
struct team *team,
struct sk_buff *skb)
46 if (team_dev_queue_xmit(team, active_port, skb))
55 static void ab_port_leave(
struct team *team,
struct team_port *port)
57 if (
ab_priv(team)->active_port == port)
66 lockdep_is_held(&team->
lock));
74 static int ab_active_port_set(
struct team *team,
struct team_gsetter_ctx *ctx)
91 .getter = ab_active_port_get,
92 .setter = ab_active_port_set,
96 static int ab_init(
struct team *team)
101 static void ab_exit(
struct team *team)
109 .receive = ab_receive,
110 .transmit = ab_transmit,
111 .port_leave = ab_port_leave,
114 static const struct team_mode ab_mode = {
115 .kind =
"activebackup",
117 .priv_size =
sizeof(
struct ab_priv),
121 static int __init ab_init_module(
void)
126 static void __exit ab_cleanup_module(
void)