6 #define xNDEBUG (NDEBUG_INTR+NDEBUG_RESELECTION+\
7 NDEBUG_SELECTION+NDEBUG_ARBITRATION)
8 #define DMA_WORKS_RIGHT
69 #define rtrc(i) {inb(0x3da); outb(0x31, 0x3c0); outb((i), 0x3c0);}
75 #include <linux/module.h>
76 #include <linux/signal.h>
79 #include <linux/stat.h>
80 #include <linux/string.h>
91 #define DTC_PUBLIC_RELEASE 2
101 #define DTC_CONTROL_REG 0x100
102 #define D_CR_ACCESS 0x80
103 #define CSR_DIR_READ 0x40
105 #define CSR_RESET 0x80
106 #define CSR_5380_REG 0x80
107 #define CSR_TRANS_DIR 0x40
108 #define CSR_SCSI_BUFF_INTR 0x20
109 #define CSR_5380_INTR 0x10
110 #define CSR_SHARED_INTR 0x08
111 #define CSR_HOST_BUF_NOT_RDY 0x04
112 #define CSR_SCSI_BUF_RDY 0x02
113 #define CSR_GATED_5380_IRQ 0x01
114 #define CSR_INT_BASE (CSR_SCSI_BUFF_INTR | CSR_5380_INTR)
117 #define DTC_BLK_CNT 0x101
121 #define D_CR_ACCESS 0x80
123 #define DTC_SWITCH_REG 0x3982
124 #define DTC_RESUME_XFER 0x3982
127 #define DTC_5380_OFFSET 0x3880
130 #define DTC_DATA_BUF 0x3900
132 static struct override {
144 #define NO_OVERRIDES ARRAY_SIZE(overrides)
149 } bases[] __initdata = {
156 #define NO_BASES ARRAY_SIZE(bases)
162 {
"DATA TECHNOLOGY CORPORATION BIOS", 0x25},
165 #define NO_SIGNATURES ARRAY_SIZE(signatures)
178 static void __init dtc_setup(
char *
str,
int *ints)
180 static int commandline_current = 0;
183 printk(
"dtc_setup: usage dtc=address,irq\n");
185 overrides[commandline_current].address = ints[1];
186 overrides[commandline_current].irq = ints[2];
188 if (bases[i].
address == ints[1]) {
192 ++commandline_current;
212 static int current_override = 0, current_base = 0;
221 for (count = 0; current_override <
NO_OVERRIDES; ++current_override) {
226 addr =
overrides[current_override].address;
231 for (; !addr && (current_base <
NO_BASES); ++current_base) {
232 #if (DTCDEBUG & DTCDEBUG_INIT)
233 printk(
KERN_DEBUG "scsi-dtc : probing address %08x\n", bases[current_base].address);
235 if (bases[current_base].noauto)
237 base =
ioremap(bases[current_base].address, 0x2000);
242 addr = bases[current_base].address;
243 #if (DTCDEBUG & DTCDEBUG_INIT)
252 #if defined(DTCDEBUG) && (DTCDEBUG & DTCDEBUG_INIT)
261 if (instance ==
NULL)
267 NCR5380_init(instance, 0);
273 instance->
irq = NCR5380_probe_irq(instance,
DTC_IRQS);
275 #ifndef DONT_USE_INTR
294 #if defined(DTCDEBUG) && (DTCDEBUG & DTCDEBUG_INIT)
300 printk(
" interrupts disabled");
304 NCR5380_print_options(instance);
358 static int dtc_maxi = 0;
359 static int dtc_wmaxi = 0;
363 unsigned char *
d =
dst;
427 for (i = 0; len > 0; ++
i) {
472 .name =
"DTC 3180/3280 ",
473 .detect = dtc_detect,
474 .release = dtc_release,
475 .queuecommand = dtc_queue_command,
476 .eh_abort_handler = dtc_abort,
477 .eh_bus_reset_handler = dtc_bus_reset,
478 .bios_param = dtc_biosparam,