Commit 6ce706a5 authored by Michal Kubecek's avatar Michal Kubecek Committed by David S. Miller

8390/etherh: convert to ethtool_{get, set}_link_ksettings

This is the last in-tree driver using the old {get,set}_settings API.

Note: this is only build tested. I don't have the hardware at hand; as it's
10Mb/s half duplex device and driver can be built only for one subplatform
of 32-bit ARM (Acorn RiscPC), it may be difficult to find someone who does.
Signed-off-by: default avatarMichal Kubecek <mkubecek@suse.cz>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7e3af593
...@@ -564,26 +564,29 @@ static void etherh_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *i ...@@ -564,26 +564,29 @@ static void etherh_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *i
sizeof(info->bus_info)); sizeof(info->bus_info));
} }
static int etherh_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) static int etherh_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{ {
cmd->supported = etherh_priv(dev)->supported; ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
ethtool_cmd_speed_set(cmd, SPEED_10); etherh_priv(dev)->supported);
cmd->duplex = DUPLEX_HALF; cmd->base.speed = SPEED_10;
cmd->port = dev->if_port == IF_PORT_10BASET ? PORT_TP : PORT_BNC; cmd->base.duplex = DUPLEX_HALF;
cmd->autoneg = (dev->flags & IFF_AUTOMEDIA ? cmd->base.port = dev->if_port == IF_PORT_10BASET ? PORT_TP : PORT_BNC;
AUTONEG_ENABLE : AUTONEG_DISABLE); cmd->base.autoneg = (dev->flags & IFF_AUTOMEDIA ? AUTONEG_ENABLE :
AUTONEG_DISABLE);
return 0; return 0;
} }
static int etherh_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) static int etherh_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{ {
switch (cmd->autoneg) { switch (cmd->base.autoneg) {
case AUTONEG_ENABLE: case AUTONEG_ENABLE:
dev->flags |= IFF_AUTOMEDIA; dev->flags |= IFF_AUTOMEDIA;
break; break;
case AUTONEG_DISABLE: case AUTONEG_DISABLE:
switch (cmd->port) { switch (cmd->base.port) {
case PORT_TP: case PORT_TP:
dev->if_port = IF_PORT_10BASET; dev->if_port = IF_PORT_10BASET;
break; break;
...@@ -622,12 +625,12 @@ static void etherh_set_msglevel(struct net_device *dev, u32 v) ...@@ -622,12 +625,12 @@ static void etherh_set_msglevel(struct net_device *dev, u32 v)
} }
static const struct ethtool_ops etherh_ethtool_ops = { static const struct ethtool_ops etherh_ethtool_ops = {
.get_settings = etherh_get_settings, .get_drvinfo = etherh_get_drvinfo,
.set_settings = etherh_set_settings, .get_ts_info = ethtool_op_get_ts_info,
.get_drvinfo = etherh_get_drvinfo, .get_msglevel = etherh_get_msglevel,
.get_ts_info = ethtool_op_get_ts_info, .set_msglevel = etherh_set_msglevel,
.get_msglevel = etherh_get_msglevel, .get_link_ksettings = etherh_get_link_ksettings,
.set_msglevel = etherh_set_msglevel, .set_link_ksettings = etherh_set_link_ksettings,
}; };
static const struct net_device_ops etherh_netdev_ops = { static const struct net_device_ops etherh_netdev_ops = {
......
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