netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2400m: minimal ethtool support
@ 2009-09-17 20:06 Dan Williams
  2009-09-18 19:57 ` Inaky Perez-Gonzalez
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Williams @ 2009-09-17 20:06 UTC (permalink / raw)
  To: Inaky Perez-Gonzalez; +Cc: wimax@linuxwimax.org, netdev

Add minimal ethtool support for carrier detection.

Signed-off-by: Dan Williams <dcbw@redhat.com>


diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c
index 9653f47..c915775 100644
--- a/drivers/net/wimax/i2400m/netdev.c
+++ b/drivers/net/wimax/i2400m/netdev.c
@@ -74,6 +74,7 @@
  */
 #include <linux/if_arp.h>
 #include <linux/netdevice.h>
+#include <linux/ethtool.h>
 #include "i2400m.h"
 
 
@@ -559,6 +560,22 @@ static const struct net_device_ops i2400m_netdev_ops = {
 	.ndo_change_mtu = i2400m_change_mtu,
 };
 
+static void i2400m_get_drvinfo(struct net_device *net_dev,
+			       struct ethtool_drvinfo *info)
+{
+	struct i2400m *i2400m = net_dev_to_i2400m(net_dev);
+
+	strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver) - 1);
+	strncpy(info->fw_version, i2400m->fw_name, sizeof(info->fw_version) - 1);
+	if (net_dev->dev.parent)
+		strncpy(info->bus_info, dev_name(net_dev->dev.parent),
+			sizeof(info->bus_info) - 1);
+}
+
+static const struct ethtool_ops i2400m_ethtool_ops = {
+	.get_drvinfo = i2400m_get_drvinfo,
+	.get_link = ethtool_op_get_link,
+};
 
 /**
  * i2400m_netdev_setup - Setup setup @net_dev's i2400m private data
@@ -580,6 +597,7 @@ void i2400m_netdev_setup(struct net_device *net_dev)
 		   & ~IFF_MULTICAST);
 	net_dev->watchdog_timeo = I2400M_TX_TIMEOUT;
 	net_dev->netdev_ops = &i2400m_netdev_ops;
+	net_dev->ethtool_ops = &i2400m_ethtool_ops;
 	d_fnend(3, NULL, "(net_dev %p) = void\n", net_dev);
 }
 EXPORT_SYMBOL_GPL(i2400m_netdev_setup);


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] i2400m: minimal ethtool support
  2009-09-17 20:06 [PATCH] i2400m: minimal ethtool support Dan Williams
@ 2009-09-18 19:57 ` Inaky Perez-Gonzalez
  0 siblings, 0 replies; 2+ messages in thread
From: Inaky Perez-Gonzalez @ 2009-09-18 19:57 UTC (permalink / raw)
  To: Dan Williams; +Cc: netdev, wimax@linuxwimax.org

On Thu, 2009-09-17 at 13:06 -0700, Dan Williams wrote:
> Add minimal ethtool support for carrier detection.
> 
> Signed-off-by: Dan Williams <dcbw@redhat.com>

Merged, thanks

-- 
-- Inaky

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-18 19:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-17 20:06 [PATCH] i2400m: minimal ethtool support Dan Williams
2009-09-18 19:57 ` Inaky Perez-Gonzalez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).