aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-07-23 14:13:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-07-23 14:13:11 -0400
commitd4e06701b89286a306b31e20ec69a904fae374a1 (patch)
treef6adefd65b021ccddb7655109ea8b9ab4e714292 /drivers/scsi/bnx2fc/bnx2fc_fcoe.c
parente4980371059ca4a81ccdcb4381c41af8869ca711 (diff)
parent87045b033a62777337ae4aa62834876da09b5fb5 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (77 commits) [SCSI] fix crash in scsi_dispatch_cmd() [SCSI] sr: check_events() ignore GET_EVENT when TUR says otherwise [SCSI] bnx2i: Fixed kernel panic due to illegal usage of sc->request->cpu [SCSI] bfa: Update the driver version to 3.0.2.1 [SCSI] bfa: Driver and BSG enhancements. [SCSI] bfa: Added support to query PHY. [SCSI] bfa: Added HBA diagnostics support. [SCSI] bfa: Added support for flash configuration [SCSI] bfa: Added support to obtain SFP info. [SCSI] bfa: Added support for CEE info and stats query. [SCSI] bfa: Extend BSG interface. [SCSI] bfa: FCS bug fixes. [SCSI] bfa: DMA memory allocation enhancement. [SCSI] bfa: Brocade-1860 Fabric Adapter vHBA support. [SCSI] bfa: Brocade-1860 Fabric Adapter PLL init fixes. [SCSI] bfa: Added Fabric Assigned Address(FAA) support [SCSI] bfa: IOC bug fixes. [SCSI] bfa: Enable ASIC block configuration and query. [SCSI] bnx2i: Updated copyright and bump version [SCSI] bnx2i: Modified to skip CNIC registration if iSCSI is not supported ... Fix up some trivial conflicts in: - drivers/scsi/bnx2fc/{bnx2fc.h,bnx2fc_fcoe.c}: Crazy broadcom version number conflicts - drivers/target/tcm_fc/tfc_cmd.c Just trivial cleanups done on adjacent lines
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc_fcoe.c')
-rw-r--r--drivers/scsi/bnx2fc/bnx2fc_fcoe.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index 9eebaebdaa78..a97aff3a0662 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -679,6 +679,9 @@ static void bnx2fc_link_speed_update(struct fc_lport *lport)
679 case SPEED_1000: 679 case SPEED_1000:
680 lport->link_speed = FC_PORTSPEED_1GBIT; 680 lport->link_speed = FC_PORTSPEED_1GBIT;
681 break; 681 break;
682 case SPEED_2500:
683 lport->link_speed = FC_PORTSPEED_2GBIT;
684 break;
682 case SPEED_10000: 685 case SPEED_10000:
683 lport->link_speed = FC_PORTSPEED_10GBIT; 686 lport->link_speed = FC_PORTSPEED_10GBIT;
684 break; 687 break;
@@ -1231,6 +1234,7 @@ static int bnx2fc_interface_setup(struct bnx2fc_hba *hba,
1231 hba->ctlr.get_src_addr = bnx2fc_get_src_mac; 1234 hba->ctlr.get_src_addr = bnx2fc_get_src_mac;
1232 set_bit(BNX2FC_CTLR_INIT_DONE, &hba->init_done); 1235 set_bit(BNX2FC_CTLR_INIT_DONE, &hba->init_done);
1233 1236
1237 INIT_LIST_HEAD(&hba->vports);
1234 rc = bnx2fc_netdev_setup(hba); 1238 rc = bnx2fc_netdev_setup(hba);
1235 if (rc) 1239 if (rc)
1236 goto setup_err; 1240 goto setup_err;
@@ -1267,8 +1271,15 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_hba *hba,
1267 struct fcoe_port *port; 1271 struct fcoe_port *port;
1268 struct Scsi_Host *shost; 1272 struct Scsi_Host *shost;
1269 struct fc_vport *vport = dev_to_vport(parent); 1273 struct fc_vport *vport = dev_to_vport(parent);
1274 struct bnx2fc_lport *blport;
1270 int rc = 0; 1275 int rc = 0;
1271 1276
1277 blport = kzalloc(sizeof(struct bnx2fc_lport), GFP_KERNEL);
1278 if (!blport) {
1279 BNX2FC_HBA_DBG(hba->ctlr.lp, "Unable to alloc bnx2fc_lport\n");
1280 return NULL;
1281 }
1282
1272 /* Allocate Scsi_Host structure */ 1283 /* Allocate Scsi_Host structure */
1273 if (!npiv) 1284 if (!npiv)
1274 lport = libfc_host_alloc(&bnx2fc_shost_template, sizeof(*port)); 1285 lport = libfc_host_alloc(&bnx2fc_shost_template, sizeof(*port));
@@ -1277,7 +1288,7 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_hba *hba,
1277 1288
1278 if (!lport) { 1289 if (!lport) {
1279 printk(KERN_ERR PFX "could not allocate scsi host structure\n"); 1290 printk(KERN_ERR PFX "could not allocate scsi host structure\n");
1280 return NULL; 1291 goto free_blport;
1281 } 1292 }
1282 shost = lport->host; 1293 shost = lport->host;
1283 port = lport_priv(lport); 1294 port = lport_priv(lport);
@@ -1333,12 +1344,20 @@ static struct fc_lport *bnx2fc_if_create(struct bnx2fc_hba *hba,
1333 } 1344 }
1334 1345
1335 bnx2fc_interface_get(hba); 1346 bnx2fc_interface_get(hba);
1347
1348 spin_lock_bh(&hba->hba_lock);
1349 blport->lport = lport;
1350 list_add_tail(&blport->list, &hba->vports);
1351 spin_unlock_bh(&hba->hba_lock);
1352
1336 return lport; 1353 return lport;
1337 1354
1338shost_err: 1355shost_err:
1339 scsi_remove_host(shost); 1356 scsi_remove_host(shost);
1340lp_config_err: 1357lp_config_err:
1341 scsi_host_put(lport->host); 1358 scsi_host_put(lport->host);
1359free_blport:
1360 kfree(blport);
1342 return NULL; 1361 return NULL;
1343} 1362}
1344 1363
@@ -1354,6 +1373,7 @@ static void bnx2fc_if_destroy(struct fc_lport *lport)
1354{ 1373{
1355 struct fcoe_port *port = lport_priv(lport); 1374 struct fcoe_port *port = lport_priv(lport);
1356 struct bnx2fc_hba *hba = port->priv; 1375 struct bnx2fc_hba *hba = port->priv;
1376 struct bnx2fc_lport *blport, *tmp;
1357 1377
1358 BNX2FC_HBA_DBG(hba->ctlr.lp, "ENTERED bnx2fc_if_destroy\n"); 1378 BNX2FC_HBA_DBG(hba->ctlr.lp, "ENTERED bnx2fc_if_destroy\n");
1359 /* Stop the transmit retry timer */ 1379 /* Stop the transmit retry timer */
@@ -1378,6 +1398,15 @@ static void bnx2fc_if_destroy(struct fc_lport *lport)
1378 /* Free memory used by statistical counters */ 1398 /* Free memory used by statistical counters */
1379 fc_lport_free_stats(lport); 1399 fc_lport_free_stats(lport);
1380 1400
1401 spin_lock_bh(&hba->hba_lock);
1402 list_for_each_entry_safe(blport, tmp, &hba->vports, list) {
1403 if (blport->lport == lport) {
1404 list_del(&blport->list);
1405 kfree(blport);
1406 }
1407 }
1408 spin_unlock_bh(&hba->hba_lock);
1409
1381 /* Release Scsi_Host */ 1410 /* Release Scsi_Host */
1382 scsi_host_put(lport->host); 1411 scsi_host_put(lport->host);
1383 1412