aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe/fcoe.c
diff options
context:
space:
mode:
authorChris Leech <christopher.leech@intel.com>2009-11-03 14:46:08 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:00:56 -0500
commit86221969e20a2f60ce104160dc836a964974673b (patch)
tree83f40bc6490feddd18fe9650cbc3b61f0fb7b2e2 /drivers/scsi/fcoe/fcoe.c
parent93e6d5ab9969a9200752658677eafd96772302f0 (diff)
[SCSI] libfc: changes to libfc_host_alloc to consolidate initialization with allocation
I'd like to keep basic initialization together with allocation, which means this can't just be a tail-call to scsi_host_alloc. This is needed to create a generic libfc host allocation routine for NPIV VN_Ports, which will share the exchange ID space (through sharing exchange manager structures) with the parent lport. In order to clone the exchange manager list when the lport is allocated, the list head must be initialized earlier. Also, update fnic to use the libfc_host_alloc so that later changes do not break it. (contribution by Joe Eykholt) Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/fcoe/fcoe.c')
-rw-r--r--drivers/scsi/fcoe/fcoe.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 4efbc17a7d7f..8ca488de492d 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -515,8 +515,6 @@ static int fcoe_shost_config(struct fc_lport *lp, struct Scsi_Host *shost,
515 int rc = 0; 515 int rc = 0;
516 516
517 /* lport scsi host config */ 517 /* lport scsi host config */
518 lp->host = shost;
519
520 lp->host->max_lun = FCOE_MAX_LUN; 518 lp->host->max_lun = FCOE_MAX_LUN;
521 lp->host->max_id = FCOE_MAX_FCP_TARGET; 519 lp->host->max_id = FCOE_MAX_FCP_TARGET;
522 lp->host->max_channel = 0; 520 lp->host->max_channel = 0;
@@ -734,14 +732,14 @@ static struct fc_lport *fcoe_if_create(struct fcoe_interface *fcoe,
734 732
735 FCOE_NETDEV_DBG(netdev, "Create Interface\n"); 733 FCOE_NETDEV_DBG(netdev, "Create Interface\n");
736 734
737 shost = libfc_host_alloc(&fcoe_shost_template, 735 lport = libfc_host_alloc(&fcoe_shost_template,
738 sizeof(struct fcoe_port)); 736 sizeof(struct fcoe_port));
739 if (!shost) { 737 if (!lport) {
740 FCOE_NETDEV_DBG(netdev, "Could not allocate host structure\n"); 738 FCOE_NETDEV_DBG(netdev, "Could not allocate host structure\n");
741 rc = -ENOMEM; 739 rc = -ENOMEM;
742 goto out; 740 goto out;
743 } 741 }
744 lport = shost_priv(shost); 742 shost = lport->host;
745 port = lport_priv(lport); 743 port = lport_priv(lport);
746 port->lport = lport; 744 port->lport = lport;
747 port->fcoe = fcoe; 745 port->fcoe = fcoe;