aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zou <yi.zou@intel.com>2009-07-29 20:04:01 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-08-22 18:52:03 -0400
commit2f718d64ecc7010463d36e6ec4ae37778d03fc0b (patch)
treedb77e1b3ac45cbc8298d05a078b3431eb5af9d7c
parent5a84baeaf7b8bb4188219140cb326a3e859b2312 (diff)
[SCSI] fcoe: Call dev_ethtool_get_settings() in fcoe_link_ok
No need to check phys_dev here, just call dev_ethtool_get_settings() directly will take care of this. Signed-off-by: Yi Zou <yi.zou@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/fcoe/fcoe.c38
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/**