1
2
3
4
5
6
7
8
9
10
11
12
13 #ifndef _BUSLOGIC_H
14
15 int buslogic_detect(Scsi_Host_Template *);
16 int buslogic_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
17 int buslogic_abort(Scsi_Cmnd *);
18 const char *buslogic_info(void);
19 int buslogic_reset(Scsi_Cmnd *);
20 int buslogic_biosparam(Disk *, int, int *);
21
22 #define BUSLOGIC_CMDLUN 1
23
24
25
26
27
28
29
30 #define BUSLOGIC { NULL, \
31 "BusLogic", \
32 buslogic_detect, \
33 NULL, \
34 buslogic_info, \
35 0, \
36 buslogic_queuecommand, \
37 buslogic_abort, \
38 buslogic_reset, \
39 0, \
40 buslogic_biosparam, \
41 0, \
42 0, \
43 0, \
44 BUSLOGIC_CMDLUN, \
45 0, \
46 0, \
47 ENABLE_CLUSTERING \
48 }
49
50 #ifdef BUSLOGIC_PRIVATE_H
51
52
53 #ifndef TRUE
54 # define TRUE 1
55 #endif
56 #ifndef FALSE
57 # define FALSE 0
58 #endif
59
60 #define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr)[0])
61
62 #define PACKED __attribute__((packed))
63
64 #define BD_ABORT 0x0001
65 #define BD_COMMAND 0x0002
66 #define BD_DETECT 0x0004
67 #define BD_ERRORS 0x0008
68 #define BD_INTERRUPT 0x0010
69 #define BD_IO 0x0020
70 #define BD_RESET 0x0040
71 #define BD_UNDOCUMENTED 0x0080
72
73
74
75 #define STATUS(base) (base)
76 #define DACT 0x80
77 #define DFAIL 0x40
78 #define INREQ 0x20
79 #define HARDY 0x10
80 #define CPRBSY 0x08
81 #define DIRRDY 0x04
82
83 #define CMDINV 0x01
84
85 #define DATA_IN(base) (STATUS(base) + 1)
86
87 #define INTERRUPT(base) (STATUS(base) + 2)
88 #define INTV 0x80
89
90 #define RSTS 0x08
91 #define CMDC 0x04
92 #define MBOR 0x02
93 #define IMBL 0x01
94 #define INTRMASK 0x8F
95
96
97 #define GEOMETRY(base) (STATUS(base) + 3)
98 #define GEO_GT_1GB 0x80
99
100 #define GEO_XLATION_S_D1 0x0C
101 #define GEO_XLATION_S_D0 0x03
102
103
104
105 #define CONTROL(base) STATUS(base)
106 #define RHARD 0x80
107 #define RSOFT 0x40
108 #define RINT 0x20
109 #define RSBUS 0x10
110
111
112 #define COMMAND_PARAMETER(base) (STATUS(base) + 1)
113 #define CMD_TSTCMDCINT 0x00
114 #define CMD_INITMB 0x01
115 #define CMD_START_SCSI 0x02
116 #define CMD_START_BIOS 0x03
117 #define CMD_INQUIRY 0x04
118 #define CMD_ENBOMBRINT 0x05
119 #define CMD_SETSELTIMOUT 0x06
120 #define CMD_BUSON_TIME 0x07
121 #define CMD_BUSOFF_TIME 0x08
122 #define CMD_BUSXFR_RATE 0x09
123 #define CMD_INQ_DEVICES 0x0A
124 #define CMD_RETCONF 0x0B
125 #define CMD_TARGET_MODE 0x0C
126 #define CMD_INQ_SETUP_INFO 0x0D
127 #define CMD_WRITE_LCL_RAM 0x1A
128 #define CMD_READ_LCL_RAM 0x1B
129 #define CMD_WRITE_BM_FIFO 0x1C
130 #define CMD_READ_BM_FIFO 0x1D
131 #define CMD_ECHO 0x1F
132 #define CMD_HA_DIAG 0x20
133 #define CMD_HA_OPTIONS 0x21
134 #define CMD_INITEXTMB 0x81
135 #define CMD_VER_NO_LAST 0x84
136 #define CMD_VER_NO_LETTER 0x85
137 #define CMD_RET_MODEL_NO 0x8B
138 #define CMD_INQEXTSETUP 0x8D
139 #define CMD_ROUND_ROBIN 0x8F
140
141 #define CMD_READ_FW_LCL_RAM 0x91
142 #define CMD_WRITE_INQ_BUF 0x9A
143
144 #define CMD_READ_INQ_BUF 0x9B
145
146
147 #define MBX_NOT_IN_USE 0x00
148 #define MBX_ACTION_START 0x01
149 #define MBX_ACTION_ABORT 0x02
150 #define MBX_COMPLETION_OK 0x01
151 #define MBX_COMPLETION_ABORTED 0x02
152 #define MBX_COMPLETION_NOT_FOUND 0x03
153 #define MBX_COMPLETION_ERROR 0x04
154
155
156 struct mailbox {
157 void *ccbptr;
158 unsigned char btstat;
159 unsigned char sdstat;
160 unsigned char reserved;
161 unsigned char status;
162 };
163
164
165 struct chain {
166 unsigned long datalen;
167 void *dataptr;
168 };
169
170 #define MAX_CDB 12
171
172 struct ccb {
173 unsigned char op;
174 unsigned char dir;
175 unsigned char cdblen;
176 unsigned char rsalen;
177 unsigned long datalen;
178 void *dataptr;
179 unsigned char reserved[2];
180 unsigned char hastat;
181 unsigned char tarstat;
182 unsigned char id;
183 unsigned char lun;
184 unsigned char cdb[MAX_CDB];
185 unsigned char ccbcontrol;
186 unsigned char commlinkid;
187 void *linkptr;
188 void *senseptr;
189 };
190
191 #define CCB_OP_INIT 0x00
192 #define CCB_OP_TARG 0x01
193 #define CCB_OP_INIT_SG 0x02
194 #define CCB_OP_INIT_R 0x03
195
196 #define CCB_OP_INIT_SG_R 0x04
197
198 #define CCB_OP_BUS_RESET 0x81
199
200 #endif
201
202 #endif