Commit 2f718d64 authored by Yi Zou's avatar Yi Zou Committed by James Bottomley

[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: default avatarYi Zou <yi.zou@intel.com>
Signed-off-by: default avatarRobert Love <robert.w.love@intel.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent 5a84baea
...@@ -1635,29 +1635,25 @@ int fcoe_link_ok(struct fc_lport *lp) ...@@ -1635,29 +1635,25 @@ int fcoe_link_ok(struct fc_lport *lp)
struct fcoe_softc *fc = lport_priv(lp); struct fcoe_softc *fc = lport_priv(lp);
struct net_device *dev = fc->real_dev; struct net_device *dev = fc->real_dev;
struct ethtool_cmd ecmd = { ETHTOOL_GSET }; struct ethtool_cmd ecmd = { ETHTOOL_GSET };
int rc = 0;
if ((dev->flags & IFF_UP) && netif_carrier_ok(dev)) { if ((dev->flags & IFF_UP) && netif_carrier_ok(dev) &&
dev = fc->phys_dev; (!dev_ethtool_get_settings(dev, &ecmd))) {
if (dev->ethtool_ops->get_settings) { lp->link_supported_speeds &=
dev->ethtool_ops->get_settings(dev, &ecmd); ~(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT);
lp->link_supported_speeds &= if (ecmd.supported & (SUPPORTED_1000baseT_Half |
~(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT); SUPPORTED_1000baseT_Full))
if (ecmd.supported & (SUPPORTED_1000baseT_Half | lp->link_supported_speeds |= FC_PORTSPEED_1GBIT;
SUPPORTED_1000baseT_Full)) if (ecmd.supported & SUPPORTED_10000baseT_Full)
lp->link_supported_speeds |= FC_PORTSPEED_1GBIT; lp->link_supported_speeds |=
if (ecmd.supported & SUPPORTED_10000baseT_Full) FC_PORTSPEED_10GBIT;
lp->link_supported_speeds |= if (ecmd.speed == SPEED_1000)
FC_PORTSPEED_10GBIT; lp->link_speed = FC_PORTSPEED_1GBIT;
if (ecmd.speed == SPEED_1000) if (ecmd.speed == SPEED_10000)
lp->link_speed = FC_PORTSPEED_1GBIT; lp->link_speed = FC_PORTSPEED_10GBIT;
if (ecmd.speed == SPEED_10000)
lp->link_speed = FC_PORTSPEED_10GBIT;
}
} else
rc = -1;
return rc; return 0;
}
return -1;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment