blob: 62bf1b43b646ae2237c46fc2687425fbe01842f1 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#define PSEUDO_DMA
Linus Torvalds1da177e2005-04-16 15:20:36 -07002#define UNSAFE /* Not unsafe for PAS16 -- use it */
3
4/*
5 * This driver adapted from Drew Eckhardt's Trantor T128 driver
6 *
7 * Copyright 1993, Drew Eckhardt
8 * Visionary Computing
9 * (Unix and Linux consulting and custom programming)
10 * drew@colorado.edu
11 * +1 (303) 666-5836
12 *
13 * ( Based on T128 - DISTRIBUTION RELEASE 3. )
14 *
15 * Modified to work with the Pro Audio Spectrum/Studio 16
16 * by John Weidman.
17 *
18 *
19 * For more information, please consult
20 *
21 * Media Vision
22 * (510) 770-8600
23 * (800) 348-7116
Linus Torvalds1da177e2005-04-16 15:20:36 -070024 */
25
26/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070027 * The card is detected and initialized in one of several ways :
28 * 1. Autoprobe (default) - There are many different models of
29 * the Pro Audio Spectrum/Studio 16, and I only have one of
30 * them, so this may require a little tweaking. An interrupt
31 * is triggered to autoprobe for the interrupt line. Note:
32 * with the newer model boards, the interrupt is set via
33 * software after reset using the default_irq for the
34 * current board number.
35 *
36 * 2. With command line overrides - pas16=port,irq may be
37 * used on the LILO command line to override the defaults.
38 *
39 * 3. With the PAS16_OVERRIDE compile time define. This is
40 * specified as an array of address, irq tuples. Ie, for
41 * one board at the default 0x388 address, IRQ10, I could say
42 * -DPAS16_OVERRIDE={{0x388, 10}}
43 * NOTE: Untested.
44 *
45 * 4. When included as a module, with arguments passed on the command line:
46 * pas16_irq=xx the interrupt
47 * pas16_addr=xx the port
48 * e.g. "modprobe pas16 pas16_addr=0x388 pas16_irq=5"
49 *
50 * Note that if the override methods are used, place holders must
51 * be specified for other boards in the system.
52 *
53 *
54 * Configuration notes :
55 * The current driver does not support interrupt sharing with the
56 * sound portion of the card. If you use the same irq for the
57 * scsi port and sound you will have problems. Either use
58 * a different irq for the scsi port or don't use interrupts
59 * for the scsi port.
60 *
61 * If you have problems with your card not being recognized, use
62 * the LILO command line override. Try to get it recognized without
63 * interrupts. Ie, for a board at the default 0x388 base port,
Finn Thain22f5f102014-11-12 16:11:56 +110064 * boot: linux pas16=0x388,0
Linus Torvalds1da177e2005-04-16 15:20:36 -070065 *
Finn Thain22f5f102014-11-12 16:11:56 +110066 * NO_IRQ (0) should be specified for no interrupt,
Linus Torvalds1da177e2005-04-16 15:20:36 -070067 * IRQ_AUTO (254) to autoprobe for an IRQ line if overridden
68 * on the command line.
Linus Torvalds1da177e2005-04-16 15:20:36 -070069 */
70
71#include <linux/module.h>
72
Linus Torvalds1da177e2005-04-16 15:20:36 -070073#include <linux/signal.h>
74#include <linux/proc_fs.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070075#include <asm/io.h>
76#include <asm/dma.h>
77#include <linux/blkdev.h>
78#include <linux/delay.h>
79#include <linux/interrupt.h>
80#include <linux/stat.h>
81#include <linux/init.h>
82
Linus Torvalds1da177e2005-04-16 15:20:36 -070083#include <scsi/scsi_host.h>
84#include "pas16.h"
85#define AUTOPROBE_IRQ
86#include "NCR5380.h"
87
88
Finn Thaind5f7e652016-01-03 16:05:03 +110089static unsigned short pas16_addr;
90static int pas16_irq;
Linus Torvalds1da177e2005-04-16 15:20:36 -070091
92
Adrian Bunk408b6642005-05-01 08:59:29 -070093static const int scsi_irq_translate[] =
Linus Torvalds1da177e2005-04-16 15:20:36 -070094 { 0, 0, 1, 2, 3, 4, 5, 6, 0, 0, 7, 8, 9, 0, 10, 11 };
95
96/* The default_irqs array contains values used to set the irq into the
97 * board via software (as must be done on newer model boards without
98 * irq jumpers on the board). The first value in the array will be
99 * assigned to logical board 0, the next to board 1, etc.
100 */
Adrian Bunk408b6642005-05-01 08:59:29 -0700101static int default_irqs[] __initdata =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700102 { PAS16_DEFAULT_BOARD_1_IRQ,
103 PAS16_DEFAULT_BOARD_2_IRQ,
104 PAS16_DEFAULT_BOARD_3_IRQ,
105 PAS16_DEFAULT_BOARD_4_IRQ
106 };
107
108static struct override {
109 unsigned short io_port;
110 int irq;
Tobias Klauser6391a112006-06-08 22:23:48 -0700111} overrides
Linus Torvalds1da177e2005-04-16 15:20:36 -0700112#ifdef PAS16_OVERRIDE
113 [] __initdata = PAS16_OVERRIDE;
114#else
115 [4] __initdata = {{0,IRQ_AUTO}, {0,IRQ_AUTO}, {0,IRQ_AUTO},
116 {0,IRQ_AUTO}};
117#endif
118
Tobias Klauser6391a112006-06-08 22:23:48 -0700119#define NO_OVERRIDES ARRAY_SIZE(overrides)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120
121static struct base {
122 unsigned short io_port;
123 int noauto;
Tobias Klauser6391a112006-06-08 22:23:48 -0700124} bases[] __initdata =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125 { {PAS16_DEFAULT_BASE_1, 0},
126 {PAS16_DEFAULT_BASE_2, 0},
127 {PAS16_DEFAULT_BASE_3, 0},
128 {PAS16_DEFAULT_BASE_4, 0}
129 };
130
Tobias Klauser6391a112006-06-08 22:23:48 -0700131#define NO_BASES ARRAY_SIZE(bases)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132
Adrian Bunk408b6642005-05-01 08:59:29 -0700133static const unsigned short pas16_offset[ 8 ] =
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134 {
135 0x1c00, /* OUTPUT_DATA_REG */
136 0x1c01, /* INITIATOR_COMMAND_REG */
137 0x1c02, /* MODE_REG */
138 0x1c03, /* TARGET_COMMAND_REG */
139 0x3c00, /* STATUS_REG ro, SELECT_ENABLE_REG wo */
140 0x3c01, /* BUS_AND_STATUS_REG ro, START_DMA_SEND_REG wo */
141 0x3c02, /* INPUT_DATA_REGISTER ro, (N/A on PAS16 ?)
142 * START_DMA_TARGET_RECEIVE_REG wo
143 */
144 0x3c03, /* RESET_PARITY_INTERRUPT_REG ro,
145 * START_DMA_INITIATOR_RECEIVE_REG wo
146 */
147 };
148/*----------------------------------------------------------------*/
149/* the following will set the monitor border color (useful to find
150 where something crashed or gets stuck at */
151/* 1 = blue
152 2 = green
153 3 = cyan
154 4 = red
155 5 = magenta
156 6 = yellow
157 7 = white
158*/
159#if 1
160#define rtrc(i) {inb(0x3da); outb(0x31, 0x3c0); outb((i), 0x3c0);}
161#else
162#define rtrc(i) {}
163#endif
164
165
166/*
167 * Function : enable_board( int board_num, unsigned short port )
168 *
169 * Purpose : set address in new model board
170 *
171 * Inputs : board_num - logical board number 0-3, port - base address
172 *
173 */
174
175static void __init
176 enable_board( int board_num, unsigned short port )
177{
178 outb( 0xbc + board_num, MASTER_ADDRESS_PTR );
179 outb( port >> 2, MASTER_ADDRESS_PTR );
180}
181
182
183
184/*
185 * Function : init_board( unsigned short port, int irq )
186 *
187 * Purpose : Set the board up to handle the SCSI interface
188 *
189 * Inputs : port - base address of the board,
190 * irq - irq to assign to the SCSI port
191 * force_irq - set it even if it conflicts with sound driver
192 *
193 */
194
195static void __init
196 init_board( unsigned short io_port, int irq, int force_irq )
197{
198 unsigned int tmp;
199 unsigned int pas_irq_code;
200
201 /* Initialize the SCSI part of the board */
202
203 outb( 0x30, io_port + P_TIMEOUT_COUNTER_REG ); /* Timeout counter */
204 outb( 0x01, io_port + P_TIMEOUT_STATUS_REG_OFFSET ); /* Reset TC */
205 outb( 0x01, io_port + WAIT_STATE ); /* 1 Wait state */
206
207 NCR5380_read( RESET_PARITY_INTERRUPT_REG );
208
209 /* Set the SCSI interrupt pointer without mucking up the sound
210 * interrupt pointer in the same byte.
211 */
212 pas_irq_code = ( irq < 16 ) ? scsi_irq_translate[irq] : 0;
213 tmp = inb( io_port + IO_CONFIG_3 );
214
215 if( (( tmp & 0x0f ) == pas_irq_code) && pas_irq_code > 0
216 && !force_irq )
217 {
218 printk( "pas16: WARNING: Can't use same irq as sound "
219 "driver -- interrupts disabled\n" );
220 /* Set up the drive parameters, disable 5380 interrupts */
221 outb( 0x4d, io_port + SYS_CONFIG_4 );
222 }
223 else
224 {
225 tmp = ( tmp & 0x0f ) | ( pas_irq_code << 4 );
226 outb( tmp, io_port + IO_CONFIG_3 );
227
228 /* Set up the drive parameters and enable 5380 interrupts */
229 outb( 0x6d, io_port + SYS_CONFIG_4 );
230 }
231}
232
233
234/*
235 * Function : pas16_hw_detect( unsigned short board_num )
236 *
237 * Purpose : determine if a pas16 board is present
238 *
239 * Inputs : board_num - logical board number ( 0 - 3 )
240 *
241 * Returns : 0 if board not found, 1 if found.
242 */
243
244static int __init
245 pas16_hw_detect( unsigned short board_num )
246{
247 unsigned char board_rev, tmp;
248 unsigned short io_port = bases[ board_num ].io_port;
249
250 /* See if we can find a PAS16 board at the address associated
251 * with this logical board number.
252 */
253
254 /* First, attempt to take a newer model board out of reset and
255 * give it a base address. This shouldn't affect older boards.
256 */
257 enable_board( board_num, io_port );
258
259 /* Now see if it looks like a PAS16 board */
260 board_rev = inb( io_port + PCB_CONFIG );
261
262 if( board_rev == 0xff )
263 return 0;
264
265 tmp = board_rev ^ 0xe0;
266
267 outb( tmp, io_port + PCB_CONFIG );
268 tmp = inb( io_port + PCB_CONFIG );
269 outb( board_rev, io_port + PCB_CONFIG );
270
271 if( board_rev != tmp ) /* Not a PAS-16 */
272 return 0;
273
274 if( ( inb( io_port + OPERATION_MODE_1 ) & 0x03 ) != 0x03 )
275 return 0; /* return if no SCSI interface found */
276
277 /* Mediavision has some new model boards that return ID bits
278 * that indicate a SCSI interface, but they're not (LMS). We'll
279 * put in an additional test to try to weed them out.
280 */
281
282 outb( 0x01, io_port + WAIT_STATE ); /* 1 Wait state */
283 NCR5380_write( MODE_REG, 0x20 ); /* Is it really SCSI? */
284 if( NCR5380_read( MODE_REG ) != 0x20 ) /* Write to a reg. */
285 return 0; /* and try to read */
286 NCR5380_write( MODE_REG, 0x00 ); /* it back. */
287 if( NCR5380_read( MODE_REG ) != 0x00 )
288 return 0;
289
290 return 1;
291}
292
293
Finn Thain925e4612014-11-12 16:11:49 +1100294#ifndef MODULE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295/*
296 * Function : pas16_setup(char *str, int *ints)
297 *
298 * Purpose : LILO command line initialization of the overrides array,
299 *
300 * Inputs : str - unused, ints - array of integer parameters with ints[0]
301 * equal to the number of ints.
302 *
303 */
304
Finn Thain925e4612014-11-12 16:11:49 +1100305static int __init pas16_setup(char *str)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700306{
Finn Thaind5f7e652016-01-03 16:05:03 +1100307 static int commandline_current;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700308 int i;
Finn Thain925e4612014-11-12 16:11:49 +1100309 int ints[10];
310
311 get_options(str, ARRAY_SIZE(ints), ints);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700312 if (ints[0] != 2)
313 printk("pas16_setup : usage pas16=io_port,irq\n");
314 else
315 if (commandline_current < NO_OVERRIDES) {
316 overrides[commandline_current].io_port = (unsigned short) ints[1];
317 overrides[commandline_current].irq = ints[2];
318 for (i = 0; i < NO_BASES; ++i)
319 if (bases[i].io_port == (unsigned short) ints[1]) {
320 bases[i].noauto = 1;
321 break;
322 }
323 ++commandline_current;
324 }
Finn Thain925e4612014-11-12 16:11:49 +1100325 return 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326}
327
Finn Thain925e4612014-11-12 16:11:49 +1100328__setup("pas16=", pas16_setup);
329#endif
330
Linus Torvalds1da177e2005-04-16 15:20:36 -0700331/*
Christoph Hellwigd0be4a7d2005-10-31 18:31:40 +0100332 * Function : int pas16_detect(struct scsi_host_template * tpnt)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700333 *
334 * Purpose : detects and initializes PAS16 controllers
335 * that were autoprobed, overridden on the LILO command line,
336 * or specified at compile time.
337 *
338 * Inputs : tpnt - template for this SCSI adapter.
339 *
340 * Returns : 1 if a host adapter was found, 0 if not.
341 *
342 */
343
Finn Thained8b9e72014-11-12 16:11:51 +1100344static int __init pas16_detect(struct scsi_host_template *tpnt)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700345{
Finn Thaind5f7e652016-01-03 16:05:03 +1100346 static int current_override;
347 static unsigned short current_base;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700348 struct Scsi_Host *instance;
349 unsigned short io_port;
350 int count;
351
Linus Torvalds1da177e2005-04-16 15:20:36 -0700352 if (pas16_addr != 0) {
353 overrides[0].io_port = pas16_addr;
354 /*
355 * This is how we avoid seeing more than
356 * one host adapter at the same I/O port.
357 * Cribbed shamelessly from pas16_setup().
358 */
359 for (count = 0; count < NO_BASES; ++count)
360 if (bases[count].io_port == pas16_addr) {
361 bases[count].noauto = 1;
362 break;
363 }
364 }
365 if (pas16_irq != 0)
366 overrides[0].irq = pas16_irq;
367
368 for (count = 0; current_override < NO_OVERRIDES; ++current_override) {
369 io_port = 0;
370
371 if (overrides[current_override].io_port)
372 {
373 io_port = overrides[current_override].io_port;
374 enable_board( current_override, io_port );
375 init_board( io_port, overrides[current_override].irq, 1 );
376 }
377 else
378 for (; !io_port && (current_base < NO_BASES); ++current_base) {
Finn Thain2f7dba92016-01-03 16:05:04 +1100379 dprintk(NDEBUG_INIT, "pas16: probing io_port 0x%04x\n",
380 (unsigned int)bases[current_base].io_port);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700381 if ( !bases[current_base].noauto &&
382 pas16_hw_detect( current_base ) ){
383 io_port = bases[current_base].io_port;
384 init_board( io_port, default_irqs[ current_base ], 0 );
Finn Thain2f7dba92016-01-03 16:05:04 +1100385 dprintk(NDEBUG_INIT, "pas16: detected board\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700386 }
387 }
388
Finn Thain2f7dba92016-01-03 16:05:04 +1100389 dprintk(NDEBUG_INIT, "pas16: io_port = 0x%04x\n",
390 (unsigned int)io_port);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700391
392 if (!io_port)
393 break;
394
395 instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
396 if(instance == NULL)
397 break;
398
399 instance->io_port = io_port;
400
401 NCR5380_init(instance, 0);
402
403 if (overrides[current_override].irq != IRQ_AUTO)
404 instance->irq = overrides[current_override].irq;
405 else
406 instance->irq = NCR5380_probe_irq(instance, PAS16_IRQS);
407
Finn Thain22f5f102014-11-12 16:11:56 +1100408 /* Compatibility with documented NCR5380 kernel parameters */
409 if (instance->irq == 255)
410 instance->irq = NO_IRQ;
411
412 if (instance->irq != NO_IRQ)
Michael Opdenacker4909cc22014-03-05 06:09:41 +0100413 if (request_irq(instance->irq, pas16_intr, 0,
Jeff Garzik1e641662007-11-11 19:52:05 -0500414 "pas16", instance)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700415 printk("scsi%d : IRQ%d not free, interrupts disabled\n",
416 instance->host_no, instance->irq);
Finn Thain22f5f102014-11-12 16:11:56 +1100417 instance->irq = NO_IRQ;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700418 }
419
Finn Thain22f5f102014-11-12 16:11:56 +1100420 if (instance->irq == NO_IRQ) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700421 printk("scsi%d : interrupts not enabled. for better interactive performance,\n", instance->host_no);
422 printk("scsi%d : please jumper the board for a free IRQ.\n", instance->host_no);
423 /* Disable 5380 interrupts, leave drive params the same */
424 outb( 0x4d, io_port + SYS_CONFIG_4 );
425 outb( (inb(io_port + IO_CONFIG_3) & 0x0f), io_port + IO_CONFIG_3 );
426 }
427
Finn Thain2f7dba92016-01-03 16:05:04 +1100428 dprintk(NDEBUG_INIT, "scsi%d : irq = %d\n",
429 instance->host_no, instance->irq);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700430
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431 ++current_override;
432 ++count;
433 }
434 return count;
435}
436
437/*
438 * Function : int pas16_biosparam(Disk *disk, struct block_device *dev, int *ip)
439 *
440 * Purpose : Generates a BIOS / DOS compatible H-C-S mapping for
441 * the specified device / size.
442 *
443 * Inputs : size = size of device in sectors (512 bytes), dev = block device
444 * major / minor, ip[] = {heads, sectors, cylinders}
445 *
446 * Returns : always 0 (success), initializes ip
447 *
448 */
449
450/*
451 * XXX Most SCSI boards use this mapping, I could be incorrect. Some one
452 * using hard disks on a trantor should verify that this mapping corresponds
453 * to that used by the BIOS / ASPI driver by running the linux fdisk program
454 * and matching the H_C_S coordinates to what DOS uses.
455 */
456
Finn Thained8b9e72014-11-12 16:11:51 +1100457static int pas16_biosparam(struct scsi_device *sdev, struct block_device *dev,
458 sector_t capacity, int *ip)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700459{
460 int size = capacity;
461 ip[0] = 64;
462 ip[1] = 32;
463 ip[2] = size >> 11; /* I think I have it as /(32*64) */
464 if( ip[2] > 1024 ) { /* yes, >, not >= */
465 ip[0]=255;
466 ip[1]=63;
467 ip[2]=size/(63*255);
468 if( ip[2] > 1023 ) /* yes >1023... */
469 ip[2] = 1023;
470 }
471
472 return 0;
473}
474
475/*
476 * Function : int NCR5380_pread (struct Scsi_Host *instance,
477 * unsigned char *dst, int len)
478 *
479 * Purpose : Fast 5380 pseudo-dma read function, transfers len bytes to
480 * dst
481 *
482 * Inputs : dst = destination, len = length in bytes
483 *
484 * Returns : 0 on success, non zero on a failure such as a watchdog
485 * timeout.
486 */
487
488static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst,
489 int len) {
490 register unsigned char *d = dst;
491 register unsigned short reg = (unsigned short) (instance->io_port +
492 P_DATA_REG_OFFSET);
493 register int i = len;
494 int ii = 0;
Finn Thaina9c2dc42014-11-12 16:11:59 +1100495 struct NCR5380_hostdata *hostdata = shost_priv(instance);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700496
497 while ( !(inb(instance->io_port + P_STATUS_REG_OFFSET) & P_ST_RDY) )
498 ++ii;
499
500 insb( reg, d, i );
501
502 if ( inb(instance->io_port + P_TIMEOUT_STATUS_REG_OFFSET) & P_TS_TIM) {
503 outb( P_TS_CT, instance->io_port + P_TIMEOUT_STATUS_REG_OFFSET);
504 printk("scsi%d : watchdog timer fired in NCR5380_pread()\n",
505 instance->host_no);
506 return -1;
507 }
Finn Thaina9c2dc42014-11-12 16:11:59 +1100508 if (ii > hostdata->spin_max_r)
509 hostdata->spin_max_r = ii;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700510 return 0;
511}
512
513/*
514 * Function : int NCR5380_pwrite (struct Scsi_Host *instance,
515 * unsigned char *src, int len)
516 *
517 * Purpose : Fast 5380 pseudo-dma write function, transfers len bytes from
518 * src
519 *
520 * Inputs : src = source, len = length in bytes
521 *
522 * Returns : 0 on success, non zero on a failure such as a watchdog
523 * timeout.
524 */
525
526static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src,
527 int len) {
528 register unsigned char *s = src;
529 register unsigned short reg = (instance->io_port + P_DATA_REG_OFFSET);
530 register int i = len;
531 int ii = 0;
Finn Thaina9c2dc42014-11-12 16:11:59 +1100532 struct NCR5380_hostdata *hostdata = shost_priv(instance);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700533
534 while ( !((inb(instance->io_port + P_STATUS_REG_OFFSET)) & P_ST_RDY) )
535 ++ii;
536
537 outsb( reg, s, i );
538
539 if (inb(instance->io_port + P_TIMEOUT_STATUS_REG_OFFSET) & P_TS_TIM) {
540 outb( P_TS_CT, instance->io_port + P_TIMEOUT_STATUS_REG_OFFSET);
541 printk("scsi%d : watchdog timer fired in NCR5380_pwrite()\n",
542 instance->host_no);
543 return -1;
544 }
Finn Thaina9c2dc42014-11-12 16:11:59 +1100545 if (ii > hostdata->spin_max_w)
546 hostdata->spin_max_w = ii;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700547 return 0;
548}
549
550#include "NCR5380.c"
551
552static int pas16_release(struct Scsi_Host *shost)
553{
Finn Thain22f5f102014-11-12 16:11:56 +1100554 if (shost->irq != NO_IRQ)
Jeff Garzik1e641662007-11-11 19:52:05 -0500555 free_irq(shost->irq, shost);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700556 NCR5380_exit(shost);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700557 if (shost->io_port && shost->n_io_port)
558 release_region(shost->io_port, shost->n_io_port);
559 scsi_unregister(shost);
560 return 0;
561}
562
Christoph Hellwigd0be4a7d2005-10-31 18:31:40 +0100563static struct scsi_host_template driver_template = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700564 .name = "Pro Audio Spectrum-16 SCSI",
565 .detect = pas16_detect,
566 .release = pas16_release,
Finn Thain4d3d2a52014-11-12 16:11:52 +1100567 .proc_name = "pas16",
568 .show_info = pas16_show_info,
569 .write_info = pas16_write_info,
Finn Thain8c325132014-11-12 16:11:58 +1100570 .info = pas16_info,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700571 .queuecommand = pas16_queue_command,
572 .eh_abort_handler = pas16_abort,
573 .eh_bus_reset_handler = pas16_bus_reset,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700574 .bios_param = pas16_biosparam,
575 .can_queue = CAN_QUEUE,
576 .this_id = 7,
577 .sg_tablesize = SG_ALL,
578 .cmd_per_lun = CMD_PER_LUN,
579 .use_clustering = DISABLE_CLUSTERING,
580};
581#include "scsi_module.c"
582
583#ifdef MODULE
584module_param(pas16_addr, ushort, 0);
585module_param(pas16_irq, int, 0);
586#endif
587MODULE_LICENSE("GPL");