Commit 3130d905 authored by Roman Zippel's avatar Roman Zippel Committed by Linus Torvalds

m68k: Atari SCSI driver compile fixes

Atari SCSI driver compile fixes
Signed-off-by: default avatarRoman Zippel <zippel@linux-m68k.org>
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c28bda25
...@@ -272,8 +272,9 @@ static struct scsi_host_template *the_template = NULL; ...@@ -272,8 +272,9 @@ static struct scsi_host_template *the_template = NULL;
(struct NCR5380_hostdata *)(in)->hostdata (struct NCR5380_hostdata *)(in)->hostdata
#define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata) #define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata)
#define NEXT(cmd) ((cmd)->host_scribble) #define NEXT(cmd) ((Scsi_Cmnd *)(cmd)->host_scribble)
#define NEXTADDR(cmd) ((Scsi_Cmnd **)&((cmd)->host_scribble)) #define SET_NEXT(cmd,next) ((cmd)->host_scribble = (void *)(next))
#define NEXTADDR(cmd) ((Scsi_Cmnd **)&(cmd)->host_scribble)
#define HOSTNO instance->host_no #define HOSTNO instance->host_no
#define H_NO(cmd) (cmd)->device->host->host_no #define H_NO(cmd) (cmd)->device->host->host_no
...@@ -479,7 +480,7 @@ static void merge_contiguous_buffers(Scsi_Cmnd *cmd) ...@@ -479,7 +480,7 @@ static void merge_contiguous_buffers(Scsi_Cmnd *cmd)
virt_to_phys(page_address(cmd->SCp.buffer[1].page) + virt_to_phys(page_address(cmd->SCp.buffer[1].page) +
cmd->SCp.buffer[1].offset) == endaddr;) { cmd->SCp.buffer[1].offset) == endaddr;) {
MER_PRINTK("VTOP(%p) == %08lx -> merging\n", MER_PRINTK("VTOP(%p) == %08lx -> merging\n",
cmd->SCp.buffer[1].address, endaddr); page_address(cmd->SCp.buffer[1].page), endaddr);
#if (NDEBUG & NDEBUG_MERGING) #if (NDEBUG & NDEBUG_MERGING)
++cnt; ++cnt;
#endif #endif
...@@ -1002,7 +1003,7 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) ...@@ -1002,7 +1003,7 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
* in a queue * in a queue
*/ */
NEXT(cmd) = NULL; SET_NEXT(cmd, NULL);
cmd->scsi_done = done; cmd->scsi_done = done;
cmd->result = 0; cmd->result = 0;
...@@ -1034,14 +1035,14 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *)) ...@@ -1034,14 +1035,14 @@ static int NCR5380_queue_command(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
} }
if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) { if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) {
LIST(cmd, hostdata->issue_queue); LIST(cmd, hostdata->issue_queue);
NEXT(cmd) = hostdata->issue_queue; SET_NEXT(cmd, hostdata->issue_queue);
hostdata->issue_queue = cmd; hostdata->issue_queue = cmd;
} else { } else {
for (tmp = (Scsi_Cmnd *)hostdata->issue_queue; for (tmp = (Scsi_Cmnd *)hostdata->issue_queue;
NEXT(tmp); tmp = NEXT(tmp)) NEXT(tmp); tmp = NEXT(tmp))
; ;
LIST(cmd, tmp); LIST(cmd, tmp);
NEXT(tmp) = cmd; SET_NEXT(tmp, cmd);
} }
local_irq_restore(flags); local_irq_restore(flags);
...@@ -1149,12 +1150,12 @@ static void NCR5380_main(void *bl) ...@@ -1149,12 +1150,12 @@ static void NCR5380_main(void *bl)
local_irq_disable(); local_irq_disable();
if (prev) { if (prev) {
REMOVE(prev, NEXT(prev), tmp, NEXT(tmp)); REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));
NEXT(prev) = NEXT(tmp); SET_NEXT(prev, NEXT(tmp));
} else { } else {
REMOVE(-1, hostdata->issue_queue, tmp, NEXT(tmp)); REMOVE(-1, hostdata->issue_queue, tmp, NEXT(tmp));
hostdata->issue_queue = NEXT(tmp); hostdata->issue_queue = NEXT(tmp);
} }
NEXT(tmp) = NULL; SET_NEXT(tmp, NULL);
falcon_dont_release++; falcon_dont_release++;
/* reenable interrupts after finding one */ /* reenable interrupts after finding one */
...@@ -1192,7 +1193,7 @@ static void NCR5380_main(void *bl) ...@@ -1192,7 +1193,7 @@ static void NCR5380_main(void *bl)
} else { } else {
local_irq_disable(); local_irq_disable();
LIST(tmp, hostdata->issue_queue); LIST(tmp, hostdata->issue_queue);
NEXT(tmp) = hostdata->issue_queue; SET_NEXT(tmp, hostdata->issue_queue);
hostdata->issue_queue = tmp; hostdata->issue_queue = tmp;
#ifdef SUPPORT_TAGS #ifdef SUPPORT_TAGS
cmd_free_tag(tmp); cmd_free_tag(tmp);
...@@ -2295,7 +2296,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) ...@@ -2295,7 +2296,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
local_irq_save(flags); local_irq_save(flags);
LIST(cmd,hostdata->issue_queue); LIST(cmd,hostdata->issue_queue);
NEXT(cmd) = hostdata->issue_queue; SET_NEXT(cmd, hostdata->issue_queue);
hostdata->issue_queue = (Scsi_Cmnd *) cmd; hostdata->issue_queue = (Scsi_Cmnd *) cmd;
local_irq_restore(flags); local_irq_restore(flags);
QU_PRINTK("scsi%d: REQUEST SENSE added to head of " QU_PRINTK("scsi%d: REQUEST SENSE added to head of "
...@@ -2357,7 +2358,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) ...@@ -2357,7 +2358,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
local_irq_save(flags); local_irq_save(flags);
cmd->device->disconnect = 1; cmd->device->disconnect = 1;
LIST(cmd,hostdata->disconnected_queue); LIST(cmd,hostdata->disconnected_queue);
NEXT(cmd) = hostdata->disconnected_queue; SET_NEXT(cmd, hostdata->disconnected_queue);
hostdata->connected = NULL; hostdata->connected = NULL;
hostdata->disconnected_queue = cmd; hostdata->disconnected_queue = cmd;
local_irq_restore(flags); local_irq_restore(flags);
...@@ -2632,12 +2633,12 @@ static void NCR5380_reselect(struct Scsi_Host *instance) ...@@ -2632,12 +2633,12 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
falcon_dont_release++; falcon_dont_release++;
if (prev) { if (prev) {
REMOVE(prev, NEXT(prev), tmp, NEXT(tmp)); REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));
NEXT(prev) = NEXT(tmp); SET_NEXT(prev, NEXT(tmp));
} else { } else {
REMOVE(-1, hostdata->disconnected_queue, tmp, NEXT(tmp)); REMOVE(-1, hostdata->disconnected_queue, tmp, NEXT(tmp));
hostdata->disconnected_queue = NEXT(tmp); hostdata->disconnected_queue = NEXT(tmp);
} }
NEXT(tmp) = NULL; SET_NEXT(tmp, NULL);
break; break;
} }
} }
...@@ -2769,7 +2770,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd) ...@@ -2769,7 +2770,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
if (cmd == tmp) { if (cmd == tmp) {
REMOVE(5, *prev, tmp, NEXT(tmp)); REMOVE(5, *prev, tmp, NEXT(tmp));
(*prev) = NEXT(tmp); (*prev) = NEXT(tmp);
NEXT(tmp) = NULL; SET_NEXT(tmp, NULL);
tmp->result = DID_ABORT << 16; tmp->result = DID_ABORT << 16;
local_irq_restore(flags); local_irq_restore(flags);
ABRT_PRINTK("scsi%d: abort removed command from issue queue.\n", ABRT_PRINTK("scsi%d: abort removed command from issue queue.\n",
...@@ -2844,7 +2845,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd) ...@@ -2844,7 +2845,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
if (cmd == tmp) { if (cmd == tmp) {
REMOVE(5, *prev, tmp, NEXT(tmp)); REMOVE(5, *prev, tmp, NEXT(tmp));
*prev = NEXT(tmp); *prev = NEXT(tmp);
NEXT(tmp) = NULL; SET_NEXT(tmp, NULL);
tmp->result = DID_ABORT << 16; tmp->result = DID_ABORT << 16;
/* We must unlock the tag/LUN immediately here, since the /* We must unlock the tag/LUN immediately here, since the
* target goes to BUS FREE and doesn't send us another * target goes to BUS FREE and doesn't send us another
...@@ -2965,7 +2966,7 @@ static int NCR5380_bus_reset(Scsi_Cmnd *cmd) ...@@ -2965,7 +2966,7 @@ static int NCR5380_bus_reset(Scsi_Cmnd *cmd)
for (i = 0; (cmd = disconnected_queue); ++i) { for (i = 0; (cmd = disconnected_queue); ++i) {
disconnected_queue = NEXT(cmd); disconnected_queue = NEXT(cmd);
NEXT(cmd) = NULL; SET_NEXT(cmd, NULL);
cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16); cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16);
cmd->scsi_done(cmd); cmd->scsi_done(cmd);
} }
......
...@@ -69,9 +69,9 @@ ...@@ -69,9 +69,9 @@
#define NDEBUG (0) #define NDEBUG (0)
#define NDEBUG_ABORT 0x800000 #define NDEBUG_ABORT 0x00100000
#define NDEBUG_TAGS 0x1000000 #define NDEBUG_TAGS 0x00200000
#define NDEBUG_MERGING 0x2000000 #define NDEBUG_MERGING 0x00400000
#define AUTOSENSE #define AUTOSENSE
/* For the Atari version, use only polled IO or REAL_DMA */ /* For the Atari version, use only polled IO or REAL_DMA */
......
...@@ -113,144 +113,58 @@ int atari_scsi_release (struct Scsi_Host *); ...@@ -113,144 +113,58 @@ int atari_scsi_release (struct Scsi_Host *);
* *
*/ */
#if NDEBUG & NDEBUG_ARBITRATION #define dprint(flg, format...) \
({ \
if (NDEBUG & (flg)) \
printk(KERN_DEBUG format); \
})
#define ARB_PRINTK(format, args...) \ #define ARB_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_ARBITRATION, format , ## args)
#else
#define ARB_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_AUTOSENSE
#define ASEN_PRINTK(format, args...) \ #define ASEN_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_AUTOSENSE, format , ## args)
#else
#define ASEN_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_DMA
#define DMA_PRINTK(format, args...) \ #define DMA_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_DMA, format , ## args)
#else
#define DMA_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_HANDSHAKE
#define HSH_PRINTK(format, args...) \ #define HSH_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_HANDSHAKE, format , ## args)
#else
#define HSH_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_INFORMATION
#define INF_PRINTK(format, args...) \ #define INF_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_INFORMATION, format , ## args)
#else
#define INF_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_INIT
#define INI_PRINTK(format, args...) \ #define INI_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_INIT, format , ## args)
#else
#define INI_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_INTR
#define INT_PRINTK(format, args...) \ #define INT_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_INTR, format , ## args)
#else
#define INT_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_LINKED
#define LNK_PRINTK(format, args...) \ #define LNK_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_LINKED, format , ## args)
#else
#define LNK_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_MAIN
#define MAIN_PRINTK(format, args...) \ #define MAIN_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_MAIN, format , ## args)
#else
#define MAIN_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_NO_DATAOUT
#define NDAT_PRINTK(format, args...) \ #define NDAT_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_NO_DATAOUT, format , ## args)
#else
#define NDAT_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_NO_WRITE
#define NWR_PRINTK(format, args...) \ #define NWR_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_NO_WRITE, format , ## args)
#else
#define NWR_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_PIO
#define PIO_PRINTK(format, args...) \ #define PIO_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_PIO, format , ## args)
#else
#define PIO_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_PSEUDO_DMA
#define PDMA_PRINTK(format, args...) \ #define PDMA_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_PSEUDO_DMA, format , ## args)
#else
#define PDMA_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_QUEUES
#define QU_PRINTK(format, args...) \ #define QU_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_QUEUES, format , ## args)
#else
#define QU_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_RESELECTION
#define RSL_PRINTK(format, args...) \ #define RSL_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_RESELECTION, format , ## args)
#else
#define RSL_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_SELECTION
#define SEL_PRINTK(format, args...) \ #define SEL_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_SELECTION, format , ## args)
#else
#define SEL_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_USLEEP
#define USL_PRINTK(format, args...) \ #define USL_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_USLEEP, format , ## args)
#else
#define USL_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_LAST_BYTE_SENT
#define LBS_PRINTK(format, args...) \ #define LBS_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_LAST_BYTE_SENT, format , ## args)
#else
#define LBS_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_RESTART_SELECT
#define RSS_PRINTK(format, args...) \ #define RSS_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_RESTART_SELECT, format , ## args)
#else
#define RSS_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_EXTENDED
#define EXT_PRINTK(format, args...) \ #define EXT_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_EXTENDED, format , ## args)
#else
#define EXT_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_ABORT
#define ABRT_PRINTK(format, args...) \ #define ABRT_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_ABORT, format , ## args)
#else
#define ABRT_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_TAGS
#define TAG_PRINTK(format, args...) \ #define TAG_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_TAGS, format , ## args)
#else
#define TAG_PRINTK(format, args...)
#endif
#if NDEBUG & NDEBUG_MERGING
#define MER_PRINTK(format, args...) \ #define MER_PRINTK(format, args...) \
printk(KERN_DEBUG format , ## args) dprint(NDEBUG_MERGING, format , ## args)
#else
#define MER_PRINTK(format, args...)
#endif
/* conditional macros for NCR5380_print_{,phase,status} */ /* conditional macros for NCR5380_print_{,phase,status} */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment