net: usb: catc: 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: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3c9b803b87
commit
de1e98c69b
|
@ -688,29 +688,34 @@ static void catc_get_drvinfo(struct net_device *dev,
|
||||||
usb_make_path(catc->usbdev, info->bus_info, sizeof(info->bus_info));
|
usb_make_path(catc->usbdev, info->bus_info, sizeof(info->bus_info));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int catc_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
static int catc_get_link_ksettings(struct net_device *dev,
|
||||||
|
struct ethtool_link_ksettings *cmd)
|
||||||
{
|
{
|
||||||
struct catc *catc = netdev_priv(dev);
|
struct catc *catc = netdev_priv(dev);
|
||||||
if (!catc->is_f5u011)
|
if (!catc->is_f5u011)
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
cmd->supported = SUPPORTED_10baseT_Half | SUPPORTED_TP;
|
ethtool_link_ksettings_zero_link_mode(cmd, supported);
|
||||||
cmd->advertising = ADVERTISED_10baseT_Half | ADVERTISED_TP;
|
ethtool_link_ksettings_add_link_mode(cmd, supported, 10baseT_Half);
|
||||||
ethtool_cmd_speed_set(cmd, SPEED_10);
|
ethtool_link_ksettings_add_link_mode(cmd, supported, TP);
|
||||||
cmd->duplex = DUPLEX_HALF;
|
|
||||||
cmd->port = PORT_TP;
|
ethtool_link_ksettings_zero_link_mode(cmd, advertising);
|
||||||
cmd->phy_address = 0;
|
ethtool_link_ksettings_add_link_mode(cmd, advertising, 10baseT_Half);
|
||||||
cmd->transceiver = XCVR_INTERNAL;
|
ethtool_link_ksettings_add_link_mode(cmd, advertising, TP);
|
||||||
cmd->autoneg = AUTONEG_DISABLE;
|
|
||||||
cmd->maxtxpkt = 1;
|
cmd->base.speed = SPEED_10;
|
||||||
cmd->maxrxpkt = 1;
|
cmd->base.duplex = DUPLEX_HALF;
|
||||||
|
cmd->base.port = PORT_TP;
|
||||||
|
cmd->base.phy_address = 0;
|
||||||
|
cmd->base.autoneg = AUTONEG_DISABLE;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct ethtool_ops ops = {
|
static const struct ethtool_ops ops = {
|
||||||
.get_drvinfo = catc_get_drvinfo,
|
.get_drvinfo = catc_get_drvinfo,
|
||||||
.get_settings = catc_get_settings,
|
.get_link = ethtool_op_get_link,
|
||||||
.get_link = ethtool_op_get_link
|
.get_link_ksettings = catc_get_link_ksettings,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue