summaryrefslogtreecommitdiffstats
path: root/drivers/net/team/team_mode_activebackup.c
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2012-04-10 07:15:42 +0200
committerDavid S. Miller <davem@davemloft.net>2012-04-11 16:03:51 +0200
commit80f7c6683fe0e891ef1db7c967d538b5fdddd22c (patch)
tree7252117971ea67654ede4e716b771bb1fe824e36 /drivers/net/team/team_mode_activebackup.c
parentbatman-adv: add bridge loop avoidance compile option (diff)
downloadlinux-80f7c6683fe0e891ef1db7c967d538b5fdddd22c.tar.xz
linux-80f7c6683fe0e891ef1db7c967d538b5fdddd22c.zip
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.c14
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;
}