Commit 23ae4736 authored by Mark Haverkamp's avatar Mark Haverkamp Committed by James Bottomley

[PATCH] clean up aacraid use of SCSI constants

parent 97e0a333
...@@ -39,25 +39,6 @@ ...@@ -39,25 +39,6 @@
#include "aacraid.h" #include "aacraid.h"
/* SCSI Commands */
/* TODO dmb - use the ones defined in include/scsi/scsi.h*/
#define SS_TEST 0x00 /* Test unit ready */
#define SS_REZERO 0x01 /* Rezero unit */
#define SS_REQSEN 0x03 /* Request Sense */
#define SS_REASGN 0x07 /* Reassign blocks */
#define SS_READ 0x08 /* Read 6 */
#define SS_WRITE 0x0A /* Write 6 */
#define SS_INQUIR 0x12 /* inquiry */
#define SS_ST_SP 0x1B /* Start/Stop unit */
#define SS_LOCK 0x1E /* prevent/allow medium removal */
#define SS_RESERV 0x16 /* Reserve */
#define SS_RELES 0x17 /* Release */
#define SS_MODESEN 0x1A /* Mode Sense 6 */
#define SS_RDCAP 0x25 /* Read Capacity */
#define SM_READ 0x28 /* Read 10 */
#define SM_WRITE 0x2A /* Write 10 */
#define SS_SEEK 0x2B /* Seek */
/* values for inqd_pdt: Peripheral device type in plain English */ /* values for inqd_pdt: Peripheral device type in plain English */
#define INQD_PDT_DA 0x00 /* Direct-access (DISK) device */ #define INQD_PDT_DA 0x00 /* Direct-access (DISK) device */
#define INQD_PDT_PROC 0x03 /* Processor device */ #define INQD_PDT_PROC 0x03 /* Processor device */
...@@ -658,7 +639,7 @@ int aac_read(Scsi_Cmnd * scsicmd, int cid) ...@@ -658,7 +639,7 @@ int aac_read(Scsi_Cmnd * scsicmd, int cid)
/* /*
* Get block address and transfer length * Get block address and transfer length
*/ */
if (scsicmd->cmnd[0] == SS_READ) /* 6 byte command */ if (scsicmd->cmnd[0] == READ_6) /* 6 byte command */
{ {
dprintk((KERN_DEBUG "aachba: received a read(6) command on target %d.\n", cid)); dprintk((KERN_DEBUG "aachba: received a read(6) command on target %d.\n", cid));
...@@ -768,7 +749,7 @@ static int aac_write(Scsi_Cmnd * scsicmd, int cid) ...@@ -768,7 +749,7 @@ static int aac_write(Scsi_Cmnd * scsicmd, int cid)
/* /*
* Get block address and transfer length * Get block address and transfer length
*/ */
if (scsicmd->cmnd[0] == SS_WRITE) /* 6 byte command */ if (scsicmd->cmnd[0] == WRITE_6) /* 6 byte command */
{ {
lba = ((scsicmd->cmnd[1] & 0x1F) << 16) | (scsicmd->cmnd[2] << 8) | scsicmd->cmnd[3]; lba = ((scsicmd->cmnd[1] & 0x1F) << 16) | (scsicmd->cmnd[2] << 8) | scsicmd->cmnd[3];
count = scsicmd->cmnd[4]; count = scsicmd->cmnd[4];
...@@ -905,9 +886,9 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd) ...@@ -905,9 +886,9 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd)
*/ */
if (fsa_dev_ptr->valid[cid] == 0) { if (fsa_dev_ptr->valid[cid] == 0) {
switch (scsicmd->cmnd[0]) { switch (scsicmd->cmnd[0]) {
case SS_INQUIR: case INQUIRY:
case SS_RDCAP: case READ_CAPACITY:
case SS_TEST: case TEST_UNIT_READY:
spin_unlock_irq(host->host_lock); spin_unlock_irq(host->host_lock);
probe_container(dev, cid); probe_container(dev, cid);
spin_lock_irq(host->host_lock); spin_lock_irq(host->host_lock);
...@@ -942,8 +923,8 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd) ...@@ -942,8 +923,8 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd)
/* /*
* else Command for the controller itself * else Command for the controller itself
*/ */
else if ((scsicmd->cmnd[0] != SS_INQUIR) && /* only INQUIRY & TUR cmnd supported for controller */ else if ((scsicmd->cmnd[0] != INQUIRY) && /* only INQUIRY & TUR cmnd supported for controller */
(scsicmd->cmnd[0] != SS_TEST)) (scsicmd->cmnd[0] != TEST_UNIT_READY))
{ {
dprintk((KERN_WARNING "Only INQUIRY & TUR command supported for controller, rcvd = 0x%x.\n", scsicmd->cmnd[0])); dprintk((KERN_WARNING "Only INQUIRY & TUR command supported for controller, rcvd = 0x%x.\n", scsicmd->cmnd[0]));
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | CHECK_CONDITION; scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | CHECK_CONDITION;
...@@ -958,7 +939,7 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd) ...@@ -958,7 +939,7 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd)
/* Handle commands here that don't really require going out to the adapter */ /* Handle commands here that don't really require going out to the adapter */
switch (scsicmd->cmnd[0]) { switch (scsicmd->cmnd[0]) {
case SS_INQUIR: case INQUIRY:
{ {
struct inquiry_data *inq_data_ptr; struct inquiry_data *inq_data_ptr;
...@@ -985,7 +966,7 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd) ...@@ -985,7 +966,7 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd)
__aac_io_done(scsicmd); __aac_io_done(scsicmd);
return 0; return 0;
} }
case SS_RDCAP: case READ_CAPACITY:
{ {
int capacity; int capacity;
char *cp; char *cp;
...@@ -1008,7 +989,7 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd) ...@@ -1008,7 +989,7 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd)
return 0; return 0;
} }
case SS_MODESEN: case MODE_SENSE:
{ {
char *mode_buf; char *mode_buf;
...@@ -1028,7 +1009,7 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd) ...@@ -1028,7 +1009,7 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd)
return 0; return 0;
} }
case SS_REQSEN: case REQUEST_SENSE:
dprintk((KERN_DEBUG "REQUEST SENSE command.\n")); dprintk((KERN_DEBUG "REQUEST SENSE command.\n"));
memcpy(scsicmd->sense_buffer, &sense_data[cid], sizeof (struct sense_data)); memcpy(scsicmd->sense_buffer, &sense_data[cid], sizeof (struct sense_data));
memset(&sense_data[cid], 0, sizeof (struct sense_data)); memset(&sense_data[cid], 0, sizeof (struct sense_data));
...@@ -1036,7 +1017,7 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd) ...@@ -1036,7 +1017,7 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd)
__aac_io_done(scsicmd); __aac_io_done(scsicmd);
return (0); return (0);
case SS_LOCK: case ALLOW_MEDIUM_REMOVAL:
dprintk((KERN_DEBUG "LOCK command.\n")); dprintk((KERN_DEBUG "LOCK command.\n"));
if (scsicmd->cmnd[4]) if (scsicmd->cmnd[4])
fsa_dev_ptr->locked[cid] = 1; fsa_dev_ptr->locked[cid] = 1;
...@@ -1049,13 +1030,13 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd) ...@@ -1049,13 +1030,13 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd)
/* /*
* These commands are all No-Ops * These commands are all No-Ops
*/ */
case SS_TEST: case TEST_UNIT_READY:
case SS_RESERV: case RESERVE:
case SS_RELES: case RELEASE:
case SS_REZERO: case REZERO_UNIT:
case SS_REASGN: case REASSIGN_BLOCKS:
case SS_SEEK: case SEEK_10:
case SS_ST_SP: case START_STOP:
scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | GOOD; scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | GOOD;
__aac_io_done(scsicmd); __aac_io_done(scsicmd);
return (0); return (0);
...@@ -1063,8 +1044,8 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd) ...@@ -1063,8 +1044,8 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd)
switch (scsicmd->cmnd[0]) switch (scsicmd->cmnd[0])
{ {
case SS_READ: case READ_6:
case SM_READ: case READ_10:
/* /*
* Hack to keep track of ordinal number of the device that * Hack to keep track of ordinal number of the device that
* corresponds to a container. Needed to convert * corresponds to a container. Needed to convert
...@@ -1081,8 +1062,8 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd) ...@@ -1081,8 +1062,8 @@ int aac_scsi_cmd(Scsi_Cmnd * scsicmd)
spin_lock_irq(host->host_lock); spin_lock_irq(host->host_lock);
return ret; return ret;
case SS_WRITE: case WRITE_6:
case SM_WRITE: case WRITE_10:
spin_unlock_irq(host->host_lock); spin_unlock_irq(host->host_lock);
ret = aac_write(scsicmd, cid); ret = aac_write(scsicmd, cid);
spin_lock_irq(host->host_lock); spin_lock_irq(host->host_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment