diff options
author | Hannes Reinecke <hare@suse.de> | 2009-12-02 15:28:48 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-03-03 05:30:11 -0500 |
commit | 6c71dcb28ff9b63b814a0b76a256f5dae08d3e0d (patch) | |
tree | 7ce5b2539300247cdc1817495856f79289719643 /drivers/scsi | |
parent | 3a5b27bf6f29574d667230c7e76e4b83fe3014e0 (diff) |
[SCSI] scsi_dh_emc: fix mode select request setup
This patch fixes the request setup code for mode selects. I got the fixes from
Hannes Reinecke while trying to hunt down some problems and merged it
into one patch. I am sending it because Hannes is busy with other things.
The patch fixes:
- setting of the length for mode selects.
- setting of the data direction for mode select 10.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/device_handler/scsi_dh_emc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c index 61966750bd60..63032ec3db92 100644 --- a/drivers/scsi/device_handler/scsi_dh_emc.c +++ b/drivers/scsi/device_handler/scsi_dh_emc.c | |||
@@ -272,7 +272,7 @@ static struct request *get_req(struct scsi_device *sdev, int cmd, | |||
272 | int len = 0; | 272 | int len = 0; |
273 | 273 | ||
274 | rq = blk_get_request(sdev->request_queue, | 274 | rq = blk_get_request(sdev->request_queue, |
275 | (cmd == MODE_SELECT) ? WRITE : READ, GFP_NOIO); | 275 | (cmd != INQUIRY) ? WRITE : READ, GFP_NOIO); |
276 | if (!rq) { | 276 | if (!rq) { |
277 | sdev_printk(KERN_INFO, sdev, "get_req: blk_get_request failed"); | 277 | sdev_printk(KERN_INFO, sdev, "get_req: blk_get_request failed"); |
278 | return NULL; | 278 | return NULL; |
@@ -286,14 +286,17 @@ static struct request *get_req(struct scsi_device *sdev, int cmd, | |||
286 | len = sizeof(short_trespass); | 286 | len = sizeof(short_trespass); |
287 | rq->cmd_flags |= REQ_RW; | 287 | rq->cmd_flags |= REQ_RW; |
288 | rq->cmd[1] = 0x10; | 288 | rq->cmd[1] = 0x10; |
289 | rq->cmd[4] = len; | ||
289 | break; | 290 | break; |
290 | case MODE_SELECT_10: | 291 | case MODE_SELECT_10: |
291 | len = sizeof(long_trespass); | 292 | len = sizeof(long_trespass); |
292 | rq->cmd_flags |= REQ_RW; | 293 | rq->cmd_flags |= REQ_RW; |
293 | rq->cmd[1] = 0x10; | 294 | rq->cmd[1] = 0x10; |
295 | rq->cmd[8] = len; | ||
294 | break; | 296 | break; |
295 | case INQUIRY: | 297 | case INQUIRY: |
296 | len = CLARIION_BUFFER_SIZE; | 298 | len = CLARIION_BUFFER_SIZE; |
299 | rq->cmd[4] = len; | ||
297 | memset(buffer, 0, len); | 300 | memset(buffer, 0, len); |
298 | break; | 301 | break; |
299 | default: | 302 | default: |
@@ -301,7 +304,6 @@ static struct request *get_req(struct scsi_device *sdev, int cmd, | |||
301 | break; | 304 | break; |
302 | } | 305 | } |
303 | 306 | ||
304 | rq->cmd[4] = len; | ||
305 | rq->cmd_type = REQ_TYPE_BLOCK_PC; | 307 | rq->cmd_type = REQ_TYPE_BLOCK_PC; |
306 | rq->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | | 308 | rq->cmd_flags |= REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | |
307 | REQ_FAILFAST_DRIVER; | 309 | REQ_FAILFAST_DRIVER; |