Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
drivers/net/bfin_mac.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index fdd361c..8762b96 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -27,6 +27,7 @@
#include <linux/phy.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
+#include <linux/ethtool.h>
#include <linux/skbuff.h>
#include <linux/platform_device.h>
@@ -453,6 +454,51 @@ static int mii_probe(struct net_device *dev)
return 0;
}
+/*
+ * Ethtool support
+ */
+
+static int
+bfin_mac_ethtool_getsettings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+ struct bfin_mac_local *lp = netdev_priv(dev);
+
+ if (lp->phydev)
+ return phy_ethtool_gset(lp->phydev, cmd);
+
+ return -EINVAL;
+}
+
+static int
+bfin_mac_ethtool_setsettings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+ struct bfin_mac_local *lp = netdev_priv(dev);
+
+ if (!capable(CAP_NET_ADMIN))
+ return -EPERM;
+
+ if (lp->phydev)
+ return phy_ethtool_sset(lp->phydev, cmd);
+
+ return -EINVAL;
+}
+
+static void bfin_mac_ethtool_getdrvinfo(struct net_device *dev,
+ struct ethtool_drvinfo *info)
+{
+ strcpy(info->driver, DRV_NAME);
+ strcpy(info->version, DRV_VERSION);
+ strcpy(info->fw_version, "N/A");
+ strcpy(info->bus_info, dev->dev.bus_id);
+}
+
+static struct ethtool_ops bfin_mac_ethtool_ops = {
+ .get_settings = bfin_mac_ethtool_getsettings,
+ .set_settings = bfin_mac_ethtool_setsettings,
+ .get_link = ethtool_op_get_link,
+ .get_drvinfo = bfin_mac_ethtool_getdrvinfo,
+};
+
/**************************************************************************/
void setup_system_regs(struct net_device *dev)
{
@@ -996,6 +1042,7 @@ static int __init bfin_mac_probe(struct platform_device *pdev)
#ifdef CONFIG_NET_POLL_CONTROLLER
ndev->poll_controller = bfin_mac_poll;
#endif
+ ndev->ethtool_ops = &bfin_mac_ethtool_ops;
spin_lock_init(&lp->lock);
--
1.5.5
--
| Arjan van de Ven | [patch] Add basic sanity checks to the syscall execution patch |
| Ingo Molnar | Re: [patch] high-res timers: UP resume fix |
| Satyam Sharma | Re: 2.6.23-rc4-mm1 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
git: | |
| Eric Wong | Re: [RFC] Git config file reader in Perl (WIP) |
| Raimund Bauer | [wishlist] graphical diff |
| Junio C Hamano | Re: git-diff on touched files: bug or feature? |
| Steve | Re: Libification project (SoC) |
| François Rousseau | carp, ospf can't see carp state |
| Benjamin Bennett | Re: Multi-Threaded SSH/SCP made by university of Puttsburgh |
| Nuno Magalhães | Can't scp, ssh is slow to authenticate. |
| Brian | drm at vga1? |
| Olof Johansson | [PATCH 3/3] pasemi_mac: Disable interface on close |
| Ilpo Järvinen | Re: [bug] stuck localhost TCP connections, v2.6.26-rc3+ |
| Chris Snook | [RFC] introducing the Atheros L2 Fast Ethernet driver |
| Steven Whitehouse | My 802.3ad is my bond |
