i2o.h revision 1.4 1 1.4 ad /* $NetBSD: i2o.h,v 1.4 2001/04/01 15:02:08 ad Exp $ */
2 1.1 ad
3 1.1 ad /*-
4 1.3 ad * Copyright (c) 2000, 2001 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.3 ad * Structures and constants, as presented by the I2O specification revision
41 1.3 ad * 1.5 (obtainable from http://www.intelligent-io.com/). Currently, only
42 1.1 ad * what's useful to us is defined in this file.
43 1.1 ad */
44 1.1 ad
45 1.1 ad #ifndef _I2O_I2O_H_
46 1.1 ad #define _I2O_I2O_H_
47 1.1 ad
48 1.1 ad /*
49 1.1 ad * ================= Miscellenous definitions =================
50 1.1 ad */
51 1.1 ad
52 1.2 ad /* Organisation IDs */
53 1.2 ad #define I2O_ORG_DPT 0x001b
54 1.3 ad #define I2O_ORG_INTEL 0x0028
55 1.2 ad #define I2O_ORG_AMI 0x1000
56 1.2 ad
57 1.1 ad /* Macros to assist in building message headers */
58 1.1 ad #define I2O_MSGFLAGS(s) (I2O_VERSION_11 | (sizeof(struct s) << 14))
59 1.1 ad #define I2O_MSGFUNC(t, f) ((t) | (I2O_TID_HOST << 12) | ((f) << 24))
60 1.1 ad
61 1.1 ad /* Common message function codes with no payload or an undefined payload */
62 1.1 ad #define I2O_UTIL_NOP 0x00
63 1.1 ad #define I2O_EXEC_IOP_CLEAR 0xbe
64 1.1 ad #define I2O_EXEC_SYS_QUIESCE 0xc3
65 1.1 ad #define I2O_EXEC_SYS_ENABLE 0xd1
66 1.1 ad #define I2O_PRIVATE_MESSAGE 0xff
67 1.1 ad
68 1.1 ad /* Device class codes */
69 1.1 ad #define I2O_CLASS_EXECUTIVE 0x00
70 1.1 ad #define I2O_CLASS_DDM 0x01
71 1.1 ad #define I2O_CLASS_RANDOM_BLOCK_STORAGE 0x10
72 1.1 ad #define I2O_CLASS_SEQUENTIAL_STORAGE 0x11
73 1.1 ad #define I2O_CLASS_LAN 0x20
74 1.1 ad #define I2O_CLASS_WAN 0x30
75 1.1 ad #define I2O_CLASS_FIBRE_CHANNEL_PORT 0x40
76 1.1 ad #define I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL 0x41
77 1.1 ad #define I2O_CLASS_SCSI_PERIPHERAL 0x51
78 1.1 ad #define I2O_CLASS_ATE_PORT 0x60
79 1.1 ad #define I2O_CLASS_ATE_PERIPHERAL 0x61
80 1.1 ad #define I2O_CLASS_FLOPPY_CONTROLLER 0x70
81 1.1 ad #define I2O_CLASS_FLOPPY_DEVICE 0x71
82 1.1 ad #define I2O_CLASS_BUS_ADAPTER_PORT 0x80
83 1.1 ad
84 1.1 ad #define I2O_CLASS_ANY 0xffffffff
85 1.1 ad
86 1.1 ad /* Reply status codes */
87 1.1 ad #define I2O_STATUS_SUCCESS 0x00
88 1.1 ad #define I2O_STATUS_ABORT_DIRTY 0x01
89 1.1 ad #define I2O_STATUS_ABORT_NO_DATA_XFER 0x02
90 1.1 ad #define I2O_STATUS_ABORT_PARTIAL_XFER 0x03
91 1.1 ad #define I2O_STATUS_ERROR_DIRTY 0x04
92 1.1 ad #define I2O_STATUS_ERROR_NO_DATA_XFER 0x05
93 1.1 ad #define I2O_STATUS_ERROR_PARTIAL_XFER 0x06
94 1.1 ad #define I2O_STATUS_PROCESS_ABORT_DIRTY 0x08
95 1.1 ad #define I2O_STATUS_PROCESS_ABORT_NO_DATA_XFER 0x09
96 1.1 ad #define I2O_STATUS_PROCESS_ABORT_PARTIAL_XFER 0x0a
97 1.1 ad #define I2O_STATUS_TRANSACTION_ERROR 0x0b
98 1.1 ad #define I2O_STATUS_PROGRESS_REPORT 0x80
99 1.1 ad
100 1.3 ad /* Detailed status codes */
101 1.3 ad #define I2O_DSC_SUCCESS 0x00
102 1.3 ad #define I2O_DSC_BAD_KEY 0x02
103 1.3 ad #define I2O_DSC_TCL_ERROR 0x03
104 1.3 ad #define I2O_DSC_REPLY_BUFFER_FULL 0x04
105 1.3 ad #define I2O_DSC_NO_SUCH_PAGE 0x05
106 1.3 ad #define I2O_DSC_INSUFFICIENT_RESOURCE_SOFT 0x06
107 1.3 ad #define I2O_DSC_INSUFFICIENT_RESOURCE_HARD 0x07
108 1.3 ad #define I2O_DSC_CHAIN_BUFFER_TOO_LARGE 0x09
109 1.3 ad #define I2O_DSC_UNSUPPORTED_FUNCTION 0x0a
110 1.3 ad #define I2O_DSC_DEVICE_LOCKED 0x0b
111 1.3 ad #define I2O_DSC_DEVICE_RESET 0x0c
112 1.3 ad #define I2O_DSC_INAPPROPRIATE_FUNCTION 0x0d
113 1.3 ad #define I2O_DSC_INVALID_INITIATOR_ADDRESS 0x0e
114 1.3 ad #define I2O_DSC_INVALID_MESSAGE_FLAGS 0x0f
115 1.3 ad #define I2O_DSC_INVALID_OFFSET 0x10
116 1.3 ad #define I2O_DSC_INVALID_PARAMETER 0x11
117 1.3 ad #define I2O_DSC_INVALID_REQUEST 0x12
118 1.3 ad #define I2O_DSC_INVALID_TARGET_ADDRESS 0x13
119 1.3 ad #define I2O_DSC_MESSAGE_TOO_LARGE 0x14
120 1.3 ad #define I2O_DSC_MESSAGE_TOO_SMALL 0x15
121 1.3 ad #define I2O_DSC_MISSING_PARAMETER 0x16
122 1.3 ad #define I2O_DSC_TIMEOUT 0x17
123 1.3 ad #define I2O_DSC_UNKNOWN_ERROR 0x18
124 1.3 ad #define I2O_DSC_UNKNOWN_FUNCTION 0x19
125 1.3 ad #define I2O_DSC_UNSUPPORTED_VERSION 0x1a
126 1.3 ad #define I2O_DSC_DEVICE_BUSY 0x1b
127 1.3 ad #define I2O_DSC_DEVICE_NOT_AVAILABLE 0x1c
128 1.3 ad
129 1.1 ad /* Message versions */
130 1.1 ad #define I2O_VERSION_10 0x00
131 1.1 ad #define I2O_VERSION_11 0x01
132 1.1 ad #define I2O_VERSION_20 0x02
133 1.1 ad
134 1.1 ad /* Commonly used TIDs */
135 1.1 ad #define I2O_TID_IOP 0
136 1.1 ad #define I2O_TID_HOST 1
137 1.1 ad #define I2O_TID_NONE 4095
138 1.1 ad
139 1.1 ad /* SGL flags. This list covers only a fraction of the possibilities. */
140 1.2 ad #define I2O_SGL_IGNORE 0x00000000
141 1.2 ad #define I2O_SGL_SIMPLE 0x10000000
142 1.3 ad #define I2O_SGL_PAGE_LIST 0x20000000
143 1.2 ad
144 1.2 ad #define I2O_SGL_BC_32BIT 0x01000000
145 1.2 ad #define I2O_SGL_BC_64BIT 0x02000000
146 1.2 ad #define I2O_SGL_BC_96BIT 0x03000000
147 1.1 ad #define I2O_SGL_DATA_OUT 0x04000000
148 1.1 ad #define I2O_SGL_END_BUFFER 0x40000000
149 1.1 ad #define I2O_SGL_END 0x80000000
150 1.1 ad
151 1.1 ad /* Serial number formats */
152 1.1 ad #define I2O_SNFMT_UNKNOWN 0
153 1.1 ad #define I2O_SNFMT_BINARY 1
154 1.1 ad #define I2O_SNFMT_ASCII 2
155 1.1 ad #define I2O_SNFMT_UNICODE 3
156 1.1 ad #define I2O_SNFMT_LAN_MAC 4
157 1.1 ad #define I2O_SNFMT_WAN_MAC 5
158 1.1 ad
159 1.1 ad /*
160 1.1 ad * ================= Common structures =================
161 1.1 ad */
162 1.1 ad
163 1.1 ad /*
164 1.1 ad * Standard I2O message frame. All message frames begin with this.
165 1.1 ad *
166 1.1 ad * Bits Field Meaning
167 1.1 ad * ---- ------------- ----------------------------------------------------
168 1.1 ad * 0-2 msgflags Message header version. Must be 001 (little endian).
169 1.1 ad * 3 msgflags Reserved.
170 1.1 ad * 4-7 msgflags Offset to SGLs expressed as # of 32-bit words.
171 1.1 ad * 8-15 msgflags Control flags.
172 1.1 ad * 16-31 msgflags Message frame size expressed as # of 32-bit words.
173 1.1 ad * 0-11 msgfunc TID of target.
174 1.1 ad * 12-23 msgfunc TID of initiator.
175 1.1 ad * 24-31 msgfunc Function (i.e., type of message).
176 1.1 ad */
177 1.1 ad struct i2o_msg {
178 1.1 ad u_int32_t msgflags;
179 1.1 ad u_int32_t msgfunc;
180 1.1 ad u_int32_t msgictx; /* Initiator context */
181 1.1 ad u_int32_t msgtctx; /* Transaction context */
182 1.1 ad
183 1.1 ad /* Message payload */
184 1.1 ad
185 1.1 ad } __attribute__ ((__packed__));
186 1.1 ad
187 1.1 ad #define I2O_MSGFLAGS_STATICMF 0x0100
188 1.1 ad #define I2O_MSGFLAGS_64BIT 0x0200
189 1.1 ad #define I2O_MSGFLAGS_MULTI 0x1000
190 1.3 ad #define I2O_MSGFLAGS_FAIL 0x2000
191 1.1 ad #define I2O_MSGFLAGS_LAST_REPLY 0x4000
192 1.1 ad #define I2O_MSGFLAGS_REPLY 0x8000
193 1.1 ad
194 1.1 ad /*
195 1.1 ad * Standard reply frame. msgflags, msgfunc, msgictx and msgtctx have the
196 1.1 ad * same meaning as in `struct i2o_msg'.
197 1.1 ad */
198 1.1 ad struct i2o_reply {
199 1.1 ad u_int32_t msgflags;
200 1.1 ad u_int32_t msgfunc;
201 1.1 ad u_int32_t msgictx;
202 1.1 ad u_int32_t msgtctx;
203 1.2 ad u_int16_t detail; /* Detailed status code */
204 1.1 ad u_int8_t reserved;
205 1.2 ad u_int8_t reqstatus; /* Request status code */
206 1.1 ad
207 1.1 ad /* Reply payload */
208 1.1 ad
209 1.1 ad } __attribute__ ((__packed__));
210 1.1 ad
211 1.1 ad /*
212 1.3 ad * Fault notification reply, returned when a message frame can not be
213 1.3 ad * processed (i.e I2O_MSGFLAGS_FAIL is set in the reply).
214 1.3 ad */
215 1.3 ad struct i2o_fault_notify {
216 1.3 ad u_int32_t msgflags;
217 1.3 ad u_int32_t msgfunc;
218 1.3 ad u_int32_t msgictx;
219 1.3 ad u_int32_t msgtctx; /* Not valid! */
220 1.3 ad u_int8_t lowestver;
221 1.3 ad u_int8_t highestver;
222 1.3 ad u_int8_t severity;
223 1.3 ad u_int8_t failurecode;
224 1.3 ad u_int16_t failingiop; /* Bits 0-12 only */
225 1.3 ad u_int16_t failinghostunit;
226 1.3 ad u_int32_t agelimit;
227 1.3 ad u_int32_t lowmfa;
228 1.3 ad u_int32_t highmfa;
229 1.3 ad };
230 1.3 ad
231 1.3 ad /*
232 1.1 ad * Hardware resource table. Not documented here.
233 1.1 ad */
234 1.1 ad struct i2o_hrt_entry {
235 1.1 ad u_int32_t adapterid;
236 1.2 ad u_int16_t controllingtid;
237 1.2 ad u_int8_t busnumber;
238 1.2 ad u_int8_t bustype;
239 1.1 ad u_int8_t businfo[8];
240 1.1 ad } __attribute__ ((__packed__));
241 1.1 ad
242 1.1 ad struct i2o_hrt {
243 1.2 ad u_int16_t numentries;
244 1.1 ad u_int8_t entrysize;
245 1.1 ad u_int8_t hrtversion;
246 1.1 ad u_int32_t changeindicator;
247 1.1 ad struct i2o_hrt_entry entry[1];
248 1.1 ad } __attribute__ ((__packed__));
249 1.1 ad
250 1.1 ad /*
251 1.1 ad * Logical configuration table entry. Bitfields are broken down as follows:
252 1.1 ad *
253 1.1 ad * Bits Field Meaning
254 1.1 ad * ----- -------------- ---------------------------------------------------
255 1.1 ad * 0-11 classid Class ID.
256 1.1 ad * 12-15 classid Class version.
257 1.1 ad * 0-11 usertid User TID
258 1.1 ad * 12-23 usertid Parent TID.
259 1.1 ad * 24-31 usertid BIOS info.
260 1.1 ad */
261 1.1 ad struct i2o_lct_entry {
262 1.1 ad u_int16_t entrysize;
263 1.1 ad u_int16_t localtid; /* Bits 0-12 only */
264 1.1 ad u_int32_t changeindicator;
265 1.1 ad u_int32_t deviceflags;
266 1.1 ad u_int16_t classid;
267 1.1 ad u_int16_t orgid;
268 1.1 ad u_int32_t subclassinfo;
269 1.1 ad u_int32_t usertid;
270 1.1 ad u_int8_t identitytag[8];
271 1.1 ad u_int32_t eventcaps;
272 1.1 ad } __attribute__ ((__packed__));
273 1.1 ad
274 1.1 ad /*
275 1.1 ad * Logical configuration table header.
276 1.1 ad */
277 1.1 ad struct i2o_lct {
278 1.1 ad u_int16_t tablesize;
279 1.2 ad u_int16_t flags;
280 1.1 ad u_int32_t iopflags;
281 1.1 ad u_int32_t changeindicator;
282 1.1 ad struct i2o_lct_entry entry[1];
283 1.1 ad } __attribute__ ((__packed__));
284 1.1 ad
285 1.1 ad /*
286 1.2 ad * IOP system table. Bitfields are broken down as follows:
287 1.1 ad *
288 1.1 ad * Bits Field Meaning
289 1.1 ad * ----- -------------- ---------------------------------------------------
290 1.1 ad * 0-11 iopid IOP ID.
291 1.1 ad * 12-31 iopid Reserved.
292 1.1 ad * 0-11 segnumber Segment number.
293 1.1 ad * 12-15 segnumber I2O version.
294 1.1 ad * 16-23 segnumber IOP state.
295 1.1 ad * 24-31 segnumber Messenger type.
296 1.1 ad */
297 1.2 ad struct i2o_systab_entry {
298 1.1 ad u_int16_t orgid;
299 1.1 ad u_int16_t reserved0;
300 1.1 ad u_int32_t iopid;
301 1.2 ad u_int32_t segnumber;
302 1.1 ad u_int16_t inboundmsgframesize;
303 1.1 ad u_int16_t reserved1;
304 1.1 ad u_int32_t lastchanged;
305 1.1 ad u_int32_t iopcaps;
306 1.1 ad u_int32_t inboundmsgportaddresslow;
307 1.1 ad u_int32_t inboundmsgportaddresshigh;
308 1.1 ad } __attribute__ ((__packed__));
309 1.1 ad
310 1.2 ad struct i2o_systab {
311 1.2 ad u_int8_t numentries;
312 1.2 ad u_int8_t version;
313 1.2 ad u_int16_t reserved0;
314 1.2 ad u_int32_t changeindicator;
315 1.2 ad u_int32_t reserved1[2];
316 1.2 ad struct i2o_systab_entry entry[1];
317 1.2 ad } __attribute__ ((__packed__));
318 1.2 ad
319 1.1 ad /*
320 1.1 ad * IOP status record. Bitfields are broken down as follows:
321 1.1 ad *
322 1.1 ad * Bits Field Meaning
323 1.1 ad * ----- -------------- ---------------------------------------------------
324 1.1 ad * 0-11 iopid IOP ID.
325 1.1 ad * 12-15 iopid Reserved.
326 1.1 ad * 16-31 iopid Host unit ID.
327 1.1 ad * 0-11 segnumber Segment number.
328 1.1 ad * 12-15 segnumber I2O version.
329 1.1 ad * 16-23 segnumber IOP state.
330 1.1 ad * 24-31 segnumber Messenger type.
331 1.1 ad */
332 1.1 ad struct i2o_status {
333 1.1 ad u_int16_t orgid;
334 1.1 ad u_int16_t reserved0;
335 1.2 ad u_int32_t iopid;
336 1.2 ad u_int32_t segnumber;
337 1.1 ad u_int16_t inboundmframesize;
338 1.1 ad u_int8_t initcode;
339 1.1 ad u_int8_t reserved1;
340 1.1 ad u_int32_t maxinboundmframes;
341 1.1 ad u_int32_t currentinboundmframes;
342 1.1 ad u_int32_t maxoutboundmframes;
343 1.1 ad u_int8_t productid[24];
344 1.1 ad u_int32_t expectedlctsize;
345 1.1 ad u_int32_t iopcaps;
346 1.1 ad u_int32_t desiredprivmemsize;
347 1.1 ad u_int32_t currentprivmemsize;
348 1.1 ad u_int32_t currentprivmembase;
349 1.1 ad u_int32_t desiredpriviosize;
350 1.1 ad u_int32_t currentpriviosize;
351 1.1 ad u_int32_t currentpriviobase;
352 1.1 ad u_int8_t reserved2[3];
353 1.1 ad u_int8_t syncbyte;
354 1.1 ad } __attribute__ ((__packed__));
355 1.1 ad
356 1.1 ad #define I2O_IOP_STATE_INITIALIZING 0x01
357 1.1 ad #define I2O_IOP_STATE_RESET 0x02
358 1.1 ad #define I2O_IOP_STATE_HOLD 0x04
359 1.1 ad #define I2O_IOP_STATE_READY 0x05
360 1.1 ad #define I2O_IOP_STATE_OPERATIONAL 0x08
361 1.1 ad #define I2O_IOP_STATE_FAILED 0x10
362 1.1 ad #define I2O_IOP_STATE_FAULTED 0x11
363 1.1 ad
364 1.1 ad /*
365 1.1 ad * ================= Executive class messages =================
366 1.1 ad */
367 1.1 ad
368 1.1 ad #define I2O_EXEC_STATUS_GET 0xa0
369 1.1 ad struct i2o_exec_status_get {
370 1.1 ad u_int32_t msgflags;
371 1.1 ad u_int32_t msgfunc;
372 1.1 ad u_int32_t reserved[4];
373 1.1 ad u_int32_t addrlow;
374 1.1 ad u_int32_t addrhigh;
375 1.1 ad u_int32_t length;
376 1.1 ad } __attribute__ ((__packed__));
377 1.1 ad
378 1.1 ad #define I2O_EXEC_OUTBOUND_INIT 0xa1
379 1.1 ad struct i2o_exec_outbound_init {
380 1.1 ad u_int32_t msgflags;
381 1.1 ad u_int32_t msgfunc;
382 1.1 ad u_int32_t msgictx;
383 1.1 ad u_int32_t msgtctx;
384 1.1 ad u_int32_t pagesize;
385 1.1 ad u_int32_t flags; /* init code, outbound msg size */
386 1.1 ad } __attribute__ ((__packed__));
387 1.1 ad
388 1.1 ad #define I2O_EXEC_OUTBOUND_INIT_IN_PROGRESS 1
389 1.1 ad #define I2O_EXEC_OUTBOUND_INIT_REJECTED 2
390 1.1 ad #define I2O_EXEC_OUTBOUND_INIT_FAILED 3
391 1.1 ad #define I2O_EXEC_OUTBOUND_INIT_COMPLETE 4
392 1.1 ad
393 1.1 ad #define I2O_EXEC_LCT_NOTIFY 0xa2
394 1.1 ad struct i2o_exec_lct_notify {
395 1.1 ad u_int32_t msgflags;
396 1.1 ad u_int32_t msgfunc;
397 1.1 ad u_int32_t msgictx;
398 1.1 ad u_int32_t msgtctx;
399 1.1 ad u_int32_t classid;
400 1.1 ad u_int32_t changeindicator;
401 1.1 ad } __attribute__ ((__packed__));
402 1.1 ad
403 1.1 ad #define I2O_EXEC_SYS_TAB_SET 0xa3
404 1.1 ad struct i2o_exec_sys_tab_set {
405 1.1 ad u_int32_t msgflags;
406 1.1 ad u_int32_t msgfunc;
407 1.1 ad u_int32_t msgictx;
408 1.1 ad u_int32_t msgtctx;
409 1.1 ad u_int32_t iopid;
410 1.1 ad u_int32_t segnumber;
411 1.1 ad } __attribute__ ((__packed__));
412 1.1 ad
413 1.1 ad #define I2O_EXEC_HRT_GET 0xa8
414 1.1 ad struct i2o_exec_hrt_get {
415 1.1 ad u_int32_t msgflags;
416 1.1 ad u_int32_t msgfunc;
417 1.1 ad u_int32_t msgictx;
418 1.1 ad u_int32_t msgtctx;
419 1.1 ad } __attribute__ ((__packed__));
420 1.1 ad
421 1.1 ad #define I2O_EXEC_IOP_RESET 0xbd
422 1.1 ad struct i2o_exec_iop_reset {
423 1.1 ad u_int32_t msgflags;
424 1.1 ad u_int32_t msgfunc;
425 1.1 ad u_int32_t reserved[4];
426 1.1 ad u_int32_t statuslow;
427 1.1 ad u_int32_t statushigh;
428 1.1 ad } __attribute__ ((__packed__));
429 1.1 ad
430 1.1 ad #define I2O_RESET_IN_PROGRESS 0x01
431 1.1 ad #define I2O_RESET_REJECTED 0x02
432 1.1 ad
433 1.1 ad /*
434 1.2 ad * ================= Executive class parameter groups =================
435 1.2 ad */
436 1.2 ad
437 1.2 ad #define I2O_PARAM_EXEC_LCT_SCALAR 0x0101
438 1.2 ad #define I2O_PARAM_EXEC_LCT_TABLE 0x0102
439 1.2 ad
440 1.2 ad /*
441 1.1 ad * ================= HBA class messages =================
442 1.1 ad */
443 1.1 ad
444 1.1 ad #define I2O_HBA_BUS_SCAN 0x89
445 1.1 ad struct i2o_hba_bus_scan {
446 1.1 ad u_int32_t msgflags;
447 1.1 ad u_int32_t msgfunc;
448 1.1 ad u_int32_t msgictx;
449 1.1 ad u_int32_t msgtctx;
450 1.2 ad } __attribute__ ((__packed__));
451 1.1 ad
452 1.1 ad /*
453 1.1 ad * ================= HBA class parameter groups =================
454 1.1 ad */
455 1.1 ad
456 1.1 ad #define I2O_PARAM_HBA_CTLR_INFO 0x0000
457 1.1 ad struct i2o_param_hba_ctlr_info {
458 1.1 ad u_int8_t bustype;
459 1.1 ad u_int8_t busstate;
460 1.1 ad u_int16_t reserved;
461 1.1 ad u_int8_t busname[12];
462 1.1 ad } __attribute__ ((__packed__));
463 1.1 ad
464 1.1 ad #define I2O_HBA_BUS_GENERIC 0x00
465 1.1 ad #define I2O_HBA_BUS_SCSI 0x01
466 1.1 ad #define I2O_HBA_BUS_FCA 0x10
467 1.1 ad
468 1.1 ad #define I2O_PARAM_HBA_SCSI_PORT_INFO 0x0001
469 1.1 ad struct i2o_param_hba_scsi_port_info {
470 1.1 ad u_int8_t physicalif;
471 1.1 ad u_int8_t electricalif;
472 1.1 ad u_int8_t isosynchonrous;
473 1.1 ad u_int8_t connectortype;
474 1.1 ad u_int8_t connectorgender;
475 1.1 ad u_int8_t reserved1;
476 1.1 ad u_int16_t reserved2;
477 1.1 ad u_int32_t maxnumberofdevices;
478 1.1 ad } __attribute__ ((__packed__));
479 1.1 ad
480 1.1 ad #define I2O_PARAM_HBA_SCSI_CTLR_INFO 0x0200
481 1.1 ad struct i2o_param_hba_scsi_ctlr_info {
482 1.1 ad u_int8_t scsitype;
483 1.1 ad u_int8_t protection;
484 1.1 ad u_int8_t settings;
485 1.1 ad u_int8_t reserved;
486 1.1 ad u_int32_t initiatorid;
487 1.1 ad u_int64_t scanlun0only;
488 1.1 ad u_int16_t disabledevice;
489 1.1 ad u_int8_t maxoffset;
490 1.1 ad u_int8_t maxdatawidth;
491 1.1 ad u_int64_t maxsyncrate;
492 1.1 ad } __attribute__ ((__packed__));
493 1.1 ad
494 1.1 ad /*
495 1.1 ad * ================= Utility messages =================
496 1.1 ad */
497 1.1 ad
498 1.2 ad #define I2O_UTIL_ABORT 0x01
499 1.2 ad struct i2o_util_abort {
500 1.2 ad u_int32_t msgflags;
501 1.2 ad u_int32_t msgfunc;
502 1.2 ad u_int32_t msgictx;
503 1.2 ad u_int32_t msgtctx;
504 1.2 ad u_int32_t flags; /* abort type and function type */
505 1.2 ad u_int32_t tctxabort;
506 1.2 ad } __attribute__ ((__packed__));
507 1.2 ad
508 1.2 ad #define I2O_UTIL_ABORT_EXACT 0x00000000
509 1.2 ad #define I2O_UTIL_ABORT_FUNCTION 0x00010000
510 1.2 ad #define I2O_UTIL_ABORT_TRANSACTION 0x00020000
511 1.2 ad #define I2O_UTIL_ABORT_WILD 0x00030000
512 1.2 ad
513 1.2 ad #define I2O_UTIL_ABORT_CLEAN 0x00040000
514 1.2 ad
515 1.2 ad struct i2o_util_abort_reply {
516 1.2 ad u_int32_t msgflags;
517 1.2 ad u_int32_t msgfunc;
518 1.2 ad u_int32_t msgictx;
519 1.2 ad u_int32_t msgtctx;
520 1.2 ad u_int32_t count;
521 1.2 ad } __attribute__ ((__packed__));
522 1.2 ad
523 1.2 ad #define I2O_UTIL_PARAMS_SET 0x05
524 1.1 ad #define I2O_UTIL_PARAMS_GET 0x06
525 1.2 ad struct i2o_util_params_op {
526 1.1 ad u_int32_t msgflags;
527 1.1 ad u_int32_t msgfunc;
528 1.1 ad u_int32_t msgictx;
529 1.1 ad u_int32_t msgtctx;
530 1.1 ad u_int32_t flags;
531 1.1 ad } __attribute__ ((__packed__));
532 1.1 ad
533 1.1 ad #define I2O_PARAMS_OP_FIELD_GET 1
534 1.1 ad #define I2O_PARAMS_OP_LIST_GET 2
535 1.1 ad #define I2O_PARAMS_OP_MORE_GET 3
536 1.1 ad #define I2O_PARAMS_OP_SIZE_GET 4
537 1.1 ad #define I2O_PARAMS_OP_TABLE_GET 5
538 1.1 ad #define I2O_PARAMS_OP_FIELD_SET 6
539 1.1 ad #define I2O_PARAMS_OP_LIST_SET 7
540 1.1 ad #define I2O_PARAMS_OP_ROW_ADD 8
541 1.1 ad #define I2O_PARAMS_OP_ROW_DELETE 9
542 1.1 ad #define I2O_PARAMS_OP_TABLE_CLEAR 10
543 1.1 ad
544 1.1 ad struct i2o_param_op_list_header {
545 1.1 ad u_int16_t count;
546 1.1 ad u_int16_t reserved;
547 1.1 ad } __attribute__ ((__packed__));
548 1.1 ad
549 1.1 ad struct i2o_param_op_all_template {
550 1.1 ad u_int16_t operation;
551 1.1 ad u_int16_t group;
552 1.1 ad u_int16_t fieldcount;
553 1.2 ad u_int16_t fields[1];
554 1.1 ad } __attribute__ ((__packed__));
555 1.1 ad
556 1.1 ad struct i2o_param_op_results {
557 1.1 ad u_int16_t count;
558 1.1 ad u_int16_t reserved;
559 1.1 ad } __attribute__ ((__packed__));
560 1.1 ad
561 1.1 ad struct i2o_param_read_results {
562 1.1 ad u_int16_t blocksize;
563 1.1 ad u_int8_t blockstatus;
564 1.1 ad u_int8_t errorinfosize;
565 1.1 ad } __attribute__ ((__packed__));
566 1.1 ad
567 1.2 ad struct i2o_param_table_results {
568 1.2 ad u_int16_t blocksize;
569 1.2 ad u_int8_t blockstatus;
570 1.2 ad u_int8_t errorinfosize;
571 1.2 ad u_int16_t rowcount;
572 1.2 ad u_int16_t moreflag;
573 1.2 ad } __attribute__ ((__packed__));
574 1.2 ad
575 1.1 ad #define I2O_UTIL_CLAIM 0x09
576 1.1 ad struct i2o_util_claim {
577 1.1 ad u_int32_t msgflags;
578 1.1 ad u_int32_t msgfunc;
579 1.1 ad u_int32_t msgictx;
580 1.1 ad u_int32_t msgtctx;
581 1.1 ad u_int32_t flags;
582 1.1 ad } __attribute__ ((__packed__));
583 1.1 ad
584 1.1 ad #define I2O_UTIL_CLAIM_RESET_SENSITIVE 0x00000002
585 1.1 ad #define I2O_UTIL_CLAIM_STATE_SENSITIVE 0x00000004
586 1.1 ad #define I2O_UTIL_CLAIM_CAPACITY_SENSITIVE 0x00000008
587 1.1 ad #define I2O_UTIL_CLAIM_NO_PEER_SERVICE 0x00000010
588 1.1 ad #define I2O_UTIL_CLAIM_NO_MANAGEMENT_SERVICE 0x00000020
589 1.2 ad
590 1.1 ad #define I2O_UTIL_CLAIM_PRIMARY_USER 0x01000000
591 1.1 ad #define I2O_UTIL_CLAIM_AUTHORIZED_USER 0x02000000
592 1.1 ad #define I2O_UTIL_CLAIM_SECONDARY_USER 0x03000000
593 1.1 ad #define I2O_UTIL_CLAIM_MANAGEMENT_USER 0x04000000
594 1.1 ad
595 1.2 ad #define I2O_UTIL_CLAIM_RELEASE 0x0b
596 1.2 ad struct i2o_util_claim_release {
597 1.2 ad u_int32_t msgflags;
598 1.2 ad u_int32_t msgfunc;
599 1.2 ad u_int32_t msgictx;
600 1.2 ad u_int32_t msgtctx;
601 1.2 ad u_int32_t flags; /* User flags as per I2O_UTIL_CLAIM */
602 1.2 ad } __attribute__ ((__packed__));
603 1.2 ad
604 1.2 ad #define I2O_UTIL_CLAIM_RELEASE_CONDITIONAL 0x00000001
605 1.2 ad
606 1.2 ad #define I2O_UTIL_CONFIG_DIALOG 0x10
607 1.2 ad struct i2o_util_config_dialog {
608 1.2 ad u_int32_t msgflags;
609 1.2 ad u_int32_t msgfunc;
610 1.2 ad u_int32_t msgictx;
611 1.2 ad u_int32_t msgtctx;
612 1.2 ad u_int32_t pageno;
613 1.2 ad } __attribute__ ((__packed__));
614 1.2 ad
615 1.2 ad #define I2O_UTIL_EVENT_REGISTER 0x13
616 1.2 ad struct i2o_util_event_register {
617 1.2 ad u_int32_t msgflags;
618 1.2 ad u_int32_t msgfunc;
619 1.2 ad u_int32_t msgictx;
620 1.2 ad u_int32_t msgtctx;
621 1.2 ad u_int32_t eventmask;
622 1.2 ad } __attribute__ ((__packed__));
623 1.2 ad
624 1.2 ad struct i2o_util_event_register_reply {
625 1.2 ad u_int32_t msgflags;
626 1.2 ad u_int32_t msgfunc;
627 1.2 ad u_int32_t msgictx;
628 1.2 ad u_int32_t msgtctx;
629 1.2 ad u_int32_t event;
630 1.2 ad u_int32_t eventdata[1];
631 1.2 ad } __attribute__ ((__packed__));
632 1.2 ad
633 1.2 ad /* Generic events. */
634 1.2 ad #define I2O_EVENT_GEN_DEVICE_STATE 0x00400000
635 1.2 ad #define I2O_EVENT_GEN_VENDOR_EVENT 0x00800000
636 1.2 ad #define I2O_EVENT_GEN_FIELD_MODIFIED 0x01000000
637 1.2 ad #define I2O_EVENT_GEN_EVENT_MASK_MODIFIED 0x02000000
638 1.2 ad #define I2O_EVENT_GEN_DEVICE_RESET 0x04000000
639 1.2 ad #define I2O_EVENT_GEN_CAPABILITY_CHANGE 0x08000000
640 1.2 ad #define I2O_EVENT_GEN_LOCK_RELEASE 0x10000000
641 1.2 ad #define I2O_EVENT_GEN_NEED_CONFIGURATION 0x20000000
642 1.2 ad #define I2O_EVENT_GEN_GENERAL_WARNING 0x40000000
643 1.2 ad #define I2O_EVENT_GEN_STATE_CHANGE 0x80000000
644 1.2 ad
645 1.2 ad /* Executive class events. */
646 1.2 ad #define I2O_EVENT_EXEC_RESOURCE_LIMITS 0x00000001
647 1.2 ad #define I2O_EVENT_EXEC_CONNECTION_FAIL 0x00000002
648 1.2 ad #define I2O_EVENT_EXEC_ADAPTER_FAULT 0x00000004
649 1.2 ad #define I2O_EVENT_EXEC_POWER_FAIL 0x00000008
650 1.2 ad #define I2O_EVENT_EXEC_RESET_PENDING 0x00000010
651 1.2 ad #define I2O_EVENT_EXEC_RESET_IMMINENT 0x00000020
652 1.2 ad #define I2O_EVENT_EXEC_HARDWARE_FAIL 0x00000040
653 1.2 ad #define I2O_EVENT_EXEC_XCT_CHANGE 0x00000080
654 1.2 ad #define I2O_EVENT_EXEC_NEW_LCT_ENTRY 0x00000100
655 1.2 ad #define I2O_EVENT_EXEC_MODIFIED_LCT 0x00000200
656 1.2 ad #define I2O_EVENT_EXEC_DDM_AVAILIBILITY 0x00000400
657 1.2 ad
658 1.3 ad /* LAN class events. */
659 1.3 ad #define I2O_EVENT_LAN_LINK_DOWN 0x00000001
660 1.3 ad #define I2O_EVENT_LAN_LINK_UP 0x00000002
661 1.3 ad #define I2O_EVENT_LAN_MEDIA_CHANGE 0x00000004
662 1.3 ad
663 1.1 ad /*
664 1.1 ad * ================= Utility parameter groups =================
665 1.1 ad */
666 1.1 ad
667 1.1 ad #define I2O_PARAM_DEVICE_IDENTITY 0xf100
668 1.1 ad struct i2o_param_device_identity {
669 1.1 ad u_int32_t classid;
670 1.1 ad u_int16_t ownertid;
671 1.1 ad u_int16_t parenttid;
672 1.1 ad u_int8_t vendorinfo[16];
673 1.1 ad u_int8_t productinfo[16];
674 1.1 ad u_int8_t description[16];
675 1.1 ad u_int8_t revlevel[8];
676 1.1 ad u_int8_t snformat;
677 1.1 ad u_int8_t serialnumber[1];
678 1.1 ad } __attribute__ ((__packed__));
679 1.1 ad
680 1.1 ad #define I2O_PARAM_DDM_IDENTITY 0xf101
681 1.1 ad struct i2o_param_ddm_identity {
682 1.1 ad u_int16_t ddmtid;
683 1.1 ad u_int8_t name[24];
684 1.1 ad u_int8_t revlevel[8];
685 1.1 ad u_int8_t snformat;
686 1.1 ad u_int8_t serialnumber[12];
687 1.1 ad } __attribute__ ((__packed__));
688 1.1 ad
689 1.1 ad /*
690 1.1 ad * ================= Block storage class messages =================
691 1.1 ad */
692 1.1 ad
693 1.1 ad #define I2O_RBS_BLOCK_READ 0x30
694 1.1 ad struct i2o_rbs_block_read {
695 1.1 ad u_int32_t msgflags;
696 1.1 ad u_int32_t msgfunc;
697 1.1 ad u_int32_t msgictx;
698 1.1 ad u_int32_t msgtctx;
699 1.1 ad u_int32_t flags; /* flags, time multipler, read ahead */
700 1.1 ad u_int32_t datasize;
701 1.1 ad u_int32_t lowoffset;
702 1.1 ad u_int32_t highoffset;
703 1.1 ad } __attribute__ ((__packed__));
704 1.1 ad
705 1.1 ad #define I2O_RBS_BLOCK_READ_NO_RETRY 0x01
706 1.1 ad #define I2O_RBS_BLOCK_READ_SOLO 0x02
707 1.1 ad #define I2O_RBS_BLOCK_READ_CACHE_READ 0x04
708 1.1 ad #define I2O_RBS_BLOCK_READ_PREFETCH 0x08
709 1.1 ad #define I2O_RBS_BLOCK_READ_CACHE_ONLY 0x10
710 1.1 ad
711 1.1 ad #define I2O_RBS_BLOCK_WRITE 0x31
712 1.1 ad struct i2o_rbs_block_write {
713 1.1 ad u_int32_t msgflags;
714 1.1 ad u_int32_t msgfunc;
715 1.1 ad u_int32_t msgictx;
716 1.1 ad u_int32_t msgtctx;
717 1.1 ad u_int32_t flags; /* flags, time multipler */
718 1.1 ad u_int32_t datasize;
719 1.1 ad u_int32_t lowoffset;
720 1.1 ad u_int32_t highoffset;
721 1.1 ad } __attribute__ ((__packed__));
722 1.1 ad
723 1.1 ad #define I2O_RBS_BLOCK_WRITE_NO_RETRY 0x01
724 1.1 ad #define I2O_RBS_BLOCK_WRITE_SOLO 0x02
725 1.1 ad #define I2O_RBS_BLOCK_WRITE_CACHE_NONE 0x04
726 1.1 ad #define I2O_RBS_BLOCK_WRITE_CACHE_WT 0x08
727 1.1 ad #define I2O_RBS_BLOCK_WRITE_CACHE_WB 0x10
728 1.1 ad
729 1.1 ad #define I2O_RBS_CACHE_FLUSH 0x37
730 1.1 ad struct i2o_rbs_cache_flush {
731 1.1 ad u_int32_t msgflags;
732 1.1 ad u_int32_t msgfunc;
733 1.1 ad u_int32_t msgictx;
734 1.1 ad u_int32_t msgtctx;
735 1.1 ad u_int32_t flags; /* flags, time multipler */
736 1.1 ad } __attribute__ ((__packed__));
737 1.1 ad
738 1.1 ad #define I2O_RBS_MEDIA_MOUNT 0x41
739 1.1 ad struct i2o_rbs_media_mount {
740 1.1 ad u_int32_t msgflags;
741 1.1 ad u_int32_t msgfunc;
742 1.1 ad u_int32_t msgictx;
743 1.1 ad u_int32_t msgtctx;
744 1.1 ad u_int32_t mediaid;
745 1.1 ad u_int32_t loadflags;
746 1.1 ad } __attribute__ ((__packed__));
747 1.1 ad
748 1.1 ad #define I2O_RBS_MEDIA_EJECT 0x43
749 1.1 ad struct i2o_rbs_media_eject {
750 1.1 ad u_int32_t msgflags;
751 1.1 ad u_int32_t msgfunc;
752 1.1 ad u_int32_t msgictx;
753 1.1 ad u_int32_t msgtctx;
754 1.1 ad u_int32_t mediaid;
755 1.1 ad } __attribute__ ((__packed__));
756 1.1 ad
757 1.1 ad #define I2O_RBS_MEDIA_LOCK 0x49
758 1.1 ad struct i2o_rbs_media_lock {
759 1.1 ad u_int32_t msgflags;
760 1.1 ad u_int32_t msgfunc;
761 1.1 ad u_int32_t msgictx;
762 1.1 ad u_int32_t msgtctx;
763 1.1 ad u_int32_t mediaid;
764 1.1 ad } __attribute__ ((__packed__));
765 1.1 ad
766 1.1 ad #define I2O_RBS_MEDIA_UNLOCK 0x4b
767 1.1 ad struct i2o_rbs_media_unlock {
768 1.1 ad u_int32_t msgflags;
769 1.1 ad u_int32_t msgfunc;
770 1.1 ad u_int32_t msgictx;
771 1.1 ad u_int32_t msgtctx;
772 1.1 ad u_int32_t mediaid;
773 1.1 ad } __attribute__ ((__packed__));
774 1.1 ad
775 1.1 ad /* Standard RBS reply frame. */
776 1.1 ad struct i2o_rbs_reply {
777 1.1 ad u_int32_t msgflags;
778 1.1 ad u_int32_t msgfunc;
779 1.1 ad u_int32_t msgictx;
780 1.1 ad u_int32_t msgtctx;
781 1.1 ad u_int16_t detail;
782 1.3 ad u_int8_t retrycount;
783 1.1 ad u_int8_t reqstatus;
784 1.1 ad u_int32_t transfercount;
785 1.1 ad u_int64_t offset; /* Error replies only */
786 1.1 ad } __attribute__ ((__packed__));
787 1.1 ad
788 1.1 ad /*
789 1.1 ad * ================= Block storage class parameter groups =================
790 1.1 ad */
791 1.1 ad
792 1.1 ad #define I2O_PARAM_RBS_DEVICE_INFO 0x0000
793 1.1 ad struct i2o_param_rbs_device_info {
794 1.1 ad u_int8_t type;
795 1.1 ad u_int8_t npaths;
796 1.1 ad u_int16_t powerstate;
797 1.1 ad u_int32_t blocksize;
798 1.1 ad u_int64_t capacity;
799 1.1 ad u_int32_t capabilities;
800 1.1 ad u_int32_t state;
801 1.1 ad } __attribute__ ((__packed__));
802 1.1 ad
803 1.1 ad #define I2O_RBS_TYPE_DIRECT 0x00
804 1.1 ad #define I2O_RBS_TYPE_WORM 0x04
805 1.1 ad #define I2O_RBS_TYPE_CDROM 0x05
806 1.1 ad #define I2O_RBS_TYPE_OPTICAL 0x07
807 1.1 ad
808 1.1 ad #define I2O_RBS_CAP_CACHING 0x00000001
809 1.1 ad #define I2O_RBS_CAP_MULTI_PATH 0x00000002
810 1.1 ad #define I2O_RBS_CAP_DYNAMIC_CAPACITY 0x00000004
811 1.1 ad #define I2O_RBS_CAP_REMOVEABLE_MEDIA 0x00000008
812 1.1 ad #define I2O_RBS_CAP_REMOVEABLE_DEVICE 0x00000010
813 1.1 ad #define I2O_RBS_CAP_READ_ONLY 0x00000020
814 1.1 ad #define I2O_RBS_CAP_LOCKOUT 0x00000040
815 1.1 ad #define I2O_RBS_CAP_BOOT_BYPASS 0x00000080
816 1.1 ad #define I2O_RBS_CAP_COMPRESSION 0x00000100
817 1.1 ad #define I2O_RBS_CAP_DATA_SECURITY 0x00000200
818 1.1 ad #define I2O_RBS_CAP_RAID 0x00000400
819 1.1 ad
820 1.1 ad #define I2O_RBS_STATE_CACHING 0x00000001
821 1.1 ad #define I2O_RBS_STATE_POWERED_ON 0x00000002
822 1.1 ad #define I2O_RBS_STATE_READY 0x00000004
823 1.1 ad #define I2O_RBS_STATE_MEDIA_LOADED 0x00000008
824 1.1 ad #define I2O_RBS_STATE_DEVICE_LOADED 0x00000010
825 1.1 ad #define I2O_RBS_STATE_READ_ONLY 0x00000020
826 1.1 ad #define I2O_RBS_STATE_LOCKOUT 0x00000040
827 1.1 ad #define I2O_RBS_STATE_BOOT_BYPASS 0x00000080
828 1.1 ad #define I2O_RBS_STATE_COMPRESSION 0x00000100
829 1.1 ad #define I2O_RBS_STATE_DATA_SECURITY 0x00000200
830 1.1 ad #define I2O_RBS_STATE_RAID 0x00000400
831 1.1 ad
832 1.2 ad #define I2O_PARAM_RBS_OPERATION 0x0001
833 1.2 ad struct i2o_param_rbs_operation {
834 1.2 ad u_int8_t autoreass;
835 1.2 ad u_int8_t reasstolerance;
836 1.2 ad u_int8_t numretries;
837 1.2 ad u_int8_t reserved0;
838 1.2 ad u_int32_t reasssize;
839 1.2 ad u_int32_t expectedtimeout;
840 1.2 ad u_int32_t rwvtimeout;
841 1.2 ad u_int32_t rwvtimeoutbase;
842 1.2 ad u_int32_t timeoutbase;
843 1.2 ad u_int32_t orderedreqdepth;
844 1.2 ad u_int32_t atomicwritesize;
845 1.2 ad } __attribute__ ((__packed__));
846 1.2 ad
847 1.1 ad #define I2O_PARAM_RBS_CACHE_CONTROL 0x0003
848 1.1 ad struct i2o_param_rbs_cache_control {
849 1.1 ad u_int32_t totalcachesize;
850 1.1 ad u_int32_t readcachesize;
851 1.1 ad u_int32_t writecachesize;
852 1.1 ad u_int8_t writepolicy;
853 1.1 ad u_int8_t readpolicy;
854 1.1 ad u_int8_t errorcorrection;
855 1.1 ad u_int8_t reserved;
856 1.1 ad } __attribute__ ((__packed__));
857 1.1 ad
858 1.1 ad /*
859 1.1 ad * ================= SCSI peripheral class messages =================
860 1.1 ad */
861 1.1 ad
862 1.1 ad #define I2O_SCSI_DEVICE_RESET 0x27
863 1.1 ad struct i2o_scsi_device_reset {
864 1.1 ad u_int32_t msgflags;
865 1.1 ad u_int32_t msgfunc;
866 1.1 ad u_int32_t msgictx;
867 1.1 ad u_int32_t msgtctx;
868 1.1 ad } __attribute__ ((__packed__));
869 1.1 ad
870 1.1 ad #define I2O_SCSI_SCB_EXEC 0x81
871 1.1 ad struct i2o_scsi_scb_exec {
872 1.1 ad u_int32_t msgflags;
873 1.1 ad u_int32_t msgfunc;
874 1.1 ad u_int32_t msgictx;
875 1.1 ad u_int32_t msgtctx;
876 1.1 ad u_int32_t flags; /* CDB length and flags */
877 1.1 ad u_int8_t cdb[16];
878 1.1 ad u_int32_t datalen;
879 1.1 ad } __attribute__ ((__packed__));
880 1.1 ad
881 1.1 ad #define I2O_SCB_FLAG_SENSE_DATA_IN_MESSAGE 0x00200000
882 1.1 ad #define I2O_SCB_FLAG_SENSE_DATA_IN_BUFFER 0x00600000
883 1.1 ad #define I2O_SCB_FLAG_SIMPLE_QUEUE_TAG 0x00800000
884 1.1 ad #define I2O_SCB_FLAG_HEAD_QUEUE_TAG 0x01000000
885 1.1 ad #define I2O_SCB_FLAG_ORDERED_QUEUE_TAG 0x01800000
886 1.1 ad #define I2O_SCB_FLAG_ACA_QUEUE_TAG 0x02000000
887 1.1 ad #define I2O_SCB_FLAG_ENABLE_DISCONNECT 0x20000000
888 1.1 ad #define I2O_SCB_FLAG_XFER_FROM_DEVICE 0x40000000
889 1.1 ad #define I2O_SCB_FLAG_XFER_TO_DEVICE 0x80000000
890 1.1 ad
891 1.1 ad #define I2O_SCSI_SCB_ABORT 0x83
892 1.1 ad struct i2o_scsi_scb_abort {
893 1.1 ad u_int32_t msgflags;
894 1.1 ad u_int32_t msgfunc;
895 1.1 ad u_int32_t msgictx;
896 1.1 ad u_int32_t msgtctx;
897 1.1 ad u_int32_t tctxabort;
898 1.1 ad } __attribute__ ((__packed__));
899 1.1 ad
900 1.1 ad struct i2o_scsi_reply {
901 1.1 ad u_int32_t msgflags;
902 1.1 ad u_int32_t msgfunc;
903 1.1 ad u_int32_t msgictx;
904 1.1 ad u_int32_t msgtctx;
905 1.3 ad u_int8_t scsistatus;
906 1.3 ad u_int8_t hbastatus;
907 1.1 ad u_int8_t reserved;
908 1.1 ad u_int8_t reqstatus;
909 1.1 ad u_int32_t datalen;
910 1.1 ad u_int32_t senselen;
911 1.1 ad u_int8_t sense[40];
912 1.1 ad } __attribute__ ((__packed__));
913 1.1 ad
914 1.1 ad #define I2O_SCSI_DSC_SUCCESS 0x00
915 1.1 ad #define I2O_SCSI_DSC_REQUEST_ABORTED 0x02
916 1.1 ad #define I2O_SCSI_DSC_UNABLE_TO_ABORT 0x03
917 1.1 ad #define I2O_SCSI_DSC_COMPLETE_WITH_ERROR 0x04
918 1.1 ad #define I2O_SCSI_DSC_ADAPTER_BUSY 0x05
919 1.1 ad #define I2O_SCSI_DSC_REQUEST_INVALID 0x06
920 1.1 ad #define I2O_SCSI_DSC_PATH_INVALID 0x07
921 1.1 ad #define I2O_SCSI_DSC_DEVICE_NOT_PRESENT 0x08
922 1.1 ad #define I2O_SCSI_DSC_UNABLE_TO_TERMINATE 0x09
923 1.1 ad #define I2O_SCSI_DSC_SELECTION_TIMEOUT 0x0a
924 1.1 ad #define I2O_SCSI_DSC_COMMAND_TIMEOUT 0x0b
925 1.1 ad #define I2O_SCSI_DSC_MR_MESSAGE_RECEIVED 0x0d
926 1.1 ad #define I2O_SCSI_DSC_SCSI_BUS_RESET 0x0e
927 1.1 ad #define I2O_SCSI_DSC_PARITY_ERROR_FAILURE 0x0f
928 1.1 ad #define I2O_SCSI_DSC_AUTOSENSE_FAILED 0x10
929 1.1 ad #define I2O_SCSI_DSC_NO_ADAPTER 0x11
930 1.1 ad #define I2O_SCSI_DSC_DATA_OVERRUN 0x12
931 1.1 ad #define I2O_SCSI_DSC_UNEXPECTED_BUS_FREE 0x13
932 1.1 ad #define I2O_SCSI_DSC_SEQUENCE_FAILURE 0x14
933 1.1 ad #define I2O_SCSI_DSC_REQUEST_LENGTH_ERROR 0x15
934 1.1 ad #define I2O_SCSI_DSC_PROVIDE_FAILURE 0x16
935 1.1 ad #define I2O_SCSI_DSC_BDR_MESSAGE_SENT 0x17
936 1.1 ad #define I2O_SCSI_DSC_REQUEST_TERMINATED 0x18
937 1.1 ad #define I2O_SCSI_DSC_IDE_MESSAGE_SENT 0x33
938 1.1 ad #define I2O_SCSI_DSC_RESOURCE_UNAVAILABLE 0x34
939 1.1 ad #define I2O_SCSI_DSC_UNACKNOWLEDGED_EVENT 0x35
940 1.1 ad #define I2O_SCSI_DSC_MESSAGE_RECEIVED 0x36
941 1.1 ad #define I2O_SCSI_DSC_INVALID_CDB 0x37
942 1.1 ad #define I2O_SCSI_DSC_LUN_INVALID 0x38
943 1.1 ad #define I2O_SCSI_DSC_SCSI_TID_INVALID 0x39
944 1.1 ad #define I2O_SCSI_DSC_FUNCTION_UNAVAILABLE 0x3a
945 1.1 ad #define I2O_SCSI_DSC_NO_NEXUS 0x3b
946 1.1 ad #define I2O_SCSI_DSC_SCSI_IID_INVALID 0x3c
947 1.1 ad #define I2O_SCSI_DSC_CDB_RECEIVED 0x3d
948 1.1 ad #define I2O_SCSI_DSC_LUN_ALREADY_ENABLED 0x3e
949 1.1 ad #define I2O_SCSI_DSC_BUS_BUSY 0x3f
950 1.1 ad #define I2O_SCSI_DSC_QUEUE_FROZEN 0x40
951 1.1 ad
952 1.1 ad /*
953 1.1 ad * ================= SCSI peripheral class parameter groups =================
954 1.1 ad */
955 1.1 ad
956 1.1 ad #define I2O_PARAM_SCSI_DEVICE_INFO 0x0000
957 1.1 ad struct i2o_param_scsi_device_info {
958 1.1 ad u_int8_t devicetype;
959 1.1 ad u_int8_t flags;
960 1.1 ad u_int16_t reserved0;
961 1.1 ad u_int32_t identifier;
962 1.1 ad u_int8_t luninfo[8];
963 1.1 ad u_int32_t queuedepth;
964 1.1 ad u_int8_t reserved1;
965 1.1 ad u_int8_t negoffset;
966 1.1 ad u_int8_t negdatawidth;
967 1.1 ad u_int8_t reserved2;
968 1.1 ad u_int64_t negsyncrate;
969 1.1 ad } __attribute__ ((__packed__));
970 1.3 ad
971 1.3 ad /*
972 1.3 ad * ================= LAN class messages =================
973 1.3 ad */
974 1.3 ad
975 1.3 ad #define I2O_LAN_PACKET_SEND 0x3b
976 1.3 ad struct i2o_lan_packet_send {
977 1.3 ad u_int32_t msgflags;
978 1.3 ad u_int32_t msgfunc;
979 1.3 ad u_int32_t msgictx;
980 1.3 ad u_int32_t tcw;
981 1.4 ad
982 1.4 ad /* SGL follows */
983 1.3 ad };
984 1.3 ad
985 1.3 ad #define I2O_LAN_TCW_ACCESS_PRI_MASK 0x00000007
986 1.3 ad #define I2O_LAN_TCW_SUPPRESS_CRC 0x00000008
987 1.3 ad #define I2O_LAN_TCW_SUPPRESS_LOOPBACK 0x00000010
988 1.3 ad #define I2O_LAN_TCW_CKSUM_NETWORK 0x00000020
989 1.3 ad #define I2O_LAN_TCW_CKSUM_TRANSPORT 0x00000040
990 1.3 ad #define I2O_LAN_TCW_REPLY_BATCH 0x00000000
991 1.3 ad #define I2O_LAN_TCW_REPLY_IMMEDIATELY 0x40000000
992 1.3 ad #define I2O_LAN_TCW_REPLY_UNSUCCESSFUL 0x80000000
993 1.3 ad #define I2O_LAN_TCW_REPLY_NONE 0xc0000000
994 1.3 ad
995 1.3 ad #define I2O_LAN_SDU_SEND 0x3d
996 1.3 ad struct i2o_lan_sdu_send {
997 1.3 ad u_int32_t msgflags;
998 1.3 ad u_int32_t msgfunc;
999 1.3 ad u_int32_t msgictx;
1000 1.3 ad u_int32_t tcw; /* As per PACKET_SEND. */
1001 1.4 ad
1002 1.4 ad /* SGL follows */
1003 1.4 ad };
1004 1.4 ad
1005 1.4 ad struct i2o_lan_send_reply {
1006 1.4 ad u_int32_t msgflags;
1007 1.4 ad u_int32_t msgfunc;
1008 1.4 ad u_int32_t msgictx;
1009 1.4 ad u_int32_t trl;
1010 1.4 ad u_int16_t detail;
1011 1.4 ad u_int8_t reserved;
1012 1.4 ad u_int8_t reqstatus;
1013 1.4 ad u_int32_t tctx[1];
1014 1.3 ad };
1015 1.3 ad
1016 1.3 ad #define I2O_LAN_RECIEVE_POST 0x3e
1017 1.3 ad struct i2o_lan_recieve_post {
1018 1.3 ad u_int32_t msgflags;
1019 1.3 ad u_int32_t msgfunc;
1020 1.3 ad u_int32_t msgictx;
1021 1.3 ad u_int32_t bktcnt;
1022 1.4 ad
1023 1.4 ad /* SGL follows */
1024 1.4 ad };
1025 1.4 ad
1026 1.4 ad struct i2o_lan_pdb {
1027 1.4 ad u_int32_t bctx;
1028 1.4 ad u_int32_t pktoff;
1029 1.4 ad u_int32_t pktlen;
1030 1.4 ad };
1031 1.4 ad
1032 1.4 ad #define I2O_LAN_FRAG_VALID 0x00
1033 1.4 ad #define I2O_LAN_FRAG_VALID_MASK foo
1034 1.4 ad
1035 1.4 ad struct i2o_lan_recieve_reply {
1036 1.4 ad u_int32_t msgflags;
1037 1.4 ad u_int32_t msgfunc;
1038 1.4 ad u_int32_t msgictx;
1039 1.4 ad u_int8_t trlcount;
1040 1.4 ad u_int8_t trlesize;
1041 1.4 ad u_int8_t reserved;
1042 1.4 ad u_int8_t trlflags;
1043 1.4 ad u_int32_t bucketsleft;
1044 1.4 ad struct i2o_lan_pdb pdb[1];
1045 1.3 ad };
1046 1.3 ad
1047 1.3 ad #define I2O_LAN_RESET 0x35
1048 1.3 ad struct i2o_lan_reset {
1049 1.3 ad u_int32_t msgflags;
1050 1.3 ad u_int32_t msgfunc;
1051 1.3 ad u_int32_t msgictx;
1052 1.3 ad u_int16_t reserved;
1053 1.3 ad u_int16_t resrcflags;
1054 1.3 ad };
1055 1.3 ad
1056 1.3 ad #define I2O_LAN_RESRC_RETURN_BUCKETS 0x0001
1057 1.3 ad #define I2O_LAN_RESRC_RETURN_XMITS 0x0002
1058 1.3 ad
1059 1.3 ad #define I2O_LAN_SUSPEND 0x37
1060 1.3 ad struct i2o_lan_suspend {
1061 1.3 ad u_int32_t msgflags;
1062 1.3 ad u_int32_t msgfunc;
1063 1.3 ad u_int32_t msgictx;
1064 1.3 ad u_int16_t reserved;
1065 1.3 ad u_int16_t resrcflags; /* As per RESET. */
1066 1.3 ad };
1067 1.3 ad
1068 1.3 ad #define I2O_LAN_DSC_SUCCESS 0x00
1069 1.3 ad #define I2O_LAN_DSC_DEVICE_FAILURE 0x01
1070 1.3 ad #define I2O_LAN_DSC_DESTINATION_NOT_FOUND 0x02
1071 1.3 ad #define I2O_LAN_DSC_TRANSMIT_ERROR 0x03
1072 1.3 ad #define I2O_LAN_DSC_TRANSMIT_ABORTED 0x04
1073 1.3 ad #define I2O_LAN_DSC_RECEIVE_ERROR 0x05
1074 1.3 ad #define I2O_LAN_DSC_RECEIVE_ABORTED 0x06
1075 1.3 ad #define I2O_LAN_DSC_DMA_ERROR 0x07
1076 1.3 ad #define I2O_LAN_DSC_BAD_PACKET_DETECTED 0x08
1077 1.3 ad #define I2O_LAN_DSC_OUT_OF_MEMORY 0x09
1078 1.3 ad #define I2O_LAN_DSC_BUCKET_OVERRUN 0x0a
1079 1.3 ad #define I2O_LAN_DSC_IOP_INTERNAL_ERROR 0x0b
1080 1.3 ad #define I2O_LAN_DSC_CANCELED 0x0c
1081 1.3 ad #define I2O_LAN_DSC_INVALID_TRANSACTION_CONTEXT 0x0d
1082 1.3 ad #define I2O_LAN_DSC_DEST_ADDRESS_DETECTED 0x0e
1083 1.3 ad #define I2O_LAN_DSC_DEST_ADDRESS_OMITTED 0x0f
1084 1.3 ad #define I2O_LAN_DSC_PARTIAL_PACKET_RETURNED 0x10
1085 1.3 ad #define I2O_LAN_DSC_TEMP_SUSPENDED_STATE 0x11
1086 1.3 ad
1087 1.3 ad /*
1088 1.3 ad * ================= LAN class parameter groups =================
1089 1.3 ad */
1090 1.3 ad
1091 1.3 ad #define I2O_PARAM_LAN_DEVICE_INFO 0x0000
1092 1.3 ad struct i2o_param_lan_device_info {
1093 1.3 ad u_int16_t lantype;
1094 1.3 ad u_int16_t flags;
1095 1.3 ad u_int8_t addrfmt;
1096 1.3 ad u_int8_t reserved1;
1097 1.3 ad u_int16_t reserved2;
1098 1.3 ad u_int32_t minpktsize;
1099 1.3 ad u_int32_t maxpktsize;
1100 1.3 ad u_int8_t hwaddr[8];
1101 1.3 ad u_int64_t maxtxbps;
1102 1.3 ad u_int64_t maxrxbps;
1103 1.3 ad };
1104 1.3 ad
1105 1.3 ad #define I2O_LAN_TYPE_ETHERNET 0x0030
1106 1.3 ad #define I2O_LAN_TYPE_100BASEVG 0x0040
1107 1.3 ad #define I2O_LAN_TYPE_TOKEN_RING 0x0050
1108 1.3 ad #define I2O_LAN_TYPE_FDDI 0x0060
1109 1.3 ad #define I2O_LAN_TYPE_FIBRECHANNEL 0x0070
1110 1.3 ad
1111 1.3 ad #define I2O_PARAM_LAN_MAC_ADDRESS 0x0001
1112 1.3 ad struct i2o_param_lan_mac_address {
1113 1.3 ad u_int8_t activeaddr[8];
1114 1.3 ad u_int8_t localaddr[8];
1115 1.3 ad u_int8_t addrmask[8];
1116 1.3 ad u_int8_t filtermask[4];
1117 1.3 ad u_int8_t hwfiltermask[4];
1118 1.3 ad u_int32_t maxmcastaddr;
1119 1.3 ad u_int32_t maxfilterperfect;
1120 1.3 ad u_int32_t maxfilterimperfect;
1121 1.3 ad };
1122 1.3 ad
1123 1.3 ad #define I2O_PARAM_LAN_MCAST_MAC_ADDRESS 0x0002
1124 1.3 ad /*
1125 1.3 ad * This one's a table, not a scalar.
1126 1.3 ad */
1127 1.3 ad
1128 1.3 ad #define I2O_PARAM_LAN_BATCH_CONTROL 0x0003
1129 1.3 ad struct i2o_param_lan_batch_control {
1130 1.3 ad u_int32_t batchflags;
1131 1.3 ad u_int32_t risingloaddly;
1132 1.3 ad u_int32_t risingloadthresh;
1133 1.3 ad u_int32_t fallingloaddly;
1134 1.3 ad u_int32_t fallingloadthresh;
1135 1.3 ad u_int32_t maxbatchcount;
1136 1.3 ad u_int32_t maxbatchdelay;
1137 1.3 ad u_int32_t transcompdelay;
1138 1.3 ad };
1139 1.3 ad
1140 1.3 ad #define I2O_PARAM_LAN_OPERATION 0x0004
1141 1.3 ad struct i2o_param_lan_operation {
1142 1.3 ad u_int32_t pktprepad;
1143 1.3 ad u_int32_t userflags;
1144 1.3 ad u_int32_t pktorphanlimit;
1145 1.3 ad };
1146 1.3 ad
1147 1.3 ad #define I2O_PARAM_LAN_MEDIA_OPERATION 0x0005
1148 1.3 ad struct i2o_param_lan_media_operation {
1149 1.3 ad u_int32_t connectortype;
1150 1.3 ad u_int32_t connectiontype;
1151 1.3 ad u_int32_t curtxbps;
1152 1.3 ad u_int32_t currxbps;
1153 1.3 ad u_int8_t fullduplex;
1154 1.3 ad u_int8_t linkstatus;
1155 1.3 ad u_int8_t badpkthandling;
1156 1.3 ad };
1157 1.4 ad
1158 1.4 ad #define I2O_LAN_CONNECTOR_OTHER 0x00
1159 1.4 ad #define I2O_LAN_CONNECTOR_UNKNOWN 0x01
1160 1.4 ad #define I2O_LAN_CONNECTOR_AUI 0x02
1161 1.4 ad #define I2O_LAN_CONNECTOR_UTP 0x03
1162 1.4 ad #define I2O_LAN_CONNECTOR_BNC 0x04
1163 1.4 ad #define I2O_LAN_CONNECTOR_RJ45 0x05
1164 1.4 ad #define I2O_LAN_CONNECTOR_STP_DB9 0x06
1165 1.4 ad #define I2O_LAN_CONNECTOR_FIBER_MIC 0x07
1166 1.4 ad #define I2O_LAN_CONNECTOR_APPLE_AUI 0x08
1167 1.4 ad #define I2O_LAN_CONNECTOR_MII 0x09
1168 1.4 ad #define I2O_LAN_CONNECTOR_COPPER_DB9 0x0a
1169 1.4 ad #define I2O_LAN_CONNECTOR_COPPER_AW 0x0b
1170 1.4 ad #define I2O_LAN_CONNECTOR_OPTICAL_LW 0x0c
1171 1.4 ad #define I2O_LAN_CONNECTOR_SIP 0x0d
1172 1.4 ad #define I2O_LAN_CONNECTOR_OPTICAL_SW 0x0e
1173 1.4 ad
1174 1.4 ad #define I2O_LAN_CONNECTION_UNKNOWN 0x0000
1175 1.4 ad
1176 1.4 ad #define I2O_LAN_CONNECTION_ETHERNET_AUI 0x0301
1177 1.4 ad #define I2O_LAN_CONNECTION_ETHERNET_10BASE5 0x0302
1178 1.4 ad #define I2O_LAN_CONNECTION_ETHERNET_FOIRL 0x0303
1179 1.4 ad #define I2O_LAN_CONNECTION_ETHERNET_10BASE2 0x0304
1180 1.4 ad #define I2O_LAN_CONNECTION_ETHERNET_10BROAD36 0x0305
1181 1.4 ad #define I2O_LAN_CONNECTION_ETHERNET_10BASET 0x0306
1182 1.4 ad #define I2O_LAN_CONNECTION_ETHERNET_10BASEFP 0x0307
1183 1.4 ad #define I2O_LAN_CONNECTION_ETHERNET_10BASEFB 0x0308
1184 1.4 ad #define I2O_LAN_CONNECTION_ETHERNET_10BASEFL 0x0309
1185 1.4 ad #define I2O_LAN_CONNECTION_ETHERNET_100BASETX 0x030a
1186 1.4 ad #define I2O_LAN_CONNECTION_ETHERNET_100BASEFX 0x030b
1187 1.4 ad #define I2O_LAN_CONNECTION_ETHERNET_100BASET4 0x030c
1188 1.4 ad
1189 1.4 ad #define I2O_LAN_CONNECTION_100BASEVG_100BASEVG 0x0401
1190 1.4 ad
1191 1.4 ad #define I2O_LAN_CONNECTION_TOKEN_RING_4MBIT 0x0501
1192 1.4 ad #define I2O_LAN_CONNECTION_TOKEN_RING_16MBIT 0x0502
1193 1.4 ad
1194 1.4 ad #define I2O_LAN_CONNECTION_FDDI_125MBIT 0x0601
1195 1.4 ad
1196 1.4 ad #define I2O_LAN_CONNECTION_FIBRECHANNEL_P2P 0x0701
1197 1.4 ad #define I2O_LAN_CONNECTION_FIBRECHANNEL_AL 0x0702
1198 1.4 ad #define I2O_LAN_CONNECTION_FIBRECHANNEL_PL 0x0703
1199 1.4 ad #define I2O_LAN_CONNECTION_FIBRECHANNEL_F 0x0704
1200 1.4 ad
1201 1.4 ad #define I2O_LAN_CONNECTION_OTHER_EMULATED 0x0f00
1202 1.4 ad #define I2O_LAN_CONNECTION_OTHER_OTHER 0x0f01
1203 1.1 ad
1204 1.1 ad #endif /* !defined _I2O_I2O_H_ */
1205