1
0
Fork 0

net: bonding: use __ethtool_get_ksettings

Signed-off-by: David Decotigny <decot@googlers.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
hifive-unleashed-5.1
David Decotigny 2016-02-24 10:58:02 -08:00 committed by David S. Miller
parent 96a0c39633
commit 9856909c2a
1 changed files with 6 additions and 8 deletions

View File

@ -376,22 +376,20 @@ down:
static void bond_update_speed_duplex(struct slave *slave) static void bond_update_speed_duplex(struct slave *slave)
{ {
struct net_device *slave_dev = slave->dev; struct net_device *slave_dev = slave->dev;
struct ethtool_cmd ecmd; struct ethtool_link_ksettings ecmd;
u32 slave_speed;
int res; int res;
slave->speed = SPEED_UNKNOWN; slave->speed = SPEED_UNKNOWN;
slave->duplex = DUPLEX_UNKNOWN; slave->duplex = DUPLEX_UNKNOWN;
res = __ethtool_get_settings(slave_dev, &ecmd); res = __ethtool_get_link_ksettings(slave_dev, &ecmd);
if (res < 0) if (res < 0)
return; return;
slave_speed = ethtool_cmd_speed(&ecmd); if (ecmd.base.speed == 0 || ecmd.base.speed == ((__u32)-1))
if (slave_speed == 0 || slave_speed == ((__u32) -1))
return; return;
switch (ecmd.duplex) { switch (ecmd.base.duplex) {
case DUPLEX_FULL: case DUPLEX_FULL:
case DUPLEX_HALF: case DUPLEX_HALF:
break; break;
@ -399,8 +397,8 @@ static void bond_update_speed_duplex(struct slave *slave)
return; return;
} }
slave->speed = slave_speed; slave->speed = ecmd.base.speed;
slave->duplex = ecmd.duplex; slave->duplex = ecmd.base.duplex;
return; return;
} }