aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe/fcoe.c
diff options
context:
space:
mode:
authorYi Zou <yi.zou@intel.com>2012-12-06 01:23:58 -0500
committerRobert Love <robert.w.love@intel.com>2012-12-14 13:38:55 -0500
commit03702689fcc985e9cb45b57099ebd5066f674739 (patch)
tree10079124d57a604c30ccfbda79ac697e362391e2 /drivers/scsi/fcoe/fcoe.c
parent66524ec9d0aeaa8bc59077c7c5f78d09ec9eeb9d (diff)
libfcoe, fcoe: move fcoe_link_speed_update() to libfcoe and export it
With the previous patch, fcoe_link_speed_update() can be moved into libfcoe and exported to used by fcoe, bnx2fc, and etc. 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/fcoe/fcoe.c')
-rw-r--r--drivers/scsi/fcoe/fcoe.c35
1 files changed, 0 insertions, 35 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 4cec9ddc03ba..64bb53156af0 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -82,7 +82,6 @@ static int fcoe_rcv(struct sk_buff *, struct net_device *,
82 struct packet_type *, struct net_device *); 82 struct packet_type *, struct net_device *);
83static int fcoe_percpu_receive_thread(void *); 83static int fcoe_percpu_receive_thread(void *);
84static void fcoe_percpu_clean(struct fc_lport *); 84static void fcoe_percpu_clean(struct fc_lport *);
85static int fcoe_link_speed_update(struct fc_lport *);
86static int fcoe_link_ok(struct fc_lport *); 85static int fcoe_link_ok(struct fc_lport *);
87 86
88static struct fc_lport *fcoe_hostlist_lookup(const struct net_device *); 87static struct fc_lport *fcoe_hostlist_lookup(const struct net_device *);
@@ -2388,40 +2387,6 @@ static int fcoe_ctlr_alloc(struct net_device *netdev)
2388} 2387}
2389 2388
2390/** 2389/**
2391 * fcoe_link_speed_update() - Update the supported and actual link speeds
2392 * @lport: The local port to update speeds for
2393 *
2394 * Returns: 0 if the ethtool query was successful
2395 * -1 if the ethtool query failed
2396 */
2397static int fcoe_link_speed_update(struct fc_lport *lport)
2398{
2399 struct net_device *netdev = fcoe_netdev(lport);
2400 struct ethtool_cmd ecmd;
2401
2402 if (!__ethtool_get_settings(netdev, &ecmd)) {
2403 lport->link_supported_speeds &=
2404 ~(FC_PORTSPEED_1GBIT | FC_PORTSPEED_10GBIT);
2405 if (ecmd.supported & (SUPPORTED_1000baseT_Half |
2406 SUPPORTED_1000baseT_Full))
2407 lport->link_supported_speeds |= FC_PORTSPEED_1GBIT;
2408 if (ecmd.supported & SUPPORTED_10000baseT_Full)
2409 lport->link_supported_speeds |=
2410 FC_PORTSPEED_10GBIT;
2411 switch (ethtool_cmd_speed(&ecmd)) {
2412 case SPEED_1000:
2413 lport->link_speed = FC_PORTSPEED_1GBIT;
2414 break;
2415 case SPEED_10000:
2416 lport->link_speed = FC_PORTSPEED_10GBIT;
2417 break;
2418 }
2419 return 0;
2420 }
2421 return -1;
2422}
2423
2424/**
2425 * fcoe_link_ok() - Check if the link is OK for a local port 2390 * fcoe_link_ok() - Check if the link is OK for a local port
2426 * @lport: The local port to check link on 2391 * @lport: The local port to check link on
2427 * 2392 *