aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/NCR5380.c70
-rw-r--r--drivers/scsi/NCR5380.h10
-rw-r--r--drivers/scsi/arm/cumana_1.c1
-rw-r--r--drivers/scsi/arm/oak.c1
-rw-r--r--drivers/scsi/atari_NCR5380.c102
-rw-r--r--drivers/scsi/atari_scsi.c5
-rw-r--r--drivers/scsi/dmx3191d.c1
-rw-r--r--drivers/scsi/dtc.c1
-rw-r--r--drivers/scsi/g_NCR5380.c1
-rw-r--r--drivers/scsi/mac_scsi.c1
-rw-r--r--drivers/scsi/pas16.c1
-rw-r--r--drivers/scsi/sun3_NCR5380.c20
-rw-r--r--drivers/scsi/sun3_scsi.c1
-rw-r--r--drivers/scsi/t128.c1
14 files changed, 105 insertions, 111 deletions
diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 12334a08b701..36244d63def2 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -277,7 +277,7 @@ static void do_reset(struct Scsi_Host *host);
277 * Set up the internal fields in the SCSI command. 277 * Set up the internal fields in the SCSI command.
278 */ 278 */
279 279
280static __inline__ void initialize_SCp(Scsi_Cmnd * cmd) 280static inline void initialize_SCp(struct scsi_cmnd *cmd)
281{ 281{
282 /* 282 /*
283 * Initialize the Scsi Pointer field so that all of the commands in the 283 * Initialize the Scsi Pointer field so that all of the commands in the
@@ -719,7 +719,7 @@ static int __maybe_unused NCR5380_write_info(struct Scsi_Host *instance,
719#undef SPRINTF 719#undef SPRINTF
720#define SPRINTF(args...) seq_printf(m, ## args) 720#define SPRINTF(args...) seq_printf(m, ## args)
721static 721static
722void lprint_Scsi_Cmnd(Scsi_Cmnd * cmd, struct seq_file *m); 722void lprint_Scsi_Cmnd(struct scsi_cmnd *cmd, struct seq_file *m);
723static 723static
724void lprint_command(unsigned char *cmd, struct seq_file *m); 724void lprint_command(unsigned char *cmd, struct seq_file *m);
725static 725static
@@ -729,7 +729,7 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m,
729 struct Scsi_Host *instance) 729 struct Scsi_Host *instance)
730{ 730{
731 struct NCR5380_hostdata *hostdata; 731 struct NCR5380_hostdata *hostdata;
732 Scsi_Cmnd *ptr; 732 struct scsi_cmnd *ptr;
733 733
734 hostdata = (struct NCR5380_hostdata *) instance->hostdata; 734 hostdata = (struct NCR5380_hostdata *) instance->hostdata;
735 735
@@ -741,19 +741,19 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m,
741 if (!hostdata->connected) 741 if (!hostdata->connected)
742 SPRINTF("scsi%d: no currently connected command\n", instance->host_no); 742 SPRINTF("scsi%d: no currently connected command\n", instance->host_no);
743 else 743 else
744 lprint_Scsi_Cmnd((Scsi_Cmnd *) hostdata->connected, m); 744 lprint_Scsi_Cmnd((struct scsi_cmnd *) hostdata->connected, m);
745 SPRINTF("scsi%d: issue_queue\n", instance->host_no); 745 SPRINTF("scsi%d: issue_queue\n", instance->host_no);
746 for (ptr = (Scsi_Cmnd *) hostdata->issue_queue; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble) 746 for (ptr = (struct scsi_cmnd *) hostdata->issue_queue; ptr; ptr = (struct scsi_cmnd *) ptr->host_scribble)
747 lprint_Scsi_Cmnd(ptr, m); 747 lprint_Scsi_Cmnd(ptr, m);
748 748
749 SPRINTF("scsi%d: disconnected_queue\n", instance->host_no); 749 SPRINTF("scsi%d: disconnected_queue\n", instance->host_no);
750 for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr; ptr = (Scsi_Cmnd *) ptr->host_scribble) 750 for (ptr = (struct scsi_cmnd *) hostdata->disconnected_queue; ptr; ptr = (struct scsi_cmnd *) ptr->host_scribble)
751 lprint_Scsi_Cmnd(ptr, m); 751 lprint_Scsi_Cmnd(ptr, m);
752 spin_unlock_irq(instance->host_lock); 752 spin_unlock_irq(instance->host_lock);
753 return 0; 753 return 0;
754} 754}
755 755
756static void lprint_Scsi_Cmnd(Scsi_Cmnd * cmd, struct seq_file *m) 756static void lprint_Scsi_Cmnd(struct scsi_cmnd *cmd, struct seq_file *m)
757{ 757{
758 SPRINTF("scsi%d : destination target %d, lun %llu\n", cmd->device->host->host_no, cmd->device->id, cmd->device->lun); 758 SPRINTF("scsi%d : destination target %d, lun %llu\n", cmd->device->host->host_no, cmd->device->id, cmd->device->lun);
759 SPRINTF(" command = "); 759 SPRINTF(" command = ");
@@ -912,11 +912,11 @@ static void NCR5380_exit(struct Scsi_Host *instance)
912 * Locks: host lock taken by caller 912 * Locks: host lock taken by caller
913 */ 913 */
914 914
915static int NCR5380_queue_command_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) 915static int NCR5380_queue_command_lck(struct scsi_cmnd *cmd, void (*done) (struct scsi_cmnd *))
916{ 916{
917 struct Scsi_Host *instance = cmd->device->host; 917 struct Scsi_Host *instance = cmd->device->host;
918 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; 918 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
919 Scsi_Cmnd *tmp; 919 struct scsi_cmnd *tmp;
920 920
921#if (NDEBUG & NDEBUG_NO_WRITE) 921#if (NDEBUG & NDEBUG_NO_WRITE)
922 switch (cmd->cmnd[0]) { 922 switch (cmd->cmnd[0]) {
@@ -950,7 +950,7 @@ static int NCR5380_queue_command_lck(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)
950 cmd->host_scribble = (unsigned char *) hostdata->issue_queue; 950 cmd->host_scribble = (unsigned char *) hostdata->issue_queue;
951 hostdata->issue_queue = cmd; 951 hostdata->issue_queue = cmd;
952 } else { 952 } else {
953 for (tmp = (Scsi_Cmnd *) hostdata->issue_queue; tmp->host_scribble; tmp = (Scsi_Cmnd *) tmp->host_scribble); 953 for (tmp = (struct scsi_cmnd *) hostdata->issue_queue; tmp->host_scribble; tmp = (struct scsi_cmnd *) tmp->host_scribble);
954 LIST(cmd, tmp); 954 LIST(cmd, tmp);
955 tmp->host_scribble = (unsigned char *) cmd; 955 tmp->host_scribble = (unsigned char *) cmd;
956 } 956 }
@@ -981,7 +981,7 @@ static void NCR5380_main(struct work_struct *work)
981 struct NCR5380_hostdata *hostdata = 981 struct NCR5380_hostdata *hostdata =
982 container_of(work, struct NCR5380_hostdata, coroutine.work); 982 container_of(work, struct NCR5380_hostdata, coroutine.work);
983 struct Scsi_Host *instance = hostdata->host; 983 struct Scsi_Host *instance = hostdata->host;
984 Scsi_Cmnd *tmp, *prev; 984 struct scsi_cmnd *tmp, *prev;
985 int done; 985 int done;
986 986
987 spin_lock_irq(instance->host_lock); 987 spin_lock_irq(instance->host_lock);
@@ -994,7 +994,7 @@ static void NCR5380_main(struct work_struct *work)
994 * Search through the issue_queue for a command destined 994 * Search through the issue_queue for a command destined
995 * for a target that's not busy. 995 * for a target that's not busy.
996 */ 996 */
997 for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, prev = NULL; tmp; prev = tmp, tmp = (Scsi_Cmnd *) tmp->host_scribble) 997 for (tmp = (struct scsi_cmnd *) hostdata->issue_queue, prev = NULL; tmp; prev = tmp, tmp = (struct scsi_cmnd *) tmp->host_scribble)
998 { 998 {
999 if (prev != tmp) 999 if (prev != tmp)
1000 dprintk(NDEBUG_LISTS, "MAIN tmp=%p target=%d busy=%d lun=%llu\n", tmp, tmp->device->id, hostdata->busy[tmp->device->id], tmp->device->lun); 1000 dprintk(NDEBUG_LISTS, "MAIN tmp=%p target=%d busy=%d lun=%llu\n", tmp, tmp->device->id, hostdata->busy[tmp->device->id], tmp->device->lun);
@@ -1006,7 +1006,7 @@ static void NCR5380_main(struct work_struct *work)
1006 prev->host_scribble = tmp->host_scribble; 1006 prev->host_scribble = tmp->host_scribble;
1007 } else { 1007 } else {
1008 REMOVE(-1, hostdata->issue_queue, tmp, tmp->host_scribble); 1008 REMOVE(-1, hostdata->issue_queue, tmp, tmp->host_scribble);
1009 hostdata->issue_queue = (Scsi_Cmnd *) tmp->host_scribble; 1009 hostdata->issue_queue = (struct scsi_cmnd *) tmp->host_scribble;
1010 } 1010 }
1011 tmp->host_scribble = NULL; 1011 tmp->host_scribble = NULL;
1012 1012
@@ -1053,7 +1053,7 @@ static void NCR5380_main(struct work_struct *work)
1053 /* exited locked */ 1053 /* exited locked */
1054 } /* if (!hostdata->connected) */ 1054 } /* if (!hostdata->connected) */
1055 if (hostdata->selecting) { 1055 if (hostdata->selecting) {
1056 tmp = (Scsi_Cmnd *) hostdata->selecting; 1056 tmp = (struct scsi_cmnd *) hostdata->selecting;
1057 /* Selection will drop and retake the lock */ 1057 /* Selection will drop and retake the lock */
1058 if (!NCR5380_select(instance, tmp)) { 1058 if (!NCR5380_select(instance, tmp)) {
1059 /* Ok ?? */ 1059 /* Ok ?? */
@@ -1175,7 +1175,8 @@ static irqreturn_t NCR5380_intr(int dummy, void *dev_id)
1175#endif 1175#endif
1176 1176
1177/* 1177/*
1178 * Function : int NCR5380_select (struct Scsi_Host *instance, Scsi_Cmnd *cmd) 1178 * Function : int NCR5380_select(struct Scsi_Host *instance,
1179 * struct scsi_cmnd *cmd)
1179 * 1180 *
1180 * Purpose : establishes I_T_L or I_T_L_Q nexus for new or existing command, 1181 * Purpose : establishes I_T_L or I_T_L_Q nexus for new or existing command,
1181 * including ARBITRATION, SELECTION, and initial message out for 1182 * including ARBITRATION, SELECTION, and initial message out for
@@ -1204,7 +1205,7 @@ static irqreturn_t NCR5380_intr(int dummy, void *dev_id)
1204 * Locks: caller holds hostdata lock in IRQ mode 1205 * Locks: caller holds hostdata lock in IRQ mode
1205 */ 1206 */
1206 1207
1207static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd) 1208static int NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
1208{ 1209{
1209 NCR5380_local_declare(); 1210 NCR5380_local_declare();
1210 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; 1211 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
@@ -2011,7 +2012,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
2011#endif 2012#endif
2012 unsigned char *data; 2013 unsigned char *data;
2013 unsigned char phase, tmp, extended_msg[10], old_phase = 0xff; 2014 unsigned char phase, tmp, extended_msg[10], old_phase = 0xff;
2014 Scsi_Cmnd *cmd = (Scsi_Cmnd *) hostdata->connected; 2015 struct scsi_cmnd *cmd = (struct scsi_cmnd *) hostdata->connected;
2015 /* RvC: we need to set the end of the polling time */ 2016 /* RvC: we need to set the end of the polling time */
2016 unsigned long poll_time = jiffies + USLEEP_POLL; 2017 unsigned long poll_time = jiffies + USLEEP_POLL;
2017 2018
@@ -2201,7 +2202,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
2201 LIST(cmd, hostdata->issue_queue); 2202 LIST(cmd, hostdata->issue_queue);
2202 cmd->host_scribble = (unsigned char *) 2203 cmd->host_scribble = (unsigned char *)
2203 hostdata->issue_queue; 2204 hostdata->issue_queue;
2204 hostdata->issue_queue = (Scsi_Cmnd *) cmd; 2205 hostdata->issue_queue = (struct scsi_cmnd *) cmd;
2205 dprintk(NDEBUG_QUEUES, "scsi%d : REQUEST SENSE added to head of issue queue\n", instance->host_no); 2206 dprintk(NDEBUG_QUEUES, "scsi%d : REQUEST SENSE added to head of issue queue\n", instance->host_no);
2206 } else { 2207 } else {
2207 cmd->scsi_done(cmd); 2208 cmd->scsi_done(cmd);
@@ -2398,7 +2399,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) {
2398 * Function : void NCR5380_reselect (struct Scsi_Host *instance) 2399 * Function : void NCR5380_reselect (struct Scsi_Host *instance)
2399 * 2400 *
2400 * Purpose : does reselection, initializing the instance->connected 2401 * Purpose : does reselection, initializing the instance->connected
2401 * field to point to the Scsi_Cmnd for which the I_T_L or I_T_L_Q 2402 * field to point to the scsi_cmnd for which the I_T_L or I_T_L_Q
2402 * nexus has been reestablished, 2403 * nexus has been reestablished,
2403 * 2404 *
2404 * Inputs : instance - this instance of the NCR5380. 2405 * Inputs : instance - this instance of the NCR5380.
@@ -2415,7 +2416,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
2415 int len; 2416 int len;
2416 unsigned char msg[3]; 2417 unsigned char msg[3];
2417 unsigned char *data; 2418 unsigned char *data;
2418 Scsi_Cmnd *tmp = NULL, *prev; 2419 struct scsi_cmnd *tmp = NULL, *prev;
2419 int abort = 0; 2420 int abort = 0;
2420 NCR5380_setup(instance); 2421 NCR5380_setup(instance);
2421 2422
@@ -2481,7 +2482,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
2481 */ 2482 */
2482 2483
2483 2484
2484 for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue, prev = NULL; tmp; prev = tmp, tmp = (Scsi_Cmnd *) tmp->host_scribble) 2485 for (tmp = (struct scsi_cmnd *) hostdata->disconnected_queue, prev = NULL; tmp; prev = tmp, tmp = (struct scsi_cmnd *) tmp->host_scribble)
2485 if ((target_mask == (1 << tmp->device->id)) && (lun == (u8)tmp->device->lun) 2486 if ((target_mask == (1 << tmp->device->id)) && (lun == (u8)tmp->device->lun)
2486 ) { 2487 ) {
2487 if (prev) { 2488 if (prev) {
@@ -2489,7 +2490,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
2489 prev->host_scribble = tmp->host_scribble; 2490 prev->host_scribble = tmp->host_scribble;
2490 } else { 2491 } else {
2491 REMOVE(-1, hostdata->disconnected_queue, tmp, tmp->host_scribble); 2492 REMOVE(-1, hostdata->disconnected_queue, tmp, tmp->host_scribble);
2492 hostdata->disconnected_queue = (Scsi_Cmnd *) tmp->host_scribble; 2493 hostdata->disconnected_queue = (struct scsi_cmnd *) tmp->host_scribble;
2493 } 2494 }
2494 tmp->host_scribble = NULL; 2495 tmp->host_scribble = NULL;
2495 break; 2496 break;
@@ -2520,7 +2521,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance) {
2520 * 2521 *
2521 * Inputs : instance - this instance of the NCR5380. 2522 * Inputs : instance - this instance of the NCR5380.
2522 * 2523 *
2523 * Returns : pointer to the Scsi_Cmnd structure for which the I_T_L 2524 * Returns : pointer to the scsi_cmnd structure for which the I_T_L
2524 * nexus has been reestablished, on failure NULL is returned. 2525 * nexus has been reestablished, on failure NULL is returned.
2525 */ 2526 */
2526 2527
@@ -2562,11 +2563,11 @@ static void NCR5380_dma_complete(NCR5380_instance * instance) {
2562#endif /* def REAL_DMA */ 2563#endif /* def REAL_DMA */
2563 2564
2564/* 2565/*
2565 * Function : int NCR5380_abort (Scsi_Cmnd *cmd) 2566 * Function : int NCR5380_abort (struct scsi_cmnd *cmd)
2566 * 2567 *
2567 * Purpose : abort a command 2568 * Purpose : abort a command
2568 * 2569 *
2569 * Inputs : cmd - the Scsi_Cmnd to abort, code - code to set the 2570 * Inputs : cmd - the scsi_cmnd to abort, code - code to set the
2570 * host byte of the result field to, if zero DID_ABORTED is 2571 * host byte of the result field to, if zero DID_ABORTED is
2571 * used. 2572 * used.
2572 * 2573 *
@@ -2580,11 +2581,12 @@ static void NCR5380_dma_complete(NCR5380_instance * instance) {
2580 * Locks: host lock taken by caller 2581 * Locks: host lock taken by caller
2581 */ 2582 */
2582 2583
2583static int NCR5380_abort(Scsi_Cmnd * cmd) { 2584static int NCR5380_abort(struct scsi_cmnd *cmd)
2585{
2584 NCR5380_local_declare(); 2586 NCR5380_local_declare();
2585 struct Scsi_Host *instance = cmd->device->host; 2587 struct Scsi_Host *instance = cmd->device->host;
2586 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata; 2588 struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) instance->hostdata;
2587 Scsi_Cmnd *tmp, **prev; 2589 struct scsi_cmnd *tmp, **prev;
2588 2590
2589 scmd_printk(KERN_WARNING, cmd, "aborting command\n"); 2591 scmd_printk(KERN_WARNING, cmd, "aborting command\n");
2590 2592
@@ -2632,10 +2634,10 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) {
2632 */ 2634 */
2633 2635
2634 dprintk(NDEBUG_ABORT, "scsi%d : abort going into loop.\n", instance->host_no); 2636 dprintk(NDEBUG_ABORT, "scsi%d : abort going into loop.\n", instance->host_no);
2635 for (prev = (Scsi_Cmnd **) & (hostdata->issue_queue), tmp = (Scsi_Cmnd *) hostdata->issue_queue; tmp; prev = (Scsi_Cmnd **) & (tmp->host_scribble), tmp = (Scsi_Cmnd *) tmp->host_scribble) 2637 for (prev = (struct scsi_cmnd **) &(hostdata->issue_queue), tmp = (struct scsi_cmnd *) hostdata->issue_queue; tmp; prev = (struct scsi_cmnd **) &(tmp->host_scribble), tmp = (struct scsi_cmnd *) tmp->host_scribble)
2636 if (cmd == tmp) { 2638 if (cmd == tmp) {
2637 REMOVE(5, *prev, tmp, tmp->host_scribble); 2639 REMOVE(5, *prev, tmp, tmp->host_scribble);
2638 (*prev) = (Scsi_Cmnd *) tmp->host_scribble; 2640 (*prev) = (struct scsi_cmnd *) tmp->host_scribble;
2639 tmp->host_scribble = NULL; 2641 tmp->host_scribble = NULL;
2640 tmp->result = DID_ABORT << 16; 2642 tmp->result = DID_ABORT << 16;
2641 dprintk(NDEBUG_ABORT, "scsi%d : abort removed command from issue queue.\n", instance->host_no); 2643 dprintk(NDEBUG_ABORT, "scsi%d : abort removed command from issue queue.\n", instance->host_no);
@@ -2688,7 +2690,7 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) {
2688 * it from the disconnected queue. 2690 * it from the disconnected queue.
2689 */ 2691 */
2690 2692
2691 for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue; tmp; tmp = (Scsi_Cmnd *) tmp->host_scribble) 2693 for (tmp = (struct scsi_cmnd *) hostdata->disconnected_queue; tmp; tmp = (struct scsi_cmnd *) tmp->host_scribble)
2692 if (cmd == tmp) { 2694 if (cmd == tmp) {
2693 dprintk(NDEBUG_ABORT, "scsi%d : aborting disconnected command.\n", instance->host_no); 2695 dprintk(NDEBUG_ABORT, "scsi%d : aborting disconnected command.\n", instance->host_no);
2694 2696
@@ -2698,10 +2700,10 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) {
2698 2700
2699 do_abort(instance); 2701 do_abort(instance);
2700 2702
2701 for (prev = (Scsi_Cmnd **) & (hostdata->disconnected_queue), tmp = (Scsi_Cmnd *) hostdata->disconnected_queue; tmp; prev = (Scsi_Cmnd **) & (tmp->host_scribble), tmp = (Scsi_Cmnd *) tmp->host_scribble) 2703 for (prev = (struct scsi_cmnd **) &(hostdata->disconnected_queue), tmp = (struct scsi_cmnd *) hostdata->disconnected_queue; tmp; prev = (struct scsi_cmnd **) &(tmp->host_scribble), tmp = (struct scsi_cmnd *) tmp->host_scribble)
2702 if (cmd == tmp) { 2704 if (cmd == tmp) {
2703 REMOVE(5, *prev, tmp, tmp->host_scribble); 2705 REMOVE(5, *prev, tmp, tmp->host_scribble);
2704 *prev = (Scsi_Cmnd *) tmp->host_scribble; 2706 *prev = (struct scsi_cmnd *) tmp->host_scribble;
2705 tmp->host_scribble = NULL; 2707 tmp->host_scribble = NULL;
2706 tmp->result = DID_ABORT << 16; 2708 tmp->result = DID_ABORT << 16;
2707 tmp->scsi_done(tmp); 2709 tmp->scsi_done(tmp);
@@ -2724,7 +2726,7 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) {
2724 2726
2725 2727
2726/* 2728/*
2727 * Function : int NCR5380_bus_reset (Scsi_Cmnd *cmd) 2729 * Function : int NCR5380_bus_reset (struct scsi_cmnd *cmd)
2728 * 2730 *
2729 * Purpose : reset the SCSI bus. 2731 * Purpose : reset the SCSI bus.
2730 * 2732 *
@@ -2733,7 +2735,7 @@ static int NCR5380_abort(Scsi_Cmnd * cmd) {
2733 * Locks: host lock taken by caller 2735 * Locks: host lock taken by caller
2734 */ 2736 */
2735 2737
2736static int NCR5380_bus_reset(Scsi_Cmnd * cmd) 2738static int NCR5380_bus_reset(struct scsi_cmnd *cmd)
2737{ 2739{
2738 struct Scsi_Host *instance = cmd->device->host; 2740 struct Scsi_Host *instance = cmd->device->host;
2739 2741
diff --git a/drivers/scsi/NCR5380.h b/drivers/scsi/NCR5380.h
index 81e9c26184c0..11257784b2d7 100644
--- a/drivers/scsi/NCR5380.h
+++ b/drivers/scsi/NCR5380.h
@@ -255,9 +255,9 @@ struct NCR5380_hostdata {
255 volatile int dma_len; /* requested length of DMA */ 255 volatile int dma_len; /* requested length of DMA */
256#endif 256#endif
257 volatile unsigned char last_message; /* last message OUT */ 257 volatile unsigned char last_message; /* last message OUT */
258 volatile Scsi_Cmnd *connected; /* currently connected command */ 258 volatile struct scsi_cmnd *connected; /* currently connected command */
259 volatile Scsi_Cmnd *issue_queue; /* waiting to be issued */ 259 volatile struct scsi_cmnd *issue_queue; /* waiting to be issued */
260 volatile Scsi_Cmnd *disconnected_queue; /* waiting for reconnect */ 260 volatile struct scsi_cmnd *disconnected_queue; /* waiting for reconnect */
261 volatile int restart_select; /* we have disconnected, 261 volatile int restart_select; /* we have disconnected,
262 used to restart 262 used to restart
263 NCR5380_select() */ 263 NCR5380_select() */
@@ -265,7 +265,7 @@ struct NCR5380_hostdata {
265 int flags; 265 int flags;
266 unsigned long time_expires; /* in jiffies, set prior to sleeping */ 266 unsigned long time_expires; /* in jiffies, set prior to sleeping */
267 int select_time; /* timer in select for target response */ 267 int select_time; /* timer in select for target response */
268 volatile Scsi_Cmnd *selecting; 268 volatile struct scsi_cmnd *selecting;
269 struct delayed_work coroutine; /* our co-routine */ 269 struct delayed_work coroutine; /* our co-routine */
270 struct scsi_eh_save ses; 270 struct scsi_eh_save ses;
271 char info[256]; 271 char info[256];
@@ -309,7 +309,7 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id);
309static void NCR5380_main(struct work_struct *work); 309static void NCR5380_main(struct work_struct *work);
310static const char *NCR5380_info(struct Scsi_Host *instance); 310static const char *NCR5380_info(struct Scsi_Host *instance);
311static void NCR5380_reselect(struct Scsi_Host *instance); 311static void NCR5380_reselect(struct Scsi_Host *instance);
312static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd); 312static int NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd);
313#if defined(PSEUDO_DMA) || defined(REAL_DMA) || defined(REAL_DMA_POLL) 313#if defined(PSEUDO_DMA) || defined(REAL_DMA) || defined(REAL_DMA_POLL)
314static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data); 314static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data);
315#endif 315#endif
diff --git a/drivers/scsi/arm/cumana_1.c b/drivers/scsi/arm/cumana_1.c
index 154c9fae255b..d28d6c0f18c0 100644
--- a/drivers/scsi/arm/cumana_1.c
+++ b/drivers/scsi/arm/cumana_1.c
@@ -13,7 +13,6 @@
13#include <asm/ecard.h> 13#include <asm/ecard.h>
14#include <asm/io.h> 14#include <asm/io.h>
15 15
16#include "../scsi.h"
17#include <scsi/scsi_host.h> 16#include <scsi/scsi_host.h>
18 17
19#include <scsi/scsicam.h> 18#include <scsi/scsicam.h>
diff --git a/drivers/scsi/arm/oak.c b/drivers/scsi/arm/oak.c
index d1a0dc9c39ff..7c6fa1479c9c 100644
--- a/drivers/scsi/arm/oak.c
+++ b/drivers/scsi/arm/oak.c
@@ -14,7 +14,6 @@
14#include <asm/ecard.h> 14#include <asm/ecard.h>
15#include <asm/io.h> 15#include <asm/io.h>
16 16
17#include "../scsi.h"
18#include <scsi/scsi_host.h> 17#include <scsi/scsi_host.h>
19 18
20/*#define PSEUDO_DMA*/ 19/*#define PSEUDO_DMA*/
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index 31bd81210fc4..4eeb9684977b 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -262,9 +262,9 @@ static struct scsi_host_template *the_template = NULL;
262 (struct NCR5380_hostdata *)(in)->hostdata 262 (struct NCR5380_hostdata *)(in)->hostdata
263#define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata) 263#define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata)
264 264
265#define NEXT(cmd) ((Scsi_Cmnd *)(cmd)->host_scribble) 265#define NEXT(cmd) ((struct scsi_cmnd *)(cmd)->host_scribble)
266#define SET_NEXT(cmd,next) ((cmd)->host_scribble = (void *)(next)) 266#define SET_NEXT(cmd,next) ((cmd)->host_scribble = (void *)(next))
267#define NEXTADDR(cmd) ((Scsi_Cmnd **)&(cmd)->host_scribble) 267#define NEXTADDR(cmd) ((struct scsi_cmnd **)&(cmd)->host_scribble)
268 268
269#define HOSTNO instance->host_no 269#define HOSTNO instance->host_no
270#define H_NO(cmd) (cmd)->device->host->host_no 270#define H_NO(cmd) (cmd)->device->host->host_no
@@ -345,7 +345,7 @@ static void __init init_tags(void)
345 * conditions. 345 * conditions.
346 */ 346 */
347 347
348static int is_lun_busy(Scsi_Cmnd *cmd, int should_be_tagged) 348static int is_lun_busy(struct scsi_cmnd *cmd, int should_be_tagged)
349{ 349{
350 u8 lun = cmd->device->lun; 350 u8 lun = cmd->device->lun;
351 SETUP_HOSTDATA(cmd->device->host); 351 SETUP_HOSTDATA(cmd->device->host);
@@ -370,7 +370,7 @@ static int is_lun_busy(Scsi_Cmnd *cmd, int should_be_tagged)
370 * untagged. 370 * untagged.
371 */ 371 */
372 372
373static void cmd_get_tag(Scsi_Cmnd *cmd, int should_be_tagged) 373static void cmd_get_tag(struct scsi_cmnd *cmd, int should_be_tagged)
374{ 374{
375 u8 lun = cmd->device->lun; 375 u8 lun = cmd->device->lun;
376 SETUP_HOSTDATA(cmd->device->host); 376 SETUP_HOSTDATA(cmd->device->host);
@@ -402,7 +402,7 @@ static void cmd_get_tag(Scsi_Cmnd *cmd, int should_be_tagged)
402 * unlock the LUN. 402 * unlock the LUN.
403 */ 403 */
404 404
405static void cmd_free_tag(Scsi_Cmnd *cmd) 405static void cmd_free_tag(struct scsi_cmnd *cmd)
406{ 406{
407 u8 lun = cmd->device->lun; 407 u8 lun = cmd->device->lun;
408 SETUP_HOSTDATA(cmd->device->host); 408 SETUP_HOSTDATA(cmd->device->host);
@@ -445,18 +445,18 @@ static void free_all_tags(void)
445 445
446 446
447/* 447/*
448 * Function: void merge_contiguous_buffers( Scsi_Cmnd *cmd ) 448 * Function: void merge_contiguous_buffers( struct scsi_cmnd *cmd )
449 * 449 *
450 * Purpose: Try to merge several scatter-gather requests into one DMA 450 * Purpose: Try to merge several scatter-gather requests into one DMA
451 * transfer. This is possible if the scatter buffers lie on 451 * transfer. This is possible if the scatter buffers lie on
452 * physical contiguous addresses. 452 * physical contiguous addresses.
453 * 453 *
454 * Parameters: Scsi_Cmnd *cmd 454 * Parameters: struct scsi_cmnd *cmd
455 * The command to work on. The first scatter buffer's data are 455 * The command to work on. The first scatter buffer's data are
456 * assumed to be already transferred into ptr/this_residual. 456 * assumed to be already transferred into ptr/this_residual.
457 */ 457 */
458 458
459static void merge_contiguous_buffers(Scsi_Cmnd *cmd) 459static void merge_contiguous_buffers(struct scsi_cmnd *cmd)
460{ 460{
461 unsigned long endaddr; 461 unsigned long endaddr;
462#if (NDEBUG & NDEBUG_MERGING) 462#if (NDEBUG & NDEBUG_MERGING)
@@ -485,15 +485,15 @@ static void merge_contiguous_buffers(Scsi_Cmnd *cmd)
485} 485}
486 486
487/* 487/*
488 * Function : void initialize_SCp(Scsi_Cmnd *cmd) 488 * Function : void initialize_SCp(struct scsi_cmnd *cmd)
489 * 489 *
490 * Purpose : initialize the saved data pointers for cmd to point to the 490 * Purpose : initialize the saved data pointers for cmd to point to the
491 * start of the buffer. 491 * start of the buffer.
492 * 492 *
493 * Inputs : cmd - Scsi_Cmnd structure to have pointers reset. 493 * Inputs : cmd - scsi_cmnd structure to have pointers reset.
494 */ 494 */
495 495
496static inline void initialize_SCp(Scsi_Cmnd *cmd) 496static inline void initialize_SCp(struct scsi_cmnd *cmd)
497{ 497{
498 /* 498 /*
499 * Initialize the Scsi Pointer field so that all of the commands in the 499 * 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)
714 * Inputs : instance, pointer to this instance. 714 * Inputs : instance, pointer to this instance.
715 */ 715 */
716 716
717static void lprint_Scsi_Cmnd(Scsi_Cmnd *cmd) 717static void lprint_Scsi_Cmnd(struct scsi_cmnd *cmd)
718{ 718{
719 int i, s; 719 int i, s;
720 unsigned char *command; 720 unsigned char *command;
@@ -731,7 +731,7 @@ static void lprint_Scsi_Cmnd(Scsi_Cmnd *cmd)
731static void NCR5380_print_status(struct Scsi_Host *instance) 731static void NCR5380_print_status(struct Scsi_Host *instance)
732{ 732{
733 struct NCR5380_hostdata *hostdata; 733 struct NCR5380_hostdata *hostdata;
734 Scsi_Cmnd *ptr; 734 struct scsi_cmnd *ptr;
735 unsigned long flags; 735 unsigned long flags;
736 736
737 NCR5380_dprint(NDEBUG_ANY, instance); 737 NCR5380_dprint(NDEBUG_ANY, instance);
@@ -745,13 +745,13 @@ static void NCR5380_print_status(struct Scsi_Host *instance)
745 if (!hostdata->connected) 745 if (!hostdata->connected)
746 printk("scsi%d: no currently connected command\n", HOSTNO); 746 printk("scsi%d: no currently connected command\n", HOSTNO);
747 else 747 else
748 lprint_Scsi_Cmnd((Scsi_Cmnd *) hostdata->connected); 748 lprint_Scsi_Cmnd((struct scsi_cmnd *) hostdata->connected);
749 printk("scsi%d: issue_queue\n", HOSTNO); 749 printk("scsi%d: issue_queue\n", HOSTNO);
750 for (ptr = (Scsi_Cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr)) 750 for (ptr = (struct scsi_cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr))
751 lprint_Scsi_Cmnd(ptr); 751 lprint_Scsi_Cmnd(ptr);
752 752
753 printk("scsi%d: disconnected_queue\n", HOSTNO); 753 printk("scsi%d: disconnected_queue\n", HOSTNO);
754 for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr; 754 for (ptr = (struct scsi_cmnd *) hostdata->disconnected_queue; ptr;
755 ptr = NEXT(ptr)) 755 ptr = NEXT(ptr))
756 lprint_Scsi_Cmnd(ptr); 756 lprint_Scsi_Cmnd(ptr);
757 757
@@ -759,7 +759,7 @@ static void NCR5380_print_status(struct Scsi_Host *instance)
759 printk("\n"); 759 printk("\n");
760} 760}
761 761
762static void show_Scsi_Cmnd(Scsi_Cmnd *cmd, struct seq_file *m) 762static void show_Scsi_Cmnd(struct scsi_cmnd *cmd, struct seq_file *m)
763{ 763{
764 int i, s; 764 int i, s;
765 unsigned char *command; 765 unsigned char *command;
@@ -777,7 +777,7 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m,
777 struct Scsi_Host *instance) 777 struct Scsi_Host *instance)
778{ 778{
779 struct NCR5380_hostdata *hostdata; 779 struct NCR5380_hostdata *hostdata;
780 Scsi_Cmnd *ptr; 780 struct scsi_cmnd *ptr;
781 unsigned long flags; 781 unsigned long flags;
782 782
783 hostdata = (struct NCR5380_hostdata *)instance->hostdata; 783 hostdata = (struct NCR5380_hostdata *)instance->hostdata;
@@ -788,13 +788,13 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m,
788 if (!hostdata->connected) 788 if (!hostdata->connected)
789 seq_printf(m, "scsi%d: no currently connected command\n", HOSTNO); 789 seq_printf(m, "scsi%d: no currently connected command\n", HOSTNO);
790 else 790 else
791 show_Scsi_Cmnd((Scsi_Cmnd *) hostdata->connected, m); 791 show_Scsi_Cmnd((struct scsi_cmnd *) hostdata->connected, m);
792 seq_printf(m, "scsi%d: issue_queue\n", HOSTNO); 792 seq_printf(m, "scsi%d: issue_queue\n", HOSTNO);
793 for (ptr = (Scsi_Cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr)) 793 for (ptr = (struct scsi_cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr))
794 show_Scsi_Cmnd(ptr, m); 794 show_Scsi_Cmnd(ptr, m);
795 795
796 seq_printf(m, "scsi%d: disconnected_queue\n", HOSTNO); 796 seq_printf(m, "scsi%d: disconnected_queue\n", HOSTNO);
797 for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr; 797 for (ptr = (struct scsi_cmnd *) hostdata->disconnected_queue; ptr;
798 ptr = NEXT(ptr)) 798 ptr = NEXT(ptr))
799 show_Scsi_Cmnd(ptr, m); 799 show_Scsi_Cmnd(ptr, m);
800 800
@@ -862,8 +862,8 @@ static void NCR5380_exit(struct Scsi_Host *instance)
862} 862}
863 863
864/* 864/*
865 * Function : int NCR5380_queue_command (Scsi_Cmnd *cmd, 865 * Function : int NCR5380_queue_command (struct scsi_cmnd *cmd,
866 * void (*done)(Scsi_Cmnd *)) 866 * void (*done)(struct scsi_cmnd *))
867 * 867 *
868 * Purpose : enqueues a SCSI command 868 * Purpose : enqueues a SCSI command
869 * 869 *
@@ -879,10 +879,11 @@ static void NCR5380_exit(struct Scsi_Host *instance)
879 * 879 *
880 */ 880 */
881 881
882static int NCR5380_queue_command_lck(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) 882static int NCR5380_queue_command_lck(struct scsi_cmnd *cmd,
883 void (*done)(struct scsi_cmnd *))
883{ 884{
884 SETUP_HOSTDATA(cmd->device->host); 885 SETUP_HOSTDATA(cmd->device->host);
885 Scsi_Cmnd *tmp; 886 struct scsi_cmnd *tmp;
886 unsigned long flags; 887 unsigned long flags;
887 888
888#if (NDEBUG & NDEBUG_NO_WRITE) 889#if (NDEBUG & NDEBUG_NO_WRITE)
@@ -937,7 +938,7 @@ static int NCR5380_queue_command_lck(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
937 SET_NEXT(cmd, hostdata->issue_queue); 938 SET_NEXT(cmd, hostdata->issue_queue);
938 hostdata->issue_queue = cmd; 939 hostdata->issue_queue = cmd;
939 } else { 940 } else {
940 for (tmp = (Scsi_Cmnd *)hostdata->issue_queue; 941 for (tmp = (struct scsi_cmnd *)hostdata->issue_queue;
941 NEXT(tmp); tmp = NEXT(tmp)) 942 NEXT(tmp); tmp = NEXT(tmp))
942 ; 943 ;
943 LIST(cmd, tmp); 944 LIST(cmd, tmp);
@@ -978,7 +979,7 @@ static DEF_SCSI_QCMD(NCR5380_queue_command)
978 979
979static void NCR5380_main(struct work_struct *work) 980static void NCR5380_main(struct work_struct *work)
980{ 981{
981 Scsi_Cmnd *tmp, *prev; 982 struct scsi_cmnd *tmp, *prev;
982 struct Scsi_Host *instance = first_instance; 983 struct Scsi_Host *instance = first_instance;
983 struct NCR5380_hostdata *hostdata = HOSTDATA(instance); 984 struct NCR5380_hostdata *hostdata = HOSTDATA(instance);
984 int done; 985 int done;
@@ -1021,7 +1022,7 @@ static void NCR5380_main(struct work_struct *work)
1021 * for a target that's not busy. 1022 * for a target that's not busy.
1022 */ 1023 */
1023#if (NDEBUG & NDEBUG_LISTS) 1024#if (NDEBUG & NDEBUG_LISTS)
1024 for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, prev = NULL; 1025 for (tmp = (struct scsi_cmnd *) hostdata->issue_queue, prev = NULL;
1025 tmp && (tmp != prev); prev = tmp, tmp = NEXT(tmp)) 1026 tmp && (tmp != prev); prev = tmp, tmp = NEXT(tmp))
1026 ; 1027 ;
1027 /*printk("%p ", tmp);*/ 1028 /*printk("%p ", tmp);*/
@@ -1029,7 +1030,7 @@ static void NCR5380_main(struct work_struct *work)
1029 printk(" LOOP\n"); 1030 printk(" LOOP\n");
1030 /* else printk("\n"); */ 1031 /* else printk("\n"); */
1031#endif 1032#endif
1032 for (tmp = (Scsi_Cmnd *) hostdata->issue_queue, 1033 for (tmp = (struct scsi_cmnd *) hostdata->issue_queue,
1033 prev = NULL; tmp; prev = tmp, tmp = NEXT(tmp)) { 1034 prev = NULL; tmp; prev = tmp, tmp = NEXT(tmp)) {
1034 u8 lun = tmp->device->lun; 1035 u8 lun = tmp->device->lun;
1035 1036
@@ -1291,7 +1292,8 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id)
1291} 1292}
1292 1293
1293/* 1294/*
1294 * Function : int NCR5380_select (struct Scsi_Host *instance, Scsi_Cmnd *cmd) 1295 * Function : int NCR5380_select(struct Scsi_Host *instance,
1296 * struct scsi_cmnd *cmd)
1295 * 1297 *
1296 * Purpose : establishes I_T_L or I_T_L_Q nexus for new or existing command, 1298 * Purpose : establishes I_T_L or I_T_L_Q nexus for new or existing command,
1297 * including ARBITRATION, SELECTION, and initial message out for 1299 * including ARBITRATION, SELECTION, and initial message out for
@@ -1318,7 +1320,7 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id)
1318 * cmd->result host byte set to DID_BAD_TARGET. 1320 * cmd->result host byte set to DID_BAD_TARGET.
1319 */ 1321 */
1320 1322
1321static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd) 1323static int NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
1322{ 1324{
1323 SETUP_HOSTDATA(instance); 1325 SETUP_HOSTDATA(instance);
1324 unsigned char tmp[3], phase; 1326 unsigned char tmp[3], phase;
@@ -1917,7 +1919,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
1917#endif 1919#endif
1918 unsigned char *data; 1920 unsigned char *data;
1919 unsigned char phase, tmp, extended_msg[10], old_phase = 0xff; 1921 unsigned char phase, tmp, extended_msg[10], old_phase = 0xff;
1920 Scsi_Cmnd *cmd = (Scsi_Cmnd *) hostdata->connected; 1922 struct scsi_cmnd *cmd = (struct scsi_cmnd *) hostdata->connected;
1921 1923
1922 while (1) { 1924 while (1) {
1923 tmp = NCR5380_read(STATUS_REG); 1925 tmp = NCR5380_read(STATUS_REG);
@@ -2154,7 +2156,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
2154 local_irq_save(flags); 2156 local_irq_save(flags);
2155 LIST(cmd,hostdata->issue_queue); 2157 LIST(cmd,hostdata->issue_queue);
2156 SET_NEXT(cmd, hostdata->issue_queue); 2158 SET_NEXT(cmd, hostdata->issue_queue);
2157 hostdata->issue_queue = (Scsi_Cmnd *) cmd; 2159 hostdata->issue_queue = (struct scsi_cmnd *) cmd;
2158 local_irq_restore(flags); 2160 local_irq_restore(flags);
2159 dprintk(NDEBUG_QUEUES, "scsi%d: REQUEST SENSE added to head of " 2161 dprintk(NDEBUG_QUEUES, "scsi%d: REQUEST SENSE added to head of "
2160 "issue queue\n", H_NO(cmd)); 2162 "issue queue\n", H_NO(cmd));
@@ -2378,7 +2380,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
2378 * Function : void NCR5380_reselect (struct Scsi_Host *instance) 2380 * Function : void NCR5380_reselect (struct Scsi_Host *instance)
2379 * 2381 *
2380 * Purpose : does reselection, initializing the instance->connected 2382 * Purpose : does reselection, initializing the instance->connected
2381 * field to point to the Scsi_Cmnd for which the I_T_L or I_T_L_Q 2383 * field to point to the scsi_cmnd for which the I_T_L or I_T_L_Q
2382 * nexus has been reestablished, 2384 * nexus has been reestablished,
2383 * 2385 *
2384 * Inputs : instance - this instance of the NCR5380. 2386 * Inputs : instance - this instance of the NCR5380.
@@ -2397,7 +2399,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
2397#endif 2399#endif
2398 unsigned char msg[3]; 2400 unsigned char msg[3];
2399 unsigned char *data; 2401 unsigned char *data;
2400 Scsi_Cmnd *tmp = NULL, *prev; 2402 struct scsi_cmnd *tmp = NULL, *prev;
2401/* unsigned long flags; */ 2403/* unsigned long flags; */
2402 2404
2403 /* 2405 /*
@@ -2471,7 +2473,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
2471 * just reestablished, and remove it from the disconnected queue. 2473 * just reestablished, and remove it from the disconnected queue.
2472 */ 2474 */
2473 2475
2474 for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue, prev = NULL; 2476 for (tmp = (struct scsi_cmnd *) hostdata->disconnected_queue, prev = NULL;
2475 tmp; prev = tmp, tmp = NEXT(tmp)) { 2477 tmp; prev = tmp, tmp = NEXT(tmp)) {
2476 if ((target_mask == (1 << tmp->device->id)) && (lun == tmp->device->lun) 2478 if ((target_mask == (1 << tmp->device->id)) && (lun == tmp->device->lun)
2477#ifdef SUPPORT_TAGS 2479#ifdef SUPPORT_TAGS
@@ -2522,11 +2524,11 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
2522 2524
2523 2525
2524/* 2526/*
2525 * Function : int NCR5380_abort (Scsi_Cmnd *cmd) 2527 * Function : int NCR5380_abort (struct scsi_cmnd *cmd)
2526 * 2528 *
2527 * Purpose : abort a command 2529 * Purpose : abort a command
2528 * 2530 *
2529 * Inputs : cmd - the Scsi_Cmnd to abort, code - code to set the 2531 * Inputs : cmd - the scsi_cmnd to abort, code - code to set the
2530 * host byte of the result field to, if zero DID_ABORTED is 2532 * host byte of the result field to, if zero DID_ABORTED is
2531 * used. 2533 * used.
2532 * 2534 *
@@ -2539,11 +2541,11 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
2539 */ 2541 */
2540 2542
2541static 2543static
2542int NCR5380_abort(Scsi_Cmnd *cmd) 2544int NCR5380_abort(struct scsi_cmnd *cmd)
2543{ 2545{
2544 struct Scsi_Host *instance = cmd->device->host; 2546 struct Scsi_Host *instance = cmd->device->host;
2545 SETUP_HOSTDATA(instance); 2547 SETUP_HOSTDATA(instance);
2546 Scsi_Cmnd *tmp, **prev; 2548 struct scsi_cmnd *tmp, **prev;
2547 unsigned long flags; 2549 unsigned long flags;
2548 2550
2549 scmd_printk(KERN_NOTICE, cmd, "aborting command\n"); 2551 scmd_printk(KERN_NOTICE, cmd, "aborting command\n");
@@ -2612,8 +2614,8 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2612 * Case 2 : If the command hasn't been issued yet, we simply remove it 2614 * Case 2 : If the command hasn't been issued yet, we simply remove it
2613 * from the issue queue. 2615 * from the issue queue.
2614 */ 2616 */
2615 for (prev = (Scsi_Cmnd **)&(hostdata->issue_queue), 2617 for (prev = (struct scsi_cmnd **)&(hostdata->issue_queue),
2616 tmp = (Scsi_Cmnd *)hostdata->issue_queue; 2618 tmp = (struct scsi_cmnd *)hostdata->issue_queue;
2617 tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp)) { 2619 tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp)) {
2618 if (cmd == tmp) { 2620 if (cmd == tmp) {
2619 REMOVE(5, *prev, tmp, NEXT(tmp)); 2621 REMOVE(5, *prev, tmp, NEXT(tmp));
@@ -2673,7 +2675,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2673 * it from the disconnected queue. 2675 * it from the disconnected queue.
2674 */ 2676 */
2675 2677
2676 for (tmp = (Scsi_Cmnd *) hostdata->disconnected_queue; tmp; 2678 for (tmp = (struct scsi_cmnd *) hostdata->disconnected_queue; tmp;
2677 tmp = NEXT(tmp)) { 2679 tmp = NEXT(tmp)) {
2678 if (cmd == tmp) { 2680 if (cmd == tmp) {
2679 local_irq_restore(flags); 2681 local_irq_restore(flags);
@@ -2687,8 +2689,8 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2687 do_abort(instance); 2689 do_abort(instance);
2688 2690
2689 local_irq_save(flags); 2691 local_irq_save(flags);
2690 for (prev = (Scsi_Cmnd **)&(hostdata->disconnected_queue), 2692 for (prev = (struct scsi_cmnd **)&(hostdata->disconnected_queue),
2691 tmp = (Scsi_Cmnd *)hostdata->disconnected_queue; 2693 tmp = (struct scsi_cmnd *)hostdata->disconnected_queue;
2692 tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp)) { 2694 tmp; prev = NEXTADDR(tmp), tmp = NEXT(tmp)) {
2693 if (cmd == tmp) { 2695 if (cmd == tmp) {
2694 REMOVE(5, *prev, tmp, NEXT(tmp)); 2696 REMOVE(5, *prev, tmp, NEXT(tmp));
@@ -2737,7 +2739,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2737 2739
2738 2740
2739/* 2741/*
2740 * Function : int NCR5380_reset (Scsi_Cmnd *cmd) 2742 * Function : int NCR5380_reset (struct scsi_cmnd *cmd)
2741 * 2743 *
2742 * Purpose : reset the SCSI bus. 2744 * Purpose : reset the SCSI bus.
2743 * 2745 *
@@ -2745,13 +2747,13 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2745 * 2747 *
2746 */ 2748 */
2747 2749
2748static int NCR5380_bus_reset(Scsi_Cmnd *cmd) 2750static int NCR5380_bus_reset(struct scsi_cmnd *cmd)
2749{ 2751{
2750 SETUP_HOSTDATA(cmd->device->host); 2752 SETUP_HOSTDATA(cmd->device->host);
2751 int i; 2753 int i;
2752 unsigned long flags; 2754 unsigned long flags;
2753#if defined(RESET_RUN_DONE) 2755#if defined(RESET_RUN_DONE)
2754 Scsi_Cmnd *connected, *disconnected_queue; 2756 struct scsi_cmnd *connected, *disconnected_queue;
2755#endif 2757#endif
2756 2758
2757 if (!IS_A_TT() && !falcon_got_lock) 2759 if (!IS_A_TT() && !falcon_got_lock)
@@ -2793,9 +2795,9 @@ static int NCR5380_bus_reset(Scsi_Cmnd *cmd)
2793 * remembered in local variables first. 2795 * remembered in local variables first.
2794 */ 2796 */
2795 local_irq_save(flags); 2797 local_irq_save(flags);
2796 connected = (Scsi_Cmnd *)hostdata->connected; 2798 connected = (struct scsi_cmnd *)hostdata->connected;
2797 hostdata->connected = NULL; 2799 hostdata->connected = NULL;
2798 disconnected_queue = (Scsi_Cmnd *)hostdata->disconnected_queue; 2800 disconnected_queue = (struct scsi_cmnd *)hostdata->disconnected_queue;
2799 hostdata->disconnected_queue = NULL; 2801 hostdata->disconnected_queue = NULL;
2800#ifdef SUPPORT_TAGS 2802#ifdef SUPPORT_TAGS
2801 free_all_tags(); 2803 free_all_tags();
diff --git a/drivers/scsi/atari_scsi.c b/drivers/scsi/atari_scsi.c
index 0e3a9cc40c94..48fabebdbbb0 100644
--- a/drivers/scsi/atari_scsi.c
+++ b/drivers/scsi/atari_scsi.c
@@ -93,7 +93,6 @@
93#include <asm/irq.h> 93#include <asm/irq.h>
94#include <asm/traps.h> 94#include <asm/traps.h>
95 95
96#include "scsi.h"
97#include <scsi/scsi_host.h> 96#include <scsi/scsi_host.h>
98#include "atari_scsi.h" 97#include "atari_scsi.h"
99#include "NCR5380.h" 98#include "NCR5380.h"
@@ -880,7 +879,7 @@ static long atari_scsi_dma_residual(struct Scsi_Host *instance)
880#define CMD_SURELY_BYTE_MODE 1 879#define CMD_SURELY_BYTE_MODE 1
881#define CMD_MODE_UNKNOWN 2 880#define CMD_MODE_UNKNOWN 2
882 881
883static int falcon_classify_cmd(Scsi_Cmnd *cmd) 882static int falcon_classify_cmd(struct scsi_cmnd *cmd)
884{ 883{
885 unsigned char opcode = cmd->cmnd[0]; 884 unsigned char opcode = cmd->cmnd[0];
886 885
@@ -912,7 +911,7 @@ static int falcon_classify_cmd(Scsi_Cmnd *cmd)
912 */ 911 */
913 912
914static unsigned long atari_dma_xfer_len(unsigned long wanted_len, 913static unsigned long atari_dma_xfer_len(unsigned long wanted_len,
915 Scsi_Cmnd *cmd, int write_flag) 914 struct scsi_cmnd *cmd, int write_flag)
916{ 915{
917 unsigned long possible_len, limit; 916 unsigned long possible_len, limit;
918 917
diff --git a/drivers/scsi/dmx3191d.c b/drivers/scsi/dmx3191d.c
index feaba705a369..159434a5cfdb 100644
--- a/drivers/scsi/dmx3191d.c
+++ b/drivers/scsi/dmx3191d.c
@@ -45,7 +45,6 @@
45 * Includes needed for NCR5380.[ch] (XXX: Move them to NCR5380.h) 45 * Includes needed for NCR5380.[ch] (XXX: Move them to NCR5380.h)
46 */ 46 */
47#include <linux/delay.h> 47#include <linux/delay.h>
48#include "scsi.h"
49 48
50#include "NCR5380.h" 49#include "NCR5380.h"
51#include "NCR5380.c" 50#include "NCR5380.c"
diff --git a/drivers/scsi/dtc.c b/drivers/scsi/dtc.c
index 072ca426293d..4c74c7ba2dff 100644
--- a/drivers/scsi/dtc.c
+++ b/drivers/scsi/dtc.c
@@ -58,7 +58,6 @@
58#include <linux/init.h> 58#include <linux/init.h>
59#include <linux/interrupt.h> 59#include <linux/interrupt.h>
60#include <linux/io.h> 60#include <linux/io.h>
61#include "scsi.h"
62#include <scsi/scsi_host.h> 61#include <scsi/scsi_host.h>
63#include "dtc.h" 62#include "dtc.h"
64#define AUTOPROBE_IRQ 63#define AUTOPROBE_IRQ
diff --git a/drivers/scsi/g_NCR5380.c b/drivers/scsi/g_NCR5380.c
index c158104fd3aa..f35792f7051c 100644
--- a/drivers/scsi/g_NCR5380.c
+++ b/drivers/scsi/g_NCR5380.c
@@ -72,7 +72,6 @@
72#include <asm/io.h> 72#include <asm/io.h>
73#include <linux/signal.h> 73#include <linux/signal.h>
74#include <linux/blkdev.h> 74#include <linux/blkdev.h>
75#include "scsi.h"
76#include <scsi/scsi_host.h> 75#include <scsi/scsi_host.h>
77#include "g_NCR5380.h" 76#include "g_NCR5380.h"
78#include "NCR5380.h" 77#include "NCR5380.h"
diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
index 54cb1ab2b676..40cb5f1e8bf9 100644
--- a/drivers/scsi/mac_scsi.c
+++ b/drivers/scsi/mac_scsi.c
@@ -30,7 +30,6 @@
30#include <asm/macints.h> 30#include <asm/macints.h>
31#include <asm/mac_via.h> 31#include <asm/mac_via.h>
32 32
33#include "scsi.h"
34#include <scsi/scsi_host.h> 33#include <scsi/scsi_host.h>
35#include "mac_scsi.h" 34#include "mac_scsi.h"
36 35
diff --git a/drivers/scsi/pas16.c b/drivers/scsi/pas16.c
index 7994b5275431..e81eadd08afc 100644
--- a/drivers/scsi/pas16.c
+++ b/drivers/scsi/pas16.c
@@ -81,7 +81,6 @@
81#include <linux/stat.h> 81#include <linux/stat.h>
82#include <linux/init.h> 82#include <linux/init.h>
83 83
84#include "scsi.h"
85#include <scsi/scsi_host.h> 84#include <scsi/scsi_host.h>
86#include "pas16.h" 85#include "pas16.h"
87#define AUTOPROBE_IRQ 86#define AUTOPROBE_IRQ
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c
index 1999c8e71d9f..963969f3f83f 100644
--- a/drivers/scsi/sun3_NCR5380.c
+++ b/drivers/scsi/sun3_NCR5380.c
@@ -660,7 +660,7 @@ static void prepare_info(struct Scsi_Host *instance)
660 * Inputs : instance, pointer to this instance. 660 * Inputs : instance, pointer to this instance.
661 */ 661 */
662 662
663static void lprint_Scsi_Cmnd(Scsi_Cmnd *cmd) 663static void lprint_Scsi_Cmnd(struct scsi_cmnd *cmd)
664{ 664{
665 int i, s; 665 int i, s;
666 unsigned char *command; 666 unsigned char *command;
@@ -677,7 +677,7 @@ static void lprint_Scsi_Cmnd(Scsi_Cmnd *cmd)
677static void NCR5380_print_status(struct Scsi_Host *instance) 677static void NCR5380_print_status(struct Scsi_Host *instance)
678{ 678{
679 struct NCR5380_hostdata *hostdata; 679 struct NCR5380_hostdata *hostdata;
680 Scsi_Cmnd *ptr; 680 struct scsi_cmnd *ptr;
681 unsigned long flags; 681 unsigned long flags;
682 682
683 NCR5380_dprint(NDEBUG_ANY, instance); 683 NCR5380_dprint(NDEBUG_ANY, instance);
@@ -691,13 +691,13 @@ static void NCR5380_print_status(struct Scsi_Host *instance)
691 if (!hostdata->connected) 691 if (!hostdata->connected)
692 printk("scsi%d: no currently connected command\n", HOSTNO); 692 printk("scsi%d: no currently connected command\n", HOSTNO);
693 else 693 else
694 lprint_Scsi_Cmnd((Scsi_Cmnd *) hostdata->connected); 694 lprint_Scsi_Cmnd((struct scsi_cmnd *) hostdata->connected);
695 printk("scsi%d: issue_queue\n", HOSTNO); 695 printk("scsi%d: issue_queue\n", HOSTNO);
696 for (ptr = (Scsi_Cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr)) 696 for (ptr = (struct scsi_cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr))
697 lprint_Scsi_Cmnd(ptr); 697 lprint_Scsi_Cmnd(ptr);
698 698
699 printk("scsi%d: disconnected_queue\n", HOSTNO); 699 printk("scsi%d: disconnected_queue\n", HOSTNO);
700 for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr; 700 for (ptr = (struct scsi_cmnd *) hostdata->disconnected_queue; ptr;
701 ptr = NEXT(ptr)) 701 ptr = NEXT(ptr))
702 lprint_Scsi_Cmnd(ptr); 702 lprint_Scsi_Cmnd(ptr);
703 703
@@ -705,7 +705,7 @@ static void NCR5380_print_status(struct Scsi_Host *instance)
705 printk("\n"); 705 printk("\n");
706} 706}
707 707
708static void show_Scsi_Cmnd(Scsi_Cmnd *cmd, struct seq_file *m) 708static void show_Scsi_Cmnd(struct scsi_cmnd *cmd, struct seq_file *m)
709{ 709{
710 int i, s; 710 int i, s;
711 unsigned char *command; 711 unsigned char *command;
@@ -723,7 +723,7 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m,
723 struct Scsi_Host *instance) 723 struct Scsi_Host *instance)
724{ 724{
725 struct NCR5380_hostdata *hostdata; 725 struct NCR5380_hostdata *hostdata;
726 Scsi_Cmnd *ptr; 726 struct scsi_cmnd *ptr;
727 unsigned long flags; 727 unsigned long flags;
728 728
729 hostdata = (struct NCR5380_hostdata *)instance->hostdata; 729 hostdata = (struct NCR5380_hostdata *)instance->hostdata;
@@ -734,13 +734,13 @@ static int __maybe_unused NCR5380_show_info(struct seq_file *m,
734 if (!hostdata->connected) 734 if (!hostdata->connected)
735 seq_printf(m, "scsi%d: no currently connected command\n", HOSTNO); 735 seq_printf(m, "scsi%d: no currently connected command\n", HOSTNO);
736 else 736 else
737 show_Scsi_Cmnd((Scsi_Cmnd *) hostdata->connected, m); 737 show_Scsi_Cmnd((struct scsi_cmnd *) hostdata->connected, m);
738 seq_printf(m, "scsi%d: issue_queue\n", HOSTNO); 738 seq_printf(m, "scsi%d: issue_queue\n", HOSTNO);
739 for (ptr = (Scsi_Cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr)) 739 for (ptr = (struct scsi_cmnd *)hostdata->issue_queue; ptr; ptr = NEXT(ptr))
740 show_Scsi_Cmnd(ptr, m); 740 show_Scsi_Cmnd(ptr, m);
741 741
742 seq_printf(m, "scsi%d: disconnected_queue\n", HOSTNO); 742 seq_printf(m, "scsi%d: disconnected_queue\n", HOSTNO);
743 for (ptr = (Scsi_Cmnd *) hostdata->disconnected_queue; ptr; 743 for (ptr = (struct scsi_cmnd *) hostdata->disconnected_queue; ptr;
744 ptr = NEXT(ptr)) 744 ptr = NEXT(ptr))
745 show_Scsi_Cmnd(ptr, m); 745 show_Scsi_Cmnd(ptr, m);
746 746
diff --git a/drivers/scsi/sun3_scsi.c b/drivers/scsi/sun3_scsi.c
index 19e9808be8d8..bb660fe4739d 100644
--- a/drivers/scsi/sun3_scsi.c
+++ b/drivers/scsi/sun3_scsi.c
@@ -43,7 +43,6 @@
43/* dma on! */ 43/* dma on! */
44#define REAL_DMA 44#define REAL_DMA
45 45
46#include "scsi.h"
47#include <scsi/scsi_host.h> 46#include <scsi/scsi_host.h>
48#include "sun3_scsi.h" 47#include "sun3_scsi.h"
49#include "NCR5380.h" 48#include "NCR5380.h"
diff --git a/drivers/scsi/t128.c b/drivers/scsi/t128.c
index 69dac7776059..87828acbf7c6 100644
--- a/drivers/scsi/t128.c
+++ b/drivers/scsi/t128.c
@@ -77,7 +77,6 @@
77#include <linux/module.h> 77#include <linux/module.h>
78#include <linux/delay.h> 78#include <linux/delay.h>
79 79
80#include "scsi.h"
81#include <scsi/scsi_host.h> 80#include <scsi/scsi_host.h>
82#include "t128.h" 81#include "t128.h"
83#define AUTOPROBE_IRQ 82#define AUTOPROBE_IRQ