diff options
Diffstat (limited to 'drivers/scsi/NCR5380.c')
-rw-r--r-- | drivers/scsi/NCR5380.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c index f8e449a98d29..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 | ||
@@ -2133,7 +2131,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2133 | sink = 1; | 2131 | sink = 1; |
2134 | do_abort(instance); | 2132 | do_abort(instance); |
2135 | cmd->result = DID_ERROR << 16; | 2133 | cmd->result = DID_ERROR << 16; |
2136 | cmd->done(cmd); | 2134 | cmd->scsi_done(cmd); |
2137 | return; | 2135 | return; |
2138 | #endif | 2136 | #endif |
2139 | /* | 2137 | /* |
@@ -2196,7 +2194,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) { | |||
2196 | sink = 1; | 2194 | sink = 1; |
2197 | do_abort(instance); | 2195 | do_abort(instance); |
2198 | cmd->result = DID_ERROR << 16; | 2196 | cmd->result = DID_ERROR << 16; |
2199 | cmd->done(cmd); | 2197 | cmd->scsi_done(cmd); |
2200 | /* XXX - need to source or sink data here, as appropriate */ | 2198 | /* XXX - need to source or sink data here, as appropriate */ |
2201 | } else | 2199 | } else |
2202 | cmd->SCp.this_residual -= transfersize - len; | 2200 | cmd->SCp.this_residual -= transfersize - len; |
@@ -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 *) |
@@ -2740,7 +2735,7 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) { | |||
2740 | tmp->host_scribble = NULL; | 2735 | tmp->host_scribble = NULL; |
2741 | tmp->result = DID_ABORT << 16; | 2736 | tmp->result = DID_ABORT << 16; |
2742 | dprintk(NDEBUG_ABORT, ("scsi%d : abort removed command from issue queue.\n", instance->host_no)); | 2737 | dprintk(NDEBUG_ABORT, ("scsi%d : abort removed command from issue queue.\n", instance->host_no)); |
2743 | tmp->done(tmp); | 2738 | tmp->scsi_done(tmp); |
2744 | return SUCCESS; | 2739 | return SUCCESS; |
2745 | } | 2740 | } |
2746 | #if (NDEBUG & NDEBUG_ABORT) | 2741 | #if (NDEBUG & NDEBUG_ABORT) |
@@ -2805,7 +2800,7 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) { | |||
2805 | *prev = (Scsi_Cmnd *) tmp->host_scribble; | 2800 | *prev = (Scsi_Cmnd *) tmp->host_scribble; |
2806 | tmp->host_scribble = NULL; | 2801 | tmp->host_scribble = NULL; |
2807 | tmp->result = DID_ABORT << 16; | 2802 | tmp->result = DID_ABORT << 16; |
2808 | tmp->done(tmp); | 2803 | tmp->scsi_done(tmp); |
2809 | return SUCCESS; | 2804 | return SUCCESS; |
2810 | } | 2805 | } |
2811 | } | 2806 | } |