diff options
author | Yi Zou <yi.zou@intel.com> | 2012-12-06 01:24:44 -0500 |
---|---|---|
committer | Robert Love <robert.w.love@intel.com> | 2012-12-14 13:38:56 -0500 |
commit | 0e0f9cd6a80dc883dab4c82c17edc1abe485cbd9 (patch) | |
tree | 7041f30b62a09690f8738ce9e0f7088883a64627 /drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |
parent | c3d7909b865274ffa74fa2715c6663caa51a80e1 (diff) |
bnx2fc: use fcoe_link_speed_update() from the exported symbol in libfcoe
We have fcoe_link_speed_update() in libfcoe ready for use now, take out the
bnx2fc version which is almost the same.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Cc: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Tested-by: Marcus Dennis <marcusx.e.dennis@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc_fcoe.c')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 9b9ccc94e7ae..a1c687c699ee 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |||
@@ -738,35 +738,6 @@ static int bnx2fc_shost_config(struct fc_lport *lport, struct device *dev) | |||
738 | return 0; | 738 | return 0; |
739 | } | 739 | } |
740 | 740 | ||
741 | static void bnx2fc_link_speed_update(struct fc_lport *lport) | ||
742 | { | ||
743 | struct fcoe_port *port = lport_priv(lport); | ||
744 | struct bnx2fc_interface *interface = port->priv; | ||
745 | struct net_device *netdev = interface->netdev; | ||
746 | struct ethtool_cmd ecmd; | ||
747 | |||
748 | if (!__ethtool_get_settings(netdev, &ecmd)) { | ||
749 | lport->link_supported_speeds &= | ||
750 | ~(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT); | ||
751 | if (ecmd.supported & (SUPPORTED_1000baseT_Half | | ||
752 | SUPPORTED_1000baseT_Full)) | ||
753 | lport->link_supported_speeds |= FC_PORTSPEED_1GBIT; | ||
754 | if (ecmd.supported & SUPPORTED_10000baseT_Full) | ||
755 | lport->link_supported_speeds |= FC_PORTSPEED_10GBIT; | ||
756 | |||
757 | switch (ethtool_cmd_speed(&ecmd)) { | ||
758 | case SPEED_1000: | ||
759 | lport->link_speed = FC_PORTSPEED_1GBIT; | ||
760 | break; | ||
761 | case SPEED_2500: | ||
762 | lport->link_speed = FC_PORTSPEED_2GBIT; | ||
763 | break; | ||
764 | case SPEED_10000: | ||
765 | lport->link_speed = FC_PORTSPEED_10GBIT; | ||
766 | break; | ||
767 | } | ||
768 | } | ||
769 | } | ||
770 | static int bnx2fc_link_ok(struct fc_lport *lport) | 741 | static int bnx2fc_link_ok(struct fc_lport *lport) |
771 | { | 742 | { |
772 | struct fcoe_port *port = lport_priv(lport); | 743 | struct fcoe_port *port = lport_priv(lport); |
@@ -824,7 +795,7 @@ static int bnx2fc_net_config(struct fc_lport *lport, struct net_device *netdev) | |||
824 | port->fcoe_pending_queue_active = 0; | 795 | port->fcoe_pending_queue_active = 0; |
825 | setup_timer(&port->timer, fcoe_queue_timer, (unsigned long) lport); | 796 | setup_timer(&port->timer, fcoe_queue_timer, (unsigned long) lport); |
826 | 797 | ||
827 | bnx2fc_link_speed_update(lport); | 798 | fcoe_link_speed_update(lport); |
828 | 799 | ||
829 | if (!lport->vport) { | 800 | if (!lport->vport) { |
830 | if (fcoe_get_wwn(netdev, &wwnn, NETDEV_FCOE_WWNN)) | 801 | if (fcoe_get_wwn(netdev, &wwnn, NETDEV_FCOE_WWNN)) |
@@ -928,7 +899,7 @@ static void bnx2fc_indicate_netevent(void *context, unsigned long event, | |||
928 | BNX2FC_HBA_DBG(lport, "netevent handler - event=%s %ld\n", | 899 | BNX2FC_HBA_DBG(lport, "netevent handler - event=%s %ld\n", |
929 | interface->netdev->name, event); | 900 | interface->netdev->name, event); |
930 | 901 | ||
931 | bnx2fc_link_speed_update(lport); | 902 | fcoe_link_speed_update(lport); |
932 | 903 | ||
933 | cdev = fcoe_ctlr_to_ctlr_dev(ctlr); | 904 | cdev = fcoe_ctlr_to_ctlr_dev(ctlr); |
934 | 905 | ||