diff options
Diffstat (limited to 'drivers/net/bonding/bond_main.c')
-rw-r--r-- | drivers/net/bonding/bond_main.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 4df674bc6f12..ca902ae3f2e5 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -631,7 +631,8 @@ down: | |||
631 | static int bond_update_speed_duplex(struct slave *slave) | 631 | static int bond_update_speed_duplex(struct slave *slave) |
632 | { | 632 | { |
633 | struct net_device *slave_dev = slave->dev; | 633 | struct net_device *slave_dev = slave->dev; |
634 | struct ethtool_cmd etool; | 634 | struct ethtool_cmd etool = { .cmd = ETHTOOL_GSET }; |
635 | u32 slave_speed; | ||
635 | int res; | 636 | int res; |
636 | 637 | ||
637 | /* Fake speed and duplex */ | 638 | /* Fake speed and duplex */ |
@@ -645,7 +646,8 @@ static int bond_update_speed_duplex(struct slave *slave) | |||
645 | if (res < 0) | 646 | if (res < 0) |
646 | return -1; | 647 | return -1; |
647 | 648 | ||
648 | switch (etool.speed) { | 649 | slave_speed = ethtool_cmd_speed(&etool); |
650 | switch (slave_speed) { | ||
649 | case SPEED_10: | 651 | case SPEED_10: |
650 | case SPEED_100: | 652 | case SPEED_100: |
651 | case SPEED_1000: | 653 | case SPEED_1000: |
@@ -663,7 +665,7 @@ static int bond_update_speed_duplex(struct slave *slave) | |||
663 | return -1; | 665 | return -1; |
664 | } | 666 | } |
665 | 667 | ||
666 | slave->speed = etool.speed; | 668 | slave->speed = slave_speed; |
667 | slave->duplex = etool.duplex; | 669 | slave->duplex = etool.duplex; |
668 | 670 | ||
669 | return 0; | 671 | return 0; |
@@ -2493,7 +2495,7 @@ static void bond_miimon_commit(struct bonding *bond) | |||
2493 | 2495 | ||
2494 | bond_update_speed_duplex(slave); | 2496 | bond_update_speed_duplex(slave); |
2495 | 2497 | ||
2496 | pr_info("%s: link status definitely up for interface %s, %d Mbps %s duplex.\n", | 2498 | pr_info("%s: link status definitely up for interface %s, %u Mbps %s duplex.\n", |
2497 | bond->dev->name, slave->dev->name, | 2499 | bond->dev->name, slave->dev->name, |
2498 | slave->speed, slave->duplex ? "full" : "half"); | 2500 | slave->speed, slave->duplex ? "full" : "half"); |
2499 | 2501 | ||
@@ -3339,7 +3341,7 @@ static int bond_slave_netdev_event(unsigned long event, | |||
3339 | 3341 | ||
3340 | slave = bond_get_slave_by_dev(bond, slave_dev); | 3342 | slave = bond_get_slave_by_dev(bond, slave_dev); |
3341 | if (slave) { | 3343 | if (slave) { |
3342 | u16 old_speed = slave->speed; | 3344 | u32 old_speed = slave->speed; |
3343 | u8 old_duplex = slave->duplex; | 3345 | u8 old_duplex = slave->duplex; |
3344 | 3346 | ||
3345 | bond_update_speed_duplex(slave); | 3347 | bond_update_speed_duplex(slave); |