amrreg.h revision 1.1 1 1.1 ad /* $NetBSD: amrreg.h,v 1.1 2002/01/30 14:35:45 ad Exp $ */
2 1.1 ad
3 1.1 ad /*-
4 1.1 ad * Copyright (c) 2002 The NetBSD Foundation, Inc.
5 1.1 ad * All rights reserved.
6 1.1 ad *
7 1.1 ad * This code is derived from software contributed to The NetBSD Foundation
8 1.1 ad * by Andrew Doran.
9 1.1 ad *
10 1.1 ad * Redistribution and use in source and binary forms, with or without
11 1.1 ad * modification, are permitted provided that the following conditions
12 1.1 ad * are met:
13 1.1 ad * 1. Redistributions of source code must retain the above copyright
14 1.1 ad * notice, this list of conditions and the following disclaimer.
15 1.1 ad * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 ad * notice, this list of conditions and the following disclaimer in the
17 1.1 ad * documentation and/or other materials provided with the distribution.
18 1.1 ad * 3. All advertising materials mentioning features or use of this software
19 1.1 ad * must display the following acknowledgement:
20 1.1 ad * This product includes software developed by the NetBSD
21 1.1 ad * Foundation, Inc. and its contributors.
22 1.1 ad * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1 ad * contributors may be used to endorse or promote products derived
24 1.1 ad * from this software without specific prior written permission.
25 1.1 ad *
26 1.1 ad * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1 ad * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1 ad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1 ad * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1 ad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1 ad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1 ad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1 ad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1 ad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1 ad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1 ad * POSSIBILITY OF SUCH DAMAGE.
37 1.1 ad */
38 1.1 ad
39 1.1 ad /*-
40 1.1 ad * Copyright (c) 1999,2000 Michael Smith
41 1.1 ad * Copyright (c) 2000 BSDi
42 1.1 ad * All rights reserved.
43 1.1 ad *
44 1.1 ad * Redistribution and use in source and binary forms, with or without
45 1.1 ad * modification, are permitted provided that the following conditions
46 1.1 ad * are met:
47 1.1 ad * 1. Redistributions of source code must retain the above copyright
48 1.1 ad * notice, this list of conditions and the following disclaimer.
49 1.1 ad * 2. Redistributions in binary form must reproduce the above copyright
50 1.1 ad * notice, this list of conditions and the following disclaimer in the
51 1.1 ad * documentation and/or other materials provided with the distribution.
52 1.1 ad *
53 1.1 ad * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
54 1.1 ad * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
55 1.1 ad * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
56 1.1 ad * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
57 1.1 ad * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
58 1.1 ad * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
59 1.1 ad * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
60 1.1 ad * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61 1.1 ad * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62 1.1 ad * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63 1.1 ad * SUCH DAMAGE.
64 1.1 ad *
65 1.1 ad * from FreeBSD: amrreg.h,v 1.2 2000/08/30 07:52:40 msmith Exp
66 1.1 ad */
67 1.1 ad
68 1.1 ad #ifndef _PCI_AMRREG_H_
69 1.1 ad #define _PCI_AMRREG_H_
70 1.1 ad
71 1.1 ad #ifdef AMR_CRASH_ME
72 1.1 ad #define AMR_MAX_CMDS 255 /* ident = 0 not allowed */
73 1.1 ad #else
74 1.1 ad #define AMR_MAX_CMDS 120
75 1.1 ad #endif
76 1.1 ad #define AMR_MAXLD 40
77 1.1 ad
78 1.1 ad #define AMR_MAX_CMDS_PU 63
79 1.1 ad
80 1.1 ad #define AMR_MAX_SEGS 17
81 1.1 ad #define AMR_MAX_XFER (PAGE_SIZE * (AMR_MAX_SEGS - 1))
82 1.1 ad
83 1.1 ad #define AMR_MAX_CHANNEL 3
84 1.1 ad #define AMR_MAX_TARGET 15
85 1.1 ad #define AMR_MAX_LUN 7
86 1.1 ad
87 1.1 ad #define AMR_MAX_CDB_LEN 0x0a
88 1.1 ad #define AMR_MAX_REQ_SENSE_LEN 0x20
89 1.1 ad
90 1.1 ad #define AMR_SECTOR_SIZE 512
91 1.1 ad
92 1.1 ad /* Mailbox commands.*/
93 1.1 ad #define AMR_CMD_LREAD 0x01
94 1.1 ad #define AMR_CMD_LWRITE 0x02
95 1.1 ad #define AMR_CMD_PASS 0x03
96 1.1 ad #define AMR_CMD_EXT_ENQUIRY 0x04
97 1.1 ad #define AMR_CMD_ENQUIRY 0x05
98 1.1 ad #define AMR_CMD_FLUSH 0x0a
99 1.1 ad #define AMR_CMD_EXT_ENQUIRY2 0x0c
100 1.1 ad #define AMR_CMD_GET_MACHINEID 0x36
101 1.1 ad #define AMR_CMD_GET_INITIATOR 0x7d /* returns one byte */
102 1.1 ad #define AMR_CMD_CONFIG 0xa1
103 1.1 ad #define AMR_CONFIG_PRODUCT_INFO 0x0e
104 1.1 ad #define AMR_CONFIG_ENQ3 0x0f
105 1.1 ad #define AMR_CONFIG_ENQ3_SOLICITED_NOTIFY 0x01
106 1.1 ad #define AMR_CONFIG_ENQ3_SOLICITED_FULL 0x02
107 1.1 ad #define AMR_CONFIG_ENQ3_UNSOLICITED 0x03
108 1.1 ad
109 1.1 ad /* Command completion status. */
110 1.1 ad #define AMR_STATUS_SUCCESS 0x00
111 1.1 ad #define AMR_STATUS_ABORTED 0x02
112 1.1 ad #define AMR_STATUS_FAILED 0x80
113 1.1 ad
114 1.1 ad /* Physical/logical drive states. */
115 1.1 ad #define AMR_DRV_CURSTATE(x) ((x) & 0x0f)
116 1.1 ad #define AMR_DRV_PREVSTATE(x) (((x) >> 4) & 0x0f)
117 1.1 ad #define AMR_DRV_OFFLINE 0x00
118 1.1 ad #define AMR_DRV_DEGRADED 0x01
119 1.1 ad #define AMR_DRV_OPTIMAL 0x02
120 1.1 ad #define AMR_DRV_ONLINE 0x03
121 1.1 ad #define AMR_DRV_FAILED 0x04
122 1.1 ad #define AMR_DRV_REBUILD 0x05
123 1.1 ad #define AMR_DRV_HOTSPARE 0x06
124 1.1 ad
125 1.1 ad /* Logical drive properties. */
126 1.1 ad #define AMR_DRV_RAID_MASK 0x0f /* RAID level 0, 1, 3, 5, etc. */
127 1.1 ad #define AMR_DRV_WRITEBACK 0x10 /* write-back enabled */
128 1.1 ad #define AMR_DRV_READHEAD 0x20 /* readhead policy enabled */
129 1.1 ad #define AMR_DRV_ADAPTIVE 0x40 /* adaptive I/O policy enabled */
130 1.1 ad
131 1.1 ad /* Battery status. */
132 1.1 ad #define AMR_BATT_MODULE_MISSING 0x01
133 1.1 ad #define AMR_BATT_LOW_VOLTAGE 0x02
134 1.1 ad #define AMR_BATT_TEMP_HIGH 0x04
135 1.1 ad #define AMR_BATT_PACK_MISSING 0x08
136 1.1 ad #define AMR_BATT_CHARGE_MASK 0x30
137 1.1 ad #define AMR_BATT_CHARGE_DONE 0x00
138 1.1 ad #define AMR_BATT_CHARGE_INPROG 0x10
139 1.1 ad #define AMR_BATT_CHARGE_FAIL 0x20
140 1.1 ad #define AMR_BATT_CYCLES_EXCEEDED 0x40
141 1.1 ad
142 1.1 ad /*
143 1.1 ad * 8LD firmware interface.
144 1.1 ad */
145 1.1 ad
146 1.1 ad /* Array constraints. */
147 1.1 ad #define AMR_8LD_MAXDRIVES 8
148 1.1 ad #define AMR_8LD_MAXCHAN 5
149 1.1 ad #define AMR_8LD_MAXTARG 15
150 1.1 ad #define AMR_8LD_MAXPHYSDRIVES (AMR_8LD_MAXCHAN * AMR_8LD_MAXTARG)
151 1.1 ad
152 1.1 ad /* Adapter information. */
153 1.1 ad struct amr_adapter_info {
154 1.1 ad u_int8_t aa_maxio;
155 1.1 ad u_int8_t aa_rebuild_rate;
156 1.1 ad u_int8_t aa_maxtargchan;
157 1.1 ad u_int8_t aa_channels;
158 1.1 ad u_int8_t aa_firmware[4];
159 1.1 ad u_int16_t aa_flashage;
160 1.1 ad u_int8_t aa_chipsetvalue;
161 1.1 ad u_int8_t aa_memorysize;
162 1.1 ad u_int8_t aa_cacheflush;
163 1.1 ad u_int8_t aa_bios[4];
164 1.1 ad u_int8_t aa_boardtype;
165 1.1 ad u_int8_t aa_scsisensealert;
166 1.1 ad u_int8_t aa_writeconfigcount;
167 1.1 ad u_int8_t aa_driveinsertioncount;
168 1.1 ad u_int8_t aa_inserteddrive;
169 1.1 ad u_int8_t aa_batterystatus;
170 1.1 ad u_int8_t aa_res1;
171 1.1 ad } __attribute__ ((__packed__));
172 1.1 ad
173 1.1 ad /* Logical drive information. */
174 1.1 ad struct amr_logdrive_info {
175 1.1 ad u_int8_t al_numdrives;
176 1.1 ad u_int8_t al_res1[3];
177 1.1 ad u_int32_t al_size[AMR_8LD_MAXDRIVES];
178 1.1 ad u_int8_t al_properties[AMR_8LD_MAXDRIVES];
179 1.1 ad u_int8_t al_state[AMR_8LD_MAXDRIVES];
180 1.1 ad } __attribute__ ((__packed__));
181 1.1 ad
182 1.1 ad /* Physical drive information. */
183 1.1 ad struct amr_physdrive_info {
184 1.1 ad /* Low nybble is current state, high nybble is previous state. */
185 1.1 ad u_int8_t ap_state[AMR_8LD_MAXPHYSDRIVES];
186 1.1 ad u_int8_t ap_predictivefailure;
187 1.1 ad } __attribute__ ((__packed__));
188 1.1 ad
189 1.1 ad /*
190 1.1 ad * Enquiry response structure for AMR_CMD_ENQUIRY (e), AMR_CMD_EXT_ENQUIRY (x)
191 1.1 ad * and AMR_CMD_EXT_ENQUIRY2 (2).
192 1.1 ad */
193 1.1 ad struct amr_enquiry {
194 1.1 ad struct amr_adapter_info ae_adapter; /* e x 2 */
195 1.1 ad struct amr_logdrive_info ae_ldrv; /* e x 2 */
196 1.1 ad struct amr_physdrive_info ae_pdrv; /* e x 2 */
197 1.1 ad u_int8_t ae_formatting[AMR_8LD_MAXDRIVES]; /* x 2 */
198 1.1 ad u_int8_t res1[AMR_8LD_MAXDRIVES]; /* x 2 */
199 1.1 ad u_int32_t ae_extlen; /* 2 */
200 1.1 ad u_int16_t ae_subsystem; /* 2 */
201 1.1 ad u_int16_t ae_subvendor; /* 2 */
202 1.1 ad u_int32_t ae_signature; /* 2 */
203 1.1 ad #define AMR_SIG_431 0xfffe0001
204 1.1 ad #define AMR_SIG_438 0xfffd0002
205 1.1 ad #define AMR_SIG_762 0xfffc0003
206 1.1 ad #define AMR_SIG_T5 0xfffb0004
207 1.1 ad #define AMR_SIG_466 0xfffa0005
208 1.1 ad #define AMR_SIG_467 0xfff90006
209 1.1 ad #define AMR_SIG_T7 0xfff80007
210 1.1 ad #define AMR_SIG_490 0xfff70008
211 1.1 ad u_int8_t res2[844]; /* 2 */
212 1.1 ad } __attribute__ ((__packed__));
213 1.1 ad
214 1.1 ad /*
215 1.1 ad * 40LD firmware interface.
216 1.1 ad */
217 1.1 ad
218 1.1 ad /* Array constraints. */
219 1.1 ad #define AMR_40LD_MAXDRIVES 40
220 1.1 ad #define AMR_40LD_MAXCHAN 16
221 1.1 ad #define AMR_40LD_MAXTARG 16
222 1.1 ad #define AMR_40LD_MAXPHYSDRIVES 256
223 1.1 ad
224 1.1 ad /* Product information structure. */
225 1.1 ad struct amr_prodinfo {
226 1.1 ad u_int32_t ap_size; /* current size in bytes (not including resvd) */
227 1.1 ad u_int32_t ap_configsig; /* default is 0x00282008, indicating 0x28 maximum
228 1.1 ad * logical drives, 0x20 maximum stripes and 0x08
229 1.1 ad * maximum spans */
230 1.1 ad u_int8_t ap_firmware[16]; /* printable identifiers */
231 1.1 ad u_int8_t ap_bios[16];
232 1.1 ad u_int8_t ap_product[80];
233 1.1 ad u_int8_t ap_maxio; /* maximum number of concurrent commands supported */
234 1.1 ad u_int8_t ap_nschan; /* number of SCSI channels present */
235 1.1 ad u_int8_t ap_fcloops; /* number of fibre loops present */
236 1.1 ad u_int8_t ap_memtype; /* memory type */
237 1.1 ad u_int32_t ap_signature;
238 1.1 ad u_int16_t ap_memsize; /* onboard memory in MB */
239 1.1 ad u_int16_t ap_subsystem; /* subsystem identifier */
240 1.1 ad u_int16_t ap_subvendor; /* subsystem vendor ID */
241 1.1 ad u_int8_t ap_numnotifyctr; /* number of notify counters */
242 1.1 ad } __attribute__ ((__packed__));
243 1.1 ad
244 1.1 ad /* Notify structure. */
245 1.1 ad struct amr_notify {
246 1.1 ad u_int32_t an_globalcounter; /* change counter */
247 1.1 ad
248 1.1 ad u_int8_t an_paramcounter; /* parameter change counter */
249 1.1 ad u_int8_t an_paramid;
250 1.1 ad #define AMR_PARAM_REBUILD_RATE 0x01 /* value = new rebuild rate */
251 1.1 ad #define AMR_PARAM_FLUSH_INTERVAL 0x02 /* value = new flush interval */
252 1.1 ad #define AMR_PARAM_SENSE_ALERT 0x03 /* value = last physical drive with check condition set */
253 1.1 ad #define AMR_PARAM_DRIVE_INSERTED 0x04 /* value = last physical drive inserted */
254 1.1 ad #define AMR_PARAM_BATTERY_STATUS 0x05 /* value = battery status */
255 1.1 ad u_int16_t an_paramval;
256 1.1 ad
257 1.1 ad u_int8_t an_writeconfigcounter; /* write config occurred */
258 1.1 ad u_int8_t res1[3];
259 1.1 ad
260 1.1 ad u_int8_t an_ldrvopcounter; /* logical drive operation started/completed */
261 1.1 ad u_int8_t an_ldrvopid;
262 1.1 ad u_int8_t an_ldrvopcmd;
263 1.1 ad #define AMR_LDRVOP_CHECK 0x01
264 1.1 ad #define AMR_LDRVOP_INIT 0x02
265 1.1 ad #define AMR_LDRVOP_REBUILD 0x03
266 1.1 ad u_int8_t an_ldrvopstatus;
267 1.1 ad #define AMR_LDRVOP_SUCCESS 0x00
268 1.1 ad #define AMR_LDRVOP_FAILED 0x01
269 1.1 ad #define AMR_LDRVOP_ABORTED 0x02
270 1.1 ad #define AMR_LDRVOP_CORRECTED 0x03
271 1.1 ad #define AMR_LDRVOP_STARTED 0x04
272 1.1 ad
273 1.1 ad u_int8_t an_ldrvstatecounter; /* logical drive state change occurred */
274 1.1 ad u_int8_t an_ldrvstateid;
275 1.1 ad u_int8_t an_ldrvstatenew;
276 1.1 ad u_int8_t an_ldrvstateold;
277 1.1 ad
278 1.1 ad u_int8_t an_pdrvstatecounter; /* physical drive state change occurred */
279 1.1 ad u_int8_t an_pdrvstateid;
280 1.1 ad u_int8_t an_pdrvstatenew;
281 1.1 ad u_int8_t an_pdrvstateold;
282 1.1 ad
283 1.1 ad u_int8_t an_pdrvfmtcounter;
284 1.1 ad u_int8_t an_pdrvfmtid;
285 1.1 ad u_int8_t an_pdrvfmtval;
286 1.1 ad #define AMR_FORMAT_START 0x01
287 1.1 ad #define AMR_FORMAT_COMPLETE 0x02
288 1.1 ad u_int8_t res2;
289 1.1 ad
290 1.1 ad u_int8_t an_targxfercounter; /* scsi xfer rate change */
291 1.1 ad u_int8_t an_targxferid;
292 1.1 ad u_int8_t an_targxferval;
293 1.1 ad u_int8_t res3;
294 1.1 ad
295 1.1 ad u_int8_t an_fcloopidcounter; /* FC/AL loop ID changed */
296 1.1 ad u_int8_t an_fcloopidpdrvid;
297 1.1 ad u_int8_t an_fcloopid0;
298 1.1 ad u_int8_t an_fcloopid1;
299 1.1 ad
300 1.1 ad u_int8_t an_fcloopstatecounter; /* FC/AL loop status changed */
301 1.1 ad u_int8_t an_fcloopstate0;
302 1.1 ad u_int8_t an_fcloopstate1;
303 1.1 ad u_int8_t res4;
304 1.1 ad } __attribute__ ((__packed__));
305 1.1 ad
306 1.1 ad /* Enquiry3 structure. */
307 1.1 ad struct amr_enquiry3 {
308 1.1 ad u_int32_t ae_datasize; /* valid data size in this structure */
309 1.1 ad union { /* event notify structure */
310 1.1 ad struct amr_notify n;
311 1.1 ad u_int8_t pad[0x80];
312 1.1 ad } ae_notify;
313 1.1 ad u_int8_t ae_rebuildrate; /* current rebuild rate in % */
314 1.1 ad u_int8_t ae_cacheflush; /* flush interval in seconds */
315 1.1 ad u_int8_t ae_sensealert;
316 1.1 ad u_int8_t ae_driveinsertcount; /* count of inserted drives */
317 1.1 ad u_int8_t ae_batterystatus;
318 1.1 ad u_int8_t ae_numldrives;
319 1.1 ad u_int8_t ae_reconstate[AMR_40LD_MAXDRIVES / 8]; /* reconstruction state */
320 1.1 ad u_int16_t ae_opstatus[AMR_40LD_MAXDRIVES / 8]; /* operation status per drive */
321 1.1 ad u_int32_t ae_drivesize[AMR_40LD_MAXDRIVES]; /* logical drive size */
322 1.1 ad u_int8_t ae_driveprop[AMR_40LD_MAXDRIVES]; /* logical drive properties */
323 1.1 ad u_int8_t ae_drivestate[AMR_40LD_MAXDRIVES]; /* physical drive state */
324 1.1 ad u_int16_t ae_driveformat[AMR_40LD_MAXPHYSDRIVES];
325 1.1 ad u_int8_t ae_targxfer[80]; /* physical drive transfer rates */
326 1.1 ad
327 1.1 ad u_int8_t res1[263]; /* pad to 1024 bytes */
328 1.1 ad } __attribute__ ((__packed__));
329 1.1 ad
330 1.1 ad /*
331 1.1 ad * Mailbox and command structures.
332 1.1 ad */
333 1.1 ad
334 1.1 ad #define AMR_MBOX_CMDSIZE 0x10 /* portion worth copying for controller */
335 1.1 ad
336 1.1 ad struct amr_mailbox {
337 1.1 ad u_int8_t mb_command;
338 1.1 ad u_int8_t mb_ident;
339 1.1 ad u_int16_t mb_blkcount;
340 1.1 ad u_int32_t mb_lba;
341 1.1 ad u_int32_t mb_physaddr;
342 1.1 ad u_int8_t mb_drive;
343 1.1 ad u_int8_t mb_nsgelem;
344 1.1 ad u_int8_t res1;
345 1.1 ad u_int8_t mb_busy;
346 1.1 ad u_int8_t mb_nstatus;
347 1.1 ad u_int8_t mb_status;
348 1.1 ad u_int8_t mb_completed[46];
349 1.1 ad u_int8_t mb_poll;
350 1.1 ad u_int8_t mb_ack;
351 1.1 ad u_int8_t res2[62]; /* Pad to 128 bytes. */
352 1.1 ad } __attribute__ ((__packed__));
353 1.1 ad
354 1.1 ad struct amr_mailbox64 {
355 1.1 ad u_int32_t mb64_segment; /* for 64-bit controllers */
356 1.1 ad struct amr_mailbox mb;
357 1.1 ad } __attribute__ ((__packed__));
358 1.1 ad
359 1.1 ad struct amr_mailbox_ioctl {
360 1.1 ad u_int8_t mb_command;
361 1.1 ad u_int8_t mb_ident;
362 1.1 ad u_int8_t mb_channel;
363 1.1 ad u_int8_t mb_param;
364 1.1 ad u_int8_t mb_pad[4];
365 1.1 ad u_int32_t mb_physaddr;
366 1.1 ad u_int8_t mb_drive;
367 1.1 ad u_int8_t mb_nsgelem;
368 1.1 ad u_int8_t res1;
369 1.1 ad u_int8_t mb_busy;
370 1.1 ad u_int8_t mb_nstatus;
371 1.1 ad u_int8_t mb_completed[46];
372 1.1 ad u_int8_t mb_poll;
373 1.1 ad u_int8_t mb_ack;
374 1.1 ad u_int8_t res4[16];
375 1.1 ad } __attribute__ ((__packed__));
376 1.1 ad
377 1.1 ad struct amr_sgentry {
378 1.1 ad u_int32_t sge_addr;
379 1.1 ad u_int32_t sge_count;
380 1.1 ad } __attribute__ ((__packed__));
381 1.1 ad
382 1.1 ad struct amr_passthrough {
383 1.1 ad u_int8_t ap_timeout:3;
384 1.1 ad u_int8_t ap_ars:1;
385 1.1 ad u_int8_t ap_dummy:3;
386 1.1 ad u_int8_t ap_islogical:1;
387 1.1 ad u_int8_t ap_logical_drive_no;
388 1.1 ad u_int8_t ap_channel;
389 1.1 ad u_int8_t ap_scsi_id;
390 1.1 ad u_int8_t ap_queue_tag;
391 1.1 ad u_int8_t ap_queue_action;
392 1.1 ad u_int8_t ap_cdb[AMR_MAX_CDB_LEN];
393 1.1 ad u_int8_t ap_cdb_length;
394 1.1 ad u_int8_t ap_request_sense_length;
395 1.1 ad u_int8_t ap_request_sense_area[AMR_MAX_REQ_SENSE_LEN];
396 1.1 ad u_int8_t ap_no_sg_elements;
397 1.1 ad u_int8_t ap_scsi_status;
398 1.1 ad u_int32_t ap_data_transfer_address;
399 1.1 ad u_int32_t ap_data_transfer_length;
400 1.1 ad } __attribute__ ((__packed__));
401 1.1 ad
402 1.1 ad /*
403 1.1 ad * "Quartz" i960 PCI bridge interface.
404 1.1 ad */
405 1.1 ad
406 1.1 ad #define AMR_QUARTZ_SIG_REG 0xa0
407 1.1 ad #define AMR_QUARTZ_SIG0 0xcccc
408 1.1 ad #define AMR_QUARTZ_SIG1 0x3344
409 1.1 ad
410 1.1 ad /* Doorbell registers. */
411 1.1 ad #define AMR_QREG_IDB 0x20
412 1.1 ad #define AMR_QREG_ODB 0x2c
413 1.1 ad
414 1.1 ad #define AMR_QIDB_SUBMIT 0x00000001 /* mailbox ready for work */
415 1.1 ad #define AMR_QIDB_ACK 0x00000002 /* mailbox done */
416 1.1 ad #define AMR_QODB_READY 0x10001234 /* work ready to be processed */
417 1.1 ad
418 1.1 ad /*
419 1.1 ad * Old-style ("standard") ASIC bridge interface.
420 1.1 ad */
421 1.1 ad
422 1.1 ad /* I/O registers. */
423 1.1 ad #define AMR_SREG_CMD 0x10 /* Command/ack register (w) */
424 1.1 ad #define AMR_SREG_MBOX_BUSY 0x10 /* Mailbox status (r) */
425 1.1 ad #define AMR_SREG_TOGL 0x11 /* Interrupt enable */
426 1.1 ad #define AMR_SREG_MBOX 0x14 /* Mailbox physical address */
427 1.1 ad #define AMR_SREG_MBOX_ENABLE 0x18 /* Atomic mailbox address enable */
428 1.1 ad #define AMR_SREG_INTR 0x1a /* Interrupt status */
429 1.1 ad
430 1.1 ad /* I/O magic numbers. */
431 1.1 ad #define AMR_SCMD_POST 0x10 /* in SCMD to initiate action on mailbox */
432 1.1 ad #define AMR_SCMD_ACKINTR 0x08 /* in SCMD to ack mailbox retrieved */
433 1.1 ad #define AMR_STOGL_ENABLE 0xc0 /* in STOGL */
434 1.1 ad #define AMR_SINTR_VALID 0x40 /* in SINTR */
435 1.1 ad #define AMR_SMBOX_BUSY_FLAG 0x10 /* in SMBOX_BUSY */
436 1.1 ad #define AMR_SMBOX_ENABLE_ADDR 0x00 /* in SMBOX_ENABLE */
437 1.1 ad
438 1.1 ad #endif /* !_PCI_AMRREG_H_ */
439