git://ftp.safe.ca
/
safe
/
jmp
/
linux-2.6
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[SCSI] hpsa: Clarify calculation of padding for commandlist structure
[safe/jmp/linux-2.6]
/
drivers
/
scsi
/
sun3_NCR5380.c
diff --git
a/drivers/scsi/sun3_NCR5380.c
b/drivers/scsi/sun3_NCR5380.c
index
2ebe0d6
..
75da6e5
100644
(file)
--- a/
drivers/scsi/sun3_NCR5380.c
+++ b/
drivers/scsi/sun3_NCR5380.c
@@
-266,14
+266,13
@@
static struct scsi_host_template *the_template = NULL;
(struct NCR5380_hostdata *)(in)->hostdata
#define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata)
(struct NCR5380_hostdata *)(in)->hostdata
#define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata)
-#define NEXT(cmd) (
(Scsi_Cmnd *)
((cmd)->host_scribble))
-#define NEXTADDR(cmd) ((
Scsi_C
mnd **)&((cmd)->host_scribble))
+#define NEXT(cmd) (
*(struct scsi_cmnd **)&
((cmd)->host_scribble))
+#define NEXTADDR(cmd) ((
struct scsi_c
mnd **)&((cmd)->host_scribble))
#define HOSTNO instance->host_no
#define H_NO(cmd) (cmd)->device->host->host_no
#define HOSTNO instance->host_no
#define H_NO(cmd) (cmd)->device->host->host_no
-#define SGADDR(buffer) (void *)(((unsigned long)page_address((buffer)->page)) + \
- (buffer)->offset)
+#define SGADDR(buffer) (void *)(((unsigned long)sg_virt(((buffer)))))
#ifdef SUPPORT_TAGS
#ifdef SUPPORT_TAGS
@@
-360,7
+359,7
@@
static void __init init_tags( void )
* conditions.
*/
* conditions.
*/
-static int is_lun_busy(
Scsi_Cmnd *cmd, int should_be_tagged
)
+static int is_lun_busy(
struct scsi_cmnd *cmd, int should_be_tagged
)
{
SETUP_HOSTDATA(cmd->device->host);
{
SETUP_HOSTDATA(cmd->device->host);
@@
-384,7
+383,7
@@
static int is_lun_busy( Scsi_Cmnd *cmd, int should_be_tagged )
* untagged.
*/
* untagged.
*/
-static void cmd_get_tag(
Scsi_Cmnd *cmd, int should_be_tagged
)
+static void cmd_get_tag(
struct scsi_cmnd *cmd, int should_be_tagged
)
{
SETUP_HOSTDATA(cmd->device->host);
{
SETUP_HOSTDATA(cmd->device->host);
@@
-416,7
+415,7
@@
static void cmd_get_tag( Scsi_Cmnd *cmd, int should_be_tagged )
* unlock the LUN.
*/
* unlock the LUN.
*/
-static void cmd_free_tag(
Scsi_Cmnd *cmd
)
+static void cmd_free_tag(
struct scsi_cmnd *cmd
)
{
SETUP_HOSTDATA(cmd->device->host);
{
SETUP_HOSTDATA(cmd->device->host);
@@
-460,18
+459,18
@@
static void free_all_tags( void )
/*
/*
- * Function: void merge_contiguous_buffers(
Scsi_Cmnd *cmd
)
+ * Function: void merge_contiguous_buffers(
struct scsi_cmnd *cmd
)
*
* Purpose: Try to merge several scatter-gather requests into one DMA
* transfer. This is possible if the scatter buffers lie on
* physical contiguous addresses.
*
*
* Purpose: Try to merge several scatter-gather requests into one DMA
* transfer. This is possible if the scatter buffers lie on
* physical contiguous addresses.
*
- * Parameters:
Scsi_C
mnd *cmd
+ * Parameters:
struct scsi_c
mnd *cmd
* The command to work on. The first scatter buffer's data are
* assumed to be already transfered into ptr/this_residual.
*/
* The command to work on. The first scatter buffer's data are
* assumed to be already transfered into ptr/this_residual.
*/
-static void merge_contiguous_buffers(
Scsi_Cmnd *cmd
)
+static void merge_contiguous_buffers(
struct scsi_cmnd *cmd
)
{
unsigned long endaddr;
#if (NDEBUG & NDEBUG_MERGING)
{
unsigned long endaddr;
#if (NDEBUG & NDEBUG_MERGING)
@@
-501,24
+500,24
@@
static void merge_contiguous_buffers( Scsi_Cmnd *cmd )
}
/*
}
/*
- * Function : void initialize_SCp(
Scsi_C
mnd *cmd)
+ * Function : void initialize_SCp(
struct scsi_c
mnd *cmd)
*
* Purpose : initialize the saved data pointers for cmd to point to the
* start of the buffer.
*
*
* Purpose : initialize the saved data pointers for cmd to point to the
* start of the buffer.
*
- * Inputs : cmd -
Scsi_C
mnd structure to have pointers reset.
+ * Inputs : cmd -
struct scsi_c
mnd structure to have pointers reset.
*/
*/
-static __inline__ void initialize_SCp(
Scsi_C
mnd *cmd)
+static __inline__ void initialize_SCp(
struct scsi_c
mnd *cmd)
{
/*
* Initialize the Scsi Pointer field so that all of the commands in the
* various queues are valid.
*/
{
/*
* Initialize the Scsi Pointer field so that all of the commands in the
* various queues are valid.
*/
- if (
cmd->use_sg
) {
- cmd->SCp.buffer =
(struct scatterlist *) cmd->buffer
;
- cmd->SCp.buffers_residual =
cmd->use_sg
- 1;
+ if (
scsi_bufflen(cmd)
) {
+ cmd->SCp.buffer =
scsi_sglist(cmd)
;
+ cmd->SCp.buffers_residual =
scsi_sg_count(cmd)
- 1;
cmd->SCp.ptr = (char *) SGADDR(cmd->SCp.buffer);
cmd->SCp.this_residual = cmd->SCp.buffer->length;
cmd->SCp.ptr = (char *) SGADDR(cmd->SCp.buffer);
cmd->SCp.this_residual = cmd->SCp.buffer->length;
@@
-529,8
+528,8
@@
static __inline__ void initialize_SCp(Scsi_Cmnd *cmd)
} else {
cmd->SCp.buffer = NULL;
cmd->SCp.buffers_residual = 0;
} else {
cmd->SCp.buffer = NULL;
cmd->SCp.buffers_residual = 0;
- cmd->SCp.ptr =
(char *) cmd->request_buffer
;
- cmd->SCp.this_residual =
cmd->request_bufflen
;
+ cmd->SCp.ptr =
NULL
;
+ cmd->SCp.this_residual =
0
;
}
}
}
}
@@
-650,7
+649,7
@@
__inline__ void NCR5380_print_phase(struct Scsi_Host *instance) { };
#include <linux/interrupt.h>
static volatile int main_running = 0;
#include <linux/interrupt.h>
static volatile int main_running = 0;
-static DECLARE_WORK(NCR5380_tqueue,
(void (*)(void*))NCR5380_main, NULL
);
+static DECLARE_WORK(NCR5380_tqueue,
NCR5380_main
);
static __inline__ void queue_main(void)
{
static __inline__ void queue_main(void)
{
@@
-753,14
+752,15
@@
static void NCR5380_print_status (struct Scsi_Host *instance)
do { if (pos + strlen(fmt) + 20 /* slop */ < buffer + length) \
pos += sprintf(pos, fmt , ## args); } while(0)
static
do { if (pos + strlen(fmt) + 20 /* slop */ < buffer + length) \
pos += sprintf(pos, fmt , ## args); } while(0)
static
-char *lprint_Scsi_Cmnd (Scsi_Cmnd *cmd, char *pos, char *buffer, int length);
+char *lprint_Scsi_Cmnd(struct scsi_cmnd *cmd, char *pos, char *buffer,
+ int length);
-static int NCR5380_proc_info
(struct Scsi_Host *instance, char *buffer, char **start
,
- off_t offset, int length, int inout)
+static int NCR5380_proc_info
(struct Scsi_Host *instance, char *buffer
,
+
char **start,
off_t offset, int length, int inout)
{
char *pos = buffer;
struct NCR5380_hostdata *hostdata;
{
char *pos = buffer;
struct NCR5380_hostdata *hostdata;
-
Scsi_C
mnd *ptr;
+
struct scsi_c
mnd *ptr;
unsigned long flags;
off_t begin = 0;
#define check_offset() \
unsigned long flags;
off_t begin = 0;
#define check_offset() \
@@
-784,18
+784,19
@@
static int NCR5380_proc_info (struct Scsi_Host *instance, char *buffer, char **s
if (!hostdata->connected)
SPRINTF("scsi%d: no currently connected command\n", HOSTNO);
else
if (!hostdata->connected)
SPRINTF("scsi%d: no currently connected command\n", HOSTNO);
else
- pos = lprint_Scsi_Cmnd ((
Scsi_C
mnd *) hostdata->connected,
+ pos = lprint_Scsi_Cmnd ((
struct scsi_c
mnd *) hostdata->connected,
pos, buffer, length);
SPRINTF("scsi%d: issue_queue\n", HOSTNO);
check_offset();
pos, buffer, length);
SPRINTF("scsi%d: issue_queue\n", HOSTNO);
check_offset();
- for (ptr = (Scsi_Cmnd *) hostdata->issue_queue; ptr; ptr = NEXT(ptr)) {
+ for (ptr = (struct scsi_cmnd *) hostdata->issue_queue; ptr; ptr = NEXT(ptr))
+ {
pos = lprint_Scsi_Cmnd (ptr, pos, buffer, length);
check_offset();
}
SPRINTF("scsi%d: disconnected_queue\n", HOSTNO);
check_offset();
pos = lprint_Scsi_Cmnd (ptr, pos, buffer, length);
check_offset();
}
SPRINTF("scsi%d: disconnected_queue\n", HOSTNO);
check_offset();
- for (ptr = (
Scsi_C
mnd *) hostdata->disconnected_queue; ptr;
+ for (ptr = (
struct scsi_c
mnd *) hostdata->disconnected_queue; ptr;
ptr = NEXT(ptr)) {
pos = lprint_Scsi_Cmnd (ptr, pos, buffer, length);
check_offset();
ptr = NEXT(ptr)) {
pos = lprint_Scsi_Cmnd (ptr, pos, buffer, length);
check_offset();
@@
-810,8
+811,8
@@
static int NCR5380_proc_info (struct Scsi_Host *instance, char *buffer, char **s
return length;
}
return length;
}
-static char *
-
lprint_Scsi_Cmnd (Scsi_Cmnd *cmd, char *pos, char *buffer,
int length)
+static char *
lprint_Scsi_Cmnd(struct scsi_cmnd *cmd, char *pos, char *buffer,
+
int length)
{
int i, s;
unsigned char *command;
{
int i, s;
unsigned char *command;
@@
-888,8
+889,8
@@
static int NCR5380_init (struct Scsi_Host *instance, int flags)
}
/*
}
/*
- * Function : int NCR5380_queue_command (
Scsi_Cmnd *cmd,
- * void (*done)(
Scsi_Cmnd *))
+ * Function : int NCR5380_queue_command (
struct scsi_cmnd *cmd,
+ * void (*done)(
struct scsi_cmnd *))
*
* Purpose : enqueues a SCSI command
*
*
* Purpose : enqueues a SCSI command
*
@@
-906,10
+907,11
@@
static int NCR5380_init (struct Scsi_Host *instance, int flags)
*/
/* Only make static if a wrapper function is used */
*/
/* Only make static if a wrapper function is used */
-static int NCR5380_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
+static int NCR5380_queue_command(struct scsi_cmnd *cmd,
+ void (*done)(struct scsi_cmnd *))
{
SETUP_HOSTDATA(cmd->device->host);
{
SETUP_HOSTDATA(cmd->device->host);
-
Scsi_C
mnd *tmp;
+
struct scsi_c
mnd *tmp;
unsigned long flags;
#if (NDEBUG & NDEBUG_NO_WRITE)
unsigned long flags;
#if (NDEBUG & NDEBUG_NO_WRITE)
@@
-933,7
+935,7
@@
static int NCR5380_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
}
# endif
# ifdef NCR5380_STAT_LIMIT
}
# endif
# ifdef NCR5380_STAT_LIMIT
- if (
cmd->request_bufflen
> NCR5380_STAT_LIMIT)
+ if (
scsi_bufflen(cmd)
> NCR5380_STAT_LIMIT)
# endif
switch (cmd->cmnd[0])
{
# endif
switch (cmd->cmnd[0])
{
@@
-941,14
+943,14
@@
static int NCR5380_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
case WRITE_6:
case WRITE_10:
hostdata->time_write[cmd->device->id] -= (jiffies - hostdata->timebase);
case WRITE_6:
case WRITE_10:
hostdata->time_write[cmd->device->id] -= (jiffies - hostdata->timebase);
- hostdata->bytes_write[cmd->device->id] +=
cmd->request_bufflen
;
+ hostdata->bytes_write[cmd->device->id] +=
scsi_bufflen(cmd)
;
hostdata->pendingw++;
break;
case READ:
case READ_6:
case READ_10:
hostdata->time_read[cmd->device->id] -= (jiffies - hostdata->timebase);
hostdata->pendingw++;
break;
case READ:
case READ_6:
case READ_10:
hostdata->time_read[cmd->device->id] -= (jiffies - hostdata->timebase);
- hostdata->bytes_read[cmd->device->id] +=
cmd->request_bufflen
;
+ hostdata->bytes_read[cmd->device->id] +=
scsi_bufflen(cmd)
;
hostdata->pendingr++;
break;
}
hostdata->pendingr++;
break;
}
@@
-990,7
+992,7
@@
static int NCR5380_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
NEXT(cmd) = hostdata->issue_queue;
hostdata->issue_queue = cmd;
} else {
NEXT(cmd) = hostdata->issue_queue;
hostdata->issue_queue = cmd;
} else {
- for (tmp = (
Scsi_C
mnd *)hostdata->issue_queue;
+ for (tmp = (
struct scsi_c
mnd *)hostdata->issue_queue;
NEXT(tmp); tmp = NEXT(tmp))
;
LIST(cmd, tmp);
NEXT(tmp); tmp = NEXT(tmp))
;
LIST(cmd, tmp);
@@
-1028,9
+1030,9
@@
static int NCR5380_queue_command (Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
* reenable them. This prevents reentrancy and kernel stack overflow.
*/
* reenable them. This prevents reentrancy and kernel stack overflow.
*/
-static void NCR5380_main (
void
*bl)
+static void NCR5380_main (
struct work_struct
*bl)
{
{
-
Scsi_C
mnd *tmp, *prev;
+
struct scsi_c
mnd *tmp, *prev;
struct Scsi_Host *instance = first_instance;
struct NCR5380_hostdata *hostdata = HOSTDATA(instance);
int done;
struct Scsi_Host *instance = first_instance;
struct NCR5380_hostdata *hostdata = HOSTDATA(instance);
int done;
@@
-1073,12
+1075,12
@@
static void NCR5380_main (void *bl)
* for a target that's not busy.
*/
#if (NDEBUG & NDEBUG_LISTS)
* for a target that's not busy.
*/
#if (NDEBUG & NDEBUG_LISTS)
- for (tmp = (
Scsi_C
mnd *) hostdata->issue_queue, prev = NULL;
+ for (tmp = (
struct scsi_c
mnd *) hostdata->issue_queue, prev = NULL;
tmp && (tmp != prev); prev = tmp, tmp = NEXT(tmp))
;
if ((tmp == prev) && tmp) printk(" LOOP\n");/* else printk("\n");*/
#endif
tmp && (tmp != prev); prev = tmp, tmp = NEXT(tmp))
;
if ((tmp == prev) && tmp) printk(" LOOP\n");/* else printk("\n");*/
#endif
- for (tmp = (
Scsi_Cmnd *) hostdata->issue_queue,
+ for (tmp = (
struct scsi_cmnd *) hostdata->issue_queue,
prev = NULL; tmp; prev = tmp, tmp = NEXT(tmp) ) {
#if (NDEBUG & NDEBUG_LISTS)
prev = NULL; tmp; prev = tmp, tmp = NEXT(tmp) ) {
#if (NDEBUG & NDEBUG_LISTS)
@@
-1252,7
+1254,7
@@
static void NCR5380_dma_complete( struct Scsi_Host *instance )
*
*/
*
*/
-static irqreturn_t NCR5380_intr (int irq, void *dev_id
, struct pt_regs *regs
)
+static irqreturn_t NCR5380_intr (int irq, void *dev_id)
{
struct Scsi_Host *instance = first_instance;
int done = 1, handled = 0;
{
struct Scsi_Host *instance = first_instance;
int done = 1, handled = 0;
@@
-1268,7
+1270,7
@@
static irqreturn_t NCR5380_intr (int irq, void *dev_id, struct pt_regs *regs)
NCR_PRINT(NDEBUG_INTR);
if ((NCR5380_read(STATUS_REG) & (SR_SEL|SR_IO)) == (SR_SEL|SR_IO)) {
done = 0;
NCR_PRINT(NDEBUG_INTR);
if ((NCR5380_read(STATUS_REG) & (SR_SEL|SR_IO)) == (SR_SEL|SR_IO)) {
done = 0;
-
ENABLE_IRQ();
+
//
ENABLE_IRQ();
INT_PRINTK("scsi%d: SEL interrupt\n", HOSTNO);
NCR5380_reselect(instance);
(void) NCR5380_read(RESET_PARITY_INTERRUPT_REG);
INT_PRINTK("scsi%d: SEL interrupt\n", HOSTNO);
NCR5380_reselect(instance);
(void) NCR5380_read(RESET_PARITY_INTERRUPT_REG);
@@
-1301,7
+1303,7
@@
static irqreturn_t NCR5380_intr (int irq, void *dev_id, struct pt_regs *regs)
INT_PRINTK("scsi%d: PHASE MISM or EOP interrupt\n", HOSTNO);
NCR5380_dma_complete( instance );
done = 0;
INT_PRINTK("scsi%d: PHASE MISM or EOP interrupt\n", HOSTNO);
NCR5380_dma_complete( instance );
done = 0;
-
ENABLE_IRQ();
+
//
ENABLE_IRQ();
} else
#endif /* REAL_DMA */
{
} else
#endif /* REAL_DMA */
{
@@
-1339,10
+1341,11
@@
static irqreturn_t NCR5380_intr (int irq, void *dev_id, struct pt_regs *regs)
}
#ifdef NCR5380_STATS
}
#ifdef NCR5380_STATS
-static void collect_stats(struct NCR5380_hostdata* hostdata, Scsi_Cmnd* cmd)
+static void collect_stats(struct NCR5380_hostdata *hostdata,
+ struct scsi_cmnd *cmd)
{
# ifdef NCR5380_STAT_LIMIT
{
# ifdef NCR5380_STAT_LIMIT
- if (
cmd->request_bufflen
> NCR5380_STAT_LIMIT)
+ if (
scsi_bufflen(cmd)
> NCR5380_STAT_LIMIT)
# endif
switch (cmd->cmnd[0])
{
# endif
switch (cmd->cmnd[0])
{
@@
-1350,14
+1353,14
@@
static void collect_stats(struct NCR5380_hostdata* hostdata, Scsi_Cmnd* cmd)
case WRITE_6:
case WRITE_10:
hostdata->time_write[cmd->device->id] += (jiffies - hostdata->timebase);
case WRITE_6:
case WRITE_10:
hostdata->time_write[cmd->device->id] += (jiffies - hostdata->timebase);
- /*hostdata->bytes_write[cmd->device->id] +=
cmd->request_bufflen
;*/
+ /*hostdata->bytes_write[cmd->device->id] +=
scsi_bufflen(cmd)
;*/
hostdata->pendingw--;
break;
case READ:
case READ_6:
case READ_10:
hostdata->time_read[cmd->device->id] += (jiffies - hostdata->timebase);
hostdata->pendingw--;
break;
case READ:
case READ_6:
case READ_10:
hostdata->time_read[cmd->device->id] += (jiffies - hostdata->timebase);
- /*hostdata->bytes_read[cmd->device->id] +=
cmd->request_bufflen
;*/
+ /*hostdata->bytes_read[cmd->device->id] +=
scsi_bufflen(cmd)
;*/
hostdata->pendingr--;
break;
}
hostdata->pendingr--;
break;
}
@@
-1365,8
+1368,8
@@
static void collect_stats(struct NCR5380_hostdata* hostdata, Scsi_Cmnd* cmd)
#endif
/*
#endif
/*
- * Function : int NCR5380_select
(struct Scsi_Host *instance, Scsi_Cmnd *cmd,
- * int tag);
+ * Function : int NCR5380_select
(struct Scsi_Host *instance,
+ *
struct scsi_cmnd *cmd,
int tag);
*
* Purpose : establishes I_T_L or I_T_L_Q nexus for new or existing command,
* including ARBITRATION, SELECTION, and initial message out for
*
* Purpose : establishes I_T_L or I_T_L_Q nexus for new or existing command,
* including ARBITRATION, SELECTION, and initial message out for
@@
-1395,7
+1398,8
@@
static void collect_stats(struct NCR5380_hostdata* hostdata, Scsi_Cmnd* cmd)
* cmd->result host byte set to DID_BAD_TARGET.
*/
* cmd->result host byte set to DID_BAD_TARGET.
*/
-static int NCR5380_select (struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag)
+static int NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd,
+ int tag)
{
SETUP_HOSTDATA(instance);
unsigned char tmp[3], phase;
{
SETUP_HOSTDATA(instance);
unsigned char tmp[3], phase;
@@
-1591,7
+1595,7
@@
static int NCR5380_select (struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag)
* IO while SEL is true. But again, there are some disks out the in the
* world that do that nevertheless. (Somebody claimed that this announces
* reselection capability of the target.) So we better skip that test and
* IO while SEL is true. But again, there are some disks out the in the
* world that do that nevertheless. (Somebody claimed that this announces
* reselection capability of the target.) So we better skip that test and
- * only wait for BSY... (Famous german words: Der Kl
ü
gere gibt nach :-)
+ * only wait for BSY... (Famous german words: Der Kl
ü
gere gibt nach :-)
*/
while (time_before(jiffies, timeout) && !(NCR5380_read(STATUS_REG) &
*/
while (time_before(jiffies, timeout) && !(NCR5380_read(STATUS_REG) &
@@
-1859,7
+1863,7
@@
static int do_abort (struct Scsi_Host *host)
* the target sees, so we just handshake.
*/
* the target sees, so we just handshake.
*/
- while (!(
tmp = NCR5380_read(STATUS_REG)) & SR_REQ
);
+ while (!(
(tmp = NCR5380_read(STATUS_REG)) & SR_REQ)
);
NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(tmp));
NCR5380_write(TARGET_COMMAND_REG, PHASE_SR_TO_TCR(tmp));
@@
-1985,7
+1989,7
@@
static void NCR5380_information_transfer (struct Scsi_Host *instance)
#endif
unsigned char *data;
unsigned char phase, tmp, extended_msg[10], old_phase=0xff;
#endif
unsigned char *data;
unsigned char phase, tmp, extended_msg[10], old_phase=0xff;
-
Scsi_Cmnd *cmd = (Scsi_C
mnd *) hostdata->connected;
+
struct scsi_cmnd *cmd = (struct scsi_c
mnd *) hostdata->connected;
#ifdef SUN3_SCSI_VME
dregs->csr |= CSR_INTR;
#ifdef SUN3_SCSI_VME
dregs->csr |= CSR_INTR;
@@
-2017,7
+2021,7
@@
static void NCR5380_information_transfer (struct Scsi_Host *instance)
if((count > SUN3_DMA_MINSIZE) && (sun3_dma_setup_done
!= cmd))
{
if((count > SUN3_DMA_MINSIZE) && (sun3_dma_setup_done
!= cmd))
{
- if(
cmd->request->flags & REQ_CMD
) {
+ if(
blk_fs_request(cmd->request)
) {
sun3scsi_dma_setup(d, count,
rq_data_dir(cmd->request));
sun3_dma_setup_done = cmd;
sun3scsi_dma_setup(d, count,
rq_data_dir(cmd->request));
sun3_dma_setup_done = cmd;
@@
-2050,7
+2054,7
@@
static void NCR5380_information_transfer (struct Scsi_Host *instance)
sink = 1;
do_abort(instance);
cmd->result = DID_ERROR << 16;
sink = 1;
do_abort(instance);
cmd->result = DID_ERROR << 16;
- cmd->done(cmd);
+ cmd->
scsi_
done(cmd);
return;
#endif
case PHASE_DATAIN:
return;
#endif
case PHASE_DATAIN:
@@
-2110,7
+2114,7
@@
static void NCR5380_information_transfer (struct Scsi_Host *instance)
sink = 1;
do_abort(instance);
cmd->result = DID_ERROR << 16;
sink = 1;
do_abort(instance);
cmd->result = DID_ERROR << 16;
- cmd->done(cmd);
+ cmd->
scsi_
done(cmd);
/* XXX - need to source or sink data here, as appropriate */
} else {
#ifdef REAL_DMA
/* XXX - need to source or sink data here, as appropriate */
} else {
#ifdef REAL_DMA
@@
-2249,30
+2253,26
@@
static void NCR5380_information_transfer (struct Scsi_Host *instance)
cmd->result = (cmd->result & 0x00ffff) | (DID_ERROR << 16);
#ifdef AUTOSENSE
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)) {
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);
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;
*/
/* 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);
NEXT(cmd) = hostdata->issue_queue;
local_irq_save(flags);
LIST(cmd,hostdata->issue_queue);
NEXT(cmd) = hostdata->issue_queue;
- hostdata->issue_queue = (
Scsi_C
mnd *) cmd;
+ hostdata->issue_queue = (
struct scsi_c
mnd *) cmd;
local_irq_restore(flags);
QU_PRINTK("scsi%d: REQUEST SENSE added to head of "
"issue queue\n", H_NO(cmd));
local_irq_restore(flags);
QU_PRINTK("scsi%d: REQUEST SENSE added to head of "
"issue queue\n", H_NO(cmd));
@@
-2502,7
+2502,7
@@
static void NCR5380_information_transfer (struct Scsi_Host *instance)
* Function : void NCR5380_reselect (struct Scsi_Host *instance)
*
* Purpose : does reselection, initializing the instance->connected
* Function : void NCR5380_reselect (struct Scsi_Host *instance)
*
* Purpose : does reselection, initializing the instance->connected
- * field to point to the
Scsi_Cmnd for which the I_T_L or I_T_L_Q
+ * field to point to the
struct scsi_cmnd for which the I_T_L or I_T_L_Q
* nexus has been reestablished,
*
* Inputs : instance - this instance of the NCR5380.
* nexus has been reestablished,
*
* Inputs : instance - this instance of the NCR5380.
@@
-2521,7
+2521,7
@@
static void NCR5380_reselect (struct Scsi_Host *instance)
unsigned char tag;
#endif
unsigned char msg[3];
unsigned char tag;
#endif
unsigned char msg[3];
-
Scsi_C
mnd *tmp = NULL, *prev;
+
struct scsi_c
mnd *tmp = NULL, *prev;
/* unsigned long flags; */
/*
/* unsigned long flags; */
/*
@@
-2577,7
+2577,7
@@
static void NCR5380_reselect (struct Scsi_Host *instance)
* just reestablished, and remove it from the disconnected queue.
*/
* just reestablished, and remove it from the disconnected queue.
*/
- for (tmp = (
Scsi_Cmnd *) hostdata->disconnected_queue, prev = NULL;
+ for (tmp = (
struct scsi_cmnd *) hostdata->disconnected_queue, prev = NULL;
tmp; prev = tmp, tmp = NEXT(tmp) ) {
if ((target_mask == (1 << tmp->device->id)) && (lun == tmp->device->lun)
#ifdef SUPPORT_TAGS
tmp; prev = tmp, tmp = NEXT(tmp) ) {
if ((target_mask == (1 << tmp->device->id)) && (lun == tmp->device->lun)
#ifdef SUPPORT_TAGS
@@
-2668,11
+2668,11
@@
static void NCR5380_reselect (struct Scsi_Host *instance)
/*
/*
- * Function : int NCR5380_abort
(Scsi_C
mnd *cmd)
+ * Function : int NCR5380_abort
(struct scsi_c
mnd *cmd)
*
* Purpose : abort a command
*
*
* Purpose : abort a command
*
- * Inputs : cmd - the
Scsi_Cmnd to abort, code - code to set the
+ * Inputs : cmd - the
struct scsi_cmnd to abort, code - code to set the
* host byte of the result field to, if zero DID_ABORTED is
* used.
*
* host byte of the result field to, if zero DID_ABORTED is
* used.
*
@@
-2684,11
+2684,11
@@
static void NCR5380_reselect (struct Scsi_Host *instance)
* called where the loop started in NCR5380_main().
*/
* called where the loop started in NCR5380_main().
*/
-static int NCR5380_abort
(Scsi_C
mnd *cmd)
+static int NCR5380_abort
(struct scsi_c
mnd *cmd)
{
struct Scsi_Host *instance = cmd->device->host;
SETUP_HOSTDATA(instance);
{
struct Scsi_Host *instance = cmd->device->host;
SETUP_HOSTDATA(instance);
-
Scsi_C
mnd *tmp, **prev;
+
struct scsi_c
mnd *tmp, **prev;
unsigned long flags;
printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO);
unsigned long flags;
printk(KERN_NOTICE "scsi%d: aborting command\n", HOSTNO);
@@
-2753,9
+2753,9
@@
static int NCR5380_abort (Scsi_Cmnd *cmd)
* Case 2 : If the command hasn't been issued yet, we simply remove it
* from the issue queue.
*/
* Case 2 : If the command hasn't been issued yet, we simply remove it
* from the issue queue.
*/
- for (prev = (
Scsi_Cmnd **) &(hostdata->issue_queue),
- tmp = (
Scsi_C
mnd *) hostdata->issue_queue;
- tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp)
)
+ for (prev = (
struct scsi_cmnd **) &(hostdata->issue_queue),
+ tmp = (
struct scsi_c
mnd *) hostdata->issue_queue;
+ tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp))
if (cmd == tmp) {
REMOVE(5, *prev, tmp, NEXT(tmp));
(*prev) = NEXT(tmp);
if (cmd == tmp) {
REMOVE(5, *prev, tmp, NEXT(tmp));
(*prev) = NEXT(tmp);
@@
-2812,7
+2812,7
@@
static int NCR5380_abort (Scsi_Cmnd *cmd)
* it from the disconnected queue.
*/
* it from the disconnected queue.
*/
- for (tmp = (
Scsi_C
mnd *) hostdata->disconnected_queue; tmp;
+ for (tmp = (
struct scsi_c
mnd *) hostdata->disconnected_queue; tmp;
tmp = NEXT(tmp))
if (cmd == tmp) {
local_irq_restore(flags);
tmp = NEXT(tmp))
if (cmd == tmp) {
local_irq_restore(flags);
@@
-2826,8
+2826,8
@@
static int NCR5380_abort (Scsi_Cmnd *cmd)
do_abort (instance);
local_irq_save(flags);
do_abort (instance);
local_irq_save(flags);
- for (prev = (
Scsi_Cmnd **) &(hostdata->disconnected_queue),
- tmp = (
Scsi_C
mnd *) hostdata->disconnected_queue;
+ for (prev = (
struct scsi_cmnd **) &(hostdata->disconnected_queue),
+ tmp = (
struct scsi_c
mnd *) hostdata->disconnected_queue;
tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp) )
if (cmd == tmp) {
REMOVE(5, *prev, tmp, NEXT(tmp));
tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp) )
if (cmd == tmp) {
REMOVE(5, *prev, tmp, NEXT(tmp));
@@
-2860,15
+2860,14
@@
static int NCR5380_abort (Scsi_Cmnd *cmd)
*/
local_irq_restore(flags);
*/
local_irq_restore(flags);
- printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully\n"
- KERN_INFO " before abortion\n", HOSTNO);
+ printk(KERN_INFO "scsi%d: warning : SCSI command probably completed successfully before abortion\n", HOSTNO);
return SCSI_ABORT_NOT_RUNNING;
}
/*
return SCSI_ABORT_NOT_RUNNING;
}
/*
- * Function : int NCR5380_bus_reset
(Scsi_C
mnd *cmd)
+ * Function : int NCR5380_bus_reset
(struct scsi_c
mnd *cmd)
*
* Purpose : reset the SCSI bus.
*
*
* Purpose : reset the SCSI bus.
*
@@
-2876,13
+2875,13
@@
static int NCR5380_abort (Scsi_Cmnd *cmd)
*
*/
*
*/
-static int NCR5380_bus_reset(
Scsi_C
mnd *cmd)
+static int NCR5380_bus_reset(
struct scsi_c
mnd *cmd)
{
SETUP_HOSTDATA(cmd->device->host);
int i;
unsigned long flags;
#if 1
{
SETUP_HOSTDATA(cmd->device->host);
int i;
unsigned long flags;
#if 1
-
Scsi_C
mnd *connected, *disconnected_queue;
+
struct scsi_c
mnd *connected, *disconnected_queue;
#endif
#endif
@@
-2914,9
+2913,9
@@
static int NCR5380_bus_reset( Scsi_Cmnd *cmd)
* remembered in local variables first.
*/
local_irq_save(flags);
* remembered in local variables first.
*/
local_irq_save(flags);
- connected = (
Scsi_C
mnd *)hostdata->connected;
+ connected = (
struct scsi_c
mnd *)hostdata->connected;
hostdata->connected = NULL;
hostdata->connected = NULL;
- disconnected_queue = (
Scsi_C
mnd *)hostdata->disconnected_queue;
+ disconnected_queue = (
struct scsi_c
mnd *)hostdata->disconnected_queue;
hostdata->disconnected_queue = NULL;
#ifdef SUPPORT_TAGS
free_all_tags();
hostdata->disconnected_queue = NULL;
#ifdef SUPPORT_TAGS
free_all_tags();