1 #ifndef _WD7000FASST_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 intr_chan 15
32 #define dma_chan 6
33 #define OGMB_CNT 8
34 #define ICMB_CNT 8
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 #define COMMAND ASC_STAT
63
64 #define INTR_ACK ASC_STAT+1
65
66
67 #define CONTROL ASC_STAT+2
68 #define INT_EN 0x08
69 #define DMA_EN 0x04
70 #define SCSI_RES 0x02
71 #define ASC_RES 0x01
72
73
74 #define DMA_MODE_REG 0xd6
75 #define DMA_MASK_REG 0xd4
76 #define S_DMA_MSK 0x04
77 #define DMA_CH 0x02
78 #define CASCADE 0xc0
79
80
81
82
83 #undef any2scsi
84 #define any2scsi(up, p) \
85 (up)[0] = (((long)(p)) >> 16); \
86 (up)[1] = ((long)(p)) >> 8; \
87 (up)[2] = ((long)(p));
88
89 #define scsi2int(up) ( (((long)*(up)) << 16) + (((long)(up)[1]) << 8) + ((long)(up)[2]) )
90
91 #define xany2scsi(up, p) \
92 (up)[0] = ((long)(p)) >> 24; \
93 (up)[1] = ((long)(p)) >> 16; \
94 (up)[2] = ((long)(p)) >> 8; \
95 (up)[3] = ((long)(p));
96
97 #define xscsi2int(up) ( (((long)(up)[0]) << 24) + (((long)(up)[1]) << 16) \
98 + (((long)(up)[2]) << 8) + ((long)(up)[3]) )
99
100 #define MAX_CDB 12
101 #define MAX_SENSE 14
102
103 struct scb {
104 unchar op;
105 unchar idlun;
106
107
108
109 unchar scbdata[12];
110 unchar sretstat;
111 unchar vue;
112 unchar maxdata[3];
113 unchar dataptr[3];
114 unchar linkptr[3];
115 unchar direc;
116 unchar reserved2[6];
117
118 };
119
120 int wd7000fasst_detect(int);
121 int wd7000fasst_command(unsigned char target, const void *cmnd, void *buff, int bufflen);
122 int wd7000fasst_queuecommand(unchar target, const void *cmnd, void *buff, int bufflen, void (*done)(int,int));
123 int wd7000fasst_abort(int);
124 char *wd7000fasst_info(void);
125 int wd7000fasst_reset(void);
126
127 #ifndef NULL
128 #define NULL 0
129 #endif
130
131 #define WD7000FASST {"Western Digital 7000FASST", wd7000fasst_detect, \
132 wd7000fasst_info, wd7000fasst_command, \
133 wd7000fasst_queuecommand, \
134 wd7000fasst_abort, \
135 wd7000fasst_reset, \
136 1, 7, 0}
137 #endif