提交 9856909c 编写于 作者: D David Decotigny 提交者: David S. Miller

net: bonding: use __ethtool_get_ksettings

Signed-off-by: NDavid Decotigny <decot@googlers.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 96a0c396
......@@ -376,22 +376,20 @@ int bond_set_carrier(struct bonding *bond)
static void bond_update_speed_duplex(struct slave *slave)
{
struct net_device *slave_dev = slave->dev;
struct ethtool_cmd ecmd;
u32 slave_speed;
struct ethtool_link_ksettings ecmd;
int res;
slave->speed = SPEED_UNKNOWN;
slave->duplex = DUPLEX_UNKNOWN;
res = __ethtool_get_settings(slave_dev, &ecmd);
res = __ethtool_get_link_ksettings(slave_dev, &ecmd);
if (res < 0)
return;
slave_speed = ethtool_cmd_speed(&ecmd);
if (slave_speed == 0 || slave_speed == ((__u32) -1))
if (ecmd.base.speed == 0 || ecmd.base.speed == ((__u32)-1))
return;
switch (ecmd.duplex) {
switch (ecmd.base.duplex) {
case DUPLEX_FULL:
case DUPLEX_HALF:
break;
......@@ -399,8 +397,8 @@ static void bond_update_speed_duplex(struct slave *slave)
return;
}
slave->speed = slave_speed;
slave->duplex = ecmd.duplex;
slave->speed = ecmd.base.speed;
slave->duplex = ecmd.base.duplex;
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册