blob: f4a1014cbe0ac1878da47ad2b39212e54f9cf8b4 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#define AUTOSENSE
2#define PSEUDO_DMA
3#define FOO
4#define UNSAFE /* Not unsafe for PAS16 -- use it */
Olaf Hering44456d32005-07-27 11:45:17 -07005#define PDEBUG 0
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
7/*
8 * This driver adapted from Drew Eckhardt's Trantor T128 driver
9 *
10 * Copyright 1993, Drew Eckhardt
11 * Visionary Computing
12 * (Unix and Linux consulting and custom programming)
13 * drew@colorado.edu
14 * +1 (303) 666-5836
15 *
16 * ( Based on T128 - DISTRIBUTION RELEASE 3. )
17 *
18 * Modified to work with the Pro Audio Spectrum/Studio 16
19 * by John Weidman.
20 *
21 *
22 * For more information, please consult
23 *
24 * Media Vision
25 * (510) 770-8600
26 * (800) 348-7116
27 *
28 * and
29 *
30 * NCR 5380 Family
31 * SCSI Protocol Controller
32 * Databook
33 *
34 * NCR Microelectronics
35 * 1635 Aeroplaza Drive
36 * Colorado Springs, CO 80916
37 * 1+ (719) 578-3400
38 * 1+ (800) 334-5454
39 */
40
41/*
42 * Options :
43 * AUTOSENSE - if defined, REQUEST SENSE will be performed automatically
44 * for commands that return with a CHECK CONDITION status.
45 *
46 * LIMIT_TRANSFERSIZE - if defined, limit the pseudo-dma transfers to 512
47 * bytes at a time. Since interrupts are disabled by default during
48 * these transfers, we might need this to give reasonable interrupt
49 * service time if the transfer size gets too large.
50 *
51 * PSEUDO_DMA - enables PSEUDO-DMA hardware, should give a 3-4X performance
52 * increase compared to polled I/O.
53 *
54 * PARITY - enable parity checking. Not supported.
55 *
56 * SCSI2 - enable support for SCSI-II tagged queueing. Untested.
57 *
58 * UNSAFE - leave interrupts enabled during pseudo-DMA transfers. This
59 * parameter comes from the NCR5380 code. It is NOT unsafe with
60 * the PAS16 and you should use it. If you don't you will have
61 * a problem with dropped characters during high speed
62 * communications during SCSI transfers. If you really don't
63 * want to use UNSAFE you can try defining LIMIT_TRANSFERSIZE or
64 * twiddle with the transfer size in the high level code.
65 *
66 * USLEEP - enable support for devices that don't disconnect. Untested.
67 *
68 * The card is detected and initialized in one of several ways :
69 * 1. Autoprobe (default) - There are many different models of
70 * the Pro Audio Spectrum/Studio 16, and I only have one of
71 * them, so this may require a little tweaking. An interrupt
72 * is triggered to autoprobe for the interrupt line. Note:
73 * with the newer model boards, the interrupt is set via
74 * software after reset using the default_irq for the
75 * current board number.
76 *
77 * 2. With command line overrides - pas16=port,irq may be
78 * used on the LILO command line to override the defaults.
79 *
80 * 3. With the PAS16_OVERRIDE compile time define. This is
81 * specified as an array of address, irq tuples. Ie, for
82 * one board at the default 0x388 address, IRQ10, I could say
83 * -DPAS16_OVERRIDE={{0x388, 10}}
84 * NOTE: Untested.
85 *
86 * 4. When included as a module, with arguments passed on the command line:
87 * pas16_irq=xx the interrupt
88 * pas16_addr=xx the port
89 * e.g. "modprobe pas16 pas16_addr=0x388 pas16_irq=5"
90 *
91 * Note that if the override methods are used, place holders must
92 * be specified for other boards in the system.
93 *
94 *
95 * Configuration notes :
96 * The current driver does not support interrupt sharing with the
97 * sound portion of the card. If you use the same irq for the
98 * scsi port and sound you will have problems. Either use
99 * a different irq for the scsi port or don't use interrupts
100 * for the scsi port.
101 *
102 * If you have problems with your card not being recognized, use
103 * the LILO command line override. Try to get it recognized without
104 * interrupts. Ie, for a board at the default 0x388 base port,
105 * boot: linux pas16=0x388,255
106 *
107 * SCSI_IRQ_NONE (255) should be specified for no interrupt,
108 * IRQ_AUTO (254) to autoprobe for an IRQ line if overridden
109 * on the command line.
110 *
111 * (IRQ_AUTO == 254, SCSI_IRQ_NONE == 255 in NCR5380.h)
112 */
113
114#include <linux/module.h>
115
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116#include <linux/signal.h>
117#include <linux/proc_fs.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -0700118#include <asm/io.h>
119#include <asm/dma.h>
120#include <linux/blkdev.h>
121#include <linux/delay.h>
122#include <linux/interrupt.h>
123#include <linux/stat.h>
124#include <linux/init.h>
125
126#include "scsi.h"
127#include <scsi/scsi_host.h>
128#include "pas16.h"
129#define AUTOPROBE_IRQ
130#include "NCR5380.h"
131
132
133static int pas_maxi = 0;
134static int pas_wmaxi = 0;
135static unsigned short pas16_addr = 0;
136static int pas16_irq = 0;
137
138
Adrian Bunk408b6642005-05-01 08:59:29 -0700139static const int scsi_irq_translate[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140 { 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 7, 8, 9, 0, 10, 11 };
141
142/* The default_irqs array contains values used to set the irq into the
143 * board via software (as must be done on newer model boards without
144 * irq jumpers on the board). The first value in the array will be
145 * assigned to logical board 0, the next to board 1, etc.
146 */
Adrian Bunk408b6642005-05-01 08:59:29 -0700147static int default_irqs[] __initdata =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148 { PAS16_DEFAULT_BOARD_1_IRQ,
149 PAS16_DEFAULT_BOARD_2_IRQ,
150 PAS16_DEFAULT_BOARD_3_IRQ,
151 PAS16_DEFAULT_BOARD_4_IRQ
152 };
153
154static struct override {
155 unsigned short io_port;
156 int irq;
Tobias Klauser6391a112006-06-08 22:23:48 -0700157} overrides
Linus Torvalds1da177e2005-04-16 15:20:36 -0700158#ifdef PAS16_OVERRIDE
159 [] __initdata = PAS16_OVERRIDE;
160#else
161 [4] __initdata = {{0,IRQ_AUTO}, {0,IRQ_AUTO}, {0,IRQ_AUTO},
162 {0,IRQ_AUTO}};
163#endif
164
Tobias Klauser6391a112006-06-08 22:23:48 -0700165#define NO_OVERRIDES ARRAY_SIZE(overrides)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166
167static struct base {
168 unsigned short io_port;
169 int noauto;
Tobias Klauser6391a112006-06-08 22:23:48 -0700170} bases[] __initdata =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700171 { {PAS16_DEFAULT_BASE_1, 0},
172 {PAS16_DEFAULT_BASE_2, 0},
173 {PAS16_DEFAULT_BASE_3, 0},
174 {PAS16_DEFAULT_BASE_4, 0}
175 };
176
Tobias Klauser6391a112006-06-08 22:23:48 -0700177#define NO_BASES ARRAY_SIZE(bases)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178
Adrian Bunk408b6642005-05-01 08:59:29 -0700179static const unsigned short pas16_offset[ 8 ] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180 {
181 0x1c00, /* OUTPUT_DATA_REG */
182 0x1c01, /* INITIATOR_COMMAND_REG */
183 0x1c02, /* MODE_REG */
184 0x1c03, /* TARGET_COMMAND_REG */
185 0x3c00, /* STATUS_REG ro, SELECT_ENABLE_REG wo */
186 0x3c01, /* BUS_AND_STATUS_REG ro, START_DMA_SEND_REG wo */
187 0x3c02, /* INPUT_DATA_REGISTER ro, (N/A on PAS16 ?)
188 * START_DMA_TARGET_RECEIVE_REG wo
189 */
190 0x3c03, /* RESET_PARITY_INTERRUPT_REG ro,
191 * START_DMA_INITIATOR_RECEIVE_REG wo
192 */
193 };
194/*----------------------------------------------------------------*/
195/* the following will set the monitor border color (useful to find
196 where something crashed or gets stuck at */
197/* 1 = blue
198 2 = green
199 3 = cyan
200 4 = red
201 5 = magenta
202 6 = yellow
203 7 = white
204*/
205#if 1
206#define rtrc(i) {inb(0x3da); outb(0x31, 0x3c0); outb((i), 0x3c0);}
207#else
208#define rtrc(i) {}
209#endif
210
211
212/*
213 * Function : enable_board( int board_num, unsigned short port )
214 *
215 * Purpose : set address in new model board
216 *
217 * Inputs : board_num - logical board number 0-3, port - base address
218 *
219 */
220
221static void __init
222 enable_board( int board_num, unsigned short port )
223{
224 outb( 0xbc + board_num, MASTER_ADDRESS_PTR );
225 outb( port >> 2, MASTER_ADDRESS_PTR );
226}
227
228
229
230/*
231 * Function : init_board( unsigned short port, int irq )
232 *
233 * Purpose : Set the board up to handle the SCSI interface
234 *
235 * Inputs : port - base address of the board,
236 * irq - irq to assign to the SCSI port
237 * force_irq - set it even if it conflicts with sound driver
238 *
239 */
240
241static void __init
242 init_board( unsigned short io_port, int irq, int force_irq )
243{
244 unsigned int tmp;
245 unsigned int pas_irq_code;
246
247 /* Initialize the SCSI part of the board */
248
249 outb( 0x30, io_port + P_TIMEOUT_COUNTER_REG ); /* Timeout counter */
250 outb( 0x01, io_port + P_TIMEOUT_STATUS_REG_OFFSET ); /* Reset TC */
251 outb( 0x01, io_port + WAIT_STATE ); /* 1 Wait state */
252
253 NCR5380_read( RESET_PARITY_INTERRUPT_REG );
254
255 /* Set the SCSI interrupt pointer without mucking up the sound
256 * interrupt pointer in the same byte.
257 */
258 pas_irq_code = ( irq < 16 ) ? scsi_irq_translate[irq] : 0;
259 tmp = inb( io_port + IO_CONFIG_3 );
260
261 if( (( tmp & 0x0f ) == pas_irq_code) && pas_irq_code > 0
262 && !force_irq )
263 {
264 printk( "pas16: WARNING: Can't use same irq as sound "
265 "driver -- interrupts disabled\n" );
266 /* Set up the drive parameters, disable 5380 interrupts */
267 outb( 0x4d, io_port + SYS_CONFIG_4 );
268 }
269 else
270 {
271 tmp = ( tmp & 0x0f ) | ( pas_irq_code << 4 );
272 outb( tmp, io_port + IO_CONFIG_3 );
273
274 /* Set up the drive parameters and enable 5380 interrupts */
275 outb( 0x6d, io_port + SYS_CONFIG_4 );
276 }
277}
278
279
280/*
281 * Function : pas16_hw_detect( unsigned short board_num )
282 *
283 * Purpose : determine if a pas16 board is present
284 *
285 * Inputs : board_num - logical board number ( 0 - 3 )
286 *
287 * Returns : 0 if board not found, 1 if found.
288 */
289
290static int __init
291 pas16_hw_detect( unsigned short board_num )
292{
293 unsigned char board_rev, tmp;
294 unsigned short io_port = bases[ board_num ].io_port;
295
296 /* See if we can find a PAS16 board at the address associated
297 * with this logical board number.
298 */
299
300 /* First, attempt to take a newer model board out of reset and
301 * give it a base address. This shouldn't affect older boards.
302 */
303 enable_board( board_num, io_port );
304
305 /* Now see if it looks like a PAS16 board */
306 board_rev = inb( io_port + PCB_CONFIG );
307
308 if( board_rev == 0xff )
309 return 0;
310
311 tmp = board_rev ^ 0xe0;
312
313 outb( tmp, io_port + PCB_CONFIG );
314 tmp = inb( io_port + PCB_CONFIG );
315 outb( board_rev, io_port + PCB_CONFIG );
316
317 if( board_rev != tmp ) /* Not a PAS-16 */
318 return 0;
319
320 if( ( inb( io_port + OPERATION_MODE_1 ) & 0x03 ) != 0x03 )
321 return 0; /* return if no SCSI interface found */
322
323 /* Mediavision has some new model boards that return ID bits
324 * that indicate a SCSI interface, but they're not (LMS). We'll
325 * put in an additional test to try to weed them out.
326 */
327
328 outb( 0x01, io_port + WAIT_STATE ); /* 1 Wait state */
329 NCR5380_write( MODE_REG, 0x20 ); /* Is it really SCSI? */
330 if( NCR5380_read( MODE_REG ) != 0x20 ) /* Write to a reg. */
331 return 0; /* and try to read */
332 NCR5380_write( MODE_REG, 0x00 ); /* it back. */
333 if( NCR5380_read( MODE_REG ) != 0x00 )
334 return 0;
335
336 return 1;
337}
338
339
Finn Thain925e4612014-11-12 16:11:49 +1100340#ifndef MODULE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341/*
342 * Function : pas16_setup(char *str, int *ints)
343 *
344 * Purpose : LILO command line initialization of the overrides array,
345 *
346 * Inputs : str - unused, ints - array of integer parameters with ints[0]
347 * equal to the number of ints.
348 *
349 */
350
Finn Thain925e4612014-11-12 16:11:49 +1100351static int __init pas16_setup(char *str)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352{
353 static int commandline_current = 0;
354 int i;
Finn Thain925e4612014-11-12 16:11:49 +1100355 int ints[10];
356
357 get_options(str, ARRAY_SIZE(ints), ints);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700358 if (ints[0] != 2)
359 printk("pas16_setup : usage pas16=io_port,irq\n");
360 else
361 if (commandline_current < NO_OVERRIDES) {
362 overrides[commandline_current].io_port = (unsigned short) ints[1];
363 overrides[commandline_current].irq = ints[2];
364 for (i = 0; i < NO_BASES; ++i)
365 if (bases[i].io_port == (unsigned short) ints[1]) {
366 bases[i].noauto = 1;
367 break;
368 }
369 ++commandline_current;
370 }
Finn Thain925e4612014-11-12 16:11:49 +1100371 return 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700372}
373
Finn Thain925e4612014-11-12 16:11:49 +1100374__setup("pas16=", pas16_setup);
375#endif
376
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377/*
Christoph Hellwigd0be4a7d2005-10-31 18:31:40 +0100378 * Function : int pas16_detect(struct scsi_host_template * tpnt)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379 *
380 * Purpose : detects and initializes PAS16 controllers
381 * that were autoprobed, overridden on the LILO command line,
382 * or specified at compile time.
383 *
384 * Inputs : tpnt - template for this SCSI adapter.
385 *
386 * Returns : 1 if a host adapter was found, 0 if not.
387 *
388 */
389
Christoph Hellwigd0be4a7d2005-10-31 18:31:40 +0100390int __init pas16_detect(struct scsi_host_template * tpnt)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391{
392 static int current_override = 0;
393 static unsigned short current_base = 0;
394 struct Scsi_Host *instance;
395 unsigned short io_port;
396 int count;
397
398 tpnt->proc_name = "pas16";
Al Virodd7ab712013-03-31 01:15:54 -0400399 tpnt->show_info = pas16_show_info;
400 tpnt->write_info = pas16_write_info;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700401
402 if (pas16_addr != 0) {
403 overrides[0].io_port = pas16_addr;
404 /*
405 * This is how we avoid seeing more than
406 * one host adapter at the same I/O port.
407 * Cribbed shamelessly from pas16_setup().
408 */
409 for (count = 0; count < NO_BASES; ++count)
410 if (bases[count].io_port == pas16_addr) {
411 bases[count].noauto = 1;
412 break;
413 }
414 }
415 if (pas16_irq != 0)
416 overrides[0].irq = pas16_irq;
417
418 for (count = 0; current_override < NO_OVERRIDES; ++current_override) {
419 io_port = 0;
420
421 if (overrides[current_override].io_port)
422 {
423 io_port = overrides[current_override].io_port;
424 enable_board( current_override, io_port );
425 init_board( io_port, overrides[current_override].irq, 1 );
426 }
427 else
428 for (; !io_port && (current_base < NO_BASES); ++current_base) {
429#if (PDEBUG & PDEBUG_INIT)
430 printk("scsi-pas16 : probing io_port %04x\n", (unsigned int) bases[current_base].io_port);
431#endif
432 if ( !bases[current_base].noauto &&
433 pas16_hw_detect( current_base ) ){
434 io_port = bases[current_base].io_port;
435 init_board( io_port, default_irqs[ current_base ], 0 );
436#if (PDEBUG & PDEBUG_INIT)
437 printk("scsi-pas16 : detected board.\n");
438#endif
439 }
440 }
441
442
443#if defined(PDEBUG) && (PDEBUG & PDEBUG_INIT)
444 printk("scsi-pas16 : io_port = %04x\n", (unsigned int) io_port);
445#endif
446
447 if (!io_port)
448 break;
449
450 instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
451 if(instance == NULL)
452 break;
453
454 instance->io_port = io_port;
455
456 NCR5380_init(instance, 0);
457
458 if (overrides[current_override].irq != IRQ_AUTO)
459 instance->irq = overrides[current_override].irq;
460 else
461 instance->irq = NCR5380_probe_irq(instance, PAS16_IRQS);
462
463 if (instance->irq != SCSI_IRQ_NONE)
Michael Opdenacker4909cc22014-03-05 06:09:41 +0100464 if (request_irq(instance->irq, pas16_intr, 0,
Jeff Garzik1e641662007-11-11 19:52:05 -0500465 "pas16", instance)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700466 printk("scsi%d : IRQ%d not free, interrupts disabled\n",
467 instance->host_no, instance->irq);
468 instance->irq = SCSI_IRQ_NONE;
469 }
470
471 if (instance->irq == SCSI_IRQ_NONE) {
472 printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no);
473 printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no);
474 /* Disable 5380 interrupts, leave drive params the same */
475 outb( 0x4d, io_port + SYS_CONFIG_4 );
476 outb( (inb(io_port + IO_CONFIG_3) & 0x0f), io_port + IO_CONFIG_3 );
477 }
478
479#if defined(PDEBUG) && (PDEBUG & PDEBUG_INIT)
480 printk("scsi%d : irq = %d\n", instance->host_no, instance->irq);
481#endif
482
483 printk("scsi%d : at 0x%04x", instance->host_no, (int)
484 instance->io_port);
485 if (instance->irq == SCSI_IRQ_NONE)
486 printk (" interrupts disabled");
487 else
488 printk (" irq %d", instance->irq);
489 printk(" options CAN_QUEUE=%d CMD_PER_LUN=%d release=%d",
490 CAN_QUEUE, CMD_PER_LUN, PAS16_PUBLIC_RELEASE);
491 NCR5380_print_options(instance);
492 printk("\n");
493
494 ++current_override;
495 ++count;
496 }
497 return count;
498}
499
500/*
501 * Function : int pas16_biosparam(Disk *disk, struct block_device *dev, int *ip)
502 *
503 * Purpose : Generates a BIOS / DOS compatible H-C-S mapping for
504 * the specified device / size.
505 *
506 * Inputs : size = size of device in sectors (512 bytes), dev = block device
507 * major / minor, ip[] = {heads, sectors, cylinders}
508 *
509 * Returns : always 0 (success), initializes ip
510 *
511 */
512
513/*
514 * XXX Most SCSI boards use this mapping, I could be incorrect. Some one
515 * using hard disks on a trantor should verify that this mapping corresponds
516 * to that used by the BIOS / ASPI driver by running the linux fdisk program
517 * and matching the H_C_S coordinates to what DOS uses.
518 */
519
520int pas16_biosparam(struct scsi_device *sdev, struct block_device *dev,
521 sector_t capacity, int * ip)
522{
523 int size = capacity;
524 ip[0] = 64;
525 ip[1] = 32;
526 ip[2] = size >> 11; /* I think I have it as /(32*64) */
527 if( ip[2] > 1024 ) { /* yes, >, not >= */
528 ip[0]=255;
529 ip[1]=63;
530 ip[2]=size/(63*255);
531 if( ip[2] > 1023 ) /* yes >1023... */
532 ip[2] = 1023;
533 }
534
535 return 0;
536}
537
538/*
539 * Function : int NCR5380_pread (struct Scsi_Host *instance,
540 * unsigned char *dst, int len)
541 *
542 * Purpose : Fast 5380 pseudo-dma read function, transfers len bytes to
543 * dst
544 *
545 * Inputs : dst = destination, len = length in bytes
546 *
547 * Returns : 0 on success, non zero on a failure such as a watchdog
548 * timeout.
549 */
550
551static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst,
552 int len) {
553 register unsigned char *d = dst;
554 register unsigned short reg = (unsigned short) (instance->io_port +
555 P_DATA_REG_OFFSET);
556 register int i = len;
557 int ii = 0;
558
559 while ( !(inb(instance->io_port + P_STATUS_REG_OFFSET) & P_ST_RDY) )
560 ++ii;
561
562 insb( reg, d, i );
563
564 if ( inb(instance->io_port + P_TIMEOUT_STATUS_REG_OFFSET) & P_TS_TIM) {
565 outb( P_TS_CT, instance->io_port + P_TIMEOUT_STATUS_REG_OFFSET);
566 printk("scsi%d : watchdog timer fired in NCR5380_pread()\n",
567 instance->host_no);
568 return -1;
569 }
570 if (ii > pas_maxi)
571 pas_maxi = ii;
572 return 0;
573}
574
575/*
576 * Function : int NCR5380_pwrite (struct Scsi_Host *instance,
577 * unsigned char *src, int len)
578 *
579 * Purpose : Fast 5380 pseudo-dma write function, transfers len bytes from
580 * src
581 *
582 * Inputs : src = source, len = length in bytes
583 *
584 * Returns : 0 on success, non zero on a failure such as a watchdog
585 * timeout.
586 */
587
588static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src,
589 int len) {
590 register unsigned char *s = src;
591 register unsigned short reg = (instance->io_port + P_DATA_REG_OFFSET);
592 register int i = len;
593 int ii = 0;
594
595 while ( !((inb(instance->io_port + P_STATUS_REG_OFFSET)) & P_ST_RDY) )
596 ++ii;
597
598 outsb( reg, s, i );
599
600 if (inb(instance->io_port + P_TIMEOUT_STATUS_REG_OFFSET) & P_TS_TIM) {
601 outb( P_TS_CT, instance->io_port + P_TIMEOUT_STATUS_REG_OFFSET);
602 printk("scsi%d : watchdog timer fired in NCR5380_pwrite()\n",
603 instance->host_no);
604 return -1;
605 }
606 if (ii > pas_maxi)
607 pas_wmaxi = ii;
608 return 0;
609}
610
611#include "NCR5380.c"
612
613static int pas16_release(struct Scsi_Host *shost)
614{
615 if (shost->irq)
Jeff Garzik1e641662007-11-11 19:52:05 -0500616 free_irq(shost->irq, shost);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700617 NCR5380_exit(shost);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700618 if (shost->io_port && shost->n_io_port)
619 release_region(shost->io_port, shost->n_io_port);
620 scsi_unregister(shost);
621 return 0;
622}
623
Christoph Hellwigd0be4a7d2005-10-31 18:31:40 +0100624static struct scsi_host_template driver_template = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700625 .name = "Pro Audio Spectrum-16 SCSI",
626 .detect = pas16_detect,
627 .release = pas16_release,
628 .queuecommand = pas16_queue_command,
629 .eh_abort_handler = pas16_abort,
630 .eh_bus_reset_handler = pas16_bus_reset,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700631 .bios_param = pas16_biosparam,
632 .can_queue = CAN_QUEUE,
633 .this_id = 7,
634 .sg_tablesize = SG_ALL,
635 .cmd_per_lun = CMD_PER_LUN,
636 .use_clustering = DISABLE_CLUSTERING,
637};
638#include "scsi_module.c"
639
640#ifdef MODULE
641module_param(pas16_addr, ushort, 0);
642module_param(pas16_irq, int, 0);
643#endif
644MODULE_LICENSE("GPL");