net: qualcomm: qca: use new api ethtool_{get|set}_link_ksettings
authorPhilippe Reynes <tremyfr@gmail.com>
Mon, 20 Feb 2017 21:59:13 +0000 (22:59 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Feb 2017 03:19:08 +0000 (22:19 -0500)
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>
drivers/net/ethernet/qualcomm/qca_debug.c

index 8e28234dddad3e8b58f6377ea21cc637f27ea8ac..d145df98feffbca8e76cebff04be6955f5c3b324 100644 (file)
@@ -188,14 +188,16 @@ qcaspi_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *p)
 }
 
 static int
-qcaspi_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+qcaspi_get_link_ksettings(struct net_device *dev,
+                         struct ethtool_link_ksettings *cmd)
 {
-       cmd->transceiver = XCVR_INTERNAL;
-       cmd->supported = SUPPORTED_10baseT_Half;
-       ethtool_cmd_speed_set(cmd,  SPEED_10);
-       cmd->duplex = DUPLEX_HALF;
-       cmd->port = PORT_OTHER;
-       cmd->autoneg = AUTONEG_DISABLE;
+       ethtool_link_ksettings_zero_link_mode(cmd, supported);
+       ethtool_link_ksettings_add_link_mode(cmd, supported, 10baseT_Half);
+
+       cmd->base.speed = SPEED_10;
+       cmd->base.duplex = DUPLEX_HALF;
+       cmd->base.port = PORT_OTHER;
+       cmd->base.autoneg = AUTONEG_DISABLE;
 
        return 0;
 }
@@ -295,7 +297,6 @@ qcaspi_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ring)
 static const struct ethtool_ops qcaspi_ethtool_ops = {
        .get_drvinfo = qcaspi_get_drvinfo,
        .get_link = ethtool_op_get_link,
-       .get_settings = qcaspi_get_settings,
        .get_ethtool_stats = qcaspi_get_ethtool_stats,
        .get_strings = qcaspi_get_strings,
        .get_sset_count = qcaspi_get_sset_count,
@@ -303,6 +304,7 @@ static const struct ethtool_ops qcaspi_ethtool_ops = {
        .get_regs = qcaspi_get_regs,
        .get_ringparam = qcaspi_get_ringparam,
        .set_ringparam = qcaspi_set_ringparam,
+       .get_link_ksettings = qcaspi_get_link_ksettings,
 };
 
 void qcaspi_set_ethtool_ops(struct net_device *dev)