diff options
author | Dan Williams <dcbw@redhat.com> | 2009-09-17 16:06:14 -0400 |
---|---|---|
committer | Inaky Perez-Gonzalez <inaky@linux.intel.com> | 2009-10-19 02:55:37 -0400 |
commit | abb307338396bd58f5d9d32c4e56ef40ff668a74 (patch) | |
tree | bcdab73e66735c613d67cee9cba3356b796013ac /drivers | |
parent | 2d44f204adf503eb1774f0ab7e404031168851ea (diff) |
i2400m: minimal ethtool support
Add minimal ethtool support for carrier detection.
Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wimax/i2400m/netdev.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c index 796396cb4c82..960fb5467546 100644 --- a/drivers/net/wimax/i2400m/netdev.c +++ b/drivers/net/wimax/i2400m/netdev.c | |||
@@ -74,6 +74,7 @@ | |||
74 | */ | 74 | */ |
75 | #include <linux/if_arp.h> | 75 | #include <linux/if_arp.h> |
76 | #include <linux/netdevice.h> | 76 | #include <linux/netdevice.h> |
77 | #include <linux/ethtool.h> | ||
77 | #include "i2400m.h" | 78 | #include "i2400m.h" |
78 | 79 | ||
79 | 80 | ||
@@ -559,6 +560,22 @@ static const struct net_device_ops i2400m_netdev_ops = { | |||
559 | .ndo_change_mtu = i2400m_change_mtu, | 560 | .ndo_change_mtu = i2400m_change_mtu, |
560 | }; | 561 | }; |
561 | 562 | ||
563 | static void i2400m_get_drvinfo(struct net_device *net_dev, | ||
564 | struct ethtool_drvinfo *info) | ||
565 | { | ||
566 | struct i2400m *i2400m = net_dev_to_i2400m(net_dev); | ||
567 | |||
568 | strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver) - 1); | ||
569 | strncpy(info->fw_version, i2400m->fw_name, sizeof(info->fw_version) - 1); | ||
570 | if (net_dev->dev.parent) | ||
571 | strncpy(info->bus_info, dev_name(net_dev->dev.parent), | ||
572 | sizeof(info->bus_info) - 1); | ||
573 | } | ||
574 | |||
575 | static const struct ethtool_ops i2400m_ethtool_ops = { | ||
576 | .get_drvinfo = i2400m_get_drvinfo, | ||
577 | .get_link = ethtool_op_get_link, | ||
578 | }; | ||
562 | 579 | ||
563 | /** | 580 | /** |
564 | * i2400m_netdev_setup - Setup setup @net_dev's i2400m private data | 581 | * i2400m_netdev_setup - Setup setup @net_dev's i2400m private data |
@@ -580,6 +597,7 @@ void i2400m_netdev_setup(struct net_device *net_dev) | |||
580 | & ~IFF_MULTICAST); | 597 | & ~IFF_MULTICAST); |
581 | net_dev->watchdog_timeo = I2400M_TX_TIMEOUT; | 598 | net_dev->watchdog_timeo = I2400M_TX_TIMEOUT; |
582 | net_dev->netdev_ops = &i2400m_netdev_ops; | 599 | net_dev->netdev_ops = &i2400m_netdev_ops; |
600 | net_dev->ethtool_ops = &i2400m_ethtool_ops; | ||
583 | d_fnend(3, NULL, "(net_dev %p) = void\n", net_dev); | 601 | d_fnend(3, NULL, "(net_dev %p) = void\n", net_dev); |
584 | } | 602 | } |
585 | EXPORT_SYMBOL_GPL(i2400m_netdev_setup); | 603 | EXPORT_SYMBOL_GPL(i2400m_netdev_setup); |