1 #ifndef _WD7000_H
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 #include <linux/types.h>
26
27 #undef STATMASK
28 #undef CONTROL
29
30 #define IO_BASE 0x350
31 #define IRQ_LVL 15
32 #define DMA_CH 6
33 #define OGMB_CNT 8
34 #define ICMB_CNT 16
35
36
37
38 #define ASC_STAT IO_BASE
39 #define INT_IM 0x80
40 #define CMD_RDY 0x40
41 #define CMD_REJ 0x20
42 #define ASC_INI 0x10
43 #define STATMASK 0xf0
44
45
46
47
48
49 #define INTR_STAT ASC_STAT+1
50 #define ANYINTR 0x80
51 #define IMB 0x40
52 #define MBMASK 0x3f
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68 #define COMMAND ASC_STAT
69
70
71
72 #define NO_OP 0
73 #define INITIALIZATION 1
74 #define DISABLE_UNS_INTR 2
75 #define ENABLE_UNS_INTR 3
76 #define INTR_ON_FREE_OGMB 4
77 #define SCSI_SOFT_RESET 5
78 #define SCSI_HARD_RESET 6
79 #define START_OGMB 0x80
80 #define SCAN_OGMBS 0xc0
81
82
83
84
85 #define BUS_ON 24
86 #define BUS_OFF 24
87
88 #define INTR_ACK ASC_STAT+1
89
90
91 #define CONTROL ASC_STAT+2
92 #define INT_EN 0x08
93 #define DMA_EN 0x04
94 #define SCSI_RES 0x02
95 #define ASC_RES 0x01
96
97
98
99 struct wd_mailbox{
100 unchar status;
101 unchar scbptr[3];
102 };
103
104
105
106 #undef any2scsi
107 #define any2scsi(up, p) \
108 (up)[0] = (((long)(p)) >> 16); \
109 (up)[1] = ((long)(p)) >> 8; \
110 (up)[2] = ((long)(p));
111
112 #define scsi2int(up) ( (((long)*(up)) << 16) + (((long)(up)[1]) << 8) + ((long)(up)[2]) )
113
114 #define xany2scsi(up, p) \
115 (up)[0] = ((long)(p)) >> 24; \
116 (up)[1] = ((long)(p)) >> 16; \
117 (up)[2] = ((long)(p)) >> 8; \
118 (up)[3] = ((long)(p));
119
120 #define xscsi2int(up) ( (((long)(up)[0]) << 24) + (((long)(up)[1]) << 16) \
121 + (((long)(up)[2]) << 8) + ((long)(up)[3]) )
122
123 #define MAX_CDB 12
124 #define MAX_SENSE 14
125
126 typedef struct scb {
127 unchar op;
128 unchar idlun;
129
130
131
132 unchar cdb[12];
133 unchar status;
134 unchar vue;
135 unchar maxlen[3];
136 unchar dataptr[3];
137 unchar linkptr[3];
138 unchar direc;
139 unchar reserved2[6];
140
141 Scsi_Cmnd *SCpnt;
142 struct scb *next;
143 } Scb;
144
145
146
147
148
149
150 #define MAX_SCBS ((WD7000_Q+1) * (WD7000_SG+1))
151
152
153
154
155
156
157
158 #define ICB_STATUS 16
159 #define ICB_PHASE 17
160 #define ICB_LEN 18
161
162 int wd7000_detect(int);
163 int wd7000_command(Scsi_Cmnd *);
164 int wd7000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
165 int wd7000_abort(Scsi_Cmnd *, int);
166 const char *wd7000_info(void);
167 int wd7000_reset(void);
168 int wd7000_biosparam(int, int, int*);
169
170 #ifndef NULL
171 #define NULL 0
172 #endif
173
174 #define WD7000_Q OGMB_CNT
175 #define WD7000_SG SG_NONE
176
177 #define WD7000 {\
178 "Western Digital WD-7000", \
179 wd7000_detect, \
180 wd7000_info, wd7000_command, \
181 wd7000_queuecommand, \
182 wd7000_abort, \
183 wd7000_reset, \
184 NULL, \
185 wd7000_biosparam, \
186 WD7000_Q, 7, WD7000_SG, 1, 0, 1}
187 #endif