net: veth: use new api ethtool_{get|set}_link_ksettings
authorPhilippe Reynes <tremyfr@gmail.com>
Wed, 29 Mar 2017 06:24:21 +0000 (08:24 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Mar 2017 21:07:22 +0000 (14:07 -0700)
The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/veth.c

index 8c39d6d690e5e7f8ea6e522b8eb01a2db550c61a..317103680675f97eb056e650d5adc07fe51f67e2 100644 (file)
@@ -45,18 +45,13 @@ static struct {
        { "peer_ifindex" },
 };
 
-static int veth_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+static int veth_get_link_ksettings(struct net_device *dev,
+                                  struct ethtool_link_ksettings *cmd)
 {
-       cmd->supported          = 0;
-       cmd->advertising        = 0;
-       ethtool_cmd_speed_set(cmd, SPEED_10000);
-       cmd->duplex             = DUPLEX_FULL;
-       cmd->port               = PORT_TP;
-       cmd->phy_address        = 0;
-       cmd->transceiver        = XCVR_INTERNAL;
-       cmd->autoneg            = AUTONEG_DISABLE;
-       cmd->maxtxpkt           = 0;
-       cmd->maxrxpkt           = 0;
+       cmd->base.speed         = SPEED_10000;
+       cmd->base.duplex        = DUPLEX_FULL;
+       cmd->base.port          = PORT_TP;
+       cmd->base.autoneg       = AUTONEG_DISABLE;
        return 0;
 }
 
@@ -95,12 +90,12 @@ static void veth_get_ethtool_stats(struct net_device *dev,
 }
 
 static const struct ethtool_ops veth_ethtool_ops = {
-       .get_settings           = veth_get_settings,
        .get_drvinfo            = veth_get_drvinfo,
        .get_link               = ethtool_op_get_link,
        .get_strings            = veth_get_strings,
        .get_sset_count         = veth_get_sset_count,
        .get_ethtool_stats      = veth_get_ethtool_stats,
+       .get_link_ksettings     = veth_get_link_ksettings,
 };
 
 static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)