aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/aachba.c
diff options
context:
space:
mode:
authorMark Haverkamp <markh@osdl.org>2006-03-27 12:43:25 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-04-13 11:13:17 -0400
commite5718774f12234c7c9be8944001cfd109ba955e1 (patch)
tree01753121c33823a0523709592e1bf1029fe97913 /drivers/scsi/aacraid/aachba.c
parentef265673434680f2307ceafae4a2badc657e94cc (diff)
[SCSI] aacraid: Use scmd_ functions
Received from Mark Salyzyn Clean up the remaining scsi id access methods, drop ID_LUN_TO_CONTAINER macro. Signed-off-by: Mark Haverkamp <markh@osdl.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aacraid/aachba.c')
-rw-r--r--drivers/scsi/aacraid/aachba.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 8df4a0ea3761..a1e473003671 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -909,7 +909,7 @@ static void io_callback(void *context, struct fib * fibptr)
909 scsicmd = (struct scsi_cmnd *) context; 909 scsicmd = (struct scsi_cmnd *) context;
910 910
911 dev = (struct aac_dev *)scsicmd->device->host->hostdata; 911 dev = (struct aac_dev *)scsicmd->device->host->hostdata;
912 cid = ID_LUN_TO_CONTAINER(scsicmd->device->id, scsicmd->device->lun); 912 cid = scmd_id(scsicmd);
913 913
914 if (nblank(dprintk(x))) { 914 if (nblank(dprintk(x))) {
915 u64 lba; 915 u64 lba;
@@ -1354,7 +1354,7 @@ static void synchronize_callback(void *context, struct fib *fibptr)
1354 else { 1354 else {
1355 struct scsi_device *sdev = cmd->device; 1355 struct scsi_device *sdev = cmd->device;
1356 struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata; 1356 struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata;
1357 u32 cid = ID_LUN_TO_CONTAINER(sdev->id, sdev->lun); 1357 u32 cid = sdev_id(sdev);
1358 printk(KERN_WARNING 1358 printk(KERN_WARNING
1359 "synchronize_callback: synchronize failed, status = %d\n", 1359 "synchronize_callback: synchronize failed, status = %d\n",
1360 le32_to_cpu(synchronizereply->status)); 1360 le32_to_cpu(synchronizereply->status));
@@ -1466,13 +1466,14 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1466 * itself. 1466 * itself.
1467 */ 1467 */
1468 if (scmd_id(scsicmd) != host->this_id) { 1468 if (scmd_id(scsicmd) != host->this_id) {
1469 if ((scsicmd->device->channel == CONTAINER_CHANNEL)) { 1469 if ((scmd_channel(scsicmd) == CONTAINER_CHANNEL)) {
1470 if( (scsicmd->device->id >= dev->maximum_num_containers) || (scsicmd->device->lun != 0)){ 1470 if((scmd_id(scsicmd) >= dev->maximum_num_containers) ||
1471 (scsicmd->device->lun != 0)) {
1471 scsicmd->result = DID_NO_CONNECT << 16; 1472 scsicmd->result = DID_NO_CONNECT << 16;
1472 scsicmd->scsi_done(scsicmd); 1473 scsicmd->scsi_done(scsicmd);
1473 return 0; 1474 return 0;
1474 } 1475 }
1475 cid = ID_LUN_TO_CONTAINER(scsicmd->device->id, scsicmd->device->lun); 1476 cid = scmd_id(scsicmd);
1476 1477
1477 /* 1478 /*
1478 * If the target container doesn't exist, it may have 1479 * If the target container doesn't exist, it may have
@@ -1548,7 +1549,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1548 { 1549 {
1549 struct inquiry_data inq_data; 1550 struct inquiry_data inq_data;
1550 1551
1551 dprintk((KERN_DEBUG "INQUIRY command, ID: %d.\n", scsicmd->device->id)); 1552 dprintk((KERN_DEBUG "INQUIRY command, ID: %d.\n", scmd_id(scsicmd)));
1552 memset(&inq_data, 0, sizeof (struct inquiry_data)); 1553 memset(&inq_data, 0, sizeof (struct inquiry_data));
1553 1554
1554 inq_data.inqd_ver = 2; /* claim compliance to SCSI-2 */ 1555 inq_data.inqd_ver = 2; /* claim compliance to SCSI-2 */
@@ -1778,7 +1779,7 @@ static int query_disk(struct aac_dev *dev, void __user *arg)
1778 if (copy_from_user(&qd, arg, sizeof (struct aac_query_disk))) 1779 if (copy_from_user(&qd, arg, sizeof (struct aac_query_disk)))
1779 return -EFAULT; 1780 return -EFAULT;
1780 if (qd.cnum == -1) 1781 if (qd.cnum == -1)
1781 qd.cnum = ID_LUN_TO_CONTAINER(qd.id, qd.lun); 1782 qd.cnum = qd.id;
1782 else if ((qd.bus == -1) && (qd.id == -1) && (qd.lun == -1)) 1783 else if ((qd.bus == -1) && (qd.id == -1) && (qd.lun == -1))
1783 { 1784 {
1784 if (qd.cnum < 0 || qd.cnum >= dev->maximum_num_containers) 1785 if (qd.cnum < 0 || qd.cnum >= dev->maximum_num_containers)
@@ -2068,7 +2069,7 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
2068 u32 timeout; 2069 u32 timeout;
2069 2070
2070 dev = (struct aac_dev *)scsicmd->device->host->hostdata; 2071 dev = (struct aac_dev *)scsicmd->device->host->hostdata;
2071 if (scsicmd->device->id >= dev->maximum_num_physicals || 2072 if (scmd_id(scsicmd) >= dev->maximum_num_physicals ||
2072 scsicmd->device->lun > 7) { 2073 scsicmd->device->lun > 7) {
2073 scsicmd->result = DID_NO_CONNECT << 16; 2074 scsicmd->result = DID_NO_CONNECT << 16;
2074 scsicmd->scsi_done(scsicmd); 2075 scsicmd->scsi_done(scsicmd);
@@ -2103,8 +2104,8 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
2103 2104
2104 srbcmd = (struct aac_srb*) fib_data(cmd_fibcontext); 2105 srbcmd = (struct aac_srb*) fib_data(cmd_fibcontext);
2105 srbcmd->function = cpu_to_le32(SRBF_ExecuteScsi); 2106 srbcmd->function = cpu_to_le32(SRBF_ExecuteScsi);
2106 srbcmd->channel = cpu_to_le32(aac_logical_to_phys(scsicmd->device->channel)); 2107 srbcmd->channel = cpu_to_le32(aac_logical_to_phys(scmd_channel(scsicmd)));
2107 srbcmd->id = cpu_to_le32(scsicmd->device->id); 2108 srbcmd->id = cpu_to_le32(scmd_id(scsicmd));
2108 srbcmd->lun = cpu_to_le32(scsicmd->device->lun); 2109 srbcmd->lun = cpu_to_le32(scsicmd->device->lun);
2109 srbcmd->flags = cpu_to_le32(flag); 2110 srbcmd->flags = cpu_to_le32(flag);
2110 timeout = scsicmd->timeout_per_command/HZ; 2111 timeout = scsicmd->timeout_per_command/HZ;