This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / drivers / scsi / qlogicfas.h
1 /* to be used by qlogicfas and qlogic_cs */
2 #ifndef __QLOGICFAS_H
3 #define __QLOGICFAS_H
4
5 /*----------------------------------------------------------------*/
6 /* Configuration */
7
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
10    drain */
11
12 #define QL_INT_ACTIVE_HIGH 2
13
14 /* Set the following to max out the speed of the PIO PseudoDMA transfers,
15    again, 0 tends to be slower, but more stable.  */
16
17 #define QL_TURBO_PDMA 1
18
19 /* This should be 1 to enable parity detection */
20
21 #define QL_ENABLE_PARITY 1
22
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. */
29
30 #define QL_RESET_AT_START 0
31
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 */
35
36 #define XTALFREQ        40
37
38 /**********/
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
44    something official */
45 /**********/
46
47 /*****/
48 /* config register 1 (offset 8) options */
49 /* This needs to be set to 1 if your cabling is long or noisy */
50 #define SLOWCABLE 1
51
52 /*****/
53 /* offset 0xc */
54 /* This will set fast (10Mhz) synchronous timing when set to 1
55    For this to have an effect, FASTCLK must also be 1 */
56 #define FASTSCSI 0
57
58 /* This when set to 1 will set a faster sync transfer rate */
59 #define FASTCLK 0       /*(XTALFREQ>25?1:0)*/
60
61 /*****/
62 /* offset 6 */
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
65    and set properly) */
66 #define SYNCXFRPD 5     /*(XTALFREQ/5)*/
67
68 /*****/
69 /* offset 7 */
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 */
75 #define SYNCOFFST 0
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). */
80
81 /*----------------------------------------------------------------*/
82 #ifdef PCMCIA
83 #undef QL_INT_ACTIVE_HIGH
84 #define QL_INT_ACTIVE_HIGH 0
85 #endif
86
87 struct qlogicfas_priv;
88 typedef struct qlogicfas_priv *qlogicfas_priv_t;
89 struct qlogicfas_priv {
90          int            qbase;          /* Port */
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 */
98 };
99
100 extern int qlcfg5;
101 extern int qlcfg6;
102 extern int qlcfg7;
103 extern int qlcfg8;
104 extern int qlcfg9;
105 extern int qlcfgc;
106
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 ))
110
111 /* following is watchdog timeout in microseconds */
112 #define WATCHDOG 5000000
113
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) */
117
118 #if 0
119 #define rtrc(i) {inb(0x3da);outb(0x31,0x3c0);outb((i),0x3c0);}
120 #else
121 #define rtrc(i) {}
122 #endif
123 #endif  /* __QLOGICFAS_H */
124