2 * Atheros AR71xx built-in ethernet mac driver
4 * Copyright (C) 2008 Gabor Juhos <juhosg@openwrt.org>
5 * Copyright (C) 2008 Imre Kaloz <kaloz@openwrt.org>
7 * Based on Atheros' AG7100 driver
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation.
16 static int ag71xx_ethtool_get_settings(struct net_device *dev,
17 struct ethtool_cmd *cmd)
19 struct ag71xx *ag = netdev_priv(dev);
20 struct phy_device *phydev = ag->phy_dev;
25 return phy_ethtool_gset(phydev, cmd);
28 static int ag71xx_ethtool_set_settings(struct net_device *dev,
29 struct ethtool_cmd *cmd)
31 struct ag71xx *ag = netdev_priv(dev);
32 struct phy_device *phydev = ag->phy_dev;
37 return phy_ethtool_sset(phydev, cmd);
40 static void ag71xx_ethtool_get_drvinfo(struct net_device *dev,
41 struct ethtool_drvinfo *info)
43 struct ag71xx *ag = netdev_priv(dev);
45 strcpy(info->driver, ag->pdev->dev.driver->name);
46 strcpy(info->version, AG71XX_DRV_VERSION);
47 strcpy(info->bus_info, ag->pdev->dev.bus_id);
50 struct ethtool_ops ag71xx_ethtool_ops = {
51 .set_settings = ag71xx_ethtool_set_settings,
52 .get_settings = ag71xx_ethtool_get_settings,
53 .get_drvinfo = ag71xx_ethtool_get_drvinfo,
54 .get_link = ethtool_op_get_link,