net: fjes: 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:
Philippe Reynes 2017-03-08 23:16:11 +01:00 committed by David S. Miller
parent 92f4a13efd
commit 031e51445a
1 changed files with 9 additions and 10 deletions

View File

@ -175,16 +175,15 @@ static void fjes_get_drvinfo(struct net_device *netdev,
"platform:%s", plat_dev->name); "platform:%s", plat_dev->name);
} }
static int fjes_get_settings(struct net_device *netdev, static int fjes_get_link_ksettings(struct net_device *netdev,
struct ethtool_cmd *ecmd) struct ethtool_link_ksettings *ecmd)
{ {
ecmd->supported = 0; ethtool_link_ksettings_zero_link_mode(ecmd, supported);
ecmd->advertising = 0; ethtool_link_ksettings_zero_link_mode(ecmd, advertising);
ecmd->duplex = DUPLEX_FULL; ecmd->base.duplex = DUPLEX_FULL;
ecmd->autoneg = AUTONEG_DISABLE; ecmd->base.autoneg = AUTONEG_DISABLE;
ecmd->transceiver = XCVR_DUMMY1; ecmd->base.port = PORT_NONE;
ecmd->port = PORT_NONE; ecmd->base.speed = 20000; /* 20Gb/s */
ethtool_cmd_speed_set(ecmd, 20000); /* 20Gb/s */
return 0; return 0;
} }
@ -296,7 +295,6 @@ static int fjes_get_dump_data(struct net_device *netdev,
} }
static const struct ethtool_ops fjes_ethtool_ops = { static const struct ethtool_ops fjes_ethtool_ops = {
.get_settings = fjes_get_settings,
.get_drvinfo = fjes_get_drvinfo, .get_drvinfo = fjes_get_drvinfo,
.get_ethtool_stats = fjes_get_ethtool_stats, .get_ethtool_stats = fjes_get_ethtool_stats,
.get_strings = fjes_get_strings, .get_strings = fjes_get_strings,
@ -306,6 +304,7 @@ static const struct ethtool_ops fjes_ethtool_ops = {
.set_dump = fjes_set_dump, .set_dump = fjes_set_dump,
.get_dump_flag = fjes_get_dump_flag, .get_dump_flag = fjes_get_dump_flag,
.get_dump_data = fjes_get_dump_data, .get_dump_data = fjes_get_dump_data,
.get_link_ksettings = fjes_get_link_ksettings,
}; };
void fjes_set_ethtool_ops(struct net_device *netdev) void fjes_set_ethtool_ops(struct net_device *netdev)