提交 9ce8c2df 编写于 作者: P Philippe Reynes 提交者: David S. Miller

net: ibm: ibmveth: 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.
Signed-off-by: NPhilippe Reynes <tremyfr@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 e4ccf764
...@@ -729,20 +729,26 @@ static int ibmveth_close(struct net_device *netdev) ...@@ -729,20 +729,26 @@ static int ibmveth_close(struct net_device *netdev)
return 0; return 0;
} }
static int netdev_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) static int netdev_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{ {
cmd->supported = (SUPPORTED_1000baseT_Full | SUPPORTED_Autoneg | u32 supported, advertising;
supported = (SUPPORTED_1000baseT_Full | SUPPORTED_Autoneg |
SUPPORTED_FIBRE); SUPPORTED_FIBRE);
cmd->advertising = (ADVERTISED_1000baseT_Full | ADVERTISED_Autoneg | advertising = (ADVERTISED_1000baseT_Full | ADVERTISED_Autoneg |
ADVERTISED_FIBRE); ADVERTISED_FIBRE);
ethtool_cmd_speed_set(cmd, SPEED_1000); cmd->base.speed = SPEED_1000;
cmd->duplex = DUPLEX_FULL; cmd->base.duplex = DUPLEX_FULL;
cmd->port = PORT_FIBRE; cmd->base.port = PORT_FIBRE;
cmd->phy_address = 0; cmd->base.phy_address = 0;
cmd->transceiver = XCVR_INTERNAL; cmd->base.autoneg = AUTONEG_ENABLE;
cmd->autoneg = AUTONEG_ENABLE;
cmd->maxtxpkt = 0; ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
cmd->maxrxpkt = 1; supported);
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,
advertising);
return 0; return 0;
} }
...@@ -978,11 +984,11 @@ static void ibmveth_get_ethtool_stats(struct net_device *dev, ...@@ -978,11 +984,11 @@ static void ibmveth_get_ethtool_stats(struct net_device *dev,
static const struct ethtool_ops netdev_ethtool_ops = { static const struct ethtool_ops netdev_ethtool_ops = {
.get_drvinfo = netdev_get_drvinfo, .get_drvinfo = netdev_get_drvinfo,
.get_settings = netdev_get_settings,
.get_link = ethtool_op_get_link, .get_link = ethtool_op_get_link,
.get_strings = ibmveth_get_strings, .get_strings = ibmveth_get_strings,
.get_sset_count = ibmveth_get_sset_count, .get_sset_count = ibmveth_get_sset_count,
.get_ethtool_stats = ibmveth_get_ethtool_stats, .get_ethtool_stats = ibmveth_get_ethtool_stats,
.get_link_ksettings = netdev_get_link_ksettings,
}; };
static int ibmveth_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) static int ibmveth_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册