diff options
author | Jiri Pirko <jpirko@redhat.com> | 2012-04-10 09:15:42 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-11 18:03:51 +0400 |
commit | 80f7c6683fe0e891ef1db7c967d538b5fdddd22c (patch) | |
tree | 7252117971ea67654ede4e716b771bb1fe824e36 /drivers/net/team/team_mode_activebackup.c | |
parent | 7a5cc24277b57ce38eb0afa6634b71d4d5cc671e (diff) | |
download | linux-80f7c6683fe0e891ef1db7c967d538b5fdddd22c.tar.xz |
team: add support for per-port options
This patch allows to create per-port options. That becomes handy for all
sorts of stuff, for example for userspace driven link-state, 802.3ad
implementation and so on.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/team/team_mode_activebackup.c')
-rw-r--r-- | drivers/net/team/team_mode_activebackup.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/net/team/team_mode_activebackup.c b/drivers/net/team/team_mode_activebackup.c index f4d960e82e29..6cde1ab8fff0 100644 --- a/drivers/net/team/team_mode_activebackup.c +++ b/drivers/net/team/team_mode_activebackup.c @@ -59,23 +59,21 @@ static void ab_port_leave(struct team *team, struct team_port *port) RCU_INIT_POINTER(ab_priv(team)->active_port, NULL); } -static int ab_active_port_get(struct team *team, void *arg) +static int ab_active_port_get(struct team *team, struct team_gsetter_ctx *ctx) { - u32 *ifindex = arg; - - *ifindex = 0; if (ab_priv(team)->active_port) - *ifindex = ab_priv(team)->active_port->dev->ifindex; + ctx->data.u32_val = ab_priv(team)->active_port->dev->ifindex; + else + ctx->data.u32_val = 0; return 0; } -static int ab_active_port_set(struct team *team, void *arg) +static int ab_active_port_set(struct team *team, struct team_gsetter_ctx *ctx) { - u32 *ifindex = arg; struct team_port *port; list_for_each_entry_rcu(port, &team->port_list, list) { - if (port->dev->ifindex == *ifindex) { + if (port->dev->ifindex == ctx->data.u32_val) { rcu_assign_pointer(ab_priv(team)->active_port, port); return 0; } |