diff options
Diffstat (limited to 'drivers/scsi/fcoe/fcoe.c')
-rw-r--r-- | drivers/scsi/fcoe/fcoe.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c index b7dfc6ebed36..81601269f4cd 100644 --- a/drivers/scsi/fcoe/fcoe.c +++ b/drivers/scsi/fcoe/fcoe.c | |||
@@ -1635,29 +1635,25 @@ int fcoe_link_ok(struct fc_lport *lp) | |||
1635 | struct fcoe_softc *fc = lport_priv(lp); | 1635 | struct fcoe_softc *fc = lport_priv(lp); |
1636 | struct net_device *dev = fc->real_dev; | 1636 | struct net_device *dev = fc->real_dev; |
1637 | struct ethtool_cmd ecmd = { ETHTOOL_GSET }; | 1637 | struct ethtool_cmd ecmd = { ETHTOOL_GSET }; |
1638 | int rc = 0; | ||
1639 | 1638 | ||
1640 | if ((dev->flags & IFF_UP) && netif_carrier_ok(dev)) { | 1639 | if ((dev->flags & IFF_UP) && netif_carrier_ok(dev) && |
1641 | dev = fc->phys_dev; | 1640 | (!dev_ethtool_get_settings(dev, &ecmd))) { |
1642 | if (dev->ethtool_ops->get_settings) { | 1641 | lp->link_supported_speeds &= |
1643 | dev->ethtool_ops->get_settings(dev, &ecmd); | 1642 | ~(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT); |
1644 | lp->link_supported_speeds &= | 1643 | if (ecmd.supported & (SUPPORTED_1000baseT_Half | |
1645 | ~(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT); | 1644 | SUPPORTED_1000baseT_Full)) |
1646 | if (ecmd.supported & (SUPPORTED_1000baseT_Half | | 1645 | lp->link_supported_speeds |= FC_PORTSPEED_1GBIT; |
1647 | SUPPORTED_1000baseT_Full)) | 1646 | if (ecmd.supported & SUPPORTED_10000baseT_Full) |
1648 | lp->link_supported_speeds |= FC_PORTSPEED_1GBIT; | 1647 | lp->link_supported_speeds |= |
1649 | if (ecmd.supported & SUPPORTED_10000baseT_Full) | 1648 | FC_PORTSPEED_10GBIT; |
1650 | lp->link_supported_speeds |= | 1649 | if (ecmd.speed == SPEED_1000) |
1651 | FC_PORTSPEED_10GBIT; | 1650 | lp->link_speed = FC_PORTSPEED_1GBIT; |
1652 | if (ecmd.speed == SPEED_1000) | 1651 | if (ecmd.speed == SPEED_10000) |
1653 | lp->link_speed = FC_PORTSPEED_1GBIT; | 1652 | lp->link_speed = FC_PORTSPEED_10GBIT; |
1654 | if (ecmd.speed == SPEED_10000) | ||
1655 | lp->link_speed = FC_PORTSPEED_10GBIT; | ||
1656 | } | ||
1657 | } else | ||
1658 | rc = -1; | ||
1659 | 1653 | ||
1660 | return rc; | 1654 | return 0; |
1655 | } | ||
1656 | return -1; | ||
1661 | } | 1657 | } |
1662 | 1658 | ||
1663 | /** | 1659 | /** |