aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptfc.c
diff options
context:
space:
mode:
authorMoore, Eric <Eric.Moore@lsil.com>2006-03-14 11:19:36 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-03-14 15:33:38 -0500
commit914c2d8e597798d62c2e0a3cba737bf6f611eecf (patch)
tree7973421cd5cc7ecd644c6c304580a93e42cec244 /drivers/message/fusion/mptfc.c
parentc972c70fa03097be4235fc441658290a3b7af06f (diff)
[SCSI] fusion - removing target_id/bus_id from the VirtDevice structure
It makes no sense in keeping the target_id and bus_id in the VirtDevice structure, when it can be obtained from the VirtTarget structure. In addition, this patch fix's couple compilation bugs in mptfc.c when MPT_DEBUG_FC is enabled. This provided by Micheal Reed. Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message/fusion/mptfc.c')
-rw-r--r--drivers/message/fusion/mptfc.c33
1 files changed, 8 insertions, 25 deletions
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c
index 5a30621051c3..b343f2a68b1c 100644
--- a/drivers/message/fusion/mptfc.c
+++ b/drivers/message/fusion/mptfc.c
@@ -349,24 +349,6 @@ mptfc_generate_rport_ids(FCDevicePage0_t *pg0, struct fc_rport_identifiers *rid)
349} 349}
350 350
351static void 351static void
352mptfc_remap_sdev(struct scsi_device *sdev, void *arg)
353{
354 VirtDevice *vdev;
355 VirtTarget *vtarget;
356 struct scsi_target *starget;
357
358 starget = scsi_target(sdev);
359 if (starget->hostdata == arg) {
360 vtarget = arg;
361 vdev = sdev->hostdata;
362 if (vdev) {
363 vdev->bus_id = vtarget->bus_id;
364 vdev->target_id = vtarget->target_id;
365 }
366 }
367}
368
369static void
370mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) 352mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0)
371{ 353{
372 struct fc_rport_identifiers rport_ids; 354 struct fc_rport_identifiers rport_ids;
@@ -423,8 +405,6 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0)
423 if (vtarget) { 405 if (vtarget) {
424 vtarget->target_id = pg0->CurrentTargetID; 406 vtarget->target_id = pg0->CurrentTargetID;
425 vtarget->bus_id = pg0->CurrentBus; 407 vtarget->bus_id = pg0->CurrentBus;
426 starget_for_each_device(ri->starget,
427 vtarget,mptfc_remap_sdev);
428 } 408 }
429 ri->remap_needed = 0; 409 ri->remap_needed = 0;
430 } 410 }
@@ -432,7 +412,7 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0)
432 "mptfc_reg_dev.%d: %x, %llx / %llx, tid %d, " 412 "mptfc_reg_dev.%d: %x, %llx / %llx, tid %d, "
433 "rport tid %d, tmo %d\n", 413 "rport tid %d, tmo %d\n",
434 ioc->name, 414 ioc->name,
435 oc->sh->host_no, 415 ioc->sh->host_no,
436 pg0->PortIdentifier, 416 pg0->PortIdentifier,
437 pg0->WWNN, 417 pg0->WWNN,
438 pg0->WWPN, 418 pg0->WWPN,
@@ -553,23 +533,26 @@ mptfc_slave_alloc(struct scsi_device *sdev)
553 } 533 }
554 534
555 vdev->vtarget = vtarget; 535 vdev->vtarget = vtarget;
556 vdev->ioc_id = hd->ioc->id;
557 vdev->lun = sdev->lun; 536 vdev->lun = sdev->lun;
558 vdev->target_id = vtarget->target_id;
559 vdev->bus_id = vtarget->bus_id;
560 537
561 spin_unlock_irqrestore(&hd->ioc->fc_rport_lock,flags); 538 spin_unlock_irqrestore(&hd->ioc->fc_rport_lock,flags);
562 539
563 vtarget->num_luns++; 540 vtarget->num_luns++;
564 541
542#ifdef DMPT_DEBUG_FC
543 {
544 struct mptfc_rport_info *ri;
545 ri = *((struct mptfc_rport_info **)rport->dd_data);
565 dfcprintk ((MYIOC_s_INFO_FMT 546 dfcprintk ((MYIOC_s_INFO_FMT
566 "mptfc_slv_alloc.%d: num_luns %d, sdev.id %d, " 547 "mptfc_slv_alloc.%d: num_luns %d, sdev.id %d, "
567 "CurrentTargetID %d, %x %llx %llx\n", 548 "CurrentTargetID %d, %x %llx %llx\n",
568 ioc->name, 549 hd->ioc->name,
569 sdev->host->host_no, 550 sdev->host->host_no,
570 vtarget->num_luns, 551 vtarget->num_luns,
571 sdev->id, ri->pg0.CurrentTargetID, 552 sdev->id, ri->pg0.CurrentTargetID,
572 ri->pg0.PortIdentifier, ri->pg0.WWPN, ri->pg0.WWNN)); 553 ri->pg0.PortIdentifier, ri->pg0.WWPN, ri->pg0.WWNN));
554 }
555#endif
573 556
574 return 0; 557 return 0;
575} 558}