aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/files/drivers/net
diff options
context:
space:
mode:
authorPetr Štetiar <ynezz@true.cz>2019-05-25 00:24:35 +0200
committerPetr Štetiar <ynezz@true.cz>2019-06-05 10:12:30 +0200
commit206af613b2441f15bc469dea223ff6fa4e5aa55e (patch)
tree4c44587ba53b3fc689450a1a5439f65cb7076cbf /target/linux/ath79/files/drivers/net
parenteafe0611d9558a9c8ea74bdc91902f54074ea55b (diff)
downloadupstream-206af613b2441f15bc469dea223ff6fa4e5aa55e.tar.gz
upstream-206af613b2441f15bc469dea223ff6fa4e5aa55e.tar.bz2
upstream-206af613b2441f15bc469dea223ff6fa4e5aa55e.zip
ath79: ag71xx: update ethtool support
ethtool doesn't work currently as phy_ethtool_ioctl expects user space pointer, but it's being passed kernel one. Fixing it doesn't make sense as {s,g}et_settings were deprecated anyway. So let's rather remove phy_ethtool_ioctl and use new {s,g}et_link_ksettings instead. While at it, update nway_reset as well. Cc: John Crispin <john@phrozen.org> Ref: https://bugs.openwrt.org/index.php?do=details&task_id=1982 Signed-off-by: Petr Štetiar <ynezz@true.cz>
Diffstat (limited to 'target/linux/ath79/files/drivers/net')
-rw-r--r--target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c40
1 files changed, 14 insertions, 26 deletions
diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c
index 6f37fda387..2cd7b1be83 100644
--- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c
+++ b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ethtool.c
@@ -13,30 +13,6 @@
#include "ag71xx.h"
-static int ag71xx_ethtool_get_settings(struct net_device *dev,
- struct ethtool_cmd *cmd)
-{
- struct ag71xx *ag = netdev_priv(dev);
- struct phy_device *phydev = ag->phy_dev;
-
- if (!phydev)
- return -ENODEV;
-
- return phy_ethtool_ioctl(phydev, cmd);
-}
-
-static int ag71xx_ethtool_set_settings(struct net_device *dev,
- struct ethtool_cmd *cmd)
-{
- struct ag71xx *ag = netdev_priv(dev);
- struct phy_device *phydev = ag->phy_dev;
-
- if (!phydev)
- return -ENODEV;
-
- return phy_ethtool_ioctl(phydev, cmd);
-}
-
static u32 ag71xx_ethtool_get_msglevel(struct net_device *dev)
{
struct ag71xx *ag = netdev_priv(dev);
@@ -108,13 +84,25 @@ static int ag71xx_ethtool_set_ringparam(struct net_device *dev,
return err;
}
+static int ag71xx_ethtool_nway_reset(struct net_device *dev)
+{
+ struct ag71xx *ag = netdev_priv(dev);
+ struct phy_device *phydev = ag->phy_dev;
+
+ if (!phydev)
+ return -ENODEV;
+
+ return genphy_restart_aneg(phydev);
+}
+
struct ethtool_ops ag71xx_ethtool_ops = {
- .set_settings = ag71xx_ethtool_set_settings,
- .get_settings = ag71xx_ethtool_get_settings,
.get_msglevel = ag71xx_ethtool_get_msglevel,
.set_msglevel = ag71xx_ethtool_set_msglevel,
.get_ringparam = ag71xx_ethtool_get_ringparam,
.set_ringparam = ag71xx_ethtool_set_ringparam,
+ .get_link_ksettings = phy_ethtool_get_link_ksettings,
+ .set_link_ksettings = phy_ethtool_set_link_ksettings,
.get_link = ethtool_op_get_link,
.get_ts_info = ethtool_op_get_ts_info,
+ .nway_reset = ag71xx_ethtool_nway_reset,
};