xref: /netbsd-src/sys/dev/i2o/i2o.h (revision 46e8a23a659f05e99a6b6a845d54bd9a17b14ab6)
1*46e8a23aSad /*	$NetBSD: i2o.h,v 1.18 2023/09/07 20:03:25 ad Exp $	*/
2d49fd135Sad 
3d49fd135Sad /*-
4ebf51109Sad  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
5d49fd135Sad  * All rights reserved.
6d49fd135Sad  *
7d49fd135Sad  * This code is derived from software contributed to The NetBSD Foundation
8d49fd135Sad  * by Andrew Doran.
9d49fd135Sad  *
10d49fd135Sad  * Redistribution and use in source and binary forms, with or without
11d49fd135Sad  * modification, are permitted provided that the following conditions
12d49fd135Sad  * are met:
13d49fd135Sad  * 1. Redistributions of source code must retain the above copyright
14d49fd135Sad  *    notice, this list of conditions and the following disclaimer.
15d49fd135Sad  * 2. Redistributions in binary form must reproduce the above copyright
16d49fd135Sad  *    notice, this list of conditions and the following disclaimer in the
17d49fd135Sad  *    documentation and/or other materials provided with the distribution.
18d49fd135Sad  *
19d49fd135Sad  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20d49fd135Sad  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21d49fd135Sad  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22d49fd135Sad  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23d49fd135Sad  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24d49fd135Sad  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25d49fd135Sad  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26d49fd135Sad  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27d49fd135Sad  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28d49fd135Sad  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29d49fd135Sad  * POSSIBILITY OF SUCH DAMAGE.
30d49fd135Sad  */
31d49fd135Sad 
32d49fd135Sad /*
33ebf51109Sad  * Structures and constants, as presented by the I2O specification revision
34ebf51109Sad  * 1.5 (obtainable from http://www.intelligent-io.com/).  Currently, only
35*46e8a23aSad  * what's useful to us is defined in this file.  LAN defs used to be here
36*46e8a23aSad  * but were removed as they're useless.
37d49fd135Sad  */
38d49fd135Sad 
39d49fd135Sad #ifndef	_I2O_I2O_H_
40d49fd135Sad #define	_I2O_I2O_H_
41d49fd135Sad 
4279203164Sriastradh #include <sys/cdefs.h>
4379203164Sriastradh #include <sys/types.h>
4479203164Sriastradh 
45d49fd135Sad /*
46c0177219Swiz  * ================= Miscellaneous definitions =================
47d49fd135Sad  */
48d49fd135Sad 
49af9d4c4fSad /* Organisation IDs */
50af9d4c4fSad #define	I2O_ORG_DPT			0x001b
51ebf51109Sad #define	I2O_ORG_INTEL			0x0028
52af9d4c4fSad #define	I2O_ORG_AMI			0x1000
53af9d4c4fSad 
54d49fd135Sad /* Macros to assist in building message headers */
55d49fd135Sad #define	I2O_MSGFLAGS(s)		(I2O_VERSION_11 | (sizeof(struct s) << 14))
56d49fd135Sad #define	I2O_MSGFUNC(t, f)	((t) | (I2O_TID_HOST << 12) | ((f) << 24))
57fcf00dccSad #define	I2O_MSGPRIV(o, f)	((f) | ((o) << 16))
58d49fd135Sad 
59d49fd135Sad /* Common message function codes with no payload or an undefined payload */
60d49fd135Sad #define	I2O_UTIL_NOP			0x00
61d49fd135Sad #define	I2O_EXEC_IOP_CLEAR		0xbe
62d49fd135Sad #define	I2O_EXEC_SYS_QUIESCE		0xc3
63d49fd135Sad #define	I2O_EXEC_SYS_ENABLE		0xd1
64d49fd135Sad #define	I2O_PRIVATE_MESSAGE		0xff
65d49fd135Sad 
66d49fd135Sad /* Device class codes */
67d49fd135Sad #define	I2O_CLASS_EXECUTIVE			0x00
68d49fd135Sad #define	I2O_CLASS_DDM				0x01
69d49fd135Sad #define	I2O_CLASS_RANDOM_BLOCK_STORAGE		0x10
70d49fd135Sad #define	I2O_CLASS_SEQUENTIAL_STORAGE		0x11
71d49fd135Sad #define	I2O_CLASS_LAN				0x20
72d49fd135Sad #define	I2O_CLASS_WAN				0x30
73d49fd135Sad #define	I2O_CLASS_FIBRE_CHANNEL_PORT		0x40
74d49fd135Sad #define	I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL	0x41
75d49fd135Sad #define	I2O_CLASS_SCSI_PERIPHERAL		0x51
76d49fd135Sad #define	I2O_CLASS_ATE_PORT			0x60
77d49fd135Sad #define	I2O_CLASS_ATE_PERIPHERAL		0x61
78d49fd135Sad #define	I2O_CLASS_FLOPPY_CONTROLLER		0x70
79d49fd135Sad #define	I2O_CLASS_FLOPPY_DEVICE			0x71
80d49fd135Sad #define	I2O_CLASS_BUS_ADAPTER_PORT		0x80
81d49fd135Sad 
82d49fd135Sad #define	I2O_CLASS_ANY				0xffffffff
83d49fd135Sad 
84d49fd135Sad /* Reply status codes */
85d49fd135Sad #define	I2O_STATUS_SUCCESS			0x00
86d49fd135Sad #define	I2O_STATUS_ABORT_DIRTY			0x01
87d49fd135Sad #define	I2O_STATUS_ABORT_NO_DATA_XFER		0x02
88d49fd135Sad #define	I2O_STATUS_ABORT_PARTIAL_XFER		0x03
89d49fd135Sad #define	I2O_STATUS_ERROR_DIRTY			0x04
90d49fd135Sad #define	I2O_STATUS_ERROR_NO_DATA_XFER		0x05
91d49fd135Sad #define	I2O_STATUS_ERROR_PARTIAL_XFER		0x06
92d49fd135Sad #define	I2O_STATUS_PROCESS_ABORT_DIRTY        	0x08
93d49fd135Sad #define	I2O_STATUS_PROCESS_ABORT_NO_DATA_XFER	0x09
94d49fd135Sad #define	I2O_STATUS_PROCESS_ABORT_PARTIAL_XFER	0x0a
95d49fd135Sad #define	I2O_STATUS_TRANSACTION_ERROR		0x0b
96d49fd135Sad #define	I2O_STATUS_PROGRESS_REPORT		0x80
97d49fd135Sad 
98ebf51109Sad /* Detailed status codes */
99ebf51109Sad #define	I2O_DSC_SUCCESS				0x00
100ebf51109Sad #define	I2O_DSC_BAD_KEY				0x02
101ebf51109Sad #define	I2O_DSC_TCL_ERROR			0x03
102ebf51109Sad #define	I2O_DSC_REPLY_BUFFER_FULL		0x04
103ebf51109Sad #define	I2O_DSC_NO_SUCH_PAGE			0x05
104ebf51109Sad #define	I2O_DSC_INSUFFICIENT_RESOURCE_SOFT	0x06
105ebf51109Sad #define	I2O_DSC_INSUFFICIENT_RESOURCE_HARD	0x07
106ebf51109Sad #define	I2O_DSC_CHAIN_BUFFER_TOO_LARGE		0x09
107ebf51109Sad #define	I2O_DSC_UNSUPPORTED_FUNCTION		0x0a
108ebf51109Sad #define	I2O_DSC_DEVICE_LOCKED			0x0b
109ebf51109Sad #define	I2O_DSC_DEVICE_RESET			0x0c
110ebf51109Sad #define	I2O_DSC_INAPPROPRIATE_FUNCTION		0x0d
111ebf51109Sad #define	I2O_DSC_INVALID_INITIATOR_ADDRESS	0x0e
112ebf51109Sad #define	I2O_DSC_INVALID_MESSAGE_FLAGS		0x0f
113ebf51109Sad #define	I2O_DSC_INVALID_OFFSET			0x10
114ebf51109Sad #define	I2O_DSC_INVALID_PARAMETER		0x11
115ebf51109Sad #define	I2O_DSC_INVALID_REQUEST			0x12
116ebf51109Sad #define	I2O_DSC_INVALID_TARGET_ADDRESS		0x13
117ebf51109Sad #define	I2O_DSC_MESSAGE_TOO_LARGE		0x14
118ebf51109Sad #define	I2O_DSC_MESSAGE_TOO_SMALL		0x15
119ebf51109Sad #define	I2O_DSC_MISSING_PARAMETER		0x16
120ebf51109Sad #define	I2O_DSC_TIMEOUT				0x17
121ebf51109Sad #define	I2O_DSC_UNKNOWN_ERROR			0x18
122ebf51109Sad #define	I2O_DSC_UNKNOWN_FUNCTION		0x19
123ebf51109Sad #define	I2O_DSC_UNSUPPORTED_VERSION		0x1a
124ebf51109Sad #define	I2O_DSC_DEVICE_BUSY			0x1b
125ebf51109Sad #define	I2O_DSC_DEVICE_NOT_AVAILABLE		0x1c
126ebf51109Sad 
127d49fd135Sad /* Message versions */
128d49fd135Sad #define	I2O_VERSION_10			0x00
129d49fd135Sad #define	I2O_VERSION_11			0x01
130d49fd135Sad #define	I2O_VERSION_20			0x02
131d49fd135Sad 
132d49fd135Sad /* Commonly used TIDs */
133d49fd135Sad #define	I2O_TID_IOP			0
134d49fd135Sad #define	I2O_TID_HOST			1
135d49fd135Sad #define	I2O_TID_NONE			4095
136d49fd135Sad 
137d49fd135Sad /* SGL flags.  This list covers only a fraction of the possibilities. */
138af9d4c4fSad #define	I2O_SGL_IGNORE			0x00000000
139d49fd135Sad #define	I2O_SGL_SIMPLE			0x10000000
140ebf51109Sad #define	I2O_SGL_PAGE_LIST		0x20000000
141af9d4c4fSad 
142af9d4c4fSad #define	I2O_SGL_BC_32BIT		0x01000000
143af9d4c4fSad #define	I2O_SGL_BC_64BIT		0x02000000
144af9d4c4fSad #define	I2O_SGL_BC_96BIT		0x03000000
145af9d4c4fSad #define	I2O_SGL_DATA_OUT		0x04000000
146d49fd135Sad #define	I2O_SGL_END_BUFFER		0x40000000
147d49fd135Sad #define	I2O_SGL_END			0x80000000
148d49fd135Sad 
149d49fd135Sad /* Serial number formats */
150d49fd135Sad #define	I2O_SNFMT_UNKNOWN		0
151d49fd135Sad #define	I2O_SNFMT_BINARY		1
152d49fd135Sad #define	I2O_SNFMT_ASCII			2
153d49fd135Sad #define	I2O_SNFMT_UNICODE		3
154d49fd135Sad #define	I2O_SNFMT_LAN_MAC		4
155d49fd135Sad #define	I2O_SNFMT_WAN_MAC		5
156d49fd135Sad 
157d49fd135Sad /*
158d49fd135Sad  * ================= Common structures =================
159d49fd135Sad  */
160d49fd135Sad 
161d49fd135Sad /*
162d49fd135Sad  * Standard I2O message frame.  All message frames begin with this.
163d49fd135Sad  *
164d49fd135Sad  * Bits  Field          Meaning
165d49fd135Sad  * ----  -------------  ----------------------------------------------------
166d49fd135Sad  * 0-2   msgflags       Message header version. Must be 001 (little endian).
167d49fd135Sad  * 3     msgflags	Reserved.
168d49fd135Sad  * 4-7   msgflags       Offset to SGLs expressed as # of 32-bit words.
169d49fd135Sad  * 8-15  msgflags       Control flags.
170d49fd135Sad  * 16-31 msgflags       Message frame size expressed as # of 32-bit words.
171d49fd135Sad  * 0-11  msgfunc	TID of target.
172d49fd135Sad  * 12-23 msgfunc        TID of initiator.
173d49fd135Sad  * 24-31 msgfunc        Function (i.e., type of message).
174d49fd135Sad  */
175d49fd135Sad struct i2o_msg {
176d49fd135Sad 	u_int32_t	msgflags;
177d49fd135Sad 	u_int32_t	msgfunc;
178d49fd135Sad 	u_int32_t	msgictx;	/* Initiator context */
179d49fd135Sad 	u_int32_t	msgtctx;	/* Transaction context */
180d49fd135Sad 
181d49fd135Sad 	/* Message payload */
182d49fd135Sad 
1830de5da96Sgmcgarry } __packed;
184d49fd135Sad 
185d49fd135Sad #define	I2O_MSGFLAGS_STATICMF		0x0100
186d49fd135Sad #define	I2O_MSGFLAGS_64BIT		0x0200
187d49fd135Sad #define	I2O_MSGFLAGS_MULTI		0x1000
188ebf51109Sad #define	I2O_MSGFLAGS_FAIL		0x2000
189d49fd135Sad #define	I2O_MSGFLAGS_LAST_REPLY		0x4000
190d49fd135Sad #define	I2O_MSGFLAGS_REPLY		0x8000
191d49fd135Sad 
192d49fd135Sad /*
193d49fd135Sad  * Standard reply frame.  msgflags, msgfunc, msgictx and msgtctx have the
194d49fd135Sad  * same meaning as in `struct i2o_msg'.
195d49fd135Sad  */
196d49fd135Sad struct i2o_reply {
197d49fd135Sad 	u_int32_t	msgflags;
198d49fd135Sad 	u_int32_t	msgfunc;
199d49fd135Sad 	u_int32_t	msgictx;
200d49fd135Sad 	u_int32_t	msgtctx;
201af9d4c4fSad 	u_int16_t	detail;		/* Detailed status code */
202d49fd135Sad 	u_int8_t	reserved;
203af9d4c4fSad 	u_int8_t	reqstatus;	/* Request status code */
204d49fd135Sad 
205d49fd135Sad 	/* Reply payload */
206d49fd135Sad 
2070de5da96Sgmcgarry } __packed;
208d49fd135Sad 
209d49fd135Sad /*
210ebf51109Sad  * Fault notification reply, returned when a message frame can not be
211ebf51109Sad  * processed (i.e I2O_MSGFLAGS_FAIL is set in the reply).
212ebf51109Sad  */
213ebf51109Sad struct i2o_fault_notify {
214ebf51109Sad 	u_int32_t	msgflags;
215ebf51109Sad 	u_int32_t	msgfunc;
216ebf51109Sad 	u_int32_t	msgictx;
217ebf51109Sad 	u_int32_t	msgtctx;	/* Not valid! */
218ebf51109Sad 	u_int8_t	lowestver;
219ebf51109Sad 	u_int8_t	highestver;
220ebf51109Sad 	u_int8_t	severity;
221ebf51109Sad 	u_int8_t	failurecode;
222ebf51109Sad 	u_int16_t	failingiop;	/* Bits 0-12 only */
223ebf51109Sad 	u_int16_t	failinghostunit;
224ebf51109Sad 	u_int32_t	agelimit;
225ebf51109Sad 	u_int32_t	lowmfa;
226ebf51109Sad 	u_int32_t	highmfa;
227ebf51109Sad };
228ebf51109Sad 
229ebf51109Sad /*
230d49fd135Sad  * Hardware resource table.  Not documented here.
231d49fd135Sad  */
232d49fd135Sad struct i2o_hrt_entry {
233d49fd135Sad 	u_int32_t	adapterid;
234af9d4c4fSad 	u_int16_t	controllingtid;
235af9d4c4fSad 	u_int8_t	busnumber;
236af9d4c4fSad 	u_int8_t	bustype;
237d49fd135Sad 	u_int8_t	businfo[8];
2380de5da96Sgmcgarry } __packed;
239d49fd135Sad 
240d49fd135Sad struct i2o_hrt {
241af9d4c4fSad 	u_int16_t	numentries;
242d49fd135Sad 	u_int8_t	entrysize;
243d49fd135Sad 	u_int8_t	hrtversion;
244d49fd135Sad 	u_int32_t	changeindicator;
245d49fd135Sad 	struct i2o_hrt_entry	entry[1];
2460de5da96Sgmcgarry } __packed;
247d49fd135Sad 
248d49fd135Sad /*
249d49fd135Sad  * Logical configuration table entry.  Bitfields are broken down as follows:
250d49fd135Sad  *
251d49fd135Sad  * Bits   Field           Meaning
252d49fd135Sad  * -----  --------------  ---------------------------------------------------
253d49fd135Sad  *  0-11  classid         Class ID.
254d49fd135Sad  * 12-15  classid         Class version.
255d49fd135Sad  *  0-11  usertid         User TID
256d49fd135Sad  * 12-23  usertid         Parent TID.
257d49fd135Sad  * 24-31  usertid         BIOS info.
258d49fd135Sad  */
259d49fd135Sad struct i2o_lct_entry {
260d49fd135Sad 	u_int16_t	entrysize;
261d49fd135Sad 	u_int16_t	localtid;		/* Bits 0-12 only */
262d49fd135Sad 	u_int32_t	changeindicator;
263d49fd135Sad 	u_int32_t	deviceflags;
264d49fd135Sad 	u_int16_t	classid;
265d49fd135Sad 	u_int16_t	orgid;
266d49fd135Sad 	u_int32_t	subclassinfo;
267d49fd135Sad 	u_int32_t	usertid;
268d49fd135Sad 	u_int8_t	identitytag[8];
269d49fd135Sad 	u_int32_t	eventcaps;
2700de5da96Sgmcgarry } __packed;
271d49fd135Sad 
272d49fd135Sad /*
273d49fd135Sad  * Logical configuration table header.
274d49fd135Sad  */
275d49fd135Sad struct i2o_lct {
276d49fd135Sad 	u_int16_t	tablesize;
277af9d4c4fSad 	u_int16_t	flags;
278d49fd135Sad 	u_int32_t	iopflags;
279d49fd135Sad 	u_int32_t	changeindicator;
280d49fd135Sad 	struct i2o_lct_entry	entry[1];
2810de5da96Sgmcgarry } __packed;
282d49fd135Sad 
283d49fd135Sad /*
284af9d4c4fSad  * IOP system table.  Bitfields are broken down as follows:
285d49fd135Sad  *
286d49fd135Sad  * Bits   Field           Meaning
287d49fd135Sad  * -----  --------------  ---------------------------------------------------
288d49fd135Sad  *  0-11  iopid           IOP ID.
289d49fd135Sad  * 12-31  iopid           Reserved.
290d49fd135Sad  *  0-11  segnumber       Segment number.
291d49fd135Sad  * 12-15  segnumber       I2O version.
292d49fd135Sad  * 16-23  segnumber       IOP state.
293d49fd135Sad  * 24-31  segnumber       Messenger type.
294d49fd135Sad  */
295af9d4c4fSad struct i2o_systab_entry {
296d49fd135Sad 	u_int16_t	orgid;
297d49fd135Sad 	u_int16_t	reserved0;
298d49fd135Sad 	u_int32_t	iopid;
299af9d4c4fSad 	u_int32_t	segnumber;
300d49fd135Sad 	u_int16_t	inboundmsgframesize;
301d49fd135Sad 	u_int16_t	reserved1;
302d49fd135Sad 	u_int32_t	lastchanged;
303d49fd135Sad 	u_int32_t	iopcaps;
304d49fd135Sad 	u_int32_t	inboundmsgportaddresslow;
305d49fd135Sad 	u_int32_t	inboundmsgportaddresshigh;
3060de5da96Sgmcgarry } __packed;
307d49fd135Sad 
308af9d4c4fSad struct i2o_systab {
309af9d4c4fSad 	u_int8_t	numentries;
310af9d4c4fSad 	u_int8_t	version;
311af9d4c4fSad 	u_int16_t	reserved0;
312af9d4c4fSad 	u_int32_t	changeindicator;
313af9d4c4fSad 	u_int32_t	reserved1[2];
314af9d4c4fSad 	struct	i2o_systab_entry entry[1];
3150de5da96Sgmcgarry } __packed;
316af9d4c4fSad 
317d49fd135Sad /*
318d49fd135Sad  * IOP status record.  Bitfields are broken down as follows:
319d49fd135Sad  *
320d49fd135Sad  * Bits   Field           Meaning
321d49fd135Sad  * -----  --------------  ---------------------------------------------------
322d49fd135Sad  *  0-11  iopid           IOP ID.
323d49fd135Sad  * 12-15  iopid           Reserved.
324d49fd135Sad  * 16-31  iopid           Host unit ID.
325d49fd135Sad  *  0-11  segnumber       Segment number.
326d49fd135Sad  * 12-15  segnumber       I2O version.
327d49fd135Sad  * 16-23  segnumber       IOP state.
328d49fd135Sad  * 24-31  segnumber       Messenger type.
329d49fd135Sad  */
330d49fd135Sad struct i2o_status {
331d49fd135Sad 	u_int16_t	orgid;
332d49fd135Sad 	u_int16_t	reserved0;
333af9d4c4fSad 	u_int32_t	iopid;
334af9d4c4fSad 	u_int32_t	segnumber;
335d49fd135Sad 	u_int16_t	inboundmframesize;
336d49fd135Sad 	u_int8_t	initcode;
337d49fd135Sad 	u_int8_t	reserved1;
338d49fd135Sad 	u_int32_t	maxinboundmframes;
339d49fd135Sad 	u_int32_t	currentinboundmframes;
340d49fd135Sad 	u_int32_t	maxoutboundmframes;
341d49fd135Sad 	u_int8_t	productid[24];
342d49fd135Sad 	u_int32_t	expectedlctsize;
343d49fd135Sad 	u_int32_t	iopcaps;
344d49fd135Sad 	u_int32_t	desiredprivmemsize;
345d49fd135Sad 	u_int32_t	currentprivmemsize;
346d49fd135Sad 	u_int32_t	currentprivmembase;
347d49fd135Sad 	u_int32_t	desiredpriviosize;
348d49fd135Sad 	u_int32_t	currentpriviosize;
349d49fd135Sad 	u_int32_t	currentpriviobase;
350d49fd135Sad 	u_int8_t	reserved2[3];
351d49fd135Sad 	u_int8_t	syncbyte;
3520de5da96Sgmcgarry } __packed;
353d49fd135Sad 
354d49fd135Sad #define	I2O_IOP_STATE_INITIALIZING		0x01
355d49fd135Sad #define	I2O_IOP_STATE_RESET			0x02
356d49fd135Sad #define	I2O_IOP_STATE_HOLD			0x04
357d49fd135Sad #define	I2O_IOP_STATE_READY			0x05
358d49fd135Sad #define	I2O_IOP_STATE_OPERATIONAL		0x08
359d49fd135Sad #define	I2O_IOP_STATE_FAILED			0x10
360d49fd135Sad #define	I2O_IOP_STATE_FAULTED			0x11
361d49fd135Sad 
362d49fd135Sad /*
363d49fd135Sad  * ================= Executive class messages =================
364d49fd135Sad  */
365d49fd135Sad 
366d49fd135Sad #define	I2O_EXEC_STATUS_GET		0xa0
367d49fd135Sad struct i2o_exec_status_get {
368d49fd135Sad 	u_int32_t	msgflags;
369d49fd135Sad 	u_int32_t	msgfunc;
370d49fd135Sad 	u_int32_t	reserved[4];
371d49fd135Sad 	u_int32_t	addrlow;
372d49fd135Sad 	u_int32_t	addrhigh;
373d49fd135Sad 	u_int32_t	length;
3740de5da96Sgmcgarry } __packed;
375d49fd135Sad 
376d49fd135Sad #define	I2O_EXEC_OUTBOUND_INIT		0xa1
377d49fd135Sad struct i2o_exec_outbound_init {
378d49fd135Sad 	u_int32_t	msgflags;
379d49fd135Sad 	u_int32_t	msgfunc;
380d49fd135Sad 	u_int32_t	msgictx;
381d49fd135Sad 	u_int32_t	msgtctx;
382d49fd135Sad 	u_int32_t	pagesize;
383d49fd135Sad 	u_int32_t	flags;		/* init code, outbound msg size */
3840de5da96Sgmcgarry } __packed;
385d49fd135Sad 
386d49fd135Sad #define	I2O_EXEC_OUTBOUND_INIT_IN_PROGRESS	1
387d49fd135Sad #define	I2O_EXEC_OUTBOUND_INIT_REJECTED		2
388d49fd135Sad #define	I2O_EXEC_OUTBOUND_INIT_FAILED		3
389d49fd135Sad #define	I2O_EXEC_OUTBOUND_INIT_COMPLETE		4
390d49fd135Sad 
391d49fd135Sad #define	I2O_EXEC_LCT_NOTIFY		0xa2
392d49fd135Sad struct i2o_exec_lct_notify {
393d49fd135Sad 	u_int32_t	msgflags;
394d49fd135Sad 	u_int32_t	msgfunc;
395d49fd135Sad 	u_int32_t	msgictx;
396d49fd135Sad 	u_int32_t	msgtctx;
397d49fd135Sad 	u_int32_t	classid;
398d49fd135Sad 	u_int32_t	changeindicator;
3990de5da96Sgmcgarry } __packed;
400d49fd135Sad 
401d49fd135Sad #define	I2O_EXEC_SYS_TAB_SET		0xa3
402d49fd135Sad struct i2o_exec_sys_tab_set {
403d49fd135Sad 	u_int32_t	msgflags;
404d49fd135Sad 	u_int32_t	msgfunc;
405d49fd135Sad 	u_int32_t	msgictx;
406d49fd135Sad 	u_int32_t	msgtctx;
407d49fd135Sad 	u_int32_t	iopid;
408d49fd135Sad 	u_int32_t	segnumber;
4090de5da96Sgmcgarry } __packed;
410d49fd135Sad 
411d49fd135Sad #define	I2O_EXEC_HRT_GET		0xa8
412d49fd135Sad struct i2o_exec_hrt_get {
413d49fd135Sad 	u_int32_t	msgflags;
414d49fd135Sad 	u_int32_t	msgfunc;
415d49fd135Sad 	u_int32_t	msgictx;
416d49fd135Sad 	u_int32_t	msgtctx;
4170de5da96Sgmcgarry } __packed;
418d49fd135Sad 
419d49fd135Sad #define	I2O_EXEC_IOP_RESET		0xbd
420d49fd135Sad struct i2o_exec_iop_reset {
421d49fd135Sad 	u_int32_t	msgflags;
422d49fd135Sad 	u_int32_t	msgfunc;
423d49fd135Sad 	u_int32_t	reserved[4];
424d49fd135Sad 	u_int32_t	statuslow;
425d49fd135Sad 	u_int32_t	statushigh;
4260de5da96Sgmcgarry } __packed;
427d49fd135Sad 
428d49fd135Sad #define	I2O_RESET_IN_PROGRESS		0x01
429d49fd135Sad #define	I2O_RESET_REJECTED		0x02
430d49fd135Sad 
431d49fd135Sad /*
432af9d4c4fSad  * ================= Executive class parameter groups =================
433af9d4c4fSad  */
434af9d4c4fSad 
435af9d4c4fSad #define	I2O_PARAM_EXEC_LCT_SCALAR	0x0101
436af9d4c4fSad #define	I2O_PARAM_EXEC_LCT_TABLE	0x0102
437af9d4c4fSad 
438af9d4c4fSad /*
439d49fd135Sad  * ================= HBA class messages =================
440d49fd135Sad  */
441d49fd135Sad 
442d49fd135Sad #define	I2O_HBA_BUS_SCAN		0x89
443d49fd135Sad struct i2o_hba_bus_scan {
444d49fd135Sad 	u_int32_t	msgflags;
445d49fd135Sad 	u_int32_t	msgfunc;
446d49fd135Sad 	u_int32_t	msgictx;
447d49fd135Sad 	u_int32_t	msgtctx;
4480de5da96Sgmcgarry } __packed;
449d49fd135Sad 
450d49fd135Sad /*
451d49fd135Sad  * ================= HBA class parameter groups =================
452d49fd135Sad  */
453d49fd135Sad 
454d49fd135Sad #define	I2O_PARAM_HBA_CTLR_INFO		0x0000
455d49fd135Sad struct i2o_param_hba_ctlr_info {
456d49fd135Sad 	u_int8_t	bustype;
457d49fd135Sad 	u_int8_t	busstate;
458d49fd135Sad 	u_int16_t	reserved;
459d49fd135Sad 	u_int8_t	busname[12];
4600de5da96Sgmcgarry } __packed;
461d49fd135Sad 
462d49fd135Sad #define	I2O_HBA_BUS_GENERIC		0x00
463d49fd135Sad #define	I2O_HBA_BUS_SCSI		0x01
464d49fd135Sad #define	I2O_HBA_BUS_FCA			0x10
465d49fd135Sad 
466d49fd135Sad #define	I2O_PARAM_HBA_SCSI_PORT_INFO	0x0001
467d49fd135Sad struct i2o_param_hba_scsi_port_info {
468d49fd135Sad 	u_int8_t	physicalif;
469d49fd135Sad 	u_int8_t	electricalif;
470d49fd135Sad 	u_int8_t	isosynchonrous;
471d49fd135Sad 	u_int8_t	connectortype;
472d49fd135Sad 	u_int8_t	connectorgender;
473d49fd135Sad 	u_int8_t	reserved1;
474d49fd135Sad 	u_int16_t	reserved2;
475d49fd135Sad 	u_int32_t	maxnumberofdevices;
4760de5da96Sgmcgarry } __packed;
477d49fd135Sad 
47803e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_GENERIC	0x01
47903e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_UNKNOWN	0x02
48003e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_PARINTF	0x03
48103e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_FCL	0x04
48203e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_1394	0x05
48303e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_SSA	0x06
48403e46dc8Sad 
48503e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_SE	0x03
48603e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_DIFF	0x04
48703e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_LVD	0x05
48803e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_OPTCL	0x06
48903e46dc8Sad 
49003e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_HDBS50	0x04
49103e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_HDBU50	0x05
49203e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_DBS50	0x06
49303e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_DBU50	0x07
49403e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_HDBS68	0x08
49503e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_HDBU68	0x09
49603e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_SCA1	0x0a
49703e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_SCA2	0x0b
49803e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_FCDB9	0x0c
49903e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_FC	0x0d
50003e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_FCSCA40	0x0e
50103e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_FCSCA20	0x0f
50203e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_FCBNC	0x10
50303e46dc8Sad 
50403e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_FEMALE	0x03
50503e46dc8Sad #define	I2O_PARAM_HBA_SCSI_PORT_MALE	0x04
50603e46dc8Sad 
507d49fd135Sad #define	I2O_PARAM_HBA_SCSI_CTLR_INFO	0x0200
508d49fd135Sad struct i2o_param_hba_scsi_ctlr_info {
509d49fd135Sad 	u_int8_t	scsitype;
510d49fd135Sad 	u_int8_t	protection;
511d49fd135Sad 	u_int8_t	settings;
512d49fd135Sad 	u_int8_t	reserved;
513d49fd135Sad 	u_int32_t	initiatorid;
514d49fd135Sad 	u_int64_t	scanlun0only;
515d49fd135Sad 	u_int16_t	disabledevice;
516d49fd135Sad 	u_int8_t	maxoffset;
517d49fd135Sad 	u_int8_t	maxdatawidth;
518d49fd135Sad 	u_int64_t	maxsyncrate;
5190de5da96Sgmcgarry } __packed;
520d49fd135Sad 
521d49fd135Sad /*
522d49fd135Sad  * ================= Utility messages =================
523d49fd135Sad  */
524d49fd135Sad 
525af9d4c4fSad #define	I2O_UTIL_ABORT			0x01
526af9d4c4fSad struct i2o_util_abort {
527af9d4c4fSad 	u_int32_t	msgflags;
528af9d4c4fSad 	u_int32_t	msgfunc;
529af9d4c4fSad 	u_int32_t	msgictx;
530af9d4c4fSad 	u_int32_t	msgtctx;
531af9d4c4fSad 	u_int32_t	flags;		/* abort type and function type */
532af9d4c4fSad 	u_int32_t	tctxabort;
5330de5da96Sgmcgarry } __packed;
534af9d4c4fSad 
535af9d4c4fSad #define	I2O_UTIL_ABORT_EXACT		0x00000000
536af9d4c4fSad #define	I2O_UTIL_ABORT_FUNCTION		0x00010000
537af9d4c4fSad #define	I2O_UTIL_ABORT_TRANSACTION	0x00020000
538af9d4c4fSad #define	I2O_UTIL_ABORT_WILD		0x00030000
539af9d4c4fSad 
540af9d4c4fSad #define	I2O_UTIL_ABORT_CLEAN		0x00040000
541af9d4c4fSad 
542af9d4c4fSad struct i2o_util_abort_reply {
543af9d4c4fSad 	u_int32_t	msgflags;
544af9d4c4fSad 	u_int32_t	msgfunc;
545af9d4c4fSad 	u_int32_t	msgictx;
546af9d4c4fSad 	u_int32_t	msgtctx;
547af9d4c4fSad 	u_int32_t	count;
5480de5da96Sgmcgarry } __packed;
549af9d4c4fSad 
550af9d4c4fSad #define	I2O_UTIL_PARAMS_SET		0x05
551d49fd135Sad #define	I2O_UTIL_PARAMS_GET		0x06
552af9d4c4fSad struct i2o_util_params_op {
553d49fd135Sad 	u_int32_t	msgflags;
554d49fd135Sad 	u_int32_t	msgfunc;
555d49fd135Sad 	u_int32_t	msgictx;
556d49fd135Sad 	u_int32_t	msgtctx;
557d49fd135Sad 	u_int32_t	flags;
5580de5da96Sgmcgarry } __packed;
559d49fd135Sad 
560d49fd135Sad #define	I2O_PARAMS_OP_FIELD_GET		1
561d49fd135Sad #define	I2O_PARAMS_OP_LIST_GET		2
562d49fd135Sad #define	I2O_PARAMS_OP_MORE_GET		3
563d49fd135Sad #define	I2O_PARAMS_OP_SIZE_GET		4
564d49fd135Sad #define	I2O_PARAMS_OP_TABLE_GET		5
565d49fd135Sad #define	I2O_PARAMS_OP_FIELD_SET		6
566d49fd135Sad #define	I2O_PARAMS_OP_LIST_SET		7
567d49fd135Sad #define	I2O_PARAMS_OP_ROW_ADD		8
568d49fd135Sad #define	I2O_PARAMS_OP_ROW_DELETE	9
569d49fd135Sad #define	I2O_PARAMS_OP_TABLE_CLEAR	10
570d49fd135Sad 
571d49fd135Sad struct i2o_param_op_list_header {
572d49fd135Sad 	u_int16_t	count;
573d49fd135Sad 	u_int16_t	reserved;
5740de5da96Sgmcgarry } __packed;
575d49fd135Sad 
576d49fd135Sad struct i2o_param_op_all_template {
577d49fd135Sad 	u_int16_t	operation;
578d49fd135Sad 	u_int16_t	group;
579d49fd135Sad 	u_int16_t	fieldcount;
580af9d4c4fSad 	u_int16_t	fields[1];
5810de5da96Sgmcgarry } __packed;
582d49fd135Sad 
583d49fd135Sad struct i2o_param_op_results {
584d49fd135Sad 	u_int16_t	count;
585d49fd135Sad 	u_int16_t	reserved;
5860de5da96Sgmcgarry } __packed;
587d49fd135Sad 
588d49fd135Sad struct i2o_param_read_results {
589d49fd135Sad 	u_int16_t	blocksize;
590d49fd135Sad 	u_int8_t	blockstatus;
591d49fd135Sad 	u_int8_t	errorinfosize;
5920de5da96Sgmcgarry } __packed;
593d49fd135Sad 
594af9d4c4fSad struct i2o_param_table_results {
595af9d4c4fSad 	u_int16_t	blocksize;
596af9d4c4fSad 	u_int8_t	blockstatus;
597af9d4c4fSad 	u_int8_t	errorinfosize;
598af9d4c4fSad 	u_int16_t	rowcount;
599af9d4c4fSad 	u_int16_t	moreflag;
6000de5da96Sgmcgarry } __packed;
601af9d4c4fSad 
602d49fd135Sad #define	I2O_UTIL_CLAIM			0x09
603d49fd135Sad struct i2o_util_claim {
604d49fd135Sad 	u_int32_t	msgflags;
605d49fd135Sad 	u_int32_t	msgfunc;
606d49fd135Sad 	u_int32_t	msgictx;
607d49fd135Sad 	u_int32_t	msgtctx;
608d49fd135Sad 	u_int32_t	flags;
6090de5da96Sgmcgarry } __packed;
610d49fd135Sad 
611d49fd135Sad #define	I2O_UTIL_CLAIM_RESET_SENSITIVE		0x00000002
612d49fd135Sad #define	I2O_UTIL_CLAIM_STATE_SENSITIVE		0x00000004
613d49fd135Sad #define	I2O_UTIL_CLAIM_CAPACITY_SENSITIVE	0x00000008
614d49fd135Sad #define	I2O_UTIL_CLAIM_NO_PEER_SERVICE		0x00000010
615d49fd135Sad #define	I2O_UTIL_CLAIM_NO_MANAGEMENT_SERVICE	0x00000020
616af9d4c4fSad 
617d49fd135Sad #define	I2O_UTIL_CLAIM_PRIMARY_USER		0x01000000
618d49fd135Sad #define	I2O_UTIL_CLAIM_AUTHORIZED_USER		0x02000000
619d49fd135Sad #define	I2O_UTIL_CLAIM_SECONDARY_USER		0x03000000
620d49fd135Sad #define	I2O_UTIL_CLAIM_MANAGEMENT_USER		0x04000000
621d49fd135Sad 
622af9d4c4fSad #define	I2O_UTIL_CLAIM_RELEASE		0x0b
623af9d4c4fSad struct i2o_util_claim_release {
624af9d4c4fSad 	u_int32_t	msgflags;
625af9d4c4fSad 	u_int32_t	msgfunc;
626af9d4c4fSad 	u_int32_t	msgictx;
627af9d4c4fSad 	u_int32_t	msgtctx;
628af9d4c4fSad 	u_int32_t	flags;		/* User flags as per I2O_UTIL_CLAIM */
6290de5da96Sgmcgarry } __packed;
630af9d4c4fSad 
631af9d4c4fSad #define	I2O_UTIL_CLAIM_RELEASE_CONDITIONAL	0x00000001
632af9d4c4fSad 
633af9d4c4fSad #define	I2O_UTIL_CONFIG_DIALOG		0x10
634af9d4c4fSad struct i2o_util_config_dialog {
635af9d4c4fSad 	u_int32_t	msgflags;
636af9d4c4fSad 	u_int32_t	msgfunc;
637af9d4c4fSad 	u_int32_t	msgictx;
638af9d4c4fSad 	u_int32_t	msgtctx;
639af9d4c4fSad 	u_int32_t	pageno;
6400de5da96Sgmcgarry } __packed;
641af9d4c4fSad 
642af9d4c4fSad #define	I2O_UTIL_EVENT_REGISTER		0x13
643af9d4c4fSad struct i2o_util_event_register {
644af9d4c4fSad 	u_int32_t	msgflags;
645af9d4c4fSad 	u_int32_t	msgfunc;
646af9d4c4fSad 	u_int32_t	msgictx;
647af9d4c4fSad 	u_int32_t	msgtctx;
648af9d4c4fSad 	u_int32_t	eventmask;
6490de5da96Sgmcgarry } __packed;
650af9d4c4fSad 
651af9d4c4fSad struct i2o_util_event_register_reply {
652af9d4c4fSad 	u_int32_t	msgflags;
653af9d4c4fSad 	u_int32_t	msgfunc;
654af9d4c4fSad 	u_int32_t	msgictx;
655af9d4c4fSad 	u_int32_t	msgtctx;
656af9d4c4fSad 	u_int32_t	event;
657af9d4c4fSad 	u_int32_t	eventdata[1];
6580de5da96Sgmcgarry } __packed;
659af9d4c4fSad 
660af9d4c4fSad /* Generic events. */
661af9d4c4fSad #define	I2O_EVENT_GEN_DEVICE_STATE		0x00400000
662af9d4c4fSad #define	I2O_EVENT_GEN_VENDOR_EVENT		0x00800000
663af9d4c4fSad #define	I2O_EVENT_GEN_FIELD_MODIFIED		0x01000000
664af9d4c4fSad #define	I2O_EVENT_GEN_EVENT_MASK_MODIFIED	0x02000000
665af9d4c4fSad #define	I2O_EVENT_GEN_DEVICE_RESET		0x04000000
666af9d4c4fSad #define	I2O_EVENT_GEN_CAPABILITY_CHANGE		0x08000000
667af9d4c4fSad #define	I2O_EVENT_GEN_LOCK_RELEASE		0x10000000
668af9d4c4fSad #define	I2O_EVENT_GEN_NEED_CONFIGURATION	0x20000000
669af9d4c4fSad #define	I2O_EVENT_GEN_GENERAL_WARNING		0x40000000
670af9d4c4fSad #define	I2O_EVENT_GEN_STATE_CHANGE		0x80000000
671af9d4c4fSad 
672af9d4c4fSad /* Executive class events. */
673af9d4c4fSad #define	I2O_EVENT_EXEC_RESOURCE_LIMITS		0x00000001
674af9d4c4fSad #define	I2O_EVENT_EXEC_CONNECTION_FAIL		0x00000002
675af9d4c4fSad #define	I2O_EVENT_EXEC_ADAPTER_FAULT		0x00000004
676af9d4c4fSad #define	I2O_EVENT_EXEC_POWER_FAIL		0x00000008
677af9d4c4fSad #define	I2O_EVENT_EXEC_RESET_PENDING		0x00000010
678af9d4c4fSad #define	I2O_EVENT_EXEC_RESET_IMMINENT		0x00000020
679af9d4c4fSad #define	I2O_EVENT_EXEC_HARDWARE_FAIL		0x00000040
680af9d4c4fSad #define	I2O_EVENT_EXEC_XCT_CHANGE		0x00000080
681af9d4c4fSad #define	I2O_EVENT_EXEC_NEW_LCT_ENTRY		0x00000100
682af9d4c4fSad #define	I2O_EVENT_EXEC_MODIFIED_LCT		0x00000200
683af9d4c4fSad #define	I2O_EVENT_EXEC_DDM_AVAILIBILITY		0x00000400
684af9d4c4fSad 
685d49fd135Sad /*
686d49fd135Sad  * ================= Utility parameter groups =================
687d49fd135Sad  */
688d49fd135Sad 
689d49fd135Sad #define	I2O_PARAM_DEVICE_IDENTITY	0xf100
690d49fd135Sad struct i2o_param_device_identity {
691d49fd135Sad 	u_int32_t	classid;
692d49fd135Sad 	u_int16_t	ownertid;
693d49fd135Sad 	u_int16_t	parenttid;
694d49fd135Sad 	u_int8_t	vendorinfo[16];
695d49fd135Sad 	u_int8_t	productinfo[16];
696d49fd135Sad 	u_int8_t	description[16];
697d49fd135Sad 	u_int8_t	revlevel[8];
698d49fd135Sad 	u_int8_t	snformat;
699d49fd135Sad 	u_int8_t	serialnumber[1];
7000de5da96Sgmcgarry } __packed;
701d49fd135Sad 
702d49fd135Sad #define	I2O_PARAM_DDM_IDENTITY		0xf101
703d49fd135Sad struct i2o_param_ddm_identity {
704d49fd135Sad 	u_int16_t	ddmtid;
705d49fd135Sad 	u_int8_t	name[24];
706d49fd135Sad 	u_int8_t	revlevel[8];
707d49fd135Sad 	u_int8_t	snformat;
708d49fd135Sad 	u_int8_t	serialnumber[12];
7090de5da96Sgmcgarry } __packed;
710d49fd135Sad 
711d49fd135Sad /*
712d49fd135Sad  * ================= Block storage class messages =================
713d49fd135Sad  */
714d49fd135Sad 
715d49fd135Sad #define	I2O_RBS_BLOCK_READ		0x30
716d49fd135Sad struct i2o_rbs_block_read {
717d49fd135Sad 	u_int32_t	msgflags;
718d49fd135Sad 	u_int32_t	msgfunc;
719d49fd135Sad 	u_int32_t	msgictx;
720d49fd135Sad 	u_int32_t	msgtctx;
72171981bceSandvar 	u_int32_t	flags;		/* flags, time multiplier, read ahead */
722d49fd135Sad 	u_int32_t	datasize;
723d49fd135Sad 	u_int32_t	lowoffset;
724d49fd135Sad 	u_int32_t	highoffset;
7250de5da96Sgmcgarry } __packed;
726d49fd135Sad 
727d49fd135Sad #define	I2O_RBS_BLOCK_READ_NO_RETRY	0x01
728d49fd135Sad #define	I2O_RBS_BLOCK_READ_SOLO		0x02
729d49fd135Sad #define	I2O_RBS_BLOCK_READ_CACHE_READ	0x04
730d49fd135Sad #define	I2O_RBS_BLOCK_READ_PREFETCH	0x08
731d49fd135Sad #define	I2O_RBS_BLOCK_READ_CACHE_ONLY	0x10
732d49fd135Sad 
733d49fd135Sad #define	I2O_RBS_BLOCK_WRITE             0x31
734d49fd135Sad struct i2o_rbs_block_write {
735d49fd135Sad 	u_int32_t	msgflags;
736d49fd135Sad 	u_int32_t	msgfunc;
737d49fd135Sad 	u_int32_t	msgictx;
738d49fd135Sad 	u_int32_t	msgtctx;
73971981bceSandvar 	u_int32_t	flags;		/* flags, time multiplier */
740d49fd135Sad 	u_int32_t	datasize;
741d49fd135Sad 	u_int32_t	lowoffset;
742d49fd135Sad 	u_int32_t	highoffset;
7430de5da96Sgmcgarry } __packed;
744d49fd135Sad 
745d49fd135Sad #define	I2O_RBS_BLOCK_WRITE_NO_RETRY	0x01
746d49fd135Sad #define	I2O_RBS_BLOCK_WRITE_SOLO	0x02
747d49fd135Sad #define	I2O_RBS_BLOCK_WRITE_CACHE_NONE	0x04
748d49fd135Sad #define	I2O_RBS_BLOCK_WRITE_CACHE_WT	0x08
749d49fd135Sad #define	I2O_RBS_BLOCK_WRITE_CACHE_WB	0x10
750d49fd135Sad 
751d49fd135Sad #define	I2O_RBS_CACHE_FLUSH             0x37
752d49fd135Sad struct i2o_rbs_cache_flush {
753d49fd135Sad 	u_int32_t	msgflags;
754d49fd135Sad 	u_int32_t	msgfunc;
755d49fd135Sad 	u_int32_t	msgictx;
756d49fd135Sad 	u_int32_t	msgtctx;
75771981bceSandvar 	u_int32_t	flags;		/* flags, time multiplier */
7580de5da96Sgmcgarry } __packed;
759d49fd135Sad 
760d49fd135Sad #define	I2O_RBS_MEDIA_MOUNT		0x41
761d49fd135Sad struct i2o_rbs_media_mount {
762d49fd135Sad 	u_int32_t	msgflags;
763d49fd135Sad 	u_int32_t	msgfunc;
764d49fd135Sad 	u_int32_t	msgictx;
765d49fd135Sad 	u_int32_t	msgtctx;
766d49fd135Sad 	u_int32_t	mediaid;
767d49fd135Sad 	u_int32_t	loadflags;
7680de5da96Sgmcgarry } __packed;
769d49fd135Sad 
770d49fd135Sad #define	I2O_RBS_MEDIA_EJECT             0x43
771d49fd135Sad struct i2o_rbs_media_eject {
772d49fd135Sad 	u_int32_t	msgflags;
773d49fd135Sad 	u_int32_t	msgfunc;
774d49fd135Sad 	u_int32_t	msgictx;
775d49fd135Sad 	u_int32_t	msgtctx;
776d49fd135Sad 	u_int32_t	mediaid;
7770de5da96Sgmcgarry } __packed;
778d49fd135Sad 
779d49fd135Sad #define	I2O_RBS_MEDIA_LOCK		0x49
780d49fd135Sad struct i2o_rbs_media_lock {
781d49fd135Sad 	u_int32_t	msgflags;
782d49fd135Sad 	u_int32_t	msgfunc;
783d49fd135Sad 	u_int32_t	msgictx;
784d49fd135Sad 	u_int32_t	msgtctx;
785d49fd135Sad 	u_int32_t	mediaid;
7860de5da96Sgmcgarry } __packed;
787d49fd135Sad 
788d49fd135Sad #define	I2O_RBS_MEDIA_UNLOCK		0x4b
789d49fd135Sad struct i2o_rbs_media_unlock {
790d49fd135Sad 	u_int32_t	msgflags;
791d49fd135Sad 	u_int32_t	msgfunc;
792d49fd135Sad 	u_int32_t	msgictx;
793d49fd135Sad 	u_int32_t	msgtctx;
794d49fd135Sad 	u_int32_t	mediaid;
7950de5da96Sgmcgarry } __packed;
796d49fd135Sad 
797d49fd135Sad /* Standard RBS reply frame. */
798d49fd135Sad struct i2o_rbs_reply {
799d49fd135Sad 	u_int32_t	msgflags;
800d49fd135Sad 	u_int32_t	msgfunc;
801d49fd135Sad 	u_int32_t	msgictx;
802d49fd135Sad 	u_int32_t	msgtctx;
803d49fd135Sad 	u_int16_t	detail;
804ebf51109Sad 	u_int8_t	retrycount;
805d49fd135Sad 	u_int8_t	reqstatus;
806d49fd135Sad 	u_int32_t	transfercount;
807d49fd135Sad 	u_int64_t	offset;		/* Error replies only */
8080de5da96Sgmcgarry } __packed;
809d49fd135Sad 
810d49fd135Sad /*
811d49fd135Sad  * ================= Block storage class parameter groups =================
812d49fd135Sad  */
813d49fd135Sad 
814d49fd135Sad #define	I2O_PARAM_RBS_DEVICE_INFO	0x0000
815d49fd135Sad struct i2o_param_rbs_device_info {
816d49fd135Sad 	u_int8_t	type;
817d49fd135Sad 	u_int8_t	npaths;
818d49fd135Sad 	u_int16_t	powerstate;
819d49fd135Sad 	u_int32_t	blocksize;
820d49fd135Sad 	u_int64_t	capacity;
821d49fd135Sad 	u_int32_t	capabilities;
822d49fd135Sad 	u_int32_t	state;
8230de5da96Sgmcgarry } __packed;
824d49fd135Sad 
825d49fd135Sad #define	I2O_RBS_TYPE_DIRECT		0x00
826d49fd135Sad #define	I2O_RBS_TYPE_WORM		0x04
827d49fd135Sad #define	I2O_RBS_TYPE_CDROM		0x05
828d49fd135Sad #define	I2O_RBS_TYPE_OPTICAL		0x07
829d49fd135Sad 
830d49fd135Sad #define	I2O_RBS_CAP_CACHING		0x00000001
831d49fd135Sad #define	I2O_RBS_CAP_MULTI_PATH		0x00000002
832d49fd135Sad #define	I2O_RBS_CAP_DYNAMIC_CAPACITY	0x00000004
8333f9411f6Swiz #define	I2O_RBS_CAP_REMOVABLE_MEDIA	0x00000008
8343f9411f6Swiz #define	I2O_RBS_CAP_REMOVABLE_DEVICE	0x00000010
835d49fd135Sad #define	I2O_RBS_CAP_READ_ONLY		0x00000020
836d49fd135Sad #define	I2O_RBS_CAP_LOCKOUT		0x00000040
837d49fd135Sad #define	I2O_RBS_CAP_BOOT_BYPASS		0x00000080
838d49fd135Sad #define	I2O_RBS_CAP_COMPRESSION		0x00000100
839d49fd135Sad #define	I2O_RBS_CAP_DATA_SECURITY	0x00000200
840d49fd135Sad #define	I2O_RBS_CAP_RAID		0x00000400
841d49fd135Sad 
842d49fd135Sad #define	I2O_RBS_STATE_CACHING		0x00000001
843d49fd135Sad #define	I2O_RBS_STATE_POWERED_ON	0x00000002
844d49fd135Sad #define	I2O_RBS_STATE_READY		0x00000004
845d49fd135Sad #define	I2O_RBS_STATE_MEDIA_LOADED	0x00000008
846d49fd135Sad #define	I2O_RBS_STATE_DEVICE_LOADED	0x00000010
847d49fd135Sad #define	I2O_RBS_STATE_READ_ONLY		0x00000020
848d49fd135Sad #define	I2O_RBS_STATE_LOCKOUT		0x00000040
849d49fd135Sad #define	I2O_RBS_STATE_BOOT_BYPASS	0x00000080
850d49fd135Sad #define	I2O_RBS_STATE_COMPRESSION	0x00000100
851d49fd135Sad #define	I2O_RBS_STATE_DATA_SECURITY	0x00000200
852d49fd135Sad #define	I2O_RBS_STATE_RAID		0x00000400
853d49fd135Sad 
854af9d4c4fSad #define	I2O_PARAM_RBS_OPERATION		0x0001
855af9d4c4fSad struct i2o_param_rbs_operation {
856af9d4c4fSad 	u_int8_t	autoreass;
857af9d4c4fSad 	u_int8_t	reasstolerance;
858af9d4c4fSad 	u_int8_t	numretries;
859af9d4c4fSad 	u_int8_t	reserved0;
860af9d4c4fSad 	u_int32_t	reasssize;
861af9d4c4fSad 	u_int32_t	expectedtimeout;
862af9d4c4fSad 	u_int32_t	rwvtimeout;
863af9d4c4fSad 	u_int32_t	rwvtimeoutbase;
864af9d4c4fSad 	u_int32_t	timeoutbase;
865af9d4c4fSad 	u_int32_t	orderedreqdepth;
866af9d4c4fSad 	u_int32_t	atomicwritesize;
8670de5da96Sgmcgarry } __packed;
868af9d4c4fSad 
8691d6329bbSad #define	I2O_PARAM_RBS_OPERATION_autoreass		0
8701d6329bbSad #define	I2O_PARAM_RBS_OPERATION_reasstolerance		1
8711d6329bbSad #define	I2O_PARAM_RBS_OPERATION_numretries		2
8721d6329bbSad #define	I2O_PARAM_RBS_OPERATION_reserved0		3
8731d6329bbSad #define	I2O_PARAM_RBS_OPERATION_reasssize		4
8741d6329bbSad #define	I2O_PARAM_RBS_OPERATION_expectedtimeout		5
8751d6329bbSad #define	I2O_PARAM_RBS_OPERATION_rwvtimeout		6
8761d6329bbSad #define	I2O_PARAM_RBS_OPERATION_rwvtimeoutbase		7
8771d6329bbSad #define	I2O_PARAM_RBS_OPERATION_timeoutbase		8
8781d6329bbSad #define	I2O_PARAM_RBS_OPERATION_orderedreqdepth		9
8791d6329bbSad #define	I2O_PARAM_RBS_OPERATION_atomicwritesize		10
8801d6329bbSad 
881d49fd135Sad #define	I2O_PARAM_RBS_CACHE_CONTROL	0x0003
882d49fd135Sad struct i2o_param_rbs_cache_control {
883d49fd135Sad 	u_int32_t	totalcachesize;
884d49fd135Sad 	u_int32_t	readcachesize;
885d49fd135Sad 	u_int32_t	writecachesize;
886d49fd135Sad 	u_int8_t	writepolicy;
887d49fd135Sad 	u_int8_t	readpolicy;
888d49fd135Sad 	u_int8_t	errorcorrection;
889d49fd135Sad 	u_int8_t	reserved;
8900de5da96Sgmcgarry } __packed;
891d49fd135Sad 
892d49fd135Sad /*
893d49fd135Sad  * ================= SCSI peripheral class messages =================
894d49fd135Sad  */
895d49fd135Sad 
896d49fd135Sad #define	I2O_SCSI_DEVICE_RESET		0x27
897d49fd135Sad struct i2o_scsi_device_reset {
898d49fd135Sad 	u_int32_t	msgflags;
899d49fd135Sad 	u_int32_t	msgfunc;
900d49fd135Sad 	u_int32_t	msgictx;
901d49fd135Sad 	u_int32_t	msgtctx;
9020de5da96Sgmcgarry } __packed;
903d49fd135Sad 
904d49fd135Sad #define	I2O_SCSI_SCB_EXEC		0x81
905d49fd135Sad struct i2o_scsi_scb_exec {
906d49fd135Sad 	u_int32_t	msgflags;
907d49fd135Sad 	u_int32_t	msgfunc;
908d49fd135Sad 	u_int32_t	msgictx;
909d49fd135Sad 	u_int32_t	msgtctx;
910d49fd135Sad 	u_int32_t	flags;		/* CDB length and flags */
911d49fd135Sad 	u_int8_t	cdb[16];
912d49fd135Sad 	u_int32_t	datalen;
9130de5da96Sgmcgarry } __packed;
914d49fd135Sad 
915d49fd135Sad #define	I2O_SCB_FLAG_SENSE_DATA_IN_MESSAGE  0x00200000
916d49fd135Sad #define	I2O_SCB_FLAG_SENSE_DATA_IN_BUFFER   0x00600000
917d49fd135Sad #define	I2O_SCB_FLAG_SIMPLE_QUEUE_TAG       0x00800000
918d49fd135Sad #define	I2O_SCB_FLAG_HEAD_QUEUE_TAG         0x01000000
919d49fd135Sad #define	I2O_SCB_FLAG_ORDERED_QUEUE_TAG      0x01800000
920d49fd135Sad #define	I2O_SCB_FLAG_ACA_QUEUE_TAG          0x02000000
921d49fd135Sad #define	I2O_SCB_FLAG_ENABLE_DISCONNECT      0x20000000
922d49fd135Sad #define	I2O_SCB_FLAG_XFER_FROM_DEVICE       0x40000000
923d49fd135Sad #define	I2O_SCB_FLAG_XFER_TO_DEVICE         0x80000000
924d49fd135Sad 
925d49fd135Sad #define	I2O_SCSI_SCB_ABORT		0x83
926d49fd135Sad struct i2o_scsi_scb_abort {
927d49fd135Sad 	u_int32_t	msgflags;
928d49fd135Sad 	u_int32_t	msgfunc;
929d49fd135Sad 	u_int32_t	msgictx;
930d49fd135Sad 	u_int32_t	msgtctx;
931d49fd135Sad 	u_int32_t	tctxabort;
9320de5da96Sgmcgarry } __packed;
933d49fd135Sad 
934d49fd135Sad struct i2o_scsi_reply {
935d49fd135Sad 	u_int32_t	msgflags;
936d49fd135Sad 	u_int32_t	msgfunc;
937d49fd135Sad 	u_int32_t	msgictx;
938d49fd135Sad 	u_int32_t	msgtctx;
939ebf51109Sad 	u_int8_t	scsistatus;
940ebf51109Sad 	u_int8_t	hbastatus;
941d49fd135Sad 	u_int8_t	reserved;
942d49fd135Sad 	u_int8_t	reqstatus;
943d49fd135Sad 	u_int32_t	datalen;
944d49fd135Sad 	u_int32_t	senselen;
945d49fd135Sad 	u_int8_t	sense[40];
9460de5da96Sgmcgarry } __packed;
947d49fd135Sad 
948d49fd135Sad #define	I2O_SCSI_DSC_SUCCESS                0x00
949d49fd135Sad #define	I2O_SCSI_DSC_REQUEST_ABORTED        0x02
950d49fd135Sad #define	I2O_SCSI_DSC_UNABLE_TO_ABORT        0x03
951d49fd135Sad #define	I2O_SCSI_DSC_COMPLETE_WITH_ERROR    0x04
952d49fd135Sad #define	I2O_SCSI_DSC_ADAPTER_BUSY           0x05
953d49fd135Sad #define	I2O_SCSI_DSC_REQUEST_INVALID        0x06
954d49fd135Sad #define	I2O_SCSI_DSC_PATH_INVALID           0x07
955d49fd135Sad #define	I2O_SCSI_DSC_DEVICE_NOT_PRESENT     0x08
956d49fd135Sad #define	I2O_SCSI_DSC_UNABLE_TO_TERMINATE    0x09
957d49fd135Sad #define	I2O_SCSI_DSC_SELECTION_TIMEOUT      0x0a
958d49fd135Sad #define	I2O_SCSI_DSC_COMMAND_TIMEOUT        0x0b
959d49fd135Sad #define	I2O_SCSI_DSC_MR_MESSAGE_RECEIVED    0x0d
960d49fd135Sad #define	I2O_SCSI_DSC_SCSI_BUS_RESET         0x0e
961d49fd135Sad #define	I2O_SCSI_DSC_PARITY_ERROR_FAILURE   0x0f
962d49fd135Sad #define	I2O_SCSI_DSC_AUTOSENSE_FAILED       0x10
963d49fd135Sad #define	I2O_SCSI_DSC_NO_ADAPTER             0x11
964d49fd135Sad #define	I2O_SCSI_DSC_DATA_OVERRUN           0x12
965d49fd135Sad #define	I2O_SCSI_DSC_UNEXPECTED_BUS_FREE    0x13
966d49fd135Sad #define	I2O_SCSI_DSC_SEQUENCE_FAILURE       0x14
967d49fd135Sad #define	I2O_SCSI_DSC_REQUEST_LENGTH_ERROR   0x15
968d49fd135Sad #define	I2O_SCSI_DSC_PROVIDE_FAILURE        0x16
969d49fd135Sad #define	I2O_SCSI_DSC_BDR_MESSAGE_SENT       0x17
970d49fd135Sad #define	I2O_SCSI_DSC_REQUEST_TERMINATED     0x18
971d49fd135Sad #define	I2O_SCSI_DSC_IDE_MESSAGE_SENT       0x33
972d49fd135Sad #define	I2O_SCSI_DSC_RESOURCE_UNAVAILABLE   0x34
973d49fd135Sad #define	I2O_SCSI_DSC_UNACKNOWLEDGED_EVENT   0x35
974d49fd135Sad #define	I2O_SCSI_DSC_MESSAGE_RECEIVED       0x36
975d49fd135Sad #define	I2O_SCSI_DSC_INVALID_CDB            0x37
976d49fd135Sad #define	I2O_SCSI_DSC_LUN_INVALID            0x38
977d49fd135Sad #define	I2O_SCSI_DSC_SCSI_TID_INVALID       0x39
978d49fd135Sad #define	I2O_SCSI_DSC_FUNCTION_UNAVAILABLE   0x3a
979d49fd135Sad #define	I2O_SCSI_DSC_NO_NEXUS               0x3b
980d49fd135Sad #define	I2O_SCSI_DSC_SCSI_IID_INVALID       0x3c
981d49fd135Sad #define	I2O_SCSI_DSC_CDB_RECEIVED           0x3d
982d49fd135Sad #define	I2O_SCSI_DSC_LUN_ALREADY_ENABLED    0x3e
983d49fd135Sad #define	I2O_SCSI_DSC_BUS_BUSY               0x3f
984d49fd135Sad #define	I2O_SCSI_DSC_QUEUE_FROZEN           0x40
985d49fd135Sad 
986d49fd135Sad /*
987d49fd135Sad  * ================= SCSI peripheral class parameter groups =================
988d49fd135Sad  */
989d49fd135Sad 
990d49fd135Sad #define	I2O_PARAM_SCSI_DEVICE_INFO	0x0000
991d49fd135Sad struct i2o_param_scsi_device_info {
992d49fd135Sad 	u_int8_t	devicetype;
993d49fd135Sad 	u_int8_t	flags;
994d49fd135Sad 	u_int16_t	reserved0;
995d49fd135Sad 	u_int32_t	identifier;
996d49fd135Sad 	u_int8_t	luninfo[8];
997d49fd135Sad 	u_int32_t	queuedepth;
998d49fd135Sad 	u_int8_t	reserved1;
999d49fd135Sad 	u_int8_t	negoffset;
1000d49fd135Sad 	u_int8_t	negdatawidth;
1001d49fd135Sad 	u_int8_t	reserved2;
1002d49fd135Sad 	u_int64_t	negsyncrate;
10030de5da96Sgmcgarry } __packed;
1004d49fd135Sad 
1005d49fd135Sad #endif	/* !defined _I2O_I2O_H_ */
1006