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