diff options
Diffstat (limited to 'drivers/scsi/atari_NCR5380.c')
-rw-r--r-- | drivers/scsi/atari_NCR5380.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c index 81e4f566b6c8..c912733ac077 100644 --- a/drivers/scsi/atari_NCR5380.c +++ b/drivers/scsi/atari_NCR5380.c | |||
@@ -272,8 +272,9 @@ static struct scsi_host_template *the_template = NULL; | |||
272 | (struct NCR5380_hostdata *)(in)->hostdata | 272 | (struct NCR5380_hostdata *)(in)->hostdata |
273 | #define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata) | 273 | #define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata) |
274 | 274 | ||
275 | #define NEXT(cmd) ((cmd)->host_scribble) | 275 | #define NEXT(cmd) ((Scsi_Cmnd *)(cmd)->host_scribble) |
276 | #define NEXTADDR(cmd) ((Scsi_Cmnd **)&((cmd)->host_scribble)) | 276 | #define SET_NEXT(cmd,next) ((cmd)->host_scribble = (void *)(next)) |
277 | #define NEXTADDR(cmd) ((Scsi_Cmnd **)&(cmd)->host_scribble) | ||
277 | 278 | ||
278 | #define HOSTNO instance->host_no | 279 | #define HOSTNO instance->host_no |
279 | #define H_NO(cmd) (cmd)->device->host->host_no | 280 | #define H_NO(cmd) (cmd)->device->host->host_no |
@@ -479,7 +480,7 @@ static void merge_contiguous_buffers(Scsi_Cmnd *cmd) | |||
479 | virt_to_phys(page_address(cmd->SCp.buffer[1].page) + | 480 | virt_to_phys(page_address(cmd->SCp.buffer[1].page) + |
480 | cmd->SCp.buffer[1].offset) == endaddr;) { | 481 | cmd->SCp.buffer[1].offset) == endaddr;) { |
481 | MER_PRINTK("VTOP(%p) == %08lx -> merging\n", | 482 | MER_PRINTK("VTOP(%p) == %08lx -> merging\n", |
482 | cmd->SCp.buffer[1].address, endaddr); | 483 | page_address(cmd->SCp.buffer[1].page), endaddr); |
483 | #if (NDEBUG & NDEBUG_MERGING) | 484 | #if (NDEBUG & NDEBUG_MERGING) |
484 | ++cnt; | 485 | ++cnt; |
485 | #endif | 486 | #endif |
@@ -1002,7 +1003,7 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) | |||
1002 | * in a queue | 1003 | * in a queue |
1003 | */ | 1004 | */ |
1004 | 1005 | ||
1005 | NEXT(cmd) = NULL; | 1006 | SET_NEXT(cmd, NULL); |
1006 | cmd->scsi_done = done; | 1007 | cmd->scsi_done = done; |
1007 | 1008 | ||
1008 | cmd->result = 0; | 1009 | cmd->result = 0; |
@@ -1034,14 +1035,14 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) | |||
1034 | } | 1035 | } |
1035 | if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) { | 1036 | if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) { |
1036 | LIST(cmd, hostdata->issue_queue); | 1037 | LIST(cmd, hostdata->issue_queue); |
1037 | NEXT(cmd) = hostdata->issue_queue; | 1038 | SET_NEXT(cmd, hostdata->issue_queue); |
1038 | hostdata->issue_queue = cmd; | 1039 | hostdata->issue_queue = cmd; |
1039 | } else { | 1040 | } else { |
1040 | for (tmp = (Scsi_Cmnd *)hostdata->issue_queue; | 1041 | for (tmp = (Scsi_Cmnd *)hostdata->issue_queue; |
1041 | NEXT(tmp); tmp = NEXT(tmp)) | 1042 | NEXT(tmp); tmp = NEXT(tmp)) |
1042 | ; | 1043 | ; |
1043 | LIST(cmd, tmp); | 1044 | LIST(cmd, tmp); |
1044 | NEXT(tmp) = cmd; | 1045 | SET_NEXT(tmp, cmd); |
1045 | } | 1046 | } |
1046 | local_irq_restore(flags); | 1047 | local_irq_restore(flags); |
1047 | 1048 | ||
@@ -1149,12 +1150,12 @@ static void NCR5380_main(void *bl) | |||
1149 | local_irq_disable(); | 1150 | local_irq_disable(); |
1150 | if (prev) { | 1151 | if (prev) { |
1151 | REMOVE(prev, NEXT(prev), tmp, NEXT(tmp)); | 1152 | REMOVE(prev, NEXT(prev), tmp, NEXT(tmp)); |
1152 | NEXT(prev) = NEXT(tmp); | 1153 | SET_NEXT(prev, NEXT(tmp)); |
1153 | } else { | 1154 | } else { |
1154 | REMOVE(-1, hostdata->issue_queue, tmp, NEXT(tmp)); | 1155 | REMOVE(-1, hostdata->issue_queue, tmp, NEXT(tmp)); |
1155 | hostdata->issue_queue = NEXT(tmp); | 1156 | hostdata->issue_queue = NEXT(tmp); |
1156 | } | 1157 | } |
1157 | NEXT(tmp) = NULL; | 1158 | SET_NEXT(tmp, NULL); |
1158 | falcon_dont_release++; | 1159 | falcon_dont_release++; |
1159 | 1160 | ||
1160 | /* reenable interrupts after finding one */ | 1161 | /* reenable interrupts after finding one */ |
@@ -1192,7 +1193,7 @@ static void NCR5380_main(void *bl) | |||
1192 | } else { | 1193 | } else { |
1193 | local_irq_disable(); | 1194 | local_irq_disable(); |
1194 | LIST(tmp, hostdata->issue_queue); | 1195 | LIST(tmp, hostdata->issue_queue); |
1195 | NEXT(tmp) = hostdata->issue_queue; | 1196 | SET_NEXT(tmp, hostdata->issue_queue); |
1196 | hostdata->issue_queue = tmp; | 1197 | hostdata->issue_queue = tmp; |
1197 | #ifdef SUPPORT_TAGS | 1198 | #ifdef SUPPORT_TAGS |
1198 | cmd_free_tag(tmp); | 1199 | cmd_free_tag(tmp); |
@@ -2295,7 +2296,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) | |||
2295 | 2296 | ||
2296 | local_irq_save(flags); | 2297 | local_irq_save(flags); |
2297 | LIST(cmd,hostdata->issue_queue); | 2298 | LIST(cmd,hostdata->issue_queue); |
2298 | NEXT(cmd) = hostdata->issue_queue; | 2299 | SET_NEXT(cmd, hostdata->issue_queue); |
2299 | hostdata->issue_queue = (Scsi_Cmnd *) cmd; | 2300 | hostdata->issue_queue = (Scsi_Cmnd *) cmd; |
2300 | local_irq_restore(flags); | 2301 | local_irq_restore(flags); |
2301 | QU_PRINTK("scsi%d: REQUEST SENSE added to head of " | 2302 | QU_PRINTK("scsi%d: REQUEST SENSE added to head of " |
@@ -2357,7 +2358,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) | |||
2357 | local_irq_save(flags); | 2358 | local_irq_save(flags); |
2358 | cmd->device->disconnect = 1; | 2359 | cmd->device->disconnect = 1; |
2359 | LIST(cmd,hostdata->disconnected_queue); | 2360 | LIST(cmd,hostdata->disconnected_queue); |
2360 | NEXT(cmd) = hostdata->disconnected_queue; | 2361 | SET_NEXT(cmd, hostdata->disconnected_queue); |
2361 | hostdata->connected = NULL; | 2362 | hostdata->connected = NULL; |
2362 | hostdata->disconnected_queue = cmd; | 2363 | hostdata->disconnected_queue = cmd; |
2363 | local_irq_restore(flags); | 2364 | local_irq_restore(flags); |
@@ -2632,12 +2633,12 @@ static void NCR5380_reselect(struct Scsi_Host *instance) | |||
2632 | falcon_dont_release++; | 2633 | falcon_dont_release++; |
2633 | if (prev) { | 2634 | if (prev) { |
2634 | REMOVE(prev, NEXT(prev), tmp, NEXT(tmp)); | 2635 | REMOVE(prev, NEXT(prev), tmp, NEXT(tmp)); |
2635 | NEXT(prev) = NEXT(tmp); | 2636 | SET_NEXT(prev, NEXT(tmp)); |
2636 | } else { | 2637 | } else { |
2637 | REMOVE(-1, hostdata->disconnected_queue, tmp, NEXT(tmp)); | 2638 | REMOVE(-1, hostdata->disconnected_queue, tmp, NEXT(tmp)); |
2638 | hostdata->disconnected_queue = NEXT(tmp); | 2639 | hostdata->disconnected_queue = NEXT(tmp); |
2639 | } | 2640 | } |
2640 | NEXT(tmp) = NULL; | 2641 | SET_NEXT(tmp, NULL); |
2641 | break; | 2642 | break; |
2642 | } | 2643 | } |
2643 | } | 2644 | } |
@@ -2769,7 +2770,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd) | |||
2769 | if (cmd == tmp) { | 2770 | if (cmd == tmp) { |
2770 | REMOVE(5, *prev, tmp, NEXT(tmp)); | 2771 | REMOVE(5, *prev, tmp, NEXT(tmp)); |
2771 | (*prev) = NEXT(tmp); | 2772 | (*prev) = NEXT(tmp); |
2772 | NEXT(tmp) = NULL; | 2773 | SET_NEXT(tmp, NULL); |
2773 | tmp->result = DID_ABORT << 16; | 2774 | tmp->result = DID_ABORT << 16; |
2774 | local_irq_restore(flags); | 2775 | local_irq_restore(flags); |
2775 | ABRT_PRINTK("scsi%d: abort removed command from issue queue.\n", | 2776 | ABRT_PRINTK("scsi%d: abort removed command from issue queue.\n", |
@@ -2844,7 +2845,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd) | |||
2844 | if (cmd == tmp) { | 2845 | if (cmd == tmp) { |
2845 | REMOVE(5, *prev, tmp, NEXT(tmp)); | 2846 | REMOVE(5, *prev, tmp, NEXT(tmp)); |
2846 | *prev = NEXT(tmp); | 2847 | *prev = NEXT(tmp); |
2847 | NEXT(tmp) = NULL; | 2848 | SET_NEXT(tmp, NULL); |
2848 | tmp->result = DID_ABORT << 16; | 2849 | tmp->result = DID_ABORT << 16; |
2849 | /* We must unlock the tag/LUN immediately here, since the | 2850 | /* We must unlock the tag/LUN immediately here, since the |
2850 | * target goes to BUS FREE and doesn't send us another | 2851 | * target goes to BUS FREE and doesn't send us another |
@@ -2965,7 +2966,7 @@ static int NCR5380_bus_reset(Scsi_Cmnd *cmd) | |||
2965 | 2966 | ||
2966 | for (i = 0; (cmd = disconnected_queue); ++i) { | 2967 | for (i = 0; (cmd = disconnected_queue); ++i) { |
2967 | disconnected_queue = NEXT(cmd); | 2968 | disconnected_queue = NEXT(cmd); |
2968 | NEXT(cmd) = NULL; | 2969 | SET_NEXT(cmd, NULL); |
2969 | cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16); | 2970 | cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16); |
2970 | cmd->scsi_done(cmd); | 2971 | cmd->scsi_done(cmd); |
2971 | } | 2972 | } |