Skip to content

Commit d46b634

Browse files
Philippe Reynesdavem330
authored andcommitted
net: bonding: 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: Philippe Reynes <tremyfr@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2701c3b commit d46b634

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4080,16 +4080,16 @@ static netdev_tx_t bond_start_xmit(struct sk_buff *skb, struct net_device *dev)
40804080
return ret;
40814081
}
40824082

4083-
static int bond_ethtool_get_settings(struct net_device *bond_dev,
4084-
struct ethtool_cmd *ecmd)
4083+
static int bond_ethtool_get_link_ksettings(struct net_device *bond_dev,
4084+
struct ethtool_link_ksettings *cmd)
40854085
{
40864086
struct bonding *bond = netdev_priv(bond_dev);
40874087
unsigned long speed = 0;
40884088
struct list_head *iter;
40894089
struct slave *slave;
40904090

4091-
ecmd->duplex = DUPLEX_UNKNOWN;
4092-
ecmd->port = PORT_OTHER;
4091+
cmd->base.duplex = DUPLEX_UNKNOWN;
4092+
cmd->base.port = PORT_OTHER;
40934093

40944094
/* Since bond_slave_can_tx returns false for all inactive or down slaves, we
40954095
* do not need to check mode. Though link speed might not represent
@@ -4100,12 +4100,12 @@ static int bond_ethtool_get_settings(struct net_device *bond_dev,
41004100
if (bond_slave_can_tx(slave)) {
41014101
if (slave->speed != SPEED_UNKNOWN)
41024102
speed += slave->speed;
4103-
if (ecmd->duplex == DUPLEX_UNKNOWN &&
4103+
if (cmd->base.duplex == DUPLEX_UNKNOWN &&
41044104
slave->duplex != DUPLEX_UNKNOWN)
4105-
ecmd->duplex = slave->duplex;
4105+
cmd->base.duplex = slave->duplex;
41064106
}
41074107
}
4108-
ethtool_cmd_speed_set(ecmd, speed ? : SPEED_UNKNOWN);
4108+
cmd->base.speed = speed ? : SPEED_UNKNOWN;
41094109

41104110
return 0;
41114111
}
@@ -4121,8 +4121,8 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
41214121

41224122
static const struct ethtool_ops bond_ethtool_ops = {
41234123
.get_drvinfo = bond_ethtool_get_drvinfo,
4124-
.get_settings = bond_ethtool_get_settings,
41254124
.get_link = ethtool_op_get_link,
4125+
.get_link_ksettings = bond_ethtool_get_link_ksettings,
41264126
};
41274127

41284128
static const struct net_device_ops bond_netdev_ops = {

0 commit comments

Comments
 (0)