diff options
author | Boaz Harrosh <bharrosh@panasas.com> | 2007-09-10 15:37:45 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-10-12 14:55:07 -0400 |
commit | 28424d3a503d43482a5537e556f7b7652d8e56d8 (patch) | |
tree | cfdfea7e635461887b735610d00d15fc41e6d19a /drivers/scsi/NCR5380.c | |
parent | dff6de73f9d29868729cb1d21d86ba0dbd28871f (diff) |
[SCSI] NCR5380: Use scsi_eh API for REQUEST_SENSE invocation
- Use new scsi_eh_prep/restor_cmnd() for synchronous
REQUEST_SENSE invocation.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/NCR5380.c')
-rw-r--r-- | drivers/scsi/NCR5380.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index 5b27966d37f0..988f0bc5eda5 100644 --- a/drivers/scsi/NCR5380.c +++ b/drivers/scsi/NCR5380.c | |||
@@ -1542,9 +1542,7 @@ part2: | |||
1542 | hostdata->connected = cmd; | 1542 | hostdata->connected = cmd; |
1543 | hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); | 1543 | hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); |
1544 | 1544 | ||
1545 | if (cmd->SCp.ptr != (char *)cmd->sense_buffer) { | 1545 | initialize_SCp(cmd); |
1546 | initialize_SCp(cmd); | ||
1547 | } | ||
1548 | 1546 | ||
1549 | return 0; | 1547 | return 0; |
1550 | 1548 | ||
@@ -2280,19 +2278,16 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2280 | cmd->result = (cmd->result & 0x00ffff) | (DID_ERROR << 16); | 2278 | cmd->result = (cmd->result & 0x00ffff) | (DID_ERROR << 16); |
2281 | 2279 | ||
2282 | #ifdef AUTOSENSE | 2280 | #ifdef AUTOSENSE |
2281 | if ((cmd->cmnd[0] == REQUEST_SENSE) && | ||
2282 | hostdata->ses.cmd_len) { | ||
2283 | scsi_eh_restore_cmnd(cmd, &hostdata->ses); | ||
2284 | hostdata->ses.cmd_len = 0 ; | ||
2285 | } | ||
2286 | |||
2283 | if ((cmd->cmnd[0] != REQUEST_SENSE) && (status_byte(cmd->SCp.Status) == CHECK_CONDITION)) { | 2287 | if ((cmd->cmnd[0] != REQUEST_SENSE) && (status_byte(cmd->SCp.Status) == CHECK_CONDITION)) { |
2288 | scsi_eh_prep_cmnd(cmd, &hostdata->ses, NULL, 0, ~0); | ||
2289 | |||
2284 | dprintk(NDEBUG_AUTOSENSE, ("scsi%d : performing request sense\n", instance->host_no)); | 2290 | dprintk(NDEBUG_AUTOSENSE, ("scsi%d : performing request sense\n", instance->host_no)); |
2285 | cmd->cmnd[0] = REQUEST_SENSE; | ||
2286 | cmd->cmnd[1] &= 0xe0; | ||
2287 | cmd->cmnd[2] = 0; | ||
2288 | cmd->cmnd[3] = 0; | ||
2289 | cmd->cmnd[4] = sizeof(cmd->sense_buffer); | ||
2290 | cmd->cmnd[5] = 0; | ||
2291 | |||
2292 | cmd->SCp.buffer = NULL; | ||
2293 | cmd->SCp.buffers_residual = 0; | ||
2294 | cmd->SCp.ptr = (char *) cmd->sense_buffer; | ||
2295 | cmd->SCp.this_residual = sizeof(cmd->sense_buffer); | ||
2296 | 2291 | ||
2297 | LIST(cmd, hostdata->issue_queue); | 2292 | LIST(cmd, hostdata->issue_queue); |
2298 | cmd->host_scribble = (unsigned char *) | 2293 | cmd->host_scribble = (unsigned char *) |