From 9cdca4026a1551d0795059b1274a0a73c6d91198 Mon Sep 17 00:00:00 2001 From: Flavio Leitner Date: Sat, 29 Dec 2012 16:37:33 +0000 Subject: [PATCH] team: add ethtool support This patch adds few ethtool operations to team driver. Signed-off-by: Flavio Leitner Acked-by: Jiri Pirko Signed-off-by: David S. Miller --- drivers/net/team/team.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 27a6edeb376f1..918a901754b6c 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #define DRV_NAME "team" @@ -1741,6 +1742,21 @@ static const struct net_device_ops team_netdev_ops = { .ndo_change_carrier = team_change_carrier, }; +/*********************** + * ethtool interface + ***********************/ + +static void team_ethtool_get_drvinfo(struct net_device *dev, + struct ethtool_drvinfo *drvinfo) +{ + strncpy(drvinfo->driver, DRV_NAME, 32); + strncpy(drvinfo->version, UTS_RELEASE, 32); +} + +static const struct ethtool_ops team_ethtool_ops = { + .get_drvinfo = team_ethtool_get_drvinfo, + .get_link = ethtool_op_get_link, +}; /*********************** * rt netlink interface @@ -1790,6 +1806,7 @@ static void team_setup(struct net_device *dev) ether_setup(dev); dev->netdev_ops = &team_netdev_ops; + dev->ethtool_ops = &team_ethtool_ops; dev->destructor = team_destructor; dev->tx_queue_len = 0; dev->flags |= IFF_MULTICAST; -- 2.39.5