114 #include <linux/module.h>
116 #include <linux/signal.h>
123 #include <linux/stat.h>
129 #define AUTOPROBE_IRQ
133 static int pas_maxi = 0;
134 static int pas_wmaxi = 0;
135 static unsigned short pas16_addr = 0;
136 static int pas16_irq = 0;
139 static const int scsi_irq_translate[] =
140 { 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 7, 8, 9, 0, 10, 11 };
154 static struct override {
158 #ifdef PAS16_OVERRIDE
165 #define NO_OVERRIDES ARRAY_SIZE(overrides)
170 } bases[] __initdata =
177 #define NO_BASES ARRAY_SIZE(bases)
179 static const unsigned short pas16_offset[ 8 ] =
206 #define rtrc(i) {inb(0x3da); outb(0x31, 0x3c0); outb((i), 0x3c0);}
222 enable_board(
int board_num,
unsigned short port )
245 unsigned int pas_irq_code;
258 pas_irq_code = ( irq < 16 ) ? scsi_irq_translate[irq] : 0;
261 if( (( tmp & 0x0f ) == pas_irq_code) && pas_irq_code > 0
264 printk(
"pas16: WARNING: Can't use same irq as sound "
265 "driver -- interrupts disabled\n" );
271 tmp = ( tmp & 0x0f ) | ( pas_irq_code << 4 );
291 pas16_hw_detect(
unsigned short board_num )
293 unsigned char board_rev,
tmp;
294 unsigned short io_port = bases[ board_num ].io_port;
303 enable_board( board_num, io_port );
308 if( board_rev == 0xff )
311 tmp = board_rev ^ 0xe0;
317 if( board_rev != tmp )
352 static int commandline_current = 0;
355 printk(
"pas16_setup : usage pas16=io_port,irq\n");
358 overrides[commandline_current].io_port = (
unsigned short) ints[1];
359 overrides[commandline_current].irq = ints[2];
361 if (bases[i].io_port == (
unsigned short) ints[1]) {
365 ++commandline_current;
384 static int current_override = 0;
385 static unsigned short current_base = 0;
393 if (pas16_addr != 0) {
401 if (bases[count].io_port == pas16_addr) {
402 bases[
count].noauto = 1;
409 for (count = 0; current_override <
NO_OVERRIDES; ++current_override) {
414 io_port =
overrides[current_override].io_port;
415 enable_board( current_override, io_port );
419 for (; !io_port && (current_base <
NO_BASES); ++current_base) {
420 #if (PDEBUG & PDEBUG_INIT)
421 printk(
"scsi-pas16 : probing io_port %04x\n", (
unsigned int) bases[current_base].io_port);
423 if ( !bases[current_base].noauto &&
424 pas16_hw_detect( current_base ) ){
425 io_port = bases[current_base].io_port;
426 init_board( io_port, default_irqs[ current_base ], 0 );
427 #if (PDEBUG & PDEBUG_INIT)
428 printk(
"scsi-pas16 : detected board.\n");
434 #if defined(PDEBUG) && (PDEBUG & PDEBUG_INIT)
435 printk(
"scsi-pas16 : io_port = %04x\n", (
unsigned int) io_port);
447 NCR5380_init(instance, 0);
456 "pas16", instance)) {
457 printk(
"scsi%d : IRQ%d not free, interrupts disabled\n",
463 printk(
"scsi%d : interrupts not enabled. for better interactive performance,\n", instance->
host_no);
464 printk(
"scsi%d : please jumper the board for a free IRQ.\n", instance->
host_no);
470 #if defined(PDEBUG) && (PDEBUG & PDEBUG_INIT)
477 printk (
" interrupts disabled");
480 printk(
" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d",
482 NCR5380_print_options(instance);
544 register unsigned char *
d =
dst;
547 register int i = len;
557 printk(
"scsi%d : watchdog timer fired in NCR5380_pread()\n",
581 register unsigned char *
s =
src;
583 register int i = len;
593 printk(
"scsi%d : watchdog timer fired in NCR5380_pwrite()\n",
618 .name =
"Pro Audio Spectrum-16 SCSI",
620 .release = pas16_release,
621 .queuecommand = pas16_queue_command,
622 .eh_abort_handler = pas16_abort,
623 .eh_bus_reset_handler = pas16_bus_reset,