Import 2.3.18pre1
[davej-history.git] / drivers / scsi / qlogicfas.c
blobaf76c3aa98831b82b5d2ef02379423740b7add58
1 /*----------------------------------------------------------------*/
2 /*
3 Qlogic linux driver - work in progress. No Warranty express or implied.
4 Use at your own risk. Support Tort Reform so you won't have to read all
5 these silly disclaimers.
7 Copyright 1994, Tom Zerucha.
8 tz@execpc.com
10 Additional Code, and much appreciated help by
11 Michael A. Griffith
12 grif@cs.ucr.edu
14 Thanks to Eric Youngdale and Dave Hinds for loadable module and PCMCIA
15 help respectively, and for suffering through my foolishness during the
16 debugging process.
18 Reference Qlogic FAS408 Technical Manual, 53408-510-00A, May 10, 1994
19 (you can reference it, but it is incomplete and inaccurate in places)
21 Version 0.46 1/30/97 - kernel 1.2.0+
23 Functions as standalone, loadable, and PCMCIA driver, the latter from
24 Dave Hind's PCMCIA package.
26 Redistributable under terms of the GNU Public License
29 /*----------------------------------------------------------------*/
30 /* Configuration */
32 /* Set the following to 2 to use normal interrupt (active high/totempole-
33 tristate), otherwise use 0 (REQUIRED FOR PCMCIA) for active low, open
34 drain */
35 #define QL_INT_ACTIVE_HIGH 2
37 /* Set the following to 1 to enable the use of interrupts. Note that 0 tends
38 to be more stable, but slower (or ties up the system more) */
39 #define QL_USE_IRQ 1
41 /* Set the following to max out the speed of the PIO PseudoDMA transfers,
42 again, 0 tends to be slower, but more stable. */
43 #define QL_TURBO_PDMA 1
45 /* This should be 1 to enable parity detection */
46 #define QL_ENABLE_PARITY 1
48 /* This will reset all devices when the driver is initialized (during bootup).
49 The other linux drivers don't do this, but the DOS drivers do, and after
50 using DOS or some kind of crash or lockup this will bring things back
51 without requiring a cold boot. It does take some time to recover from a
52 reset, so it is slower, and I have seen timeouts so that devices weren't
53 recognized when this was set. */
54 #define QL_RESET_AT_START 0
56 /* crystal frequency in megahertz (for offset 5 and 9)
57 Please set this for your card. Most Qlogic cards are 40 Mhz. The
58 Control Concepts ISA (not VLB) is 24 Mhz */
59 #define XTALFREQ 40
61 /**********/
62 /* DANGER! modify these at your own risk */
63 /* SLOWCABLE can usually be reset to zero if you have a clean setup and
64 proper termination. The rest are for synchronous transfers and other
65 advanced features if your device can transfer faster than 5Mb/sec.
66 If you are really curious, email me for a quick howto until I have
67 something official */
68 /**********/
70 /*****/
71 /* config register 1 (offset 8) options */
72 /* This needs to be set to 1 if your cabling is long or noisy */
73 #define SLOWCABLE 1
75 /*****/
76 /* offset 0xc */
77 /* This will set fast (10Mhz) synchronous timing when set to 1
78 For this to have an effect, FASTCLK must also be 1 */
79 #define FASTSCSI 0
81 /* This when set to 1 will set a faster sync transfer rate */
82 #define FASTCLK 0
83 /*(XTALFREQ>25?1:0)*/
85 /*****/
86 /* offset 6 */
87 /* This is the sync transfer divisor, XTALFREQ/X will be the maximum
88 achievable data rate (assuming the rest of the system is capable
89 and set properly) */
90 #define SYNCXFRPD 5
91 /*(XTALFREQ/5)*/
93 /*****/
94 /* offset 7 */
95 /* This is the count of how many synchronous transfers can take place
96 i.e. how many reqs can occur before an ack is given.
97 The maximum value for this is 15, the upper bits can modify
98 REQ/ACK assertion and deassertion during synchronous transfers
99 If this is 0, the bus will only transfer asynchronously */
100 #define SYNCOFFST 0
101 /* for the curious, bits 7&6 control the deassertion delay in 1/2 cycles
102 of the 40Mhz clock. If FASTCLK is 1, specifying 01 (1/2) will
103 cause the deassertion to be early by 1/2 clock. Bits 5&4 control
104 the assertion delay, also in 1/2 clocks (FASTCLK is ignored here). */
106 /*----------------------------------------------------------------*/
107 #ifdef PCMCIA
108 #undef QL_INT_ACTIVE_HIGH
109 #define QL_INT_ACTIVE_HIGH 0
110 #define MODULE
111 #endif
113 #include <linux/module.h>
115 #ifdef PCMCIA
116 #undef MODULE
117 #endif
119 #include <linux/blk.h> /* to get disk capacity */
120 #include <linux/kernel.h>
121 #include <linux/string.h>
122 #include <linux/ioport.h>
123 #include <linux/sched.h>
124 #include <linux/proc_fs.h>
125 #include <linux/unistd.h>
126 #include <linux/spinlock.h>
127 #include <asm/io.h>
128 #include <asm/irq.h>
129 #include "sd.h"
130 #include "hosts.h"
131 #include "qlogicfas.h"
132 #include<linux/stat.h>
134 static struct proc_dir_entry proc_scsi_qlogicfas = {
135 PROC_SCSI_QLOGICFAS, 6, "qlogicfas",
136 S_IFDIR | S_IRUGO | S_IXUGO, 2
139 /*----------------------------------------------------------------*/
140 /* driver state info, local to driver */
141 static int qbase = 0; /* Port */
142 static int qinitid; /* initiator ID */
143 static int qabort; /* Flag to cause an abort */
144 static int qlirq = -1; /* IRQ being used */
145 static char qinfo[80]; /* description */
146 static Scsi_Cmnd *qlcmd; /* current command being processed */
148 static int qlcfg5 = ( XTALFREQ << 5 ); /* 15625/512 */
149 static int qlcfg6 = SYNCXFRPD;
150 static int qlcfg7 = SYNCOFFST;
151 static int qlcfg8 = ( SLOWCABLE << 7 ) | ( QL_ENABLE_PARITY << 4 );
152 static int qlcfg9 = ( ( XTALFREQ + 4 ) / 5 );
153 static int qlcfgc = ( FASTCLK << 3 ) | ( FASTSCSI << 4 );
155 /*----------------------------------------------------------------*/
156 /* The qlogic card uses two register maps - These macros select which one */
157 #define REG0 ( outb( inb( qbase + 0xd ) & 0x7f , qbase + 0xd ), outb( 4 , qbase + 0xd ))
158 #define REG1 ( outb( inb( qbase + 0xd ) | 0x80 , qbase + 0xd ), outb( 0xb4 | QL_INT_ACTIVE_HIGH , qbase + 0xd ))
160 /* following is watchdog timeout in microseconds */
161 #define WATCHDOG 5000000
163 /*----------------------------------------------------------------*/
164 /* the following will set the monitor border color (useful to find
165 where something crashed or gets stuck at and as a simple profiler) */
167 #if 0
168 #define rtrc(i) {inb(0x3da);outb(0x31,0x3c0);outb((i),0x3c0);}
169 #else
170 #define rtrc(i) {}
171 #endif
173 /*----------------------------------------------------------------*/
174 /* local functions */
175 /*----------------------------------------------------------------*/
176 static void ql_zap(void);
177 /* error recovery - reset everything */
178 void ql_zap()
180 int x;
181 unsigned long flags;
182 save_flags( flags );
183 cli();
184 x = inb(qbase + 0xd);
185 REG0;
186 outb(3, qbase + 3); /* reset SCSI */
187 outb(2, qbase + 3); /* reset chip */
188 if (x & 0x80)
189 REG1;
190 restore_flags( flags );
193 /*----------------------------------------------------------------*/
194 /* do pseudo-dma */
195 static int ql_pdma(int phase, char *request, int reqlen)
197 int j;
198 j = 0;
199 if (phase & 1) { /* in */
200 #if QL_TURBO_PDMA
201 rtrc(4)
202 /* empty fifo in large chunks */
203 if( reqlen >= 128 && (inb( qbase + 8 ) & 2) ) { /* full */
204 insl( qbase + 4, request, 32 );
205 reqlen -= 128;
206 request += 128;
208 while( reqlen >= 84 && !( j & 0xc0 ) ) /* 2/3 */
209 if( (j=inb( qbase + 8 )) & 4 ) {
210 insl( qbase + 4, request, 21 );
211 reqlen -= 84;
212 request += 84;
214 if( reqlen >= 44 && (inb( qbase + 8 ) & 8) ) { /* 1/3 */
215 insl( qbase + 4, request, 11 );
216 reqlen -= 44;
217 request += 44;
219 #endif
220 /* until both empty and int (or until reclen is 0) */
221 rtrc(7)
222 j = 0;
223 while( reqlen && !( (j & 0x10) && (j & 0xc0) ) ) {
224 /* while bytes to receive and not empty */
225 j &= 0xc0;
226 while ( reqlen && !( (j=inb(qbase + 8)) & 0x10 ) ) {
227 *request++ = inb(qbase + 4);
228 reqlen--;
230 if( j & 0x10 )
231 j = inb(qbase+8);
235 else { /* out */
236 #if QL_TURBO_PDMA
237 rtrc(4)
238 if( reqlen >= 128 && inb( qbase + 8 ) & 0x10 ) { /* empty */
239 outsl(qbase + 4, request, 32 );
240 reqlen -= 128;
241 request += 128;
243 while( reqlen >= 84 && !( j & 0xc0 ) ) /* 1/3 */
244 if( !((j=inb( qbase + 8 )) & 8) ) {
245 outsl( qbase + 4, request, 21 );
246 reqlen -= 84;
247 request += 84;
249 if( reqlen >= 40 && !(inb( qbase + 8 ) & 4 ) ) { /* 2/3 */
250 outsl( qbase + 4, request, 10 );
251 reqlen -= 40;
252 request += 40;
254 #endif
255 /* until full and int (or until reclen is 0) */
256 rtrc(7)
257 j = 0;
258 while( reqlen && !( (j & 2) && (j & 0xc0) ) ) {
259 /* while bytes to send and not full */
260 while ( reqlen && !( (j=inb(qbase + 8)) & 2 ) ) {
261 outb(*request++, qbase + 4);
262 reqlen--;
264 if( j & 2 )
265 j = inb(qbase+8);
268 /* maybe return reqlen */
269 return inb( qbase + 8 ) & 0xc0;
272 /*----------------------------------------------------------------*/
273 /* wait for interrupt flag (polled - not real hardware interrupt) */
274 static int ql_wai(void)
276 int i,k;
277 k = 0;
278 i = jiffies + WATCHDOG;
279 while ( i > jiffies && !qabort && !((k = inb(qbase + 4)) & 0xe0))
280 barrier();
281 if (i <= jiffies)
282 return (DID_TIME_OUT);
283 if (qabort)
284 return (qabort == 1 ? DID_ABORT : DID_RESET);
285 if (k & 0x60)
286 ql_zap();
287 if (k & 0x20)
288 return (DID_PARITY);
289 if (k & 0x40)
290 return (DID_ERROR);
291 return 0;
294 /*----------------------------------------------------------------*/
295 /* initiate scsi command - queueing handler */
296 static void ql_icmd(Scsi_Cmnd * cmd)
298 unsigned int i;
299 unsigned long flags;
301 qabort = 0;
303 save_flags( flags );
304 cli();
305 REG0;
306 /* clearing of interrupts and the fifo is needed */
307 inb(qbase + 5); /* clear interrupts */
308 if (inb(qbase + 5)) /* if still interrupting */
309 outb(2, qbase + 3); /* reset chip */
310 else if (inb(qbase + 7) & 0x1f)
311 outb(1, qbase + 3); /* clear fifo */
312 while (inb(qbase + 5)); /* clear ints */
313 REG1;
314 outb(1, qbase + 8); /* set for PIO pseudo DMA */
315 outb(0, qbase + 0xb); /* disable ints */
316 inb(qbase + 8); /* clear int bits */
317 REG0;
318 outb(0x40, qbase + 0xb); /* enable features */
320 /* configurables */
321 outb( qlcfgc , qbase + 0xc);
322 /* config: no reset interrupt, (initiator) bus id */
323 outb( 0x40 | qlcfg8 | qinitid, qbase + 8);
324 outb( qlcfg7 , qbase + 7 );
325 outb( qlcfg6 , qbase + 6 );
326 /**/
327 outb(qlcfg5, qbase + 5); /* select timer */
328 outb(qlcfg9 & 7, qbase + 9); /* prescaler */
329 /* outb(0x99, qbase + 5); */
330 outb(cmd->target, qbase + 4);
332 for (i = 0; i < cmd->cmd_len; i++)
333 outb(cmd->cmnd[i], qbase + 2);
334 qlcmd = cmd;
335 outb(0x41, qbase + 3); /* select and send command */
336 restore_flags( flags );
338 /*----------------------------------------------------------------*/
339 /* process scsi command - usually after interrupt */
340 static unsigned int ql_pcmd(Scsi_Cmnd * cmd)
342 unsigned int i, j, k;
343 unsigned int result; /* ultimate return result */
344 unsigned int status; /* scsi returned status */
345 unsigned int message; /* scsi returned message */
346 unsigned int phase; /* recorded scsi phase */
347 unsigned int reqlen; /* total length of transfer */
348 struct scatterlist *sglist; /* scatter-gather list pointer */
349 unsigned int sgcount; /* sg counter */
351 rtrc(1)
352 j = inb(qbase + 6);
353 i = inb(qbase + 5);
354 if (i == 0x20) {
355 return (DID_NO_CONNECT << 16);
357 i |= inb(qbase + 5); /* the 0x10 bit can be set after the 0x08 */
358 if (i != 0x18) {
359 printk("Ql:Bad Interrupt status:%02x\n", i);
360 ql_zap();
361 return (DID_BAD_INTR << 16);
363 j &= 7; /* j = inb( qbase + 7 ) >> 5; */
364 /* correct status is supposed to be step 4 */
365 /* it sometimes returns step 3 but with 0 bytes left to send */
366 /* We can try stuffing the FIFO with the max each time, but we will get a
367 sequence of 3 if any bytes are left (but we do flush the FIFO anyway */
368 if(j != 3 && j != 4) {
369 printk("Ql:Bad sequence for command %d, int %02X, cmdleft = %d\n", j, i, inb( qbase+7 ) & 0x1f );
370 ql_zap();
371 return (DID_ERROR << 16);
373 result = DID_OK;
374 if (inb(qbase + 7) & 0x1f) /* if some bytes in fifo */
375 outb(1, qbase + 3); /* clear fifo */
376 /* note that request_bufflen is the total xfer size when sg is used */
377 reqlen = cmd->request_bufflen;
378 /* note that it won't work if transfers > 16M are requested */
379 if (reqlen && !((phase = inb(qbase + 4)) & 6)) { /* data phase */
380 rtrc(2)
381 outb(reqlen, qbase); /* low-mid xfer cnt */
382 outb(reqlen >> 8, qbase+1); /* low-mid xfer cnt */
383 outb(reqlen >> 16, qbase + 0xe); /* high xfer cnt */
384 outb(0x90, qbase + 3); /* command do xfer */
385 /* PIO pseudo DMA to buffer or sglist */
386 REG1;
387 if (!cmd->use_sg)
388 ql_pdma(phase, cmd->request_buffer, cmd->request_bufflen);
389 else {
390 sgcount = cmd->use_sg;
391 sglist = cmd->request_buffer;
392 while (sgcount--) {
393 if (qabort) {
394 REG0;
395 return ((qabort == 1 ? DID_ABORT : DID_RESET) << 16);
397 if (ql_pdma(phase, sglist->address, sglist->length))
398 break;
399 sglist++;
402 REG0;
403 rtrc(2)
404 /* wait for irq (split into second state of irq handler if this can take time) */
405 if ((k = ql_wai()))
406 return (k << 16);
407 k = inb(qbase + 5); /* should be 0x10, bus service */
409 /*** Enter Status (and Message In) Phase ***/
410 k = jiffies + WATCHDOG;
411 while ( k > jiffies && !qabort && !(inb(qbase + 4) & 6)); /* wait for status phase */
412 if ( k <= jiffies ) {
413 ql_zap();
414 return (DID_TIME_OUT << 16);
416 while (inb(qbase + 5)); /* clear pending ints */
417 if (qabort)
418 return ((qabort == 1 ? DID_ABORT : DID_RESET) << 16);
419 outb(0x11, qbase + 3); /* get status and message */
420 if ((k = ql_wai()))
421 return (k << 16);
422 i = inb(qbase + 5); /* get chip irq stat */
423 j = inb(qbase + 7) & 0x1f; /* and bytes rec'd */
424 status = inb(qbase + 2);
425 message = inb(qbase + 2);
426 /* should get function complete int if Status and message, else bus serv if only status */
427 if (!((i == 8 && j == 2) || (i == 0x10 && j == 1))) {
428 printk("Ql:Error during status phase, int=%02X, %d bytes recd\n", i, j);
429 result = DID_ERROR;
431 outb(0x12, qbase + 3); /* done, disconnect */
432 rtrc(1)
433 if ((k = ql_wai()))
434 return (k << 16);
435 /* should get bus service interrupt and disconnect interrupt */
436 i = inb(qbase + 5); /* should be bus service */
437 while (!qabort && ((i & 0x20) != 0x20)) {
438 barrier();
439 i |= inb(qbase + 5);
441 rtrc(0)
442 if (qabort)
443 return ((qabort == 1 ? DID_ABORT : DID_RESET) << 16);
444 return (result << 16) | (message << 8) | (status & STATUS_MASK);
447 #if QL_USE_IRQ
448 /*----------------------------------------------------------------*/
449 /* interrupt handler */
450 static void ql_ihandl(int irq, void *dev_id, struct pt_regs * regs)
452 Scsi_Cmnd *icmd;
453 REG0;
454 if (!(inb(qbase + 4) & 0x80)) /* false alarm? */
455 return;
456 if (qlcmd == NULL) { /* no command to process? */
457 int i;
458 i = 16;
459 while (i-- && inb(qbase + 5)); /* maybe also ql_zap() */
460 return;
462 icmd = qlcmd;
463 icmd->result = ql_pcmd(icmd);
464 qlcmd = NULL;
465 /* if result is CHECK CONDITION done calls qcommand to request sense */
466 (icmd->scsi_done) (icmd);
469 static void do_ql_ihandl(int irq, void *dev_id, struct pt_regs * regs)
471 unsigned long flags;
473 spin_lock_irqsave(&io_request_lock, flags);
474 ql_ihandl(irq, dev_id, regs);
475 spin_unlock_irqrestore(&io_request_lock, flags);
477 #endif
479 /*----------------------------------------------------------------*/
480 /* global functions */
481 /*----------------------------------------------------------------*/
482 /* non queued command */
483 #if QL_USE_IRQ
484 static void qlidone(Scsi_Cmnd * cmd) {}; /* null function */
485 #endif
487 /* command process */
488 int qlogicfas_command(Scsi_Cmnd * cmd)
490 int k;
491 #if QL_USE_IRQ
492 if (qlirq >= 0) {
493 qlogicfas_queuecommand(cmd, qlidone);
494 while (qlcmd != NULL);
495 return cmd->result;
497 #endif
498 /* non-irq version */
499 if (cmd->target == qinitid)
500 return (DID_BAD_TARGET << 16);
501 ql_icmd(cmd);
502 if ((k = ql_wai()))
503 return (k << 16);
504 return ql_pcmd(cmd);
508 #if QL_USE_IRQ
509 /*----------------------------------------------------------------*/
510 /* queued command */
511 int qlogicfas_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
513 if(cmd->target == qinitid) {
514 cmd->result = DID_BAD_TARGET << 16;
515 done(cmd);
516 return 0;
519 cmd->scsi_done = done;
520 /* wait for the last command's interrupt to finish */
521 while (qlcmd != NULL)
522 barrier();
523 ql_icmd(cmd);
524 return 0;
526 #else
527 int qlogicfas_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
529 return 1;
531 #endif
533 #ifdef PCMCIA
534 /*----------------------------------------------------------------*/
535 /* allow PCMCIA code to preset the port */
536 /* port should be 0 and irq to -1 respectively for autoprobing */
537 void qlogicfas_preset(int port, int irq)
539 qbase=port;
540 qlirq=irq;
542 #endif
544 /*----------------------------------------------------------------*/
545 /* look for qlogic card and init if found */
546 int qlogicfas_detect(Scsi_Host_Template * host)
548 int i, j; /* these are only used by IRQ detect */
549 int qltyp; /* type of chip */
550 struct Scsi_Host *hreg; /* registered host structure */
551 unsigned long flags;
553 host->proc_dir = &proc_scsi_qlogicfas;
555 /* Qlogic Cards only exist at 0x230 or 0x330 (the chip itself decodes the
556 address - I check 230 first since MIDI cards are typically at 330
558 Theoretically, two Qlogic cards can coexist in the same system. This
559 should work by simply using this as a loadable module for the second
560 card, but I haven't tested this.
563 if( !qbase ) {
564 for (qbase = 0x230; qbase < 0x430; qbase += 0x100) {
565 if( check_region( qbase , 0x10 ) )
566 continue;
567 REG1;
568 if ( ( (inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7 )
569 && ( (inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7 ) )
570 break;
572 if (qbase == 0x430)
573 return 0;
575 else
576 printk( "Ql: Using preset base address of %03x\n", qbase );
578 qltyp = inb(qbase + 0xe) & 0xf8;
579 qinitid = host->this_id;
580 if (qinitid < 0)
581 qinitid = 7; /* if no ID, use 7 */
582 outb(1, qbase + 8); /* set for PIO pseudo DMA */
583 REG0;
584 outb(0x40 | qlcfg8 | qinitid, qbase + 8); /* (ini) bus id, disable scsi rst */
585 outb(qlcfg5, qbase + 5); /* select timer */
586 outb(qlcfg9, qbase + 9); /* prescaler */
587 #if QL_RESET_AT_START
588 outb( 3 , qbase + 3 );
589 REG1;
590 while( inb( qbase + 0xf ) & 4 );
591 REG0;
592 #endif
593 #if QL_USE_IRQ
594 /* IRQ probe - toggle pin and check request pending */
596 if( qlirq == -1 ) {
597 save_flags( flags );
598 cli();
599 i = 0xffff;
600 j = 3;
601 outb(0x90, qbase + 3); /* illegal command - cause interrupt */
602 REG1;
603 outb(10, 0x20); /* access pending interrupt map */
604 outb(10, 0xa0);
605 while (j--) {
606 outb(0xb0 | QL_INT_ACTIVE_HIGH , qbase + 0xd); /* int pin off */
607 i &= ~(inb(0x20) | (inb(0xa0) << 8)); /* find IRQ off */
608 outb(0xb4 | QL_INT_ACTIVE_HIGH , qbase + 0xd); /* int pin on */
609 i &= inb(0x20) | (inb(0xa0) << 8); /* find IRQ on */
611 REG0;
612 while (inb(qbase + 5)); /* purge int */
613 j = -1;
614 while (i) /* find on bit */
615 i >>= 1, j++; /* should check for exactly 1 on */
616 qlirq = j;
617 restore_flags( flags );
619 else
620 printk( "Ql: Using preset IRQ %d\n", qlirq );
622 if (qlirq >= 0 && !request_irq(qlirq, do_ql_ihandl, 0, "qlogicfas", NULL))
623 host->can_queue = 1;
624 #endif
625 request_region( qbase , 0x10 ,"qlogicfas");
626 hreg = scsi_register( host , 0 ); /* no host data */
627 hreg->io_port = qbase;
628 hreg->n_io_port = 16;
629 hreg->dma_channel = -1;
630 if( qlirq != -1 )
631 hreg->irq = qlirq;
633 sprintf(qinfo, "Qlogicfas Driver version 0.46, chip %02X at %03X, IRQ %d, TPdma:%d",
634 qltyp, qbase, qlirq, QL_TURBO_PDMA );
635 host->name = qinfo;
637 return 1;
640 /*----------------------------------------------------------------*/
641 /* return bios parameters */
642 int qlogicfas_biosparam(Disk * disk, kdev_t dev, int ip[])
644 /* This should mimic the DOS Qlogic driver's behavior exactly */
645 ip[0] = 0x40;
646 ip[1] = 0x20;
647 ip[2] = disk->capacity / (ip[0] * ip[1]);
648 if (ip[2] > 1024) {
649 ip[0] = 0xff;
650 ip[1] = 0x3f;
651 ip[2] = disk->capacity / (ip[0] * ip[1]);
652 if (ip[2] > 1023)
653 ip[2] = 1023;
655 return 0;
658 /*----------------------------------------------------------------*/
659 /* abort command in progress */
660 int qlogicfas_abort(Scsi_Cmnd * cmd)
662 qabort = 1;
663 ql_zap();
664 return 0;
667 /*----------------------------------------------------------------*/
668 /* reset SCSI bus */
669 int qlogicfas_reset(Scsi_Cmnd * cmd, unsigned int ignored)
671 qabort = 2;
672 ql_zap();
673 return 1;
676 /*----------------------------------------------------------------*/
677 /* return info string */
678 const char *qlogicfas_info(struct Scsi_Host * host)
680 return qinfo;
683 #ifdef MODULE
684 /* Eventually this will go into an include file, but this will be later */
685 Scsi_Host_Template driver_template = QLOGICFAS;
687 #include "scsi_module.c"
688 #endif