summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@titanic.(none)>2005-08-28 11:31:14 -0500
committerJames Bottomley <jejb@titanic.(none)>2005-08-28 11:31:14 -0500
commit33aa687db90dd8541bd5e9a762eebf880eaee767 (patch)
treedac741e1f3f43a1de2433a21b874a093783717f3 /drivers/scsi/scsi_lib.c
parent1cf72699c1530c3e4ac3d58344f6a6a40a2f46d3 (diff)
[SCSI] convert SPI transport class to scsi_execute
This one's slightly more difficult. The transport class uses REQ_FAILFAST, so another interface (scsi_execute) had to be invented to take the extra flag. Also, the sense functions are shifted around to allow spi_execute to place data directly into a struct scsi_sense_hdr. With this change, there's probably a lot of unnecessary sense buffer allocation going on which we can fix later. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 3f3accd6cd4..42edf29223a 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -282,7 +282,7 @@ void scsi_wait_req(struct scsi_request *sreq, const void *cmnd, void *buffer,
EXPORT_SYMBOL(scsi_wait_req);
/**
- * scsi_execute_req - insert request and wait for the result
+ * scsi_execute - insert request and wait for the result
* @sdev: scsi device
* @cmd: scsi command
* @data_direction: data direction
@@ -291,13 +291,14 @@ EXPORT_SYMBOL(scsi_wait_req);
* @sense: optional sense buffer
* @timeout: request timeout in seconds
* @retries: number of times to retry request
+ * @flags: or into request flags;
*
* scsi_execute_req returns the req->errors value which is the
* the scsi_cmnd result field.
**/
-int scsi_execute_req(struct scsi_device *sdev, unsigned char *cmd,
- int data_direction, void *buffer, unsigned bufflen,
- unsigned char *sense, int timeout, int retries)
+int scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
+ int data_direction, void *buffer, unsigned bufflen,
+ unsigned char *sense, int timeout, int retries, int flags)
{
struct request *req;
int write = (data_direction == DMA_TO_DEVICE);
@@ -314,7 +315,7 @@ int scsi_execute_req(struct scsi_device *sdev, unsigned char *cmd,
req->sense = sense;
req->sense_len = 0;
req->timeout = timeout;
- req->flags |= REQ_BLOCK_PC | REQ_SPECIAL;
+ req->flags |= flags | REQ_BLOCK_PC | REQ_SPECIAL;
/*
* head injection *required* here otherwise quiesce won't work
@@ -328,7 +329,7 @@ int scsi_execute_req(struct scsi_device *sdev, unsigned char *cmd,
return ret;
}
-EXPORT_SYMBOL(scsi_execute_req);
+EXPORT_SYMBOL(scsi_execute);
/*
* Function: scsi_init_cmd_errh()