Commit bb370568 authored by Philippe Reynes's avatar Philippe Reynes Committed by David S. Miller

net: cris: eth_v10: use new api ethtool_{get|set}_link_ksettings

The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

As I don't have the hardware, I'd be very pleased if
someone may test this patch.
Signed-off-by: default avatarPhilippe Reynes <tremyfr@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5dac9eaa
...@@ -1412,31 +1412,39 @@ e100_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) ...@@ -1412,31 +1412,39 @@ e100_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
return rc; return rc;
} }
static int e100_get_settings(struct net_device *dev, static int e100_get_link_ksettings(struct net_device *dev,
struct ethtool_cmd *cmd) struct ethtool_link_ksettings *cmd)
{ {
struct net_local *np = netdev_priv(dev); struct net_local *np = netdev_priv(dev);
u32 supported;
int err; int err;
spin_lock_irq(&np->lock); spin_lock_irq(&np->lock);
err = mii_ethtool_gset(&np->mii_if, cmd); err = mii_ethtool_get_link_ksettings(&np->mii_if, cmd);
spin_unlock_irq(&np->lock); spin_unlock_irq(&np->lock);
/* The PHY may support 1000baseT, but the Etrax100 does not. */ /* The PHY may support 1000baseT, but the Etrax100 does not. */
cmd->supported &= ~(SUPPORTED_1000baseT_Half ethtool_convert_link_mode_to_legacy_u32(&supported,
| SUPPORTED_1000baseT_Full); cmd->link_modes.supported);
supported &= ~(SUPPORTED_1000baseT_Half | SUPPORTED_1000baseT_Full);
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
supported);
return err; return err;
} }
static int e100_set_settings(struct net_device *dev, static int e100_set_link_ksettings(struct net_device *dev,
struct ethtool_cmd *ecmd) const struct ethtool_link_ksettings *ecmd)
{ {
if (ecmd->autoneg == AUTONEG_ENABLE) { if (ecmd->base.autoneg == AUTONEG_ENABLE) {
e100_set_duplex(dev, autoneg); e100_set_duplex(dev, autoneg);
e100_set_speed(dev, 0); e100_set_speed(dev, 0);
} else { } else {
e100_set_duplex(dev, ecmd->duplex == DUPLEX_HALF ? half : full); e100_set_duplex(dev, ecmd->base.duplex == DUPLEX_HALF ?
e100_set_speed(dev, ecmd->speed == SPEED_10 ? 10: 100); half : full);
e100_set_speed(dev, ecmd->base.speed == SPEED_10 ? 10 : 100);
} }
return 0; return 0;
...@@ -1459,11 +1467,11 @@ static int e100_nway_reset(struct net_device *dev) ...@@ -1459,11 +1467,11 @@ static int e100_nway_reset(struct net_device *dev)
} }
static const struct ethtool_ops e100_ethtool_ops = { static const struct ethtool_ops e100_ethtool_ops = {
.get_settings = e100_get_settings,
.set_settings = e100_set_settings,
.get_drvinfo = e100_get_drvinfo, .get_drvinfo = e100_get_drvinfo,
.nway_reset = e100_nway_reset, .nway_reset = e100_nway_reset,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_link_ksettings = e100_get_link_ksettings,
.set_link_ksettings = e100_set_link_ksettings,
}; };
static int static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment