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

net: microchip: enc28j60: 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 2fb93a1a
...@@ -1487,27 +1487,30 @@ enc28j60_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info) ...@@ -1487,27 +1487,30 @@ enc28j60_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
} }
static int static int
enc28j60_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) enc28j60_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{ {
struct enc28j60_net *priv = netdev_priv(dev); struct enc28j60_net *priv = netdev_priv(dev);
cmd->transceiver = XCVR_INTERNAL; ethtool_link_ksettings_zero_link_mode(cmd, supported);
cmd->supported = SUPPORTED_10baseT_Half ethtool_link_ksettings_add_link_mode(cmd, supported, 10baseT_Half);
| SUPPORTED_10baseT_Full ethtool_link_ksettings_add_link_mode(cmd, supported, 10baseT_Full);
| SUPPORTED_TP; ethtool_link_ksettings_add_link_mode(cmd, supported, TP);
ethtool_cmd_speed_set(cmd, SPEED_10);
cmd->duplex = priv->full_duplex ? DUPLEX_FULL : DUPLEX_HALF; cmd->base.speed = SPEED_10;
cmd->port = PORT_TP; cmd->base.duplex = priv->full_duplex ? DUPLEX_FULL : DUPLEX_HALF;
cmd->autoneg = AUTONEG_DISABLE; cmd->base.port = PORT_TP;
cmd->base.autoneg = AUTONEG_DISABLE;
return 0; return 0;
} }
static int static int
enc28j60_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) enc28j60_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{ {
return enc28j60_setlink(dev, cmd->autoneg, return enc28j60_setlink(dev, cmd->base.autoneg,
ethtool_cmd_speed(cmd), cmd->duplex); cmd->base.speed, cmd->base.duplex);
} }
static u32 enc28j60_get_msglevel(struct net_device *dev) static u32 enc28j60_get_msglevel(struct net_device *dev)
...@@ -1523,11 +1526,11 @@ static void enc28j60_set_msglevel(struct net_device *dev, u32 val) ...@@ -1523,11 +1526,11 @@ static void enc28j60_set_msglevel(struct net_device *dev, u32 val)
} }
static const struct ethtool_ops enc28j60_ethtool_ops = { static const struct ethtool_ops enc28j60_ethtool_ops = {
.get_settings = enc28j60_get_settings,
.set_settings = enc28j60_set_settings,
.get_drvinfo = enc28j60_get_drvinfo, .get_drvinfo = enc28j60_get_drvinfo,
.get_msglevel = enc28j60_get_msglevel, .get_msglevel = enc28j60_get_msglevel,
.set_msglevel = enc28j60_set_msglevel, .set_msglevel = enc28j60_set_msglevel,
.get_link_ksettings = enc28j60_get_link_ksettings,
.set_link_ksettings = enc28j60_set_link_ksettings,
}; };
static int enc28j60_chipset_init(struct net_device *dev) static int enc28j60_chipset_init(struct net_device *dev)
......
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