diff options
author | Yan Burman <yanb@mellanox.com> | 2013-01-29 18:43:07 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-01-30 22:47:22 -0500 |
commit | 1b13c97fae9c61dc20db8e0d0a72a29df29ac377 (patch) | |
tree | a0c13a66ebb5da43f79bef2b9a83b1d1eb7b3c18 /drivers/net | |
parent | c33e7b05f1411b97cd0260ae682fc1cdb27bfaa4 (diff) |
net/vxlan: Add ethtool drvinfo
Implement ethtool get_drvinfo.
Signed-off-by: Yan Burman <yanb@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/vxlan.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index 656230e0d18c..72485b9b9005 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/etherdevice.h> | 29 | #include <linux/etherdevice.h> |
30 | #include <linux/if_ether.h> | 30 | #include <linux/if_ether.h> |
31 | #include <linux/hash.h> | 31 | #include <linux/hash.h> |
32 | #include <linux/ethtool.h> | ||
32 | #include <net/arp.h> | 33 | #include <net/arp.h> |
33 | #include <net/ndisc.h> | 34 | #include <net/ndisc.h> |
34 | #include <net/ip.h> | 35 | #include <net/ip.h> |
@@ -1271,6 +1272,18 @@ static int vxlan_validate(struct nlattr *tb[], struct nlattr *data[]) | |||
1271 | return 0; | 1272 | return 0; |
1272 | } | 1273 | } |
1273 | 1274 | ||
1275 | static void vxlan_get_drvinfo(struct net_device *netdev, | ||
1276 | struct ethtool_drvinfo *drvinfo) | ||
1277 | { | ||
1278 | strlcpy(drvinfo->version, VXLAN_VERSION, sizeof(drvinfo->version)); | ||
1279 | strlcpy(drvinfo->driver, "vxlan", sizeof(drvinfo->driver)); | ||
1280 | } | ||
1281 | |||
1282 | static const struct ethtool_ops vxlan_ethtool_ops = { | ||
1283 | .get_drvinfo = vxlan_get_drvinfo, | ||
1284 | .get_link = ethtool_op_get_link, | ||
1285 | }; | ||
1286 | |||
1274 | static int vxlan_newlink(struct net *net, struct net_device *dev, | 1287 | static int vxlan_newlink(struct net *net, struct net_device *dev, |
1275 | struct nlattr *tb[], struct nlattr *data[]) | 1288 | struct nlattr *tb[], struct nlattr *data[]) |
1276 | { | 1289 | { |
@@ -1348,6 +1361,8 @@ static int vxlan_newlink(struct net *net, struct net_device *dev, | |||
1348 | vxlan->port_max = ntohs(p->high); | 1361 | vxlan->port_max = ntohs(p->high); |
1349 | } | 1362 | } |
1350 | 1363 | ||
1364 | SET_ETHTOOL_OPS(dev, &vxlan_ethtool_ops); | ||
1365 | |||
1351 | err = register_netdevice(dev); | 1366 | err = register_netdevice(dev); |
1352 | if (!err) | 1367 | if (!err) |
1353 | hlist_add_head_rcu(&vxlan->hlist, vni_head(net, vxlan->vni)); | 1368 | hlist_add_head_rcu(&vxlan->hlist, vni_head(net, vxlan->vni)); |