]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: qlogic: qlge: use new api ethtool_{get|set}_link_ksettings
authorPhilippe Reynes <tremyfr@gmail.com>
Sun, 19 Feb 2017 22:21:41 +0000 (23:21 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 20 Feb 2017 16:22:19 +0000 (11:22 -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/qlogic/qlge/qlge_ethtool.c

index 5dade1fd08b8656be02cfb9a79ea20176989a29f..31f40148fa5cbab05d03a178593a667ce517c5e0 100644 (file)
@@ -375,28 +375,34 @@ ql_get_ethtool_stats(struct net_device *ndev,
        }
 }
 
-static int ql_get_settings(struct net_device *ndev,
-                             struct ethtool_cmd *ecmd)
+static int ql_get_link_ksettings(struct net_device *ndev,
+                                struct ethtool_link_ksettings *ecmd)
 {
        struct ql_adapter *qdev = netdev_priv(ndev);
+       u32 supported, advertising;
+
+       supported = SUPPORTED_10000baseT_Full;
+       advertising = ADVERTISED_10000baseT_Full;
 
-       ecmd->supported = SUPPORTED_10000baseT_Full;
-       ecmd->advertising = ADVERTISED_10000baseT_Full;
-       ecmd->transceiver = XCVR_EXTERNAL;
        if ((qdev->link_status & STS_LINK_TYPE_MASK) ==
                                STS_LINK_TYPE_10GBASET) {
-               ecmd->supported |= (SUPPORTED_TP | SUPPORTED_Autoneg);
-               ecmd->advertising |= (ADVERTISED_TP | ADVERTISED_Autoneg);
-               ecmd->port = PORT_TP;
-               ecmd->autoneg = AUTONEG_ENABLE;
+               supported |= (SUPPORTED_TP | SUPPORTED_Autoneg);
+               advertising |= (ADVERTISED_TP | ADVERTISED_Autoneg);
+               ecmd->base.port = PORT_TP;
+               ecmd->base.autoneg = AUTONEG_ENABLE;
        } else {
-               ecmd->supported |= SUPPORTED_FIBRE;
-               ecmd->advertising |= ADVERTISED_FIBRE;
-               ecmd->port = PORT_FIBRE;
+               supported |= SUPPORTED_FIBRE;
+               advertising |= ADVERTISED_FIBRE;
+               ecmd->base.port = PORT_FIBRE;
        }
 
-       ethtool_cmd_speed_set(ecmd, SPEED_10000);
-       ecmd->duplex = DUPLEX_FULL;
+       ecmd->base.speed = SPEED_10000;
+       ecmd->base.duplex = DUPLEX_FULL;
+
+       ethtool_convert_legacy_u32_to_link_mode(ecmd->link_modes.supported,
+                                               supported);
+       ethtool_convert_legacy_u32_to_link_mode(ecmd->link_modes.advertising,
+                                               advertising);
 
        return 0;
 }
@@ -706,7 +712,6 @@ static void ql_set_msglevel(struct net_device *ndev, u32 value)
 }
 
 const struct ethtool_ops qlge_ethtool_ops = {
-       .get_settings = ql_get_settings,
        .get_drvinfo = ql_get_drvinfo,
        .get_wol = ql_get_wol,
        .set_wol = ql_set_wol,
@@ -724,5 +729,6 @@ const struct ethtool_ops qlge_ethtool_ops = {
        .get_sset_count = ql_get_sset_count,
        .get_strings = ql_get_strings,
        .get_ethtool_stats = ql_get_ethtool_stats,
+       .get_link_ksettings = ql_get_link_ksettings,
 };