]> git.baikalelectronics.ru Git - kernel.git/commitdiff
team: implement carrier change
authorFlavio Leitner <fbl@redhat.com>
Sat, 29 Dec 2012 15:31:01 +0000 (15:31 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 30 Dec 2012 10:31:58 +0000 (02:31 -0800)
The user space teamd daemon may need to control the
master's carrier state depending on the selected mode.

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Acked-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/team/team.c

index ad86660fb8f92b092f06c9b41d03e416991f4636..27a6edeb376f1ad834939f62e1420ed0a8a15f53 100644 (file)
@@ -1707,6 +1707,15 @@ static netdev_features_t team_fix_features(struct net_device *dev,
        return features;
 }
 
+static int team_change_carrier(struct net_device *dev, bool new_carrier)
+{
+       if (new_carrier)
+               netif_carrier_on(dev);
+       else
+               netif_carrier_off(dev);
+       return 0;
+}
+
 static const struct net_device_ops team_netdev_ops = {
        .ndo_init               = team_init,
        .ndo_uninit             = team_uninit,
@@ -1729,6 +1738,7 @@ static const struct net_device_ops team_netdev_ops = {
        .ndo_add_slave          = team_add_slave,
        .ndo_del_slave          = team_del_slave,
        .ndo_fix_features       = team_fix_features,
+       .ndo_change_carrier     = team_change_carrier,
 };