|
|
@@ -262,9 +262,9 @@ static struct scsi_host_template *the_template = NULL;
|
|
|
(struct NCR5380_hostdata *)(in)->hostdata
|
|
|
#define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata)
|
|
|
|
|
|
-#define NEXT(cmd) ((Scsi_Cmnd *)(cmd)->host_scribble)
|
|
|
+#define NEXT(cmd) ((struct scsi_cmnd *)(cmd)->host_scribble)
|
|
|
#define SET_NEXT(cmd,next) ((cmd)->host_scribble = (void *)(next))
|
|
|
-#define NEXTADDR(cmd) ((Scsi_Cmnd **)&(cmd)->host_scribble)
|
|
|
+#define NEXTADDR(cmd) ((struct scsi_cmnd **)&(cmd)->host_scribble)
|
|
|
|
|
|
#define HOSTNO instance->host_no
|
|
|
#define H_NO(cmd) (cmd)->device->host->host_no
|
|
|
@@ -345,7 +345,7 @@ static void __init init_tags(void)
|
|
|
* 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)
|
|
|
{
|
|
|
u8 lun = cmd->device->lun;
|
|
|
SETUP_HOSTDATA(cmd->device->host);
|
|
|
@@ -370,7 +370,7 @@ static int is_lun_busy(Scsi_Cmnd *cmd, int should_be_tagged)
|
|
|
* 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)
|
|
|
{
|
|
|
u8 lun = cmd->device->lun;
|
|
|
SETUP_HOSTDATA(cmd->device->host);
|
|
|
@@ -402,7 +402,7 @@ static void cmd_get_tag(Scsi_Cmnd *cmd, int should_be_tagged)
|
|
|
* unlock the LUN.
|
|
|
*/
|
|
|
|
|
|
-static void cmd_free_tag(Scsi_Cmnd *cmd)
|
|
|
+static void cmd_free_tag(struct scsi_cmnd *cmd)
|
|
|
{
|
|
|
u8 lun = cmd->device->lun;
|
|
|
SETUP_HOSTDATA(cmd->device->host);
|
|
|
@@ -445,18 +445,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.
|
|
|
*
|
|
|
- * Parameters: Scsi_Cmnd *cmd
|
|
|
+ * Parameters: struct scsi_cmnd *cmd
|
|
|
* The command to work on. The first scatter buffer's data are
|
|
|
* assumed to be already transferred 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)
|
|
|
@@ -485,15 +485,15 @@ static void merge_contiguous_buffers(Scsi_Cmnd *cmd)
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- * Function : void initialize_SCp(Scsi_Cmnd *cmd)
|
|
|
+ * Function : void initialize_SCp(struct scsi_cmnd *cmd)
|
|
|
*
|
|
|
* Purpose : initialize the saved data pointers for cmd to point to the
|
|
|
* start of the buffer.
|
|
|
*
|
|
|
- * Inputs : cmd - Scsi_Cmnd structure to have pointers reset.
|
|
|
+ * Inputs : cmd - scsi_cmnd structure to have pointers reset.
|
|
|
*/
|
|
|
|
|
|
-static inline void initialize_SCp(Scsi_Cmnd *cmd)
|
|
|
+static inline void initialize_SCp(struct scsi_cmnd *cmd)
|
|
|
{
|
|
|
/*
|
|
|
* Initialize the Scsi Pointer field so that all of the commands in the
|
|
|
@@ -714,7 +714,7 @@ static void prepare_info(struct Scsi_Host *instance)
|
|
|
* Inputs : instance, pointer to this instance.
|
|
|
*/
|
|
|
|
|
|
-static void lprint_Scsi_Cmnd(Scsi_Cmnd *cmd)
|
|
|
+static void lprint_Scsi_Cmnd(struct scsi_cmnd *cmd)
|
|
|
{
|
|
|
int i, s;
|
|
|
unsigned char *command;
|
|
|
@@ -731,7 +731,7 @@ static void lprint_Scsi_Cmnd(Scsi_Cmnd *cmd)
|
|
|
static void NCR5380_print_status(struct Scsi_Host *instance)
|
|
|
{
|
|
|
struct NCR5380_hostdata *hostdata;
|
|
|
- Scsi_Cmnd *ptr;
|
|
|
+ struct scsi_cmnd *ptr;
|
|
|
unsigned long flags;
|
|
|
|
|
|
NCR5380_dprint(NDEBUG_ANY, instance);
|
|
|
@@ -745,13 +745,13 @@ static void NCR5380_print_status(struct Scsi_Host *instance)
|
|
|
if (!hostdata->connected)
|
|
|
printk("scsi%d: no currently connected command\n", HOSTNO);
|
|
|
else
|
|
|
- lprint_Scsi_Cmnd((Scsi_Cmnd *) hostdata->connected);
|
|
|
+ lprint_Scsi_Cmnd((struct scsi_cmnd *) hostdata->connected);
|
|
|
printk("scsi%d: issue_queue\n", HOSTNO);
|
|
|
- for (ptr = (Scsi_Cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr))
|
|
|
+ for (ptr = (struct scsi_cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr))
|
|
|
lprint_Scsi_Cmnd(ptr);
|
|
|
|
|
|
printk("scsi%d: disconnected_queue\n", HOSTNO);
|
|
|
- for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr;
|
|
|
+ for (ptr = (struct scsi_cmnd *) hostdata->disconnected_queue; ptr;
|
|
|
ptr = NEXT(ptr))
|
|
|
lprint_Scsi_Cmnd(ptr);
|
|
|
|
|
|
@@ -759,7 +759,7 @@ static void NCR5380_print_status(struct Scsi_Host *instance)
|
|
|
printk("\n");
|
|
|
}
|
|
|
|
|
|
-static void show_Scsi_Cmnd(Scsi_Cmnd *cmd, struct seq_file *m)
|
|
|
+static void show_Scsi_Cmnd(struct scsi_cmnd *cmd, struct seq_file *m)
|
|
|
{
|
|
|
int i, s;
|
|
|
unsigned char *command;
|
|
|
@@ -777,7 +777,7 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m,
|
|
|
struct Scsi_Host *instance)
|
|
|
{
|
|
|
struct NCR5380_hostdata *hostdata;
|
|
|
- Scsi_Cmnd *ptr;
|
|
|
+ struct scsi_cmnd *ptr;
|
|
|
unsigned long flags;
|
|
|
|
|
|
hostdata = (struct NCR5380_hostdata *)instance->hostdata;
|
|
|
@@ -788,13 +788,13 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m,
|
|
|
if (!hostdata->connected)
|
|
|
seq_printf(m, "scsi%d: no currently connected command\n", HOSTNO);
|
|
|
else
|
|
|
- show_Scsi_Cmnd((Scsi_Cmnd *) hostdata->connected, m);
|
|
|
+ show_Scsi_Cmnd((struct scsi_cmnd *) hostdata->connected, m);
|
|
|
seq_printf(m, "scsi%d: issue_queue\n", HOSTNO);
|
|
|
- for (ptr = (Scsi_Cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr))
|
|
|
+ for (ptr = (struct scsi_cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr))
|
|
|
show_Scsi_Cmnd(ptr, m);
|
|
|
|
|
|
seq_printf(m, "scsi%d: disconnected_queue\n", HOSTNO);
|
|
|
- for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr;
|
|
|
+ for (ptr = (struct scsi_cmnd *) hostdata->disconnected_queue; ptr;
|
|
|
ptr = NEXT(ptr))
|
|
|
show_Scsi_Cmnd(ptr, m);
|
|
|
|
|
|
@@ -862,8 +862,8 @@ static void NCR5380_exit(struct Scsi_Host *instance)
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- * 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
|
|
|
*
|
|
|
@@ -879,10 +879,11 @@ static void NCR5380_exit(struct Scsi_Host *instance)
|
|
|
*
|
|
|
*/
|
|
|
|
|
|
-static int NCR5380_queue_command_lck(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
|
|
|
+static int NCR5380_queue_command_lck(struct scsi_cmnd *cmd,
|
|
|
+ void (*done)(struct scsi_cmnd *))
|
|
|
{
|
|
|
SETUP_HOSTDATA(cmd->device->host);
|
|
|
- Scsi_Cmnd *tmp;
|
|
|
+ struct scsi_cmnd *tmp;
|
|
|
unsigned long flags;
|
|
|
|
|
|
#if (NDEBUG & NDEBUG_NO_WRITE)
|
|
|
@@ -937,7 +938,7 @@ static int NCR5380_queue_command_lck(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
|
|
|
SET_NEXT(cmd, hostdata->issue_queue);
|
|
|
hostdata->issue_queue = cmd;
|
|
|
} else {
|
|
|
- for (tmp = (Scsi_Cmnd *)hostdata->issue_queue;
|
|
|
+ for (tmp = (struct scsi_cmnd *)hostdata->issue_queue;
|
|
|
NEXT(tmp); tmp = NEXT(tmp))
|
|
|
;
|
|
|
LIST(cmd, tmp);
|
|
|
@@ -978,7 +979,7 @@ static DEF_SCSI_QCMD(NCR5380_queue_command)
|
|
|
|
|
|
static void NCR5380_main(struct work_struct *work)
|
|
|
{
|
|
|
- Scsi_Cmnd *tmp, *prev;
|
|
|
+ struct scsi_cmnd *tmp, *prev;
|
|
|
struct Scsi_Host *instance = first_instance;
|
|
|
struct NCR5380_hostdata *hostdata = HOSTDATA(instance);
|
|
|
int done;
|
|
|
@@ -1021,7 +1022,7 @@ static void NCR5380_main(struct work_struct *work)
|
|
|
* for a target that's not busy.
|
|
|
*/
|
|
|
#if (NDEBUG & NDEBUG_LISTS)
|
|
|
- for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, prev = NULL;
|
|
|
+ for (tmp = (struct scsi_cmnd *) hostdata->issue_queue, prev = NULL;
|
|
|
tmp && (tmp != prev); prev = tmp, tmp = NEXT(tmp))
|
|
|
;
|
|
|
/*printk("%p ", tmp);*/
|
|
|
@@ -1029,7 +1030,7 @@ static void NCR5380_main(struct work_struct *work)
|
|
|
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)) {
|
|
|
u8 lun = tmp->device->lun;
|
|
|
|
|
|
@@ -1291,7 +1292,8 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id)
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
- * Function : int NCR5380_select (struct Scsi_Host *instance, Scsi_Cmnd *cmd)
|
|
|
+ * Function : int NCR5380_select(struct Scsi_Host *instance,
|
|
|
+ * struct scsi_cmnd *cmd)
|
|
|
*
|
|
|
* Purpose : establishes I_T_L or I_T_L_Q nexus for new or existing command,
|
|
|
* including ARBITRATION, SELECTION, and initial message out for
|
|
|
@@ -1318,7 +1320,7 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id)
|
|
|
* cmd->result host byte set to DID_BAD_TARGET.
|
|
|
*/
|
|
|
|
|
|
-static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd)
|
|
|
+static int NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
|
|
|
{
|
|
|
SETUP_HOSTDATA(instance);
|
|
|
unsigned char tmp[3], phase;
|
|
|
@@ -1917,7 +1919,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
|
|
#endif
|
|
|
unsigned char *data;
|
|
|
unsigned char phase, tmp, extended_msg[10], old_phase = 0xff;
|
|
|
- Scsi_Cmnd *cmd = (Scsi_Cmnd *) hostdata->connected;
|
|
|
+ struct scsi_cmnd *cmd = (struct scsi_cmnd *) hostdata->connected;
|
|
|
|
|
|
while (1) {
|
|
|
tmp = NCR5380_read(STATUS_REG);
|
|
|
@@ -2154,7 +2156,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
|
|
|
local_irq_save(flags);
|
|
|
LIST(cmd,hostdata->issue_queue);
|
|
|
SET_NEXT(cmd, hostdata->issue_queue);
|
|
|
- hostdata->issue_queue = (Scsi_Cmnd *) cmd;
|
|
|
+ hostdata->issue_queue = (struct scsi_cmnd *) cmd;
|
|
|
local_irq_restore(flags);
|
|
|
dprintk(NDEBUG_QUEUES, "scsi%d: REQUEST SENSE added to head of "
|
|
|
"issue queue\n", H_NO(cmd));
|
|
|
@@ -2378,7 +2380,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
|
|
|
- * field to point to the Scsi_Cmnd for which the I_T_L or I_T_L_Q
|
|
|
+ * field to point to the scsi_cmnd for which the I_T_L or I_T_L_Q
|
|
|
* nexus has been reestablished,
|
|
|
*
|
|
|
* Inputs : instance - this instance of the NCR5380.
|
|
|
@@ -2397,7 +2399,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
|
|
|
#endif
|
|
|
unsigned char msg[3];
|
|
|
unsigned char *data;
|
|
|
- Scsi_Cmnd *tmp = NULL, *prev;
|
|
|
+ struct scsi_cmnd *tmp = NULL, *prev;
|
|
|
/* unsigned long flags; */
|
|
|
|
|
|
/*
|
|
|
@@ -2471,7 +2473,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
|
|
|
* 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
|
|
|
@@ -2522,11 +2524,11 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
|
|
|
|
|
|
|
|
|
/*
|
|
|
- * Function : int NCR5380_abort (Scsi_Cmnd *cmd)
|
|
|
+ * Function : int NCR5380_abort (struct scsi_cmnd *cmd)
|
|
|
*
|
|
|
* Purpose : abort a command
|
|
|
*
|
|
|
- * Inputs : cmd - the Scsi_Cmnd to abort, code - code to set the
|
|
|
+ * Inputs : cmd - the scsi_cmnd to abort, code - code to set the
|
|
|
* host byte of the result field to, if zero DID_ABORTED is
|
|
|
* used.
|
|
|
*
|
|
|
@@ -2539,11 +2541,11 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
|
|
|
*/
|
|
|
|
|
|
static
|
|
|
-int NCR5380_abort(Scsi_Cmnd *cmd)
|
|
|
+int NCR5380_abort(struct scsi_cmnd *cmd)
|
|
|
{
|
|
|
struct Scsi_Host *instance = cmd->device->host;
|
|
|
SETUP_HOSTDATA(instance);
|
|
|
- Scsi_Cmnd *tmp, **prev;
|
|
|
+ struct scsi_cmnd *tmp, **prev;
|
|
|
unsigned long flags;
|
|
|
|
|
|
scmd_printk(KERN_NOTICE, cmd, "aborting command\n");
|
|
|
@@ -2612,8 +2614,8 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
|
|
|
* 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_Cmnd *)hostdata->issue_queue;
|
|
|
+ for (prev = (struct scsi_cmnd **)&(hostdata->issue_queue),
|
|
|
+ tmp = (struct scsi_cmnd *)hostdata->issue_queue;
|
|
|
tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp)) {
|
|
|
if (cmd == tmp) {
|
|
|
REMOVE(5, *prev, tmp, NEXT(tmp));
|
|
|
@@ -2673,7 +2675,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
|
|
|
* it from the disconnected queue.
|
|
|
*/
|
|
|
|
|
|
- for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue; tmp;
|
|
|
+ for (tmp = (struct scsi_cmnd *) hostdata->disconnected_queue; tmp;
|
|
|
tmp = NEXT(tmp)) {
|
|
|
if (cmd == tmp) {
|
|
|
local_irq_restore(flags);
|
|
|
@@ -2687,8 +2689,8 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
|
|
|
do_abort(instance);
|
|
|
|
|
|
local_irq_save(flags);
|
|
|
- for (prev = (Scsi_Cmnd **)&(hostdata->disconnected_queue),
|
|
|
- tmp = (Scsi_Cmnd *)hostdata->disconnected_queue;
|
|
|
+ for (prev = (struct scsi_cmnd **)&(hostdata->disconnected_queue),
|
|
|
+ tmp = (struct scsi_cmnd *)hostdata->disconnected_queue;
|
|
|
tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp)) {
|
|
|
if (cmd == tmp) {
|
|
|
REMOVE(5, *prev, tmp, NEXT(tmp));
|
|
|
@@ -2737,7 +2739,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
|
|
|
|
|
|
|
|
|
/*
|
|
|
- * Function : int NCR5380_reset (Scsi_Cmnd *cmd)
|
|
|
+ * Function : int NCR5380_reset (struct scsi_cmnd *cmd)
|
|
|
*
|
|
|
* Purpose : reset the SCSI bus.
|
|
|
*
|
|
|
@@ -2745,13 +2747,13 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
|
|
|
*
|
|
|
*/
|
|
|
|
|
|
-static int NCR5380_bus_reset(Scsi_Cmnd *cmd)
|
|
|
+static int NCR5380_bus_reset(struct scsi_cmnd *cmd)
|
|
|
{
|
|
|
SETUP_HOSTDATA(cmd->device->host);
|
|
|
int i;
|
|
|
unsigned long flags;
|
|
|
#if defined(RESET_RUN_DONE)
|
|
|
- Scsi_Cmnd *connected, *disconnected_queue;
|
|
|
+ struct scsi_cmnd *connected, *disconnected_queue;
|
|
|
#endif
|
|
|
|
|
|
if (!IS_A_TT() && !falcon_got_lock)
|
|
|
@@ -2793,9 +2795,9 @@ static int NCR5380_bus_reset(Scsi_Cmnd *cmd)
|
|
|
* remembered in local variables first.
|
|
|
*/
|
|
|
local_irq_save(flags);
|
|
|
- connected = (Scsi_Cmnd *)hostdata->connected;
|
|
|
+ connected = (struct scsi_cmnd *)hostdata->connected;
|
|
|
hostdata->connected = NULL;
|
|
|
- disconnected_queue = (Scsi_Cmnd *)hostdata->disconnected_queue;
|
|
|
+ disconnected_queue = (struct scsi_cmnd *)hostdata->disconnected_queue;
|
|
|
hostdata->disconnected_queue = NULL;
|
|
|
#ifdef SUPPORT_TAGS
|
|
|
free_all_tags();
|