diff options
author | Olaf Hering <olaf@aepfle.de> | 2007-08-25 14:32:59 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:50:54 -0400 |
commit | ced13330bb687780ce1d46f5404521cc0ea40481 (patch) | |
tree | 7591914fee64afb2436c023f29dc753cf19b35c6 | |
parent | 167f53d05fccb47b6eeadac7f6705b3f2f042d03 (diff) |
bmac: add simple ethtool support for network manager
NetworkManager will not start dhcpd on an interface unless it reports
link-up state via ethtool.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
-rw-r--r-- | drivers/net/bmac.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c index 9b8d7d9dbe86..1eb95b603004 100644 --- a/drivers/net/bmac.c +++ b/drivers/net/bmac.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/spinlock.h> | 19 | #include <linux/spinlock.h> |
20 | #include <linux/crc32.h> | 20 | #include <linux/crc32.h> |
21 | #include <linux/bitrev.h> | 21 | #include <linux/bitrev.h> |
22 | #include <linux/ethtool.h> | ||
22 | #include <asm/prom.h> | 23 | #include <asm/prom.h> |
23 | #include <asm/dbdma.h> | 24 | #include <asm/dbdma.h> |
24 | #include <asm/io.h> | 25 | #include <asm/io.h> |
@@ -1246,6 +1247,17 @@ static void bmac_reset_and_enable(struct net_device *dev) | |||
1246 | } | 1247 | } |
1247 | spin_unlock_irqrestore(&bp->lock, flags); | 1248 | spin_unlock_irqrestore(&bp->lock, flags); |
1248 | } | 1249 | } |
1250 | static void bmac_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) | ||
1251 | { | ||
1252 | struct bmac_data *bp = netdev_priv(dev); | ||
1253 | strcpy(info->driver, "bmac"); | ||
1254 | strcpy(info->bus_info, bp->mdev->ofdev.dev.bus_id); | ||
1255 | } | ||
1256 | |||
1257 | static const struct ethtool_ops bmac_ethtool_ops = { | ||
1258 | .get_drvinfo = bmac_get_drvinfo, | ||
1259 | .get_link = ethtool_op_get_link, | ||
1260 | }; | ||
1249 | 1261 | ||
1250 | static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_id *match) | 1262 | static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_id *match) |
1251 | { | 1263 | { |
@@ -1311,6 +1323,7 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i | |||
1311 | 1323 | ||
1312 | dev->open = bmac_open; | 1324 | dev->open = bmac_open; |
1313 | dev->stop = bmac_close; | 1325 | dev->stop = bmac_close; |
1326 | dev->ethtool_ops = &bmac_ethtool_ops; | ||
1314 | dev->hard_start_xmit = bmac_output; | 1327 | dev->hard_start_xmit = bmac_output; |
1315 | dev->get_stats = bmac_stats; | 1328 | dev->get_stats = bmac_stats; |
1316 | dev->set_multicast_list = bmac_set_multicast; | 1329 | dev->set_multicast_list = bmac_set_multicast; |