2 * seagate.c Copyright (C) 1992, 1993 Drew Eckhardt
3 * low level scsi driver for ST01/ST02, Future Domain TMC-885,
4 * TMC-950 by Drew Eckhardt <drew@colorado.edu>
6 * Note : TMC-880 boards don't work because they have two bits in
7 * the status register flipped, I'll fix this "RSN"
8 * [why do I have strong feeling that above message is from 1993? :-)
11 * This card does all the I/O via memory mapped I/O, so there is no need
12 * to check or allocate a region of the I/O address space.
15 /* 1996 - to use new read{b,w,l}, write{b,w,l}, and phys_to_virt
16 * macros, replaced assembler routines with C. There's probably a
17 * performance hit, but I only have a cdrom and can't tell. Define
18 * SEAGATE_USE_ASM if you want the old assembler code -- SJT
20 * 1998-jul-29 - created DPRINTK macros and made it work under
21 * linux 2.1.112, simplified some #defines etc. <pavel@ucw.cz>
23 * Aug 2000 - aeb - deleted seagate_st0x_biosparam(). It would try to
24 * read the physical disk geometry, a bad mistake. Of course it doesn't
25 * matter much what geometry one invents, but on large disks it
26 * returned 256 (or more) heads, causing all kind of failures.
27 * Of course this means that people might see a different geometry now,
28 * so boot parameters may be necessary in some cases.
33 * To use without BIOS -DOVERRIDE=base_address -DCONTROLLER=FD or SEAGATE
34 * -DIRQ will override the default of 5.
35 * Note: You can now set these options from the kernel's "command line".
38 * st0x=ADDRESS,IRQ (for a Seagate controller)
40 * tmc8xx=ADDRESS,IRQ (for a TMC-8xx or TMC-950 controller)
44 * will configure the driver for a TMC-8xx style controller using IRQ 15
45 * with a base address of 0xC8000.
48 * Will cause the host adapter to arbitrate for the
49 * bus for better SCSI-II compatibility, rather than just
50 * waiting for BUS FREE and then doing its thing. Should
51 * let us do one command per Lun when I integrate my
52 * reorganization changes into the distribution sources.
55 * Will activate debug code.
58 * Will use blind transfers where possible
61 * This will enable parity.
64 * Will use older seagate assembly code. should be (very small amount)
68 * Will allow compatibility with broken devices that don't
69 * handshake fast enough (ie, some CD ROM's) for the Seagate
72 * 50 is some number, It will let you specify a default
73 * transfer rate if handshaking isn't working correctly.
75 * -DOLDCNTDATASCEME There is a new sceme to set the CONTROL
76 * and DATA reigsters which complies more closely
77 * with the SCSI2 standard. This hopefully eliminates
78 * the need to swap the order these registers are
79 * 'messed' with. It makes the following two options
80 * obsolete. To reenable the old sceme define this.
82 * The following to options are patches from the SCSI.HOWTO
84 * -DSWAPSTAT This will swap the definitions for STAT_MSG and STAT_CD.
86 * -DSWAPCNTDATA This will swap the order that seagate.c messes with
87 * the CONTROL an DATA registers.
90 #include <linux/module.h>
91 #include <linux/interrupt.h>
92 #include <linux/spinlock.h>
93 #include <linux/signal.h>
94 #include <linux/string.h>
95 #include <linux/proc_fs.h>
96 #include <linux/init.h>
97 #include <linux/delay.h>
98 #include <linux/blk.h>
99 #include <linux/stat.h>
102 #include <asm/system.h>
103 #include <asm/uaccess.h>
109 #include <scsi/scsi_ioctl.h>
112 #define DPRINTK( when, msg... ) do { if ( (DEBUG & (when)) == (when) ) printk( msg ); } while (0)
114 #define DPRINTK( when, msg... ) do { } while (0)
116 #define DANY( msg... ) DPRINTK( 0xffff, msg );
126 #undef LINKED /* Linked commands are currently broken! */
128 #if defined(OVERRIDE) && !defined(CONTROLLER)
129 #error Please use -DCONTROLLER=SEAGATE or -DCONTROLLER=FD to override controller type
133 #undef SEAGATE_USE_ASM
137 Thanks to Brian Antoine for the example code in his Messy-Loss ST-01
138 driver, and Mitsugu Suzuki for information on the ST-01
149 #define CMD_ATTN 0x08
150 #define CMD_START_ARB 0x10
151 #define CMD_EN_PARITY 0x20
152 #define CMD_INTR 0x40
153 #define CMD_DRVR_ENABLE 0x80
159 #define STAT_MSG 0x08
162 #define STAT_MSG 0x02
166 #define STAT_BSY 0x01
168 #define STAT_REQ 0x10
169 #define STAT_SEL 0x20
170 #define STAT_PARITY 0x40
171 #define STAT_ARB_CMPL 0x80
177 #define REQ_MASK (STAT_CD | STAT_IO | STAT_MSG)
178 #define REQ_DATAOUT 0
179 #define REQ_DATAIN STAT_IO
180 #define REQ_CMDOUT STAT_CD
181 #define REQ_STATIN (STAT_CD | STAT_IO)
182 #define REQ_MSGOUT (STAT_MSG | STAT_CD)
183 #define REQ_MSGIN (STAT_MSG | STAT_CD | STAT_IO)
185 extern volatile int seagate_st0x_timeout
;
188 #define BASE_CMD CMD_EN_PARITY
197 #define PHASE_BUS_FREE 1
198 #define PHASE_ARBITRATION 2
199 #define PHASE_SELECTION 4
200 #define PHASE_DATAIN 8
201 #define PHASE_DATAOUT 0x10
202 #define PHASE_CMDOUT 0x20
203 #define PHASE_MSGIN 0x40
204 #define PHASE_MSGOUT 0x80
205 #define PHASE_STATUSIN 0x100
206 #define PHASE_ETC (PHASE_DATAIN | PHASE_DATAOUT | PHASE_CMDOUT | PHASE_MSGIN | PHASE_MSGOUT | PHASE_STATUSIN)
207 #define PRINT_COMMAND 0x200
208 #define PHASE_EXIT 0x400
209 #define PHASE_RESELECT 0x800
210 #define DEBUG_FAST 0x1000
211 #define DEBUG_SG 0x2000
212 #define DEBUG_LINKED 0x4000
213 #define DEBUG_BORKEN 0x8000
216 * Control options - these are timeouts specified in .01 seconds.
220 #define ST0X_BUS_FREE_DELAY 25
221 #define ST0X_SELECTION_DELAY 25
223 #define SEAGATE 1 /* these determine the type of the controller */
226 #define ST0X_ID_STR "Seagate ST-01/ST-02"
227 #define FD_ID_STR "TMC-8XX/TMC-950"
229 static int internal_command (unsigned char target
, unsigned char lun
,
231 void *buff
, int bufflen
, int reselect
);
233 static int incommand
; /* set if arbitration has finished
234 and we are in some command phase. */
236 static unsigned int base_address
= 0; /* Where the card ROM starts, used to
237 calculate memory mapped register
240 static unsigned long st0x_cr_sr
; /* control register write, status
241 register read. 256 bytes in
243 Read is status of SCSI BUS, as per
246 static unsigned long st0x_dr
; /* data register, read write 256
249 static volatile int st0x_aborted
= 0; /* set when we are aborted, ie by a
252 static unsigned char controller_type
= 0; /* set to SEAGATE for ST0x
253 boards or FD for TMC-8xx
255 static int irq
= IRQ
;
257 MODULE_PARM (base_address
, "i");
258 MODULE_PARM (controller_type
, "b");
259 MODULE_PARM (irq
, "i");
260 MODULE_LICENSE("GPL");
263 #define retcode(result) (((result) << 16) | (message << 8) | status)
264 #define STATUS ((u8) isa_readb(st0x_cr_sr))
265 #define DATA ((u8) isa_readb(st0x_dr))
266 #define WRITE_CONTROL(d) { isa_writeb((d), st0x_cr_sr); }
267 #define WRITE_DATA(d) { isa_writeb((d), st0x_dr); }
270 static unsigned int seagate_bases
[] = {
271 0xc8000, 0xca000, 0xcc000,
272 0xce000, 0xdc000, 0xde000
276 const unsigned char *signature
;
282 static Signature __initdata signatures
[] = {
283 {"ST01 v1.7 (C) Copyright 1987 Seagate", 15, 37, SEAGATE
},
284 {"SCSI BIOS 2.00 (C) Copyright 1987 Seagate", 15, 40, SEAGATE
},
287 * The following two lines are NOT mistakes. One detects ROM revision
288 * 3.0.0, the other 3.2. Since seagate has only one type of SCSI adapter,
289 * and this is not going to change, the "SEAGATE" and "SCSI" together
290 * are probably "good enough"
293 {"SEAGATE SCSI BIOS ", 16, 17, SEAGATE
},
294 {"SEAGATE SCSI BIOS ", 17, 17, SEAGATE
},
297 * However, future domain makes several incompatible SCSI boards, so specific
298 * signatures must be used.
301 {"FUTURE DOMAIN CORP. (C) 1986-1989 V5.0C2/14/89", 5, 46, FD
},
302 {"FUTURE DOMAIN CORP. (C) 1986-1989 V6.0A7/28/89", 5, 46, FD
},
303 {"FUTURE DOMAIN CORP. (C) 1986-1990 V6.0105/31/90", 5, 47, FD
},
304 {"FUTURE DOMAIN CORP. (C) 1986-1990 V6.0209/18/90", 5, 47, FD
},
305 {"FUTURE DOMAIN CORP. (C) 1986-1990 V7.009/18/90", 5, 46, FD
},
306 {"FUTURE DOMAIN CORP. (C) 1992 V8.00.004/02/92", 5, 44, FD
},
307 {"IBM F1 BIOS V1.1004/30/92", 5, 25, FD
},
308 {"FUTURE DOMAIN TMC-950", 5, 21, FD
},
309 /* Added for 2.2.16 by Matthias_Heidbrink@b.maus.de */
310 {"IBM F1 V1.2009/22/93", 5, 25, FD
},
313 #define NUM_SIGNATURES (sizeof(signatures) / sizeof(Signature))
314 #endif /* n OVERRIDE */
317 * hostno stores the hostnumber, as told to us by the init routine.
320 static int hostno
= -1;
321 static void seagate_reconnect_intr (int, void *, struct pt_regs
*);
322 static irqreturn_t
do_seagate_reconnect_intr (int, void *, struct pt_regs
*);
332 * Support for broken devices :
333 * The Seagate board has a handshaking problem. Namely, a lack
334 * thereof for slow devices. You can blast 600K/second through
335 * it if you are polling for each byte, more if you do a blind
336 * transfer. In the first case, with a fast device, REQ will
337 * transition high-low or high-low-high before your loop restarts
338 * and you'll have no problems. In the second case, the board
339 * will insert wait states for up to 13.2 usecs for REQ to
340 * transition low->high, and everything will work.
342 * However, there's nothing in the state machine that says
343 * you *HAVE* to see a high-low-high set of transitions before
344 * sending the next byte, and slow things like the Trantor CD ROMS
345 * will break because of this.
347 * So, we need to slow things down, which isn't as simple as it
348 * seems. We can't slow things down period, because then people
349 * who don't recompile their kernels will shoot me for ruining
350 * their performance. We need to do it on a case per case basis.
352 * The best for performance will be to, only for borken devices
353 * (this is stored on a per-target basis in the scsi_devices array)
355 * Wait for a low->high transition before continuing with that
356 * transfer. If we timeout, continue anyways. We don't need
357 * a long timeout, because REQ should only be asserted until the
358 * corresponding ACK is received and processed.
360 * Note that we can't use the system timer for this, because of
361 * resolution, and we *really* can't use the timer chip since
362 * gettimeofday() and the beeper routines use that. So,
363 * the best thing for us to do will be to calibrate a timing
364 * loop in the initialization code using the timer chip before
365 * gettimeofday() can screw with it.
367 * FIXME: this is broken (not borken :-). Empty loop costs less than
368 * loop with ISA access in it! -- pavel@ucw.cz
371 static int borken_calibration
= 0;
373 static void __init
borken_init (void)
375 register int count
= 0, start
= jiffies
+ 1, stop
= start
+ 25;
377 /* FIXME: There may be a better approach, this is a straight port for
380 while (time_before (jiffies
, start
))
382 for (; time_before (jiffies
, stop
); ++count
)
387 * Ok, we now have a count for .25 seconds. Convert to a
388 * count per second and divide by transfer rate in K. */
390 borken_calibration
= (count
* 4) / (SLOW_RATE
* 1024);
392 if (borken_calibration
< 1)
393 borken_calibration
= 1;
396 static inline void borken_wait (void)
400 for (count
= borken_calibration
; count
&& (STATUS
& STAT_REQ
); --count
)
403 #if (DEBUG & DEBUG_BORKEN)
405 printk ("scsi%d : borken timeout\n", hostno
);
409 #endif /* def SLOW_RATE */
411 /* These beasts only live on ISA, and ISA means 8MHz. Each ULOOP()
412 * contains at least one ISA access, which takes more than 0.125
413 * usec. So if we loop 8 times time in usec, we are safe.
416 #define ULOOP( i ) for (clock = i*8;;)
417 #define TIMEOUT (!(clock--))
419 int __init
seagate_st0x_detect (Scsi_Host_Template
* tpnt
)
421 struct Scsi_Host
*instance
;
424 tpnt
->proc_name
= "seagate";
426 * First, we try for the manual override.
428 DANY ("Autodetecting ST0x / TMC-8xx\n");
431 printk (KERN_ERR
"seagate_st0x_detect() called twice?!\n");
435 /* If the user specified the controller type from the command line,
436 controller_type will be non-zero, so don't try to detect one */
438 if (!controller_type
) {
440 base_address
= OVERRIDE
;
441 controller_type
= CONTROLLER
;
443 DANY ("Base address overridden to %x, controller type is %s\n",
445 controller_type
== SEAGATE
? "SEAGATE" : "FD");
448 * To detect this card, we simply look for the signature
449 * from the BIOS version notice in all the possible locations
450 * of the ROM's. This has a nice side effect of not trashing
451 * any register locations that might be used by something else.
453 * XXX - note that we probably should be probing the address
454 * space for the on-board RAM instead.
457 for (i
= 0; i
< (sizeof (seagate_bases
) / sizeof (unsigned int)); ++i
)
458 for (j
= 0; !base_address
&& j
< NUM_SIGNATURES
; ++j
)
459 if (isa_check_signature(seagate_bases
[i
] + signatures
[j
].offset
, signatures
[j
].signature
, signatures
[j
].length
)) {
460 base_address
= seagate_bases
[i
];
461 controller_type
= signatures
[j
].type
;
463 #endif /* OVERRIDE */
465 /* (! controller_type) */
466 tpnt
->this_id
= (controller_type
== SEAGATE
) ? 7 : 6;
467 tpnt
->name
= (controller_type
== SEAGATE
) ? ST0X_ID_STR
: FD_ID_STR
;
470 printk(KERN_INFO
"seagate: ST0x/TMC-8xx not detected.\n");
474 st0x_cr_sr
= base_address
+ (controller_type
== SEAGATE
? 0x1a00 : 0x1c00);
475 st0x_dr
= st0x_cr_sr
+ 0x200;
477 DANY("%s detected. Base address = %x, cr = %x, dr = %x\n",
478 tpnt
->name
, base_address
, st0x_cr_sr
, st0x_dr
);
481 * At all times, we will use IRQ 5. Should also check for IRQ3
482 * if we lose our first interrupt.
484 instance
= scsi_register (tpnt
, 0);
485 if (instance
== NULL
)
488 hostno
= instance
->host_no
;
489 if (request_irq (irq
, do_seagate_reconnect_intr
, SA_INTERRUPT
, (controller_type
== SEAGATE
) ? "seagate" : "tmc-8xx", instance
)) {
490 printk(KERN_ERR
"scsi%d : unable to allocate IRQ%d\n", hostno
, irq
);
494 instance
->io_port
= base_address
;
496 printk(KERN_INFO
"Calibrating borken timer... ");
498 printk(" %d cycles per transfer\n", borken_calibration
);
500 printk (KERN_INFO
"This is one second... ");
503 ULOOP (1 * 1000 * 1000) {
510 printk ("done, %s options:"
529 #ifdef SEAGATE_USE_ASM
545 static const char *seagate_st0x_info (struct Scsi_Host
*shpnt
)
547 static char buffer
[64];
549 snprintf(buffer
, 64, "%s at irq %d, address 0x%05X",
550 (controller_type
== SEAGATE
) ? ST0X_ID_STR
: FD_ID_STR
,
556 * These are our saved pointers for the outstanding command that is
557 * waiting for a reconnect
560 static unsigned char current_target
, current_lun
;
561 static unsigned char *current_cmnd
, *current_data
;
562 static int current_nobuffs
;
563 static struct scatterlist
*current_buffer
;
564 static int current_bufflen
;
568 * linked_connected indicates whether or not we are currently connected to
569 * linked_target, linked_lun and in an INFORMATION TRANSFER phase,
570 * using linked commands.
573 static int linked_connected
= 0;
574 static unsigned char linked_target
, linked_lun
;
577 static void (*done_fn
) (Scsi_Cmnd
*) = NULL
;
578 static Scsi_Cmnd
*SCint
= NULL
;
581 * These control whether or not disconnect / reconnect will be attempted,
582 * or are being attempted.
585 #define NO_RECONNECT 0
586 #define RECONNECT_NOW 1
587 #define CAN_RECONNECT 2
590 * LINKED_RIGHT indicates that we are currently connected to the correct target
591 * for this command, LINKED_WRONG indicates that we are connected to the wrong
592 * target. Note that these imply CAN_RECONNECT and require defined(LINKED).
595 #define LINKED_RIGHT 3
596 #define LINKED_WRONG 4
599 * This determines if we are expecting to reconnect or not.
602 static int should_reconnect
= 0;
605 * The seagate_reconnect_intr routine is called when a target reselects the
606 * host adapter. This occurs on the interrupt triggered by the target
610 static irqreturn_t
do_seagate_reconnect_intr(int irq
, void *dev_id
,
611 struct pt_regs
*regs
)
614 struct Scsi_Host
*dev
= dev_id
;
616 spin_lock_irqsave (dev
->host_lock
, flags
);
617 seagate_reconnect_intr (irq
, dev_id
, regs
);
618 spin_unlock_irqrestore (dev
->host_lock
, flags
);
622 static void seagate_reconnect_intr (int irq
, void *dev_id
, struct pt_regs
*regs
)
627 DPRINTK (PHASE_RESELECT
, "scsi%d : seagate_reconnect_intr() called\n", hostno
);
629 if (!should_reconnect
)
630 printk(KERN_WARNING
"scsi%d: unexpected interrupt.\n", hostno
);
632 should_reconnect
= 0;
634 DPRINTK (PHASE_RESELECT
, "scsi%d : internal_command(%d, %08x, %08x, RECONNECT_NOW\n",
635 hostno
, current_target
, current_data
, current_bufflen
);
637 temp
= internal_command (current_target
, current_lun
, current_cmnd
, current_data
, current_bufflen
, RECONNECT_NOW
);
639 if (msg_byte(temp
) != DISCONNECT
) {
641 DPRINTK(PHASE_RESELECT
, "scsi%d : done_fn(%d,%08x)", hostno
, hostno
, temp
);
643 panic ("SCint == NULL in seagate");
646 SCtmp
->result
= temp
;
649 printk(KERN_ERR
"done_fn() not defined.\n");
655 * The seagate_st0x_queue_command() function provides a queued interface
656 * to the seagate SCSI driver. Basically, it just passes control onto the
657 * seagate_command() function, after fixing it so that the done_fn()
658 * is set to the one passed to the function. We have to be very careful,
659 * because there are some commands on some devices that do not disconnect,
660 * and if we simply call the done_fn when the command is done then another
661 * command is started and queue_command is called again... We end up
662 * overflowing the kernel stack, and this tends not to be such a good idea.
665 static int recursion_depth
= 0;
667 static int seagate_st0x_queue_command (Scsi_Cmnd
* SCpnt
, void (*done
) (Scsi_Cmnd
*))
669 int result
, reconnect
;
672 DANY ("seagate: que_command");
674 current_target
= SCpnt
->device
->id
;
675 current_lun
= SCpnt
->device
->lun
;
676 current_cmnd
= SCpnt
->cmnd
;
677 current_data
= (unsigned char *) SCpnt
->request_buffer
;
678 current_bufflen
= SCpnt
->request_bufflen
;
686 * Set linked command bit in control field of SCSI command.
689 current_cmnd
[SCpnt
->cmd_len
] |= 0x01;
690 if (linked_connected
) {
691 DPRINTK (DEBUG_LINKED
, "scsi%d : using linked commands, current I_T_L nexus is ", hostno
);
692 if (linked_target
== current_target
&& linked_lun
== current_lun
)
694 DPRINTK(DEBUG_LINKED
, "correct\n");
695 reconnect
= LINKED_RIGHT
;
697 DPRINTK(DEBUG_LINKED
, "incorrect\n");
698 reconnect
= LINKED_WRONG
;
702 reconnect
= CAN_RECONNECT
;
704 result
= internal_command(SCint
->device
->id
, SCint
->device
->lun
, SCint
->cmnd
,
705 SCint
->request_buffer
, SCint
->request_bufflen
, reconnect
);
706 if (msg_byte(result
) == DISCONNECT
)
710 SCtmp
->result
= result
;
718 static int internal_command (unsigned char target
, unsigned char lun
,
719 const void *cmnd
, void *buff
, int bufflen
, int reselect
)
721 unsigned char *data
= NULL
;
722 struct scatterlist
*buffer
= NULL
;
723 int clock
, temp
, nobuffs
= 0, done
= 0, len
= 0;
725 int transfered
= 0, phase
= 0, newphase
;
727 register unsigned char status_read
;
728 unsigned char tmp_data
, tmp_control
, status
= 0, message
= 0;
729 unsigned transfersize
= 0, underflow
= 0;
731 int borken
= (int) SCint
->device
->borken
; /* Does the current target require
738 #if (DEBUG & PRINT_COMMAND)
739 printk("scsi%d : target = %d, command = ", hostno
, target
);
740 print_command((unsigned char *) cmnd
);
743 #if (DEBUG & PHASE_RESELECT)
746 printk("scsi%d : reconnecting\n", hostno
);
750 printk("scsi%d : connected, can reconnect\n", hostno
);
753 printk("scsi%d : connected to wrong target, can reconnect\n",
758 printk("scsi%d : allowed to reconnect\n", hostno
);
761 printk("scsi%d : not allowed to reconnect\n", hostno
);
765 if (target
== (controller_type
== SEAGATE
? 7 : 6))
766 return DID_BAD_TARGET
;
769 * We work it differently depending on if this is is "the first time,"
770 * or a reconnect. If this is a reselect phase, then SEL will
771 * be asserted, and we must skip selection / arbitration phases.
776 DPRINTK (PHASE_RESELECT
, "scsi%d : phase RESELECT \n", hostno
);
778 * At this point, we should find the logical or of our ID
779 * and the original target's ID on the BUS, with BSY, SEL,
780 * and I/O signals asserted.
782 * After ARBITRATION phase is completed, only SEL, BSY,
783 * and the target ID are asserted. A valid initiator ID
784 * is not on the bus until IO is asserted, so we must wait
789 if ((temp
& STAT_IO
) && !(temp
& STAT_BSY
))
792 DPRINTK (PHASE_RESELECT
, "scsi%d : RESELECT timed out while waiting for IO .\n", hostno
);
793 return (DID_BAD_INTR
<< 16);
798 * After I/O is asserted by the target, we can read our ID
799 * and its ID off of the BUS.
802 if (!((temp
= DATA
) & (controller_type
== SEAGATE
? 0x80 : 0x40))) {
803 DPRINTK (PHASE_RESELECT
, "scsi%d : detected reconnect request to different target.\n\tData bus = %d\n", hostno
, temp
);
804 return (DID_BAD_INTR
<< 16);
807 if (!(temp
& (1 << current_target
))) {
808 printk(KERN_WARNING
"scsi%d : Unexpected reselect interrupt. Data bus = %d\n", hostno
, temp
);
809 return (DID_BAD_INTR
<< 16);
812 buffer
= current_buffer
;
813 cmnd
= current_cmnd
; /* WDE add */
814 data
= current_data
; /* WDE add */
815 len
= current_bufflen
; /* WDE add */
816 nobuffs
= current_nobuffs
;
819 * We have determined that we have been selected. At this
820 * point, we must respond to the reselection by asserting
825 WRITE_CONTROL (BASE_CMD
| CMD_DRVR_ENABLE
| CMD_BSY
);
827 WRITE_CONTROL (BASE_CMD
| CMD_BSY
);
831 * The target will drop SEL, and raise BSY, at which time
836 if (!(STATUS
& STAT_SEL
))
839 WRITE_CONTROL (BASE_CMD
| CMD_INTR
);
840 DPRINTK (PHASE_RESELECT
, "scsi%d : RESELECT timed out while waiting for SEL.\n", hostno
);
841 return (DID_BAD_INTR
<< 16);
844 WRITE_CONTROL (BASE_CMD
);
846 * At this point, we have connected with the target
847 * and can get on with our lives.
853 * This is a bletcherous hack, just as bad as the Unix #!
854 * interpreter stuff. If it turns out we are using the wrong
855 * I_T_L nexus, the easiest way to deal with it is to go into
856 * our INFORMATION TRANSFER PHASE code, send a ABORT
857 * message on MESSAGE OUT phase, and then loop back to here.
861 DPRINTK (PHASE_BUS_FREE
, "scsi%d : phase = BUS FREE \n", hostno
);
866 * On entry, we make sure that the BUS is in a BUS FREE
867 * phase, by insuring that both BSY and SEL are low for
868 * at least one bus settle delay. Several reads help
869 * eliminate wire glitch.
873 #error FIXME: this is broken: we may not use jiffies here - we are under cli(). It will hardlock.
874 clock
= jiffies
+ ST0X_BUS_FREE_DELAY
;
876 while (((STATUS
| STATUS
| STATUS
) & (STAT_BSY
| STAT_SEL
)) && (!st0x_aborted
) && time_before (jiffies
, clock
))
879 if (time_after (jiffies
, clock
))
880 return retcode (DID_BUS_BUSY
);
881 else if (st0x_aborted
)
882 return retcode (st0x_aborted
);
884 DPRINTK (PHASE_SELECTION
, "scsi%d : phase = SELECTION\n", hostno
);
886 clock
= jiffies
+ ST0X_SELECTION_DELAY
;
889 * Arbitration/selection procedure :
891 * 2. Write HOST adapter address bit
892 * 3. Set start arbitration.
893 * 4. We get either ARBITRATION COMPLETE or SELECT at this
895 * 5. OR our ID and targets on bus.
896 * 6. Enable SCSI drivers and asserted SEL and ATTN
900 /* FIXME: verify host lock is always held here */
902 WRITE_DATA((controller_type
== SEAGATE
) ? 0x80 : 0x40);
903 WRITE_CONTROL(CMD_START_ARB
);
905 ULOOP (ST0X_SELECTION_DELAY
* 10000) {
906 status_read
= STATUS
;
907 if (status_read
& STAT_ARB_CMPL
)
909 if (st0x_aborted
) /* FIXME: What? We are going to do something even after abort? */
911 if (TIMEOUT
|| (status_read
& STAT_SEL
)) {
912 printk(KERN_WARNING
"scsi%d : arbitration lost or timeout.\n", hostno
);
913 WRITE_CONTROL (BASE_CMD
);
914 return retcode (DID_NO_CONNECT
);
917 DPRINTK (PHASE_SELECTION
, "scsi%d : arbitration complete\n", hostno
);
921 * When the SCSI device decides that we're gawking at it,
922 * it will respond by asserting BUSY on the bus.
924 * Note : the Seagate ST-01/02 product manual says that we
925 * should twiddle the DATA register before the control
926 * register. However, this does not work reliably so we do
927 * it the other way around.
929 * Probably could be a problem with arbitration too, we
930 * really should try this with a SCSI protocol or logic
931 * analyzer to see what is going on.
933 tmp_data
= (unsigned char) ((1 << target
) | (controller_type
== SEAGATE
? 0x80 : 0x40));
934 tmp_control
= BASE_CMD
| CMD_DRVR_ENABLE
| CMD_SEL
| (reselect
? CMD_ATTN
: 0);
936 /* FIXME: verify host lock is always held here */
937 #ifdef OLDCNTDATASCEME
939 WRITE_CONTROL (tmp_control
);
940 WRITE_DATA (tmp_data
);
942 WRITE_DATA (tmp_data
);
943 WRITE_CONTROL (tmp_control
);
946 tmp_control
^= CMD_BSY
; /* This is guesswork. What used to be in driver */
947 WRITE_CONTROL (tmp_control
); /* could never work: it sent data into control */
948 WRITE_DATA (tmp_data
); /* register and control info into data. Hopefully */
949 tmp_control
^= CMD_BSY
; /* fixed, but order of first two may be wrong. */
950 WRITE_CONTROL (tmp_control
); /* -- pavel@ucw.cz */
956 * If we have been aborted, and we have a
957 * command in progress, IE the target
958 * still has BSY asserted, then we will
959 * reset the bus, and notify the midlevel
960 * driver to expect sense.
963 WRITE_CONTROL (BASE_CMD
);
964 if (STATUS
& STAT_BSY
) {
965 printk(KERN_WARNING
"scsi%d : BST asserted after we've been aborted.\n", hostno
);
966 seagate_st0x_bus_reset(NULL
);
967 return retcode (DID_RESET
);
969 return retcode (st0x_aborted
);
971 if (STATUS
& STAT_BSY
)
974 DPRINTK (PHASE_SELECTION
, "scsi%d : NO CONNECT with target %d, stat = %x \n", hostno
, target
, STATUS
);
975 return retcode (DID_NO_CONNECT
);
979 /* Establish current pointers. Take into account scatter / gather */
981 if ((nobuffs
= SCint
->use_sg
)) {
982 #if (DEBUG & DEBUG_SG)
985 printk("scsi%d : scatter gather requested, using %d buffers.\n", hostno
, nobuffs
);
986 for (i
= 0; i
< nobuffs
; ++i
)
987 printk("scsi%d : buffer %d address = %p length = %d\n",
989 page_address(buffer
[i
].page
) + buffer
[i
].offset
,
994 buffer
= (struct scatterlist
*) SCint
->buffer
;
995 len
= buffer
->length
;
996 data
= page_address(buffer
->page
) + buffer
->offset
;
998 DPRINTK (DEBUG_SG
, "scsi%d : scatter gather not requested.\n", hostno
);
1000 len
= SCint
->request_bufflen
;
1001 data
= (unsigned char *) SCint
->request_buffer
;
1004 DPRINTK (PHASE_DATAIN
| PHASE_DATAOUT
, "scsi%d : len = %d\n",
1014 } /* end of switch(reselect) */
1017 * There are several conditions under which we wish to send a message :
1018 * 1. When we are allowing disconnect / reconnect, and need to
1019 * establish the I_T_L nexus via an IDENTIFY with the DiscPriv bit
1022 * 2. When we are doing linked commands, are have the wrong I_T_L
1023 * nexus established and want to send an ABORT message.
1026 /* GCC does not like an ifdef inside a macro, so do it the hard way. */
1028 WRITE_CONTROL (BASE_CMD
| CMD_DRVR_ENABLE
| (((reselect
== CAN_RECONNECT
)|| (reselect
== LINKED_WRONG
))? CMD_ATTN
: 0));
1030 WRITE_CONTROL (BASE_CMD
| CMD_DRVR_ENABLE
| (((reselect
== CAN_RECONNECT
))? CMD_ATTN
: 0));
1034 * INFORMATION TRANSFER PHASE
1036 * The nasty looking read / write inline assembler loops we use for
1037 * DATAIN and DATAOUT phases are approximately 4-5 times as fast as
1038 * the 'C' versions - since we're moving 1024 bytes of data, this
1041 * SJT: The nasty-looking assembler is gone, so it's slower.
1045 DPRINTK (PHASE_ETC
, "scsi%d : phase = INFORMATION TRANSFER\n", hostno
);
1048 transfersize
= SCint
->transfersize
;
1049 underflow
= SCint
->underflow
;
1052 * Now, we poll the device for status information,
1053 * and handle any requests it makes. Note that since we are unsure
1054 * of how much data will be flowing across the system, etc and
1055 * cannot make reasonable timeouts, that we will instead have the
1056 * midlevel driver handle any timeouts that occur in this phase.
1059 while (((status_read
= STATUS
) & STAT_BSY
) && !st0x_aborted
&& !done
) {
1061 if (status_read
& STAT_PARITY
) {
1062 printk(KERN_ERR
"scsi%d : got parity error\n", hostno
);
1063 st0x_aborted
= DID_PARITY
;
1066 if (status_read
& STAT_REQ
) {
1067 #if ((DEBUG & PHASE_ETC) == PHASE_ETC)
1068 if ((newphase
= (status_read
& REQ_MASK
)) != phase
) {
1072 printk ("scsi%d : phase = DATA OUT\n", hostno
);
1075 printk ("scsi%d : phase = DATA IN\n", hostno
);
1079 ("scsi%d : phase = COMMAND OUT\n", hostno
);
1082 printk ("scsi%d : phase = STATUS IN\n", hostno
);
1086 ("scsi%d : phase = MESSAGE OUT\n", hostno
);
1089 printk ("scsi%d : phase = MESSAGE IN\n", hostno
);
1092 printk ("scsi%d : phase = UNKNOWN\n", hostno
);
1093 st0x_aborted
= DID_ERROR
;
1097 switch (status_read
& REQ_MASK
) {
1100 * If we are in fast mode, then we simply splat
1101 * the data out in word-sized chunks as fast as
1107 printk("scsi%d: underflow to target %d lun %d \n", hostno
, target
, lun
);
1108 st0x_aborted
= DID_ERROR
;
1114 if (fast
&& transfersize
1115 && !(len
% transfersize
)
1116 && (len
>= transfersize
)
1118 && !(transfersize
% 4)
1121 DPRINTK (DEBUG_FAST
,
1122 "scsi%d : FAST transfer, underflow = %d, transfersize = %d\n"
1123 " len = %d, data = %08x\n",
1124 hostno
, SCint
->underflow
,
1125 SCint
->transfersize
, len
,
1128 /* SJT: Start. Fast Write */
1129 #ifdef SEAGATE_USE_ASM
1135 "movl %%eax, (%%edi)\n\t"
1139 "movb %%al, (%%edi)\n\t"
1143 /* input */ :"D" (phys_to_virt (st0x_dr
)),
1146 "c" (SCint
->transfersize
)
1150 #else /* SEAGATE_USE_ASM */
1153 unsigned int *iop
= phys_to_virt (st0x_dr
);
1154 const unsigned int *dp
=(unsigned int *) data
;
1155 int xferlen
= transfersize
>> 2;
1157 unsigned char *iop
= phys_to_virt (st0x_dr
);
1158 const unsigned char *dp
= data
;
1159 int xferlen
= transfersize
;
1161 for (; xferlen
; --xferlen
)
1164 #endif /* SEAGATE_USE_ASM */
1166 len
-= transfersize
;
1167 data
+= transfersize
;
1168 DPRINTK (DEBUG_FAST
, "scsi%d : FAST transfer complete len = %d data = %08x\n", hostno
, len
, data
);
1171 * We loop as long as we are in a
1172 * data out phase, there is data to
1173 * send, and BSY is still active.
1176 /* SJT: Start. Slow Write. */
1177 #ifdef SEAGATE_USE_ASM
1179 int __dummy_1
, __dummy_2
;
1182 * We loop as long as we are in a data out phase, there is data to send,
1183 * and BSY is still active.
1185 /* Local variables : len = ecx , data = esi,
1186 st0x_cr_sr = ebx, st0x_dr = edi
1189 /* Test for any data here at all. */
1190 "orl %%ecx, %%ecx\n\t"
1191 "jz 2f\n\t" "cld\n\t"
1192 /* "movl st0x_cr_sr, %%ebx\n\t" */
1193 /* "movl st0x_dr, %%edi\n\t" */
1195 "movb (%%ebx), %%al\n\t"
1199 /* Test for data out phase - STATUS & REQ_MASK should be
1200 REQ_DATAOUT, which is 0. */
1201 "test $0xe, %%al\n\t"
1204 "test $0x10, %%al\n\t"
1207 "movb %%al, (%%edi)\n\t"
1208 "loop 1b\n\t" "2:\n"
1209 /* output */ :"=S" (data
), "=c" (len
),
1214 : "0" (data
), "1" (len
),
1221 #else /* SEAGATE_USE_ASM */
1226 if (!(stat
& STAT_BSY
)
1227 || ((stat
& REQ_MASK
) !=
1230 if (stat
& STAT_REQ
) {
1231 WRITE_DATA (*data
++);
1235 #endif /* SEAGATE_USE_ASM */
1239 if (!len
&& nobuffs
) {
1242 len
= buffer
->length
;
1243 data
= page_address(buffer
->page
) + buffer
->offset
;
1245 "scsi%d : next scatter-gather buffer len = %d address = %08x\n",
1253 #if (DEBUG & (PHASE_DATAIN))
1256 for (; len
&& (STATUS
& (REQ_MASK
| STAT_REQ
)) == (REQ_DATAIN
| STAT_REQ
); --len
) {
1260 #if (DEBUG & (PHASE_DATAIN))
1266 if (fast
&& transfersize
1267 && !(len
% transfersize
)
1268 && (len
>= transfersize
)
1270 && !(transfersize
% 4)
1273 DPRINTK (DEBUG_FAST
,
1274 "scsi%d : FAST transfer, underflow = %d, transfersize = %d\n"
1275 " len = %d, data = %08x\n",
1276 hostno
, SCint
->underflow
,
1277 SCint
->transfersize
, len
,
1280 /* SJT: Start. Fast Read */
1281 #ifdef SEAGATE_USE_ASM
1286 "movl (%%esi), %%eax\n\t"
1290 "movb (%%esi), %%al\n\t"
1295 /* input */ :"S" (phys_to_virt (st0x_dr
)),
1298 "c" (SCint
->transfersize
)
1302 #else /* SEAGATE_USE_ASM */
1305 const unsigned int *iop
=
1306 phys_to_virt (st0x_dr
);
1308 (unsigned int *) data
;
1309 int xferlen
= len
>> 2;
1311 const unsigned char *iop
=
1312 phys_to_virt (st0x_dr
);
1313 unsigned char *dp
= data
;
1316 for (; xferlen
; --xferlen
)
1319 #endif /* SEAGATE_USE_ASM */
1321 len
-= transfersize
;
1322 data
+= transfersize
;
1323 #if (DEBUG & PHASE_DATAIN)
1324 printk ("scsi%d: transfered += %d\n", hostno
, transfersize
);
1325 transfered
+= transfersize
;
1328 DPRINTK (DEBUG_FAST
, "scsi%d : FAST transfer complete len = %d data = %08x\n", hostno
, len
, data
);
1331 #if (DEBUG & PHASE_DATAIN)
1332 printk ("scsi%d: transfered += %d\n", hostno
, len
);
1333 transfered
+= len
; /* Assume we'll transfer it all, then
1334 subtract what we *didn't* transfer */
1338 * We loop as long as we are in a data in phase, there is room to read,
1339 * and BSY is still active
1343 #ifdef SEAGATE_USE_ASM
1345 int __dummy_3
, __dummy_4
;
1347 /* Dummy clobbering variables for the new gcc-2.95 */
1350 * We loop as long as we are in a data in phase, there is room to read,
1351 * and BSY is still active
1353 /* Local variables : ecx = len, edi = data
1354 esi = st0x_cr_sr, ebx = st0x_dr */
1356 /* Test for room to read */
1357 "orl %%ecx, %%ecx\n\t"
1358 "jz 2f\n\t" "cld\n\t"
1359 /* "movl st0x_cr_sr, %%esi\n\t" */
1360 /* "movl st0x_dr, %%ebx\n\t" */
1362 "movb (%%esi), %%al\n\t"
1366 /* Test for data in phase - STATUS & REQ_MASK should be REQ_DATAIN,
1367 = STAT_IO, which is 4. */
1368 "movb $0xe, %%ah\n\t"
1369 "andb %%al, %%ah\n\t"
1370 "cmpb $0x04, %%ah\n\t"
1373 "test $0x10, %%al\n\t"
1375 "movb (%%ebx), %%al\n\t"
1377 "loop 1b\n\t" "2:\n"
1378 /* output */ :"=D" (data
), "=c" (len
),
1383 : "0" (data
), "1" (len
),
1390 #else /* SEAGATE_USE_ASM */
1395 if (!(stat
& STAT_BSY
)
1396 || ((stat
& REQ_MASK
) !=
1399 if (stat
& STAT_REQ
) {
1404 #endif /* SEAGATE_USE_ASM */
1406 #if (DEBUG & PHASE_DATAIN)
1407 printk ("scsi%d: transfered -= %d\n", hostno
, len
);
1408 transfered
-= len
; /* Since we assumed all of Len got *
1409 transfered, correct our mistake */
1413 if (!len
&& nobuffs
) {
1416 len
= buffer
->length
;
1417 data
= page_address(buffer
->page
) + buffer
->offset
;
1418 DPRINTK (DEBUG_SG
, "scsi%d : next scatter-gather buffer len = %d address = %08x\n", hostno
, len
, data
);
1423 while (((status_read
= STATUS
) & STAT_BSY
) &&
1424 ((status_read
& REQ_MASK
) == REQ_CMDOUT
))
1425 if (status_read
& STAT_REQ
) {
1426 WRITE_DATA (*(const unsigned char *) cmnd
);
1427 cmnd
= 1 + (const unsigned char *)cmnd
;
1441 * We can only have sent a MSG OUT if we
1442 * requested to do this by raising ATTN.
1443 * So, we must drop ATTN.
1445 WRITE_CONTROL (BASE_CMD
| CMD_DRVR_ENABLE
);
1447 * If we are reconnecting, then we must
1448 * send an IDENTIFY message in response
1453 WRITE_DATA (IDENTIFY (1, lun
));
1454 DPRINTK (PHASE_RESELECT
| PHASE_MSGOUT
, "scsi%d : sent IDENTIFY message.\n", hostno
);
1459 linked_connected
= 0;
1460 reselect
= CAN_RECONNECT
;
1462 DPRINTK (PHASE_MSGOUT
| DEBUG_LINKED
, "scsi%d : sent ABORT message to cancel incorrect I_T_L nexus.\n", hostno
);
1464 DPRINTK (DEBUG_LINKED
, "correct\n");
1467 printk("scsi%d : target %d requested MSGOUT, sent NOP message.\n", hostno
, target
);
1472 switch (message
= DATA
) {
1474 DANY("seagate: deciding to disconnect\n");
1475 should_reconnect
= 1;
1476 current_data
= data
; /* WDE add */
1477 current_buffer
= buffer
;
1478 current_bufflen
= len
; /* WDE add */
1479 current_nobuffs
= nobuffs
;
1481 linked_connected
= 0;
1484 DPRINTK ((PHASE_RESELECT
| PHASE_MSGIN
), "scsi%d : disconnected.\n", hostno
);
1488 case LINKED_CMD_COMPLETE
:
1489 case LINKED_FLG_CMD_COMPLETE
:
1491 case COMMAND_COMPLETE
:
1493 * Note : we should check for underflow here.
1495 DPRINTK(PHASE_MSGIN
, "scsi%d : command complete.\n", hostno
);
1499 DPRINTK(PHASE_MSGIN
, "scsi%d : abort message.\n", hostno
);
1503 current_buffer
= buffer
;
1504 current_bufflen
= len
; /* WDE add */
1505 current_data
= data
; /* WDE mod */
1506 current_nobuffs
= nobuffs
;
1507 DPRINTK (PHASE_MSGIN
, "scsi%d : pointers saved.\n", hostno
);
1509 case RESTORE_POINTERS
:
1510 buffer
= current_buffer
;
1511 cmnd
= current_cmnd
;
1512 data
= current_data
; /* WDE mod */
1513 len
= current_bufflen
;
1514 nobuffs
= current_nobuffs
;
1515 DPRINTK(PHASE_MSGIN
, "scsi%d : pointers restored.\n", hostno
);
1520 * IDENTIFY distinguishes itself
1521 * from the other messages by
1522 * setting the high bit.
1524 * Note : we need to handle at
1525 * least one outstanding command
1526 * per LUN, and need to hash the
1527 * SCSI command for that I_T_L
1528 * nexus based on the known ID
1529 * (at this point) and LUN.
1532 if (message
& 0x80) {
1533 DPRINTK (PHASE_MSGIN
, "scsi%d : IDENTIFY message received from id %d, lun %d.\n", hostno
, target
, message
& 7);
1536 * We should go into a
1537 * MESSAGE OUT phase, and
1538 * send a MESSAGE_REJECT
1539 * if we run into a message
1540 * that we don't like. The
1541 * seagate driver needs
1543 * restructuring first
1546 DPRINTK (PHASE_MSGIN
, "scsi%d : unknown message %d from target %d.\n", hostno
, message
, target
);
1551 printk(KERN_ERR
"scsi%d : unknown phase.\n", hostno
);
1552 st0x_aborted
= DID_ERROR
;
1553 } /* end of switch (status_read & REQ_MASK) */
1556 * I really don't care to deal with borken devices in
1557 * each single byte transfer case (ie, message in,
1558 * message out, status), so I'll do the wait here if
1565 } /* if(status_read & STAT_REQ) ends */
1566 } /* while(((status_read = STATUS)...) ends */
1568 DPRINTK(PHASE_DATAIN
| PHASE_DATAOUT
| PHASE_EXIT
, "scsi%d : Transfered %d bytes\n", hostno
, transfered
);
1570 #if (DEBUG & PHASE_EXIT)
1571 #if 0 /* Doesn't work for scatter/gather */
1572 printk("Buffer : \n");
1573 for(i
= 0; i
< 20; ++i
)
1574 printk("%02x ", ((unsigned char *) data
)[i
]); /* WDE mod */
1577 printk("scsi%d : status = ", hostno
);
1578 print_status(status
);
1579 printk(" message = %02x\n", message
);
1582 /* We shouldn't reach this until *after* BSY has been deasserted */
1588 * Fix the message byte so that unsuspecting high level drivers
1589 * don't puke when they see a LINKED COMMAND message in place of
1590 * the COMMAND COMPLETE they may be expecting. Shouldn't be
1591 * necessary, but it's better to be on the safe side.
1593 * A non LINKED* message byte will indicate that the command
1594 * completed, and we are now disconnected.
1598 case LINKED_CMD_COMPLETE
:
1599 case LINKED_FLG_CMD_COMPLETE
:
1600 message
= COMMAND_COMPLETE
;
1601 linked_target
= current_target
;
1602 linked_lun
= current_lun
;
1603 linked_connected
= 1;
1604 DPRINTK (DEBUG_LINKED
, "scsi%d : keeping I_T_L nexus established for linked command.\n", hostno
);
1605 /* We also will need to adjust status to accommodate intermediate
1607 if ((status
== INTERMEDIATE_GOOD
) || (status
== INTERMEDIATE_C_GOOD
))
1611 * We should also handle what are "normal" termination
1612 * messages here (ABORT, BUS_DEVICE_RESET?, and
1613 * COMMAND_COMPLETE individually, and flake if things
1617 DPRINTK (DEBUG_LINKED
, "scsi%d : closing I_T_L nexus.\n", hostno
);
1618 linked_connected
= 0;
1623 if (should_reconnect
) {
1624 DPRINTK (PHASE_RESELECT
, "scsi%d : exiting seagate_st0x_queue_command() with reconnect enabled.\n", hostno
);
1625 WRITE_CONTROL (BASE_CMD
| CMD_INTR
);
1627 WRITE_CONTROL (BASE_CMD
);
1629 return retcode (st0x_aborted
);
1630 } /* end of internal_command */
1632 static int seagate_st0x_abort (Scsi_Cmnd
* SCpnt
)
1634 st0x_aborted
= DID_ABORT
;
1642 * the seagate_st0x_reset function resets the SCSI bus
1644 * May be called with SCpnt = NULL
1647 static int seagate_st0x_bus_reset(Scsi_Cmnd
* SCpnt
)
1649 /* No timeouts - this command is going to fail because it was reset. */
1650 DANY ("scsi%d: Reseting bus... ", hostno
);
1652 /* assert RESET signal on SCSI bus. */
1653 WRITE_CONTROL (BASE_CMD
| CMD_RST
);
1657 WRITE_CONTROL (BASE_CMD
);
1658 st0x_aborted
= DID_RESET
;
1664 static int seagate_st0x_host_reset(Scsi_Cmnd
*SCpnt
)
1669 static int seagate_st0x_device_reset(Scsi_Cmnd
*SCpnt
)
1674 static int seagate_st0x_release(struct Scsi_Host
*shost
)
1677 free_irq(shost
->irq
, shost
);
1678 release_region(shost
->io_port
, shost
->n_io_port
);
1682 static Scsi_Host_Template driver_template
= {
1683 .detect
= seagate_st0x_detect
,
1684 .release
= seagate_st0x_release
,
1685 .info
= seagate_st0x_info
,
1686 .queuecommand
= seagate_st0x_queue_command
,
1687 .eh_abort_handler
= seagate_st0x_abort
,
1688 .eh_bus_reset_handler
= seagate_st0x_bus_reset
,
1689 .eh_host_reset_handler
= seagate_st0x_host_reset
,
1690 .eh_device_reset_handler
= seagate_st0x_device_reset
,
1693 .sg_tablesize
= SG_ALL
,
1695 .use_clustering
= DISABLE_CLUSTERING
,
1697 #include "scsi_module.c"