1 /* to be used by qlogicfas and qlogic_cs */
5 /*----------------------------------------------------------------*/
8 /* Set the following to 2 to use normal interrupt (active high/totempole-
9 tristate), otherwise use 0 (REQUIRED FOR PCMCIA) for active low, open
12 #define QL_INT_ACTIVE_HIGH 2
14 /* Set the following to max out the speed of the PIO PseudoDMA transfers,
15 again, 0 tends to be slower, but more stable. */
17 #define QL_TURBO_PDMA 1
19 /* This should be 1 to enable parity detection */
21 #define QL_ENABLE_PARITY 1
23 /* This will reset all devices when the driver is initialized (during bootup).
24 The other linux drivers don't do this, but the DOS drivers do, and after
25 using DOS or some kind of crash or lockup this will bring things back
26 without requiring a cold boot. It does take some time to recover from a
27 reset, so it is slower, and I have seen timeouts so that devices weren't
28 recognized when this was set. */
30 #define QL_RESET_AT_START 0
32 /* crystal frequency in megahertz (for offset 5 and 9)
33 Please set this for your card. Most Qlogic cards are 40 Mhz. The
34 Control Concepts ISA (not VLB) is 24 Mhz */
39 /* DANGER! modify these at your own risk */
40 /* SLOWCABLE can usually be reset to zero if you have a clean setup and
41 proper termination. The rest are for synchronous transfers and other
42 advanced features if your device can transfer faster than 5Mb/sec.
43 If you are really curious, email me for a quick howto until I have
48 /* config register 1 (offset 8) options */
49 /* This needs to be set to 1 if your cabling is long or noisy */
54 /* This will set fast (10Mhz) synchronous timing when set to 1
55 For this to have an effect, FASTCLK must also be 1 */
58 /* This when set to 1 will set a faster sync transfer rate */
59 #define FASTCLK 0 /*(XTALFREQ>25?1:0)*/
63 /* This is the sync transfer divisor, XTALFREQ/X will be the maximum
64 achievable data rate (assuming the rest of the system is capable
66 #define SYNCXFRPD 5 /*(XTALFREQ/5)*/
70 /* This is the count of how many synchronous transfers can take place
71 i.e. how many reqs can occur before an ack is given.
72 The maximum value for this is 15, the upper bits can modify
73 REQ/ACK assertion and deassertion during synchronous transfers
74 If this is 0, the bus will only transfer asynchronously */
76 /* for the curious, bits 7&6 control the deassertion delay in 1/2 cycles
77 of the 40Mhz clock. If FASTCLK is 1, specifying 01 (1/2) will
78 cause the deassertion to be early by 1/2 clock. Bits 5&4 control
79 the assertion delay, also in 1/2 clocks (FASTCLK is ignored here). */
81 /*----------------------------------------------------------------*/
83 #undef QL_INT_ACTIVE_HIGH
84 #define QL_INT_ACTIVE_HIGH 0
87 struct qlogicfas_priv;
88 typedef struct qlogicfas_priv *qlogicfas_priv_t;
89 struct qlogicfas_priv {
91 int qinitid; /* initiator ID */
92 int qabort; /* Flag to cause an abort */
93 int qlirq; /* IRQ being used */
94 char qinfo[80]; /* description */
95 Scsi_Cmnd *qlcmd; /* current command being processed */
96 struct Scsi_Host *shost; /* pointer back to host */
97 qlogicfas_priv_t next; /* next private struct */
107 /* The qlogic card uses two register maps - These macros select which one */
108 #define REG0 ( outb( inb( qbase + 0xd ) & 0x7f , qbase + 0xd ), outb( 4 , qbase + 0xd ))
109 #define REG1 ( outb( inb( qbase + 0xd ) | 0x80 , qbase + 0xd ), outb( 0xb4 | QL_INT_ACTIVE_HIGH , qbase + 0xd ))
111 /* following is watchdog timeout in microseconds */
112 #define WATCHDOG 5000000
114 /*----------------------------------------------------------------*/
115 /* the following will set the monitor border color (useful to find
116 where something crashed or gets stuck at and as a simple profiler) */
119 #define rtrc(i) {inb(0x3da);outb(0x31,0x3c0);outb((i),0x3c0);}
123 #endif /* __QLOGICFAS_H */