aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptsas.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/mptsas.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/mptsas.c')
-rw-r--r--drivers/message/fusion/mptsas.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index ba93ef13a41e..ba555a60bf7f 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -350,6 +350,7 @@ mptsas_slave_alloc(struct scsi_device *sdev)
350 VirtTarget *vtarget; 350 VirtTarget *vtarget;
351 VirtDevice *vdev; 351 VirtDevice *vdev;
352 struct scsi_target *starget; 352 struct scsi_target *starget;
353 u32 target_id;
353 int i; 354 int i;
354 355
355 vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL); 356 vdev = kzalloc(sizeof(VirtDevice), GFP_KERNEL);
@@ -358,10 +359,10 @@ mptsas_slave_alloc(struct scsi_device *sdev)
358 hd->ioc->name, sizeof(VirtDevice)); 359 hd->ioc->name, sizeof(VirtDevice));
359 return -ENOMEM; 360 return -ENOMEM;
360 } 361 }
361 vdev->ioc_id = hd->ioc->id;
362 sdev->hostdata = vdev; 362 sdev->hostdata = vdev;
363 starget = scsi_target(sdev); 363 starget = scsi_target(sdev);
364 vtarget = starget->hostdata; 364 vtarget = starget->hostdata;
365 vtarget->ioc_id = hd->ioc->id;
365 vdev->vtarget = vtarget; 366 vdev->vtarget = vtarget;
366 if (vtarget->num_luns == 0) { 367 if (vtarget->num_luns == 0) {
367 vtarget->tflags = MPT_TARGET_FLAGS_Q_YES|MPT_TARGET_FLAGS_VALID_INQUIRY; 368 vtarget->tflags = MPT_TARGET_FLAGS_Q_YES|MPT_TARGET_FLAGS_VALID_INQUIRY;
@@ -372,8 +373,8 @@ mptsas_slave_alloc(struct scsi_device *sdev)
372 RAID volumes placed beyond the last expected port. 373 RAID volumes placed beyond the last expected port.
373 */ 374 */
374 if (sdev->channel == hd->ioc->num_ports) { 375 if (sdev->channel == hd->ioc->num_ports) {
375 vdev->target_id = sdev->id; 376 target_id = sdev->id;
376 vdev->bus_id = 0; 377 vtarget->bus_id = 0;
377 vdev->lun = 0; 378 vdev->lun = 0;
378 goto out; 379 goto out;
379 } 380 }
@@ -384,11 +385,10 @@ mptsas_slave_alloc(struct scsi_device *sdev)
384 for (i = 0; i < p->num_phys; i++) { 385 for (i = 0; i < p->num_phys; i++) {
385 if (p->phy_info[i].attached.sas_address == 386 if (p->phy_info[i].attached.sas_address ==
386 rphy->identify.sas_address) { 387 rphy->identify.sas_address) {
387 vdev->target_id = 388 target_id = p->phy_info[i].attached.id;
388 p->phy_info[i].attached.id; 389 vtarget->bus_id = p->phy_info[i].attached.channel;
389 vdev->bus_id = p->phy_info[i].attached.channel;
390 vdev->lun = sdev->lun; 390 vdev->lun = sdev->lun;
391 mutex_unlock(&hd->ioc->sas_topology_mutex); 391 mutex_unlock(&hd->ioc->sas_topology_mutex);
392 goto out; 392 goto out;
393 } 393 }
394 } 394 }
@@ -399,9 +399,7 @@ mptsas_slave_alloc(struct scsi_device *sdev)
399 return -ENXIO; 399 return -ENXIO;
400 400
401 out: 401 out:
402 vtarget->ioc_id = vdev->ioc_id; 402 vtarget->target_id = target_id;
403 vtarget->target_id = vdev->target_id;
404 vtarget->bus_id = vdev->bus_id;
405 vtarget->num_luns++; 403 vtarget->num_luns++;
406 return 0; 404 return 0;
407} 405}
@@ -444,8 +442,8 @@ mptsas_slave_destroy(struct scsi_device *sdev)
444 if (vdev->configured_lun){ 442 if (vdev->configured_lun){
445 if (mptscsih_TMHandler(hd, 443 if (mptscsih_TMHandler(hd,
446 MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, 444 MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET,
447 vdev->bus_id, 445 vdev->vtarget->bus_id,
448 vdev->target_id, 446 vdev->vtarget->target_id,
449 0, 0, 5 /* 5 second timeout */) 447 0, 0, 5 /* 5 second timeout */)
450 < 0){ 448 < 0){
451 449
@@ -455,7 +453,7 @@ mptsas_slave_destroy(struct scsi_device *sdev)
455 printk(MYIOC_s_WARN_FMT 453 printk(MYIOC_s_WARN_FMT
456 "Error processing TaskMgmt id=%d TARGET_RESET\n", 454 "Error processing TaskMgmt id=%d TARGET_RESET\n",
457 hd->ioc->name, 455 hd->ioc->name,
458 vdev->target_id); 456 vdev->vtarget->target_id);
459 457
460 hd->tmPending = 0; 458 hd->tmPending = 0;
461 hd->tmState = TM_STATE_NONE; 459 hd->tmState = TM_STATE_NONE;