diff options
author | Vasu Dev <vasu.dev@intel.com> | 2011-04-28 18:55:44 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-05-01 17:19:48 -0400 |
commit | 134a4e27a2c4372f23b94fd3be041133cb69b52a (patch) | |
tree | 46d0ebc76ee2677c22e92109a513093e1d7eb23f /drivers/scsi/bnx2fc | |
parent | e37c4913c555bd149eba3af953fb5d3a1686dfbd (diff) |
[SCSI] bnx2fc: setup em for npiv port
Use fc_exch_mgr_list_clone to setup em for npiv port.
Also remove redundant vport and lport initializations.
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Acked-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bnx2fc')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 139955a6ba7f..662365676689 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |||
@@ -1254,20 +1254,17 @@ setup_err: | |||
1254 | static struct fc_lport *bnx2fc_if_create(struct bnx2fc_hba *hba, | 1254 | static struct fc_lport *bnx2fc_if_create(struct bnx2fc_hba *hba, |
1255 | struct device *parent, int npiv) | 1255 | struct device *parent, int npiv) |
1256 | { | 1256 | { |
1257 | struct fc_lport *lport = NULL; | 1257 | struct fc_lport *lport, *n_port; |
1258 | struct fcoe_port *port; | 1258 | struct fcoe_port *port; |
1259 | struct Scsi_Host *shost; | 1259 | struct Scsi_Host *shost; |
1260 | struct fc_vport *vport = dev_to_vport(parent); | 1260 | struct fc_vport *vport = dev_to_vport(parent); |
1261 | int rc = 0; | 1261 | int rc = 0; |
1262 | 1262 | ||
1263 | /* Allocate Scsi_Host structure */ | 1263 | /* Allocate Scsi_Host structure */ |
1264 | if (!npiv) { | 1264 | if (!npiv) |
1265 | lport = libfc_host_alloc(&bnx2fc_shost_template, | 1265 | lport = libfc_host_alloc(&bnx2fc_shost_template, sizeof(*port)); |
1266 | sizeof(struct fcoe_port)); | 1266 | else |
1267 | } else { | 1267 | lport = libfc_vport_create(vport, sizeof(*port)); |
1268 | lport = libfc_vport_create(vport, | ||
1269 | sizeof(struct fcoe_port)); | ||
1270 | } | ||
1271 | 1268 | ||
1272 | if (!lport) { | 1269 | if (!lport) { |
1273 | printk(KERN_ERR PFX "could not allocate scsi host structure\n"); | 1270 | printk(KERN_ERR PFX "could not allocate scsi host structure\n"); |
@@ -1285,7 +1282,6 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_hba *hba, | |||
1285 | goto lp_config_err; | 1282 | goto lp_config_err; |
1286 | 1283 | ||
1287 | if (npiv) { | 1284 | if (npiv) { |
1288 | vport = dev_to_vport(parent); | ||
1289 | printk(KERN_ERR PFX "Setting vport names, 0x%llX 0x%llX\n", | 1285 | printk(KERN_ERR PFX "Setting vport names, 0x%llX 0x%llX\n", |
1290 | vport->node_name, vport->port_name); | 1286 | vport->node_name, vport->port_name); |
1291 | fc_set_wwnn(lport, vport->node_name); | 1287 | fc_set_wwnn(lport, vport->node_name); |
@@ -1314,12 +1310,17 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_hba *hba, | |||
1314 | fc_host_port_type(lport->host) = FC_PORTTYPE_UNKNOWN; | 1310 | fc_host_port_type(lport->host) = FC_PORTTYPE_UNKNOWN; |
1315 | 1311 | ||
1316 | /* Allocate exchange manager */ | 1312 | /* Allocate exchange manager */ |
1317 | if (!npiv) { | 1313 | if (!npiv) |
1318 | rc = bnx2fc_em_config(lport); | 1314 | rc = bnx2fc_em_config(lport); |
1319 | if (rc) { | 1315 | else { |
1320 | printk(KERN_ERR PFX "Error on bnx2fc_em_config\n"); | 1316 | shost = vport_to_shost(vport); |
1321 | goto shost_err; | 1317 | n_port = shost_priv(shost); |
1322 | } | 1318 | rc = fc_exch_mgr_list_clone(n_port, lport); |
1319 | } | ||
1320 | |||
1321 | if (rc) { | ||
1322 | printk(KERN_ERR PFX "Error on bnx2fc_em_config\n"); | ||
1323 | goto shost_err; | ||
1323 | } | 1324 | } |
1324 | 1325 | ||
1325 | bnx2fc_interface_get(hba); | 1326 | bnx2fc_interface_get(hba); |