Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68986
b: refs/heads/master
c: 28424d3
h: refs/heads/master
v: v3
  • Loading branch information
Boaz Harrosh authored and James Bottomley committed Oct 12, 2007
1 parent ba60dd4 commit a655a7f
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 41 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dff6de73f9d29868729cb1d21d86ba0dbd28871f
refs/heads/master: 28424d3a503d43482a5537e556f7b7652d8e56d8
23 changes: 9 additions & 14 deletions trunk/drivers/scsi/NCR5380.c
Original file line number Diff line number Diff line change
Expand Up @@ -1542,9 +1542,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd * cmd, int tag)
hostdata->connected = cmd;
hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun);

if (cmd->SCp.ptr != (char *)cmd->sense_buffer) {
initialize_SCp(cmd);
}
initialize_SCp(cmd);

return 0;

Expand Down Expand Up @@ -2280,19 +2278,16 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
cmd->result = (cmd->result & 0x00ffff) | (DID_ERROR << 16);

#ifdef AUTOSENSE
if ((cmd->cmnd[0] == REQUEST_SENSE) &&
hostdata->ses.cmd_len) {
scsi_eh_restore_cmnd(cmd, &hostdata->ses);
hostdata->ses.cmd_len = 0 ;
}

if ((cmd->cmnd[0] != REQUEST_SENSE) && (status_byte(cmd->SCp.Status) == CHECK_CONDITION)) {
scsi_eh_prep_cmnd(cmd, &hostdata->ses, NULL, 0, ~0);

dprintk(NDEBUG_AUTOSENSE, ("scsi%d : performing request sense\n", instance->host_no));
cmd->cmnd[0] = REQUEST_SENSE;
cmd->cmnd[1] &= 0xe0;
cmd->cmnd[2] = 0;
cmd->cmnd[3] = 0;
cmd->cmnd[4] = sizeof(cmd->sense_buffer);
cmd->cmnd[5] = 0;

cmd->SCp.buffer = NULL;
cmd->SCp.buffers_residual = 0;
cmd->SCp.ptr = (char *) cmd->sense_buffer;
cmd->SCp.this_residual = sizeof(cmd->sense_buffer);

LIST(cmd, hostdata->issue_queue);
cmd->host_scribble = (unsigned char *)
Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/scsi/NCR5380.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@

#include <linux/interrupt.h>

#ifdef AUTOSENSE
#include <scsi/scsi_eh.h>
#endif

#define NCR5380_PUBLIC_RELEASE 7
#define NCR53C400_PUBLIC_RELEASE 2

Expand Down Expand Up @@ -281,6 +285,9 @@ struct NCR5380_hostdata {
unsigned pendingr;
unsigned pendingw;
#endif
#ifdef AUTOSENSE
struct scsi_eh_save ses;
#endif
};

#ifdef __KERNEL__
Expand Down
23 changes: 8 additions & 15 deletions trunk/drivers/scsi/atari_NCR5380.c
Original file line number Diff line number Diff line change
Expand Up @@ -2235,24 +2235,17 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
cmd->result = (cmd->result & 0x00ffff) | (DID_ERROR << 16);

#ifdef AUTOSENSE
if ((cmd->cmnd[0] == REQUEST_SENSE) &&
hostdata->ses.cmd_len) {
scsi_eh_restore_cmnd(cmd, &hostdata->ses);
hostdata->ses.cmd_len = 0 ;
}

if ((cmd->cmnd[0] != REQUEST_SENSE) &&
(status_byte(cmd->SCp.Status) == CHECK_CONDITION)) {
scsi_eh_prep_cmnd(cmd, &hostdata->ses, NULL, 0, ~0);

ASEN_PRINTK("scsi%d: performing request sense\n", HOSTNO);
cmd->cmnd[0] = REQUEST_SENSE;
cmd->cmnd[1] &= 0xe0;
cmd->cmnd[2] = 0;
cmd->cmnd[3] = 0;
cmd->cmnd[4] = sizeof(cmd->sense_buffer);
cmd->cmnd[5] = 0;
cmd->cmd_len = COMMAND_SIZE(cmd->cmnd[0]);

cmd->use_sg = 0;
/* this is initialized from initialize_SCp
cmd->SCp.buffer = NULL;
cmd->SCp.buffers_residual = 0;
*/
cmd->request_buffer = (char *) cmd->sense_buffer;
cmd->request_bufflen = sizeof(cmd->sense_buffer);

local_irq_save(flags);
LIST(cmd,hostdata->issue_queue);
Expand Down
18 changes: 7 additions & 11 deletions trunk/drivers/scsi/sun3_NCR5380.c
Original file line number Diff line number Diff line change
Expand Up @@ -2254,25 +2254,21 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
cmd->result = (cmd->result & 0x00ffff) | (DID_ERROR << 16);

#ifdef AUTOSENSE
if ((cmd->cmnd[0] == REQUEST_SENSE) &&
hostdata->ses.cmd_len) {
scsi_eh_restore_cmnd(cmd, &hostdata->ses);
hostdata->ses.cmd_len = 0 ;
}

if ((cmd->cmnd[0] != REQUEST_SENSE) &&
(status_byte(cmd->SCp.Status) == CHECK_CONDITION)) {
scsi_eh_prep_cmnd(cmd, &hostdata->ses, NULL, 0, ~0);
ASEN_PRINTK("scsi%d: performing request sense\n",
HOSTNO);
cmd->cmnd[0] = REQUEST_SENSE;
cmd->cmnd[1] &= 0xe0;
cmd->cmnd[2] = 0;
cmd->cmnd[3] = 0;
cmd->cmnd[4] = sizeof(cmd->sense_buffer);
cmd->cmnd[5] = 0;
cmd->cmd_len = COMMAND_SIZE(cmd->cmnd[0]);

cmd->use_sg = 0;
/* this is initialized from initialize_SCp
cmd->SCp.buffer = NULL;
cmd->SCp.buffers_residual = 0;
*/
cmd->request_buffer = (char *) cmd->sense_buffer;
cmd->request_bufflen = sizeof(cmd->sense_buffer);

local_irq_save(flags);
LIST(cmd,hostdata->issue_queue);
Expand Down

0 comments on commit a655a7f

Please sign in to comment.