xref: /dragonfly/sys/dev/raid/asr/i2omsg.h (revision 1b7d1d10)
1 /*-
2  ****************************************************************
3  * Copyright (c) 1996-2000 Distributed Processing Technology Corporation
4  * Copyright (c) 2000 Adaptec Corporation.
5  * All rights reserved.
6  *
7  * Copyright 1999 I2O Special Interest Group (I2O SIG).	 All rights reserved.
8  * All rights reserved
9  *
10  * TERMS AND CONDITIONS OF USE
11  *
12  * Redistribution and use in source form, with or without modification, are
13  * permitted provided that redistributions of source code must retain the
14  * above copyright notice, this list of conditions and the following disclaimer.
15  *
16  * This software is provided `as is' by Distributed Processing Technology and
17  * any express or implied warranties, including, but not limited to, the
18  * implied warranties of merchantability and fitness for a particular purpose,
19  * are disclaimed. In no event shall Distributed Processing Technology be
20  * liable for any direct, indirect, incidental, special, exemplary or
21  * consequential damages (including, but not limited to, procurement of
22  * substitute goods or services; loss of use, data, or profits; or business
23  * interruptions) however caused and on any theory of liability, whether in
24  * contract, strict liability, or tort (including negligence or otherwise)
25  * arising in any way out of the use of this driver software, even if advised
26  * of the possibility of such damage.
27  *
28  * This header file, and any modifications of this header file, are provided
29  * contingent upon your agreement and adherence to the here-listed terms and
30  * conditions.	By accepting and/or using this header file, you agree to abide
31  * by these terms and conditions and that these terms and conditions will be
32  * construed and governed in accordance with the laws of the State of California,
33  * without reference to conflict-of-law provisions.  If you do not agree
34  * to these terms and conditions, please delete this file, and any copies,
35  * permanently, without making any use thereof.
36  *
37  * THIS HEADER FILE IS PROVIDED FREE OF CHARGE ON AN AS-IS BASIS WITHOUT
38  * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
39  * TO IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
40  * PURPOSE.  I2O SIG DOES NOT WARRANT THAT THIS HEADER FILE WILL MEET THE
41  * USER'S REQUIREMENTS OR THAT ITS OPERATION WILL BE UNINTERRUPTED OR
42  * ERROR-FREE.
43  *
44  * I2O SIG DISCLAIMS ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF
45  * ANY PROPRIETARY RIGHTS, RELATING TO THE IMPLEMENTATION OF THE I2O
46  * SPECIFICATIONS.  I2O SIG DOES NOT WARRANT OR REPRESENT THAT SUCH
47  * IMPLEMENTATIONS WILL NOT INFRINGE SUCH RIGHTS.
48  *
49  * THE USER OF THIS HEADER FILE SHALL HAVE NO RECOURSE TO I2O SIG FOR ANY
50  * ACTUAL OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, LOST DATA
51  * OR LOST PROFITS ARISING OUT OF THE USE OR INABILITY TO USE THIS PROGRAM.
52  *
53  * I2O SIG grants the user of this header file a license to copy, distribute,
54  * and modify it, for any purpose, under the following terms.  Any copying,
55  * distribution, or modification of this header file must not delete or alter
56  * the copyright notice of I2O SIG or any of these Terms and Conditions.
57  *
58  * Any distribution of this header file must not include a charge for the
59  * header file (unless such charges are strictly for the physical acts of
60  * copying or transferring copies).  However, distribution of a product in
61  * which this header file is embedded may include a charge so long as any
62  * such charge does not include any charge for the header file itself.
63  *
64  * Any modification of this header file constitutes a derivative work based
65  * on this header file.	 Any distribution of such derivative work: (1) must
66  * include prominent notices that the header file has been changed from the
67  * original, together with the dates of any changes; (2) automatically includes
68  * this same license to the original header file from I2O SIG, without any
69  * restriction thereon from the distributing user; and (3) must include a
70  * grant of license of the modified file under the same terms and conditions
71  * as these Terms and Conditions.
72  *
73  * The I2O SIG Web site can be found at: http://www.i2osig.org
74  *
75  * The I2O SIG encourages you to deposit derivative works based on this
76  * header file at the I2O SIG Web site.	 Furthermore, to become a Registered
77  * Developer of the I2O SIG, sign up at the Web site or call 415.750.8352
78  * (United States).
79  *
80  * $FreeBSD: src/sys/dev/asr/i2omsg.h,v 1.8 2011/02/21 09:01:34 brucec Exp $
81  *
82  ****************************************************************/
83 
84 /*********************************************************************
85  * I2OMsg.h -- I2O Message defintion file
86  *
87  * This file contains information presented in Chapter 3, 4 and 6 of
88  * the I2O(tm) Specification and most of the I2O Global defines and
89  * Typedefs.
90  **********************************************************************/
91 
92 #if !defined(I2O_MESSAGE_HDR)
93 #define	I2O_MESSAGE_HDR
94 
95 #define	I2OMSG_REV 1_5_4  /* I2OMsg header file revision string */
96 
97 /*
98 
99    NOTES:
100 
101    Gets, reads, receives, etc. are all even numbered functions.
102    Sets, writes, sends, etc. are all odd numbered functions.
103    Functions that both send and receive data can be either but an attempt is
104    made to use the function number that indicates the greater transfer amount.
105    Functions that do not send or receive data use odd function numbers.
106 
107    Some functions are synonyms like read, receive and send, write.
108 
109    All common functions will have a code of less than 0x80.
110    Unique functions to a class will start at 0x80.
111    Executive Functions start at 0xA0.
112 
113    Utility Message function codes range from 0 - 0x1f
114    Base Message function codes range from 0x20 - 0xfe
115    Private Message function code is 0xff.
116 */
117 
118 
119 
120 #include "i2otypes.h"
121 
122 
123 PRAGMA_ALIGN_PUSH
124 
125 PRAGMA_PACK_PUSH
126 
127 /* Set to 1 for 64 bit Context Fields */
128 #define	    I2O_64BIT_CONTEXT	       0
129 
130 /****************************************************************************/
131 
132 /* Common functions accross all classes. */
133 
134 #define	   I2O_PRIVATE_MESSAGE			       0xFF
135 
136 /****************************************************************************/
137 /* Class ID and Code Assignments */
138 
139 
140 #define	   I2O_CLASS_VERSION_10			       0x00
141 #define	   I2O_CLASS_VERSION_11			       0x01
142 
143 /*    Class Code Names:	 Table 6-1 Class Code Assignments. */
144 #define	   I2O_CLASS_EXECUTIVE			       0x000
145 #define	   I2O_CLASS_DDM			       0x001
146 #define	   I2O_CLASS_RANDOM_BLOCK_STORAGE	       0x010
147 #define	   I2O_CLASS_SEQUENTIAL_STORAGE		       0x011
148 #define	   I2O_CLASS_LAN			       0x020
149 #define	   I2O_CLASS_WAN			       0x030
150 #define	   I2O_CLASS_FIBRE_CHANNEL_PORT		       0x040
151 #define	   I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL	       0x041
152 #define	   I2O_CLASS_SCSI_PERIPHERAL		       0x051
153 #define	   I2O_CLASS_ATE_PORT			       0x060
154 #define	   I2O_CLASS_ATE_PERIPHERAL		       0x061
155 #define	   I2O_CLASS_FLOPPY_CONTROLLER		       0x070
156 #define	   I2O_CLASS_FLOPPY_DEVICE		       0x071
157 #define	   I2O_CLASS_BUS_ADAPTER_PORT		       0x080
158 /* Class Codes 0x090 - 0x09f are reserved for Peer-to-Peer classes */
159 #define	   I2O_CLASS_MATCH_ANYCLASS		       0xffffffff
160 
161 #define	   I2O_SUBCLASS_i960			       0x001
162 #define	   I2O_SUBCLASS_HDM			       0x020
163 #define	   I2O_SUBCLASS_ISM			       0x021
164 
165 
166 /****************************************************************************/
167 /* Message Frame defines and structures	 */
168 
169 /*   Defines for the Version_Status field. */
170 
171 #define	   I2O_VERSION_10			       0x00
172 #define	   I2O_VERSION_11			       0x01
173 
174 #define	   I2O_VERSION_OFFSET_NUMBER_MASK	       0x07
175 #define	   I2O_VERSION_OFFSET_SGL_TRL_OFFSET_MASK      0xF0
176 
177 /*   Defines for the Message Flags Field. */
178 /*   Please Note the FAIL bit is only set in the Transport Fail Message. */
179 #define	   I2O_MESSAGE_FLAGS_STATIC		       0x01
180 #define	   I2O_MESSAGE_FLAGS_64BIT_CONTEXT	       0x02
181 #define	   I2O_MESSAGE_FLAGS_MULTIPLE		       0x10
182 #define	   I2O_MESSAGE_FLAGS_FAIL		       0x20
183 #define	   I2O_MESSAGE_FLAGS_LAST		       0x40
184 #define	   I2O_MESSAGE_FLAGS_REPLY		       0x80
185 
186 /* Defines for Request Status Codes:  Table 3-1 Reply Status Codes.  */
187 
188 #define	   I2O_REPLY_STATUS_SUCCESS		       0x00
189 #define	   I2O_REPLY_STATUS_ABORT_DIRTY		       0x01
190 #define	   I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER     0x02
191 #define	   I2O_REPLY_STATUS_ABORT_PARTIAL_TRANSFER     0x03
192 #define	   I2O_REPLY_STATUS_ERROR_DIRTY		       0x04
193 #define	   I2O_REPLY_STATUS_ERROR_NO_DATA_TRANSFER     0x05
194 #define	   I2O_REPLY_STATUS_ERROR_PARTIAL_TRANSFER     0x06
195 #define	   I2O_REPLY_STATUS_PROCESS_ABORT_DIRTY	       0x08
196 #define	   I2O_REPLY_STATUS_PROCESS_ABORT_NO_DATA_TRANSFER   0x09
197 #define	   I2O_REPLY_STATUS_PROCESS_ABORT_PARTIAL_TRANSFER   0x0A
198 #define	   I2O_REPLY_STATUS_TRANSACTION_ERROR	       0x0B
199 #define	   I2O_REPLY_STATUS_PROGRESS_REPORT	       0x80
200 
201 /* DetailedStatusCode defines for ALL messages: Table 3-2 Detailed Status Codes.  */
202 
203 #define	   I2O_DETAIL_STATUS_SUCCESS			    0x0000
204 #define	   I2O_DETAIL_STATUS_BAD_KEY			    0x0002
205 #define	   I2O_DETAIL_STATUS_TCL_ERROR			    0x0003
206 #define	   I2O_DETAIL_STATUS_REPLY_BUFFER_FULL		    0x0004
207 #define	   I2O_DETAIL_STATUS_NO_SUCH_PAGE		    0x0005
208 #define	   I2O_DETAIL_STATUS_INSUFFICIENT_RESOURCE_SOFT	    0x0006
209 #define	   I2O_DETAIL_STATUS_INSUFFICIENT_RESOURCE_HARD	    0x0007
210 #define	   I2O_DETAIL_STATUS_CHAIN_BUFFER_TOO_LARGE	    0x0009
211 #define	   I2O_DETAIL_STATUS_UNSUPPORTED_FUNCTION	    0x000A
212 #define	   I2O_DETAIL_STATUS_DEVICE_LOCKED		    0x000B
213 #define	   I2O_DETAIL_STATUS_DEVICE_RESET		    0x000C
214 #define	   I2O_DETAIL_STATUS_INAPPROPRIATE_FUNCTION	    0x000D
215 #define	   I2O_DETAIL_STATUS_INVALID_INITIATOR_ADDRESS	    0x000E
216 #define	   I2O_DETAIL_STATUS_INVALID_MESSAGE_FLAGS	    0x000F
217 #define	   I2O_DETAIL_STATUS_INVALID_OFFSET		    0x0010
218 #define	   I2O_DETAIL_STATUS_INVALID_PARAMETER		    0x0011
219 #define	   I2O_DETAIL_STATUS_INVALID_REQUEST		    0x0012
220 #define	   I2O_DETAIL_STATUS_INVALID_TARGET_ADDRESS	    0x0013
221 #define	   I2O_DETAIL_STATUS_MESSAGE_TOO_LARGE		    0x0014
222 #define	   I2O_DETAIL_STATUS_MESSAGE_TOO_SMALL		    0x0015
223 #define	   I2O_DETAIL_STATUS_MISSING_PARAMETER		    0x0016
224 #define	   I2O_DETAIL_STATUS_TIMEOUT			    0x0017
225 #define	   I2O_DETAIL_STATUS_UNKNOWN_ERROR		    0x0018
226 #define	   I2O_DETAIL_STATUS_UNKNOWN_FUNCTION		    0x0019
227 #define	   I2O_DETAIL_STATUS_UNSUPPORTED_VERSION	    0x001A
228 #define	   I2O_DEATIL_STATUS_DEVICE_BUSY		    0x001B
229 #define	   I2O_DETAIL_STATUS_DEVICE_NOT_AVAILABLE	    0x001C
230 
231 /* Common I2O Field sizes  */
232 
233 #define	   I2O_TID_SZ				       12
234 #define	   I2O_FUNCTION_SZ			       8
235 #define	   I2O_UNIT_ID_SZ			       16
236 #define	   I2O_SEGMENT_NUMBER_SZ		       12
237 
238 #define	   I2O_IOP_ID_SZ			       12
239 #define	   I2O_GROUP_ID_SZ			       16
240 #define	   I2O_IOP_STATE_SZ			       8
241 #define	   I2O_MESSENGER_TYPE_SZ		       8
242 
243 #define	   I2O_CLASS_ID_SZ			       12
244 #define	   I2O_CLASS_ORGANIZATION_ID_SZ		       16
245 
246 #define	   I2O_4BIT_VERSION_SZ			       4
247 #define	   I2O_8BIT_FLAGS_SZ			       8
248 #define	   I2O_COMMON_LENGTH_FIELD_SZ		       16
249 
250 #define	   I2O_DEVID_DESCRIPTION_SZ		       16
251 #define	   I2O_DEVID_VENDOR_INFO_SZ		       16
252 #define	   I2O_DEVID_PRODUCT_INFO_SZ		       16
253 #define	   I2O_DEVID_REV_LEVEL_SZ		       8
254 #define	   I2O_MODULE_NAME_SZ			       24
255 
256 #define	   I2O_BIOS_INFO_SZ			       8
257 
258 #define	   I2O_RESERVED_4BITS			       4
259 #define	   I2O_RESERVED_8BITS			       8
260 #define	   I2O_RESERVED_12BITS			       12
261 #define	   I2O_RESERVED_16BITS			       16
262 #define	   I2O_RESERVED_20BITS			       20
263 #define	   I2O_RESERVED_24BITS			       24
264 #define	   I2O_RESERVED_28BITS			       28
265 
266 
267 typedef	   U32	      I2O_PARAMETER_TID;
268 
269 
270 #if	I2O_64BIT_CONTEXT
271 typedef	   U64	      I2O_INITIATOR_CONTEXT;
272 typedef	   U64	      I2O_TRANSACTION_CONTEXT;
273 #else
274 typedef	   U32	      I2O_INITIATOR_CONTEXT;
275 typedef	   U32	      I2O_TRANSACTION_CONTEXT;
276 #endif
277 
278 /*  Serial Number format defines */
279 
280 #define	   I2O_SERIAL_FORMAT_UNKNOWN		       0
281 #define	   I2O_SERIAL_FORMAT_BINARY		       1
282 #define	   I2O_SERIAL_FORMAT_ASCII		       2
283 #define	   I2O_SERIAL_FORMAT_UNICODE		       3
284 #define	   I2O_SERIAL_FORMAT_LAN_MAC		       4
285 #define	   I2O_SERIAL_FORMAT_WAN		       5
286 
287 /* Special TID Assignments */
288 
289 #define	   I2O_IOP_TID				       0
290 #define	   I2O_HOST_TID				       1
291 
292 
293 /****************************************************************************/
294 
295 /* I2O Message Frame common for all messages  */
296 
297 typedef struct _I2O_MESSAGE_FRAME {
298    U8			       VersionOffset;
299    U8			       MsgFlags;
300    U16			       MessageSize;
301 #if  (defined(__BORLANDC__)) || defined(_DPT_BIG_ENDIAN) || (defined(sparc))
302    U32			       TargetAddress;
303 #else
304    BF			       TargetAddress:I2O_TID_SZ;
305    BF			       InitiatorAddress:I2O_TID_SZ;
306    BF			       Function:I2O_FUNCTION_SZ;
307 #endif
308    I2O_INITIATOR_CONTEXT       InitiatorContext;
309 } I2O_MESSAGE_FRAME, *PI2O_MESSAGE_FRAME;
310 
311 
312 /****************************************************************************/
313 
314 /* Transaction Reply Lists (TRL) Control Word structure */
315 
316 #define	   I2O_TRL_FLAGS_SINGLE_FIXED_LENGTH	       0x00
317 #define	   I2O_TRL_FLAGS_SINGLE_VARIABLE_LENGTH	       0x40
318 #define	   I2O_TRL_FLAGS_MULTIPLE_FIXED_LENGTH	       0x80
319 
320 typedef struct _I2O_TRL_CONTROL_WORD {
321    U8			       TrlCount;
322    U8			       TrlElementSize;
323    U8			       reserved;
324    U8			       TrlFlags;
325 #if	I2O_64BIT_CONTEXT
326    U32			       Padding;		  /* Padding for 64 bit */
327 #endif
328 } I2O_TRL_CONTROL_WORD, *PI2O_TRL_CONTROL_WORD;
329 
330 /****************************************************************************/
331 
332 /* I2O Successful Single Transaction Reply Message Frame structure. */
333 
334 typedef struct _I2O_SINGLE_REPLY_MESSAGE_FRAME {
335    I2O_MESSAGE_FRAME	       StdMessageFrame;
336    I2O_TRANSACTION_CONTEXT     TransactionContext;
337    U16			       DetailedStatusCode;
338    U8			       reserved;
339    U8			       ReqStatus;
340 /*			       ReplyPayload	   */
341 } I2O_SINGLE_REPLY_MESSAGE_FRAME, *PI2O_SINGLE_REPLY_MESSAGE_FRAME;
342 
343 
344 /****************************************************************************/
345 
346 /* I2O Successful Multiple Transaction Reply Message Frame structure. */
347 
348 typedef struct _I2O_MULTIPLE_REPLY_MESSAGE_FRAME {
349    I2O_MESSAGE_FRAME	       StdMessageFrame;
350    I2O_TRL_CONTROL_WORD	       TrlControlWord;
351    U16			       DetailedStatusCode;
352    U8			       reserved;
353    U8			       ReqStatus;
354 /*			       TransactionDetails[]	   */
355 } I2O_MULTIPLE_REPLY_MESSAGE_FRAME, *PI2O_MULTIPLE_REPLY_MESSAGE_FRAME;
356 
357 
358 /****************************************************************************/
359 
360 /* I2O Private Message Frame structure. */
361 
362 typedef struct _I2O_PRIVATE_MESSAGE_FRAME {
363    I2O_MESSAGE_FRAME	       StdMessageFrame;
364    I2O_TRANSACTION_CONTEXT     TransactionContext;
365    U16			       XFunctionCode;
366    U16			       OrganizationID;
367 /*			       PrivatePayload[]	       */
368 } I2O_PRIVATE_MESSAGE_FRAME, *PI2O_PRIVATE_MESSAGE_FRAME;
369 
370 
371 /****************************************************************************/
372 
373 /* Message Failure Severity Codes */
374 
375 #define	   I2O_SEVERITY_FORMAT_ERROR		       0x1
376 #define	   I2O_SEVERITY_PATH_ERROR		       0x2
377 #define	   I2O_SEVERITY_PATH_STATE		       0x4
378 #define	   I2O_SEVERITY_CONGESTION		       0x8
379 
380 /* Transport Failure Codes: Table 3-3 Mesasge Failure Codes */
381 
382 #define	   I2O_FAILURE_CODE_TRANSPORT_SERVICE_SUSPENDED	   0x81
383 #define	   I2O_FAILURE_CODE_TRANSPORT_SERVICE_TERMINATED   0x82
384 #define	   I2O_FAILURE_CODE_TRANSPORT_CONGESTION	   0x83
385 #define	   I2O_FAILURE_CODE_TRANSPORT_FAIL		   0x84
386 #define	   I2O_FAILURE_CODE_TRANSPORT_STATE_ERROR	   0x85
387 #define	   I2O_FAILURE_CODE_TRANSPORT_TIME_OUT		   0x86
388 #define	   I2O_FAILURE_CODE_TRANSPORT_ROUTING_FAILURE	   0x87
389 #define	   I2O_FAILURE_CODE_TRANSPORT_INVALID_VERSION	   0x88
390 #define	   I2O_FAILURE_CODE_TRANSPORT_INVALID_OFFSET	   0x89
391 #define	   I2O_FAILURE_CODE_TRANSPORT_INVALID_MSG_FLAGS	   0x8A
392 #define	   I2O_FAILURE_CODE_TRANSPORT_FRAME_TOO_SMALL	   0x8B
393 #define	   I2O_FAILURE_CODE_TRANSPORT_FRAME_TOO_LARGE	   0x8C
394 #define	   I2O_FAILURE_CODE_TRANSPORT_INVALID_TARGET_ID	   0x8D
395 #define	   I2O_FAILURE_CODE_TRANSPORT_INVALID_INITIATOR_ID 0x8E
396 #define	   I2O_FAILURE_CODE_TRANSPORT_INVALID_INITIATOR_CONTEXT	   0x8F
397 #define	   I2O_FAILURE_CODE_TRANSPORT_UNKNOWN_FAILURE	   0xFF
398 
399 /* IOP_ID and Severity sizes */
400 
401 #define	   I2O_FAILCODE_SEVERITY_SZ			   8
402 #define	   I2O_FAILCODE_CODE_SZ				   8
403 
404 /* I2O Transport Message Reply for Message Failure. */
405 
406 typedef struct _I2O_FAILURE_REPLY_MESSAGE_FRAME {
407     I2O_MESSAGE_FRAME		StdMessageFrame;
408     I2O_TRANSACTION_CONTEXT	TransactionContext;
409 #   if (defined(_DPT_BIG_ENDIAN) || defined(sparc) || defined(__BORLANDC__))
410 	U32			LowestVersion;
411 	U32			reserved;
412 #   else
413 	U8			LowestVersion;
414 	U8			HighestVersion;
415 /*	BF			Severity:I2O_FAILCODE_SEVERITY_SZ; */
416 /*	BF			FailureCode:I2O_FAILCODE_CODE_SZ; */
417 /* Due to our compiler padding this structure and making it larger than
418  * it really is (4 bytes larger), we are re-defining these two fields
419  */
420 	U8			Severity;
421 	U8			FailureCode;
422 	BF			reserved:I2O_RESERVED_4BITS;
423 	BF			FailingHostUnitID:I2O_UNIT_ID_SZ;
424 	BF			reserved1:12;
425 #   endif
426     U32				AgeLimit;
427     U32				PreservedMFA;
428 } I2O_FAILURE_REPLY_MESSAGE_FRAME, *PI2O_FAILURE_REPLY_MESSAGE_FRAME;
429 
430 /* I2O Transport Message Reply for Transaction Error. */
431 
432 typedef struct _I2O_TRANSACTION_ERROR_REPLY_MESSAGE_FRAME {
433    I2O_MESSAGE_FRAME	       StdMessageFrame;
434    I2O_TRANSACTION_CONTEXT     TransactionContext;
435    U16			       DetailedStatusCode;
436    U8			       reserved;
437    U8			       ReqStatus;   /* Should always be Transaction Error */
438    U32			       ErrorOffset;
439    U8			       BitOffset;
440    U8			       reserved1;
441    U16			       reserved2;
442 } I2O_TRANSACTION_ERROR_REPLY_MESSAGE_FRAME, *PI2O_TRANSACTION_ERROR_REPLY_MESSAGE_FRAME;
443 
444 /****************************************************************************/
445 
446 /*  Misc. commonly used structures */
447 
448 /* Class ID Block */
449 
450 typedef struct _I2O_CLASS_ID {
451 #if (defined(_DPT_BIG_ENDIAN) || defined(sparc))
452    U32			       Class;
453 #else
454    BF			       Class:I2O_CLASS_ID_SZ;
455    BF			       Version:I2O_4BIT_VERSION_SZ;
456    BF			       OrganizationID:I2O_CLASS_ORGANIZATION_ID_SZ;
457 #endif
458 } I2O_CLASS_ID, *PI2O_CLASS_ID;
459 
460 
461 #define	   I2O_MAX_SERIAL_NUMBER_SZ		       256
462 
463 typedef struct _I2O_SERIAL_INFO {
464    U8			       SerialNumberLength;
465    U8			       SerialNumberFormat;
466    U8			       SerialNumber[I2O_MAX_SERIAL_NUMBER_SZ];
467 } I2O_SERIAL_INFO, *PI2O_SERIAL_INFO;
468 
469 
470 /****************************************************************************/
471 /* Hardware Resource Table (HRT) and Logical Configuration Table (LCT) */
472 /****************************************************************************/
473 
474 /* Bus Type Code defines */
475 
476 #define	   I2O_LOCAL_BUS			       0
477 #define	   I2O_ISA_BUS				       1
478 #define	   I2O_EISA_BUS				       2
479 #define	   I2O_MCA_BUS				       3
480 #define	   I2O_PCI_BUS				       4
481 #define	   I2O_PCMCIA_BUS			       5
482 #define	   I2O_NUBUS_BUS			       6
483 #define	   I2O_CARDBUS_BUS			       7
484 #define	   I2O_OTHER_BUS			       0x80
485 
486 #define	   I2O_HRT_STATE_SZ			       4
487 #define	   I2O_HRT_BUS_NUMBER_SZ		       8
488 #define	   I2O_HRT_BUS_TYPE_SZ			       8
489 
490 
491 /* Bus Structures */
492 
493 /* PCI Bus */
494 typedef struct _I2O_PCI_BUS_INFO {
495    U8			       PciFunctionNumber;
496    U8			       PciDeviceNumber;
497    U8			       PciBusNumber;
498    U8			       reserved;
499    U16			       PciVendorID;
500    U16			       PciDeviceID;
501 } I2O_PCI_BUS_INFO, *PI2O_PCI_BUS_INFO;
502 
503 /* Local Bus */
504 typedef struct _I2O_LOCAL_BUS_INFO {
505    U16			       LbBaseIOPort;
506    U16			       reserved;
507    U32			       LbBaseMemoryAddress;
508 } I2O_LOCAL_BUS_INFO, *PI2O_LOCAL_BUS_INFO;
509 
510 /* ISA Bus */
511 typedef struct _I2O_ISA_BUS_INFO {
512    U16			       IsaBaseIOPort;
513    U8			       CSN;
514    U8			       reserved;
515    U32			       IsaBaseMemoryAddress;
516 } I2O_ISA_BUS_INFO, *PI2O_ISA_BUS_INFO;
517 
518 /* EISA Bus */
519 typedef struct _I2O_EISA_BUS_INFO {
520    U16			       EisaBaseIOPort;
521    U8			       reserved;
522    U8			       EisaSlotNumber;
523    U32			       EisaBaseMemoryAddress;
524 } I2O_EISA_BUS_INFO, *PI2O_EISA_BUS_INFO;
525 
526 /* MCA Bus */
527 typedef struct _I2O_MCA_BUS_INFO {
528    U16			       McaBaseIOPort;
529    U8			       reserved;
530    U8			       McaSlotNumber;
531    U32			       McaBaseMemoryAddress;
532 } I2O_MCA_BUS_INFO, *PI2O_MCA_BUS_INFO;
533 
534 /* Other Bus */
535 typedef struct _I2O_OTHER_BUS_INFO {
536    U16			       BaseIOPort;
537    U16			       reserved;
538    U32			       BaseMemoryAddress;
539 } I2O_OTHER_BUS_INFO, *PI2O_OTHER_BUS_INFO;
540 
541 
542 /* HRT Entry Block */
543 
544 typedef struct _I2O_HRT_ENTRY {
545    U32			       AdapterID;
546 #if (defined(_DPT_BIG_ENDIAN) || defined(sparc))
547    U32			       ControllingTID;
548 #else
549    BF			       ControllingTID:I2O_TID_SZ;
550    BF			       AdapterState:I2O_HRT_STATE_SZ;
551    BF			       BusNumber:I2O_HRT_BUS_NUMBER_SZ;
552    BF			       BusType:I2O_HRT_BUS_TYPE_SZ;
553 #endif
554    union {
555        /* PCI Bus */
556        I2O_PCI_BUS_INFO	       PCIBus;
557 
558        /* Local Bus */
559        I2O_LOCAL_BUS_INFO      LocalBus;
560 
561        /* ISA Bus */
562        I2O_ISA_BUS_INFO	       ISABus;
563 
564        /* EISA Bus */
565        I2O_EISA_BUS_INFO       EISABus;
566 
567        /* MCA Bus */
568        I2O_MCA_BUS_INFO	       MCABus;
569 
570        /* Other. */
571        I2O_OTHER_BUS_INFO      OtherBus;
572    }uBus;
573 } I2O_HRT_ENTRY, *PI2O_HRT_ENTRY;
574 
575 
576 /* I2O Hardware Resource Table structure. */
577 
578 typedef struct _I2O_HRT {
579    U16			       NumberEntries;
580    U8			       EntryLength;
581    U8			       HRTVersion;
582    U32			       CurrentChangeIndicator;
583    I2O_HRT_ENTRY	       HRTEntry[1];
584 } I2O_HRT, *PI2O_HRT;
585 
586 
587 /****************************************************************************/
588 /* Logical Configuration Table	*/
589 /****************************************************************************/
590 
591 /* I2O Logical Configuration Table structures. */
592 
593 #define	   I2O_IDENTITY_TAG_SZ			       8
594 
595 /* I2O Logical Configuration Table Device Flags */
596 
597 #define	   I2O_LCT_DEVICE_FLAGS_CONF_DIALOG_REQUEST	       0x01
598 #define	   I2O_LCT_DEVICE_FLAGS_MORE_THAN_1_USER	       0x02
599 #define	   I2O_LCT_DEVICE_FLAGS_PEER_SERVICE_DISABLED	       0x10
600 #define	   I2O_LCT_DEVICE_FLAGS_MANAGEMENT_SERVICE_DISABLED    0x20
601 
602 /* LCT Entry Block */
603 
604 typedef struct _I2O_LCT_ENTRY {
605 #if (defined(_DPT_BIG_ENDIAN) || defined(sparc))
606    U32			       TableEntrySize;
607 #else
608    BF			       TableEntrySize:I2O_COMMON_LENGTH_FIELD_SZ;
609    BF			       LocalTID:I2O_TID_SZ;
610    BF			       reserved:I2O_4BIT_VERSION_SZ;
611 #endif
612    U32			       ChangeIndicator;
613    U32			       DeviceFlags;
614    I2O_CLASS_ID		       ClassID;
615    U32			       SubClassInfo;
616 #if (defined(__BORLANDC__)) || defined(_DPT_BIG_ENDIAN) || (defined(sparc))
617    U32			       UserTID;
618 #else
619    BF			       UserTID:I2O_TID_SZ;
620    BF			       ParentTID:I2O_TID_SZ;
621    BF			       BiosInfo:I2O_BIOS_INFO_SZ;
622 #endif
623    U8			       IdentityTag[I2O_IDENTITY_TAG_SZ];
624    U32			       EventCapabilities;
625 } I2O_LCT_ENTRY, *PI2O_LCT_ENTRY;
626 
627 
628 /* I2O Logical Configuration Table structure. */
629 
630 typedef struct _I2O_LCT {
631 #if (defined(_DPT_BIG_ENDIAN) || defined(sparc))
632    U32			       TableSize;
633 #else
634    BF			       TableSize:I2O_COMMON_LENGTH_FIELD_SZ;
635    BF			       BootDeviceTID:I2O_TID_SZ;
636    BF			       LctVer:I2O_4BIT_VERSION_SZ;
637 #endif
638    U32			       IopFlags;
639    U32			       CurrentChangeIndicator;
640    I2O_LCT_ENTRY	       LCTEntry[1];
641 } I2O_LCT, *PI2O_LCT;
642 
643 
644 /****************************************************************************/
645 
646 /* Memory Addressing structures and defines. */
647 
648 /* SglFlags defines. */
649 
650 #define	   I2O_SGL_FLAGS_LAST_ELEMENT		       0x80
651 #define	   I2O_SGL_FLAGS_END_OF_BUFFER		       0x40
652 
653 #define	   I2O_SGL_FLAGS_IGNORE_ELEMENT		       0x00
654 #define	   I2O_SGL_FLAGS_TRANSPORT_ELEMENT	       0x04
655 #define	   I2O_SGL_FLAGS_BIT_BUCKET_ELEMENT	       0x08
656 #define	   I2O_SGL_FLAGS_IMMEDIATE_DATA_ELEMENT	       0x0C
657 #define	   I2O_SGL_FLAGS_SIMPLE_ADDRESS_ELEMENT	       0x10
658 #define	   I2O_SGL_FLAGS_PAGE_LIST_ADDRESS_ELEMENT     0x20
659 #define	   I2O_SGL_FLAGS_CHAIN_POINTER_ELEMENT	       0x30
660 #define	   I2O_SGL_FLAGS_LONG_TRANSACTION_ELEMENT      0x40
661 #define	   I2O_SGL_FLAGS_SHORT_TRANSACTION_ELEMENT     0x70
662 #define	   I2O_SGL_FLAGS_SGL_ATTRIBUTES_ELEMENT	       0x7C
663 
664 #define	   I2O_SGL_FLAGS_BC0			       0x01
665 #define	   I2O_SGL_FLAGS_BC1			       0x02
666 #define	   I2O_SGL_FLAGS_DIR			       0x04
667 #define	   I2O_SGL_FLAGS_LOCAL_ADDRESS		       0x08
668 
669 #define	   I2O_SGL_FLAGS_CONTEXT_COUNT_MASK	       0x03
670 #define	   I2O_SGL_FLAGS_ADDRESS_MODE_MASK	       0x3C
671 #define	   I2O_SGL_FLAGS_NO_CONTEXT		       0x00
672 
673 /*  Scatter/Gather Truth Table */
674 
675 /*
676 
677 typedef enum _SG_TYPE {
678    INVALID,
679    Ignore,
680    TransportDetails,
681    BitBucket,
682    ImmediateData,
683    Simple,
684    PageList,
685    ChainPointer,
686    ShortTransaction,
687    LongTransaction,
688    SGLAttributes,
689    INVALID/ReservedLongFormat,
690    INVALID/ReservedShortFormat
691 } SG_TYPE, *PSG_TYPE;
692 
693 
694    0x00	   Ignore;
695    0x04	   TransportDetails;
696    0x08	   BitBucket;
697    0x0C	   ImmediateData;
698    0x10	   Simple;
699    0x14	   Simple;
700    0x18	   Simple;
701    0x1C	   Simple;
702    0x20	   PageList;
703    0x24	   PageList;
704    0x28	   PageList;
705    0x2C	   PageList;
706    0x30	   ChainPointer;
707    0x34	   INVALID;
708    0x38	   ChainPointer;
709    0x3C	   INVALID;
710    0x40	   LongTransaction;
711    0x44	   INVALID/ReservedLongFormat;
712    0x48	   BitBucket;
713    0x4C	   ImmediateData;
714    0x50	   Simple;
715    0x54	   Simple;
716    0x58	   Simple;
717    0x5C	   Simple;
718    0x60	   PageList;
719    0x64	   PageList;
720    0x68	   PageList;
721    0x6C	   PageList;
722    0x70	   ShortTransaction;
723    0x74	   INVALID/ReservedShortFormat;
724    0x78	   INVALID/ReservedShortFormat;
725    0x7C	   SGLAttributes;
726 */
727 
728 
729 /* 32 Bit Context Field defines */
730 
731 #define	   I2O_SGL_FLAGS_CONTEXT32_NULL		       0x00
732 #define	   I2O_SGL_FLAGS_CONTEXT32_U32		       0x01
733 #define	   I2O_SGL_FLAGS_CONTEXT32_U64		       0x02
734 #define	   I2O_SGL_FLAGS_CONTEXT32_U96		       0x03
735 
736 #define	   I2O_SGL_FLAGS_CONTEXT32_NULL_SZ	       0x00
737 #define	   I2O_SGL_FLAGS_CONTEXT32_U32_SZ	       0x04
738 #define	   I2O_SGL_FLAGS_CONTEXT32_U64_SZ	       0x08
739 #define	   I2O_SGL_FLAGS_CONTEXT32_U96_SZ	       0x0C
740 
741 /* 64 Bit Context Field defines */
742 
743 #define	   I2O_SGL_FLAGS_CONTEXT64_NULL		       0x00
744 #define	   I2O_SGL_FLAGS_CONTEXT64_U64		       0x01
745 #define	   I2O_SGL_FLAGS_CONTEXT64_U128		       0x02
746 #define	   I2O_SGL_FLAGS_CONTEXT64_U192		       0x03
747 
748 #define	   I2O_SGL_FLAGS_CONTEXT64_NULL_SZ	       0x00
749 #define	   I2O_SGL_FLAGS_CONTEXT64_U64_SZ	       0x08
750 #define	   I2O_SGL_FLAGS_CONTEXT64_U128_SZ	       0x10
751 #define	   I2O_SGL_FLAGS_CONTEXT64_U192_SZ	       0x18
752 
753 /* SGL Attribute Element defines */
754 
755 #define	   I2O_SGL_ATTRIBUTE_FLAGS_BIT_BUCKET_HINT     0x0400
756 #define	   I2O_SGL_ATTRIBUTE_FLAGS_IMMEDIATE_DATA_HINT 0x0200
757 #define	   I2O_SGL_ATTRIBUTE_FLAGS_LOCAL_ADDRESS_HINT  0x0100
758 #define	   I2O_SGL_ATTRIBUTE_FLAGS_32BIT_TRANSACTION   0x0000
759 #define	   I2O_SGL_ATTRIBUTE_FLAGS_64BIT_TRANSACTION   0x0004
760 #define	   I2O_SGL_ATTRIBUTE_FLAGS_32BIT_LOCAL_ADDRESS 0x0000
761 
762 /* SG Size defines */
763 
764 #define	   I2O_SG_COUNT_SZ			       24
765 #define	   I2O_SG_FLAGS_SZ			       8
766 
767 /* Standard Flags and Count fields for SG Elements */
768 
769 typedef struct _I2O_FLAGS_COUNT {
770 #if (defined(__BORLANDC__)) || defined(_DPT_BIG_ENDIAN) || (defined(sparc))
771    U32			       Count;
772 #else
773    BF			       Count:I2O_SG_COUNT_SZ;
774    BF			       Flags:I2O_SG_FLAGS_SZ;
775 #endif
776 } I2O_FLAGS_COUNT, *PI2O_FLAGS_COUNT;
777 
778 /* Bit Bucket Element */
779 
780 typedef struct _I2O_SGE_BIT_BUCKET_ELEMENT {
781    I2O_FLAGS_COUNT	       FlagsCount;
782    U32			       BufferContext;
783 } I2O_SGE_BIT_BUCKET_ELEMENT, *PI2O_SGE_BIT_BUCKET_ELEMENT;
784 
785 /* Chain Addressing Scatter-Gather Element */
786 
787 typedef struct _I2O_SGE_CHAIN_ELEMENT {
788    I2O_FLAGS_COUNT	       FlagsCount;
789    U32			       PhysicalAddress;
790 } I2O_SGE_CHAIN_ELEMENT, *PI2O_SGE_CHAIN_ELEMENT;
791 
792 /* Chain Addressing with Context Scatter-Gather Element */
793 
794 typedef struct _I2O_SGE_CHAIN_CONTEXT_ELEMENT {
795    I2O_FLAGS_COUNT	       FlagsCount;
796    U32			       Context[1];
797    U32			       PhysicalAddress;
798 } I2O_SGE_CHAIN_CONTEXT_ELEMENT, *PI2O_SGE_CHAIN_CONTEXT_ELEMENT;
799 
800 /* Ignore Scatter-Gather Element */
801 
802 typedef struct _I2O_SGE_IGNORE_ELEMENT {
803    I2O_FLAGS_COUNT	       FlagsCount;
804 } I2O_SGE_IGNORE_ELEMENT, *PI2O_SGE_IGNORE_ELEMENT;
805 
806 /* Immediate Data Element */
807 
808 typedef struct _I2O_SGE_IMMEDIATE_DATA_ELEMENT {
809    I2O_FLAGS_COUNT	       FlagsCount;
810 } I2O_SGE_IMMEDIATE_DATA_ELEMENT, *PI2O_SGE_IMMEDIATE_DATA_ELEMENT;
811 
812 /* Immediate Data with Context Element */
813 
814 typedef struct _I2O_SGE_IMMEDIATE_DATA_CONTEXT_ELEMENT {
815    I2O_FLAGS_COUNT	       FlagsCount;
816    U32			       BufferContext;
817 } I2O_SGE_IMMEDIATE_DATA_CONTEXT_ELEMENT, *PI2O_SGE_IMMEDIATE_DATA_CONTEXT_ELEMENT;
818 
819 /* Long Transaction Parameters Element */
820 
821 typedef struct _I2O_SGE_LONG_TRANSACTION_ELEMENT {
822 #if (defined(__BORLANDC__))
823    U32			       LongElementLength;
824 #else
825    BF			       LongElementLength:I2O_SG_COUNT_SZ;
826    BF			       Flags:I2O_SG_FLAGS_SZ;
827 #endif
828    U32			       BufferContext;
829 } I2O_SGE_LONG_TRANSACTION_ELEMENT, *PI2O_SGE_LONG_TRANSACTION_ELEMENT;
830 
831 /* Page List Scatter-Gather Element */
832 
833 typedef struct _I2O_SGE_PAGE_ELEMENT {
834    I2O_FLAGS_COUNT	       FlagsCount;
835    U32			       PhysicalAddress[1];
836 } I2O_SGE_PAGE_ELEMENT , *PI2O_SGE_PAGE_ELEMENT ;
837 
838 /* Page List with Context Scatter-Gather Element */
839 
840 typedef struct _I2O_SGE_PAGE_CONTEXT_ELEMENT {
841    I2O_FLAGS_COUNT	       FlagsCount;
842    U32			       BufferContext[1];
843    U32			       PhysicalAddress[1];
844 } I2O_SGE_PAGE_CONTEXT_ELEMENT, *PI2O_SGE_PAGE_CONTEXT_ELEMENT;
845 
846 /* SGL Attribute Element */
847 
848 typedef struct _I2O_SGE_SGL_ATTRIBUTES_ELEMENT {
849    U16			       SglAttributeFlags;
850    U8			       ElementLength;
851    U8			       Flags;
852    U32			       PageFrameSize;
853 } I2O_SGE_SGL_ATTRIBUTES_ELEMENT, *PI2O_SGE_SGL_ATTRIBUTES_ELEMENT;
854 
855 /* Short Transaction Parameters Element */
856 
857 typedef struct _I2O_SGE_SHORT_TRANSACTION_ELEMENT {
858    U16			       ClassFields;
859    U8			       ElementLength;
860    U8			       Flags;
861    U32			       BufferContext;
862 } I2O_SGE_SHORT_TRANSACTION_ELEMENT, *PI2O_SGE_SHORT_TRANSACTION_ELEMENT;
863 
864 /* Simple Addressing Scatter-Gather Element */
865 
866 typedef struct _I2O_SGE_SIMPLE_ELEMENT {
867    I2O_FLAGS_COUNT	       FlagsCount;
868    U32			       PhysicalAddress;
869 } I2O_SGE_SIMPLE_ELEMENT, *PI2O_SGE_SIMPLE_ELEMENT;
870 
871 /* Simple Addressing with Context Scatter-Gather Element */
872 
873 typedef struct _I2O_SGE_SIMPLE_CONTEXT_ELEMENT {
874    I2O_FLAGS_COUNT	       FlagsCount;
875    U32			       BufferContext[1];
876    U32			       PhysicalAddress;
877 } I2O_SGE_SIMPLE_CONTEXT_ELEMENT, *PI2O_SGE_SIMPLE_CONTEXT_ELEMENT;
878 
879 /* Transport Detail Element */
880 
881 typedef struct _I2O_SGE_TRANSPORT_ELEMENT {
882 #if (defined(__BORLANDC__))
883    U32			       LongElementLength;
884 #else
885    BF			       LongElementLength:I2O_SG_COUNT_SZ;
886    BF			       Flags:I2O_SG_FLAGS_SZ;
887 #endif
888 } I2O_SGE_TRANSPORT_ELEMENT, *PI2O_SGE_TRANSPORT_ELEMENT;
889 
890 typedef struct _I2O_SG_ELEMENT {
891    union {
892        /* Bit Bucket Element */
893        I2O_SGE_BIT_BUCKET_ELEMENT	   BitBucket;
894 
895        /* Chain Addressing Element */
896        I2O_SGE_CHAIN_ELEMENT		   Chain;
897 
898        /* Chain Addressing with Context Element */
899        I2O_SGE_CHAIN_CONTEXT_ELEMENT	   ChainContext;
900 
901        /* Ignore Scatter-Gather Element */
902        I2O_SGE_IGNORE_ELEMENT		   Ignore;
903 
904        /* Immediate Data Element */
905        I2O_SGE_IMMEDIATE_DATA_ELEMENT	   ImmediateData;
906 
907        /* Immediate Data with Context Element */
908        I2O_SGE_IMMEDIATE_DATA_CONTEXT_ELEMENT  ImmediateDataContext;
909 
910        /* Long Transaction Parameters Element */
911        I2O_SGE_LONG_TRANSACTION_ELEMENT	   LongTransaction;
912 
913        /* Page List Element */
914        I2O_SGE_PAGE_ELEMENT		   Page;
915 
916        /* Page List with Context Element */
917        I2O_SGE_PAGE_CONTEXT_ELEMENT	   PageContext;
918 
919        /* SGL Attribute Element */
920        I2O_SGE_SGL_ATTRIBUTES_ELEMENT	   SGLAttribute;
921 
922        /* Short Transaction Parameters Element */
923        I2O_SGE_SHORT_TRANSACTION_ELEMENT   ShortTransaction;
924 
925        /* Simple Addressing Element */
926        /* (variable, as with others, use '2' to avoid gcc warning) */
927        I2O_SGE_SIMPLE_ELEMENT		   Simple[2];
928 
929        /* Simple Addressing with Context Element */
930        I2O_SGE_SIMPLE_CONTEXT_ELEMENT	   SimpleContext[1];
931 
932        /* Transport Detail Element */
933        I2O_SGE_TRANSPORT_ELEMENT	   Transport;
934 #if (defined(sun) && defined(u))
935 /* there is a macro defined in Solaris sys/user.h for u, rename this to uSG */
936    } uSG ;
937 #else
938    } u ;
939 #endif
940 } I2O_SG_ELEMENT, *PI2O_SG_ELEMENT;
941 
942 /****************************************************************************/
943 /*  Basic Parameter Group Access */
944 /****************************************************************************/
945 
946 /* Operation Function Numbers */
947 
948 #define	  I2O_PARAMS_OPERATION_FIELD_GET	       0x0001
949 #define	  I2O_PARAMS_OPERATION_LIST_GET		       0x0002
950 #define	  I2O_PARAMS_OPERATION_MORE_GET		       0x0003
951 #define	  I2O_PARAMS_OPERATION_SIZE_GET		       0x0004
952 #define	  I2O_PARAMS_OPERATION_TABLE_GET	       0x0005
953 #define	  I2O_PARAMS_OPERATION_FIELD_SET	       0x0006
954 #define	  I2O_PARAMS_OPERATION_LIST_SET		       0x0007
955 #define	  I2O_PARAMS_OPERATION_ROW_ADD		       0x0008
956 #define	  I2O_PARAMS_OPERATION_ROW_DELETE	       0x0009
957 #define	  I2O_PARAMS_OPERATION_TABLE_CLEAR	       0x000A
958 
959 /* Operations List Header */
960 
961 typedef struct _I2O_PARAM_OPERATIONS_LIST_HEADER {
962    U16			       OperationCount;
963    U16			       Reserved;
964 } I2O_PARAM_OPERATIONS_LIST_HEADER, *PI2O_PARAM_OPERATIONS_LIST_HEADER;
965 
966 /* Results List Header */
967 
968 typedef struct _I2O_PARAM_RESULTS_LIST_HEADER {
969    U16			       ResultCount;
970    U16			       Reserved;
971 } I2O_PARAM_RESULTS_LIST_HEADER, *PI2O_PARAM_RESULTS_LIST_HEADER;
972 
973 /* Read Operation Result Block Template Structure */
974 
975 typedef struct _I2O_PARAM_READ_OPERATION_RESULT {
976    U16			       BlockSize;
977    U8			       BlockStatus;
978    U8			       ErrorInfoSize;
979    /*			       Operations Results	   */
980    /*			       Pad (if any)		   */
981    /*			       ErrorInformation (if any)   */
982 } I2O_PARAM_READ_OPERATION_RESULT, *PI2O_PARAM_READ_OPERATION_RESULT;
983 
984 typedef struct _I2O_TABLE_READ_OPERATION_RESULT {
985    U16			       BlockSize;
986    U8			       BlockStatus;
987    U8			       ErrorInfoSize;
988    U16			       RowCount;
989    U16			       MoreFlag;
990    /*			       Operations Results	   */
991    /*			       Pad (if any)		   */
992    /*			       ErrorInformation (if any)   */
993 } I2O_TABLE_READ_OPERATION_RESULT, *PI2O_TABLE_READ_OPERATION_RESULT;
994 
995 /* Error Information Template Structure */
996 
997 typedef struct _I2O_PARAM_ERROR_INFO_TEMPLATE {
998    U16			       OperationCode;
999    U16			       GroupNumber;
1000    U16			       FieldIdx;
1001    U8			       AdditionalStatus;
1002    U8			       NumberKeys;
1003    /*			       List of Key Values (variable)   */
1004    /*			       Pad (if any)		       */
1005 } I2O_PARAM_ERROR_INFO_TEMPLATE, *PI2O_PARAM_ERROR_INFO_TEMPLATE;
1006 
1007 /* Operation Template for Specific Fields */
1008 
1009 typedef struct _I2O_PARAM_OPERATION_SPECIFIC_TEMPLATE {
1010    U16			       Operation;
1011    U16			       GroupNumber;
1012    U16			       FieldCount;
1013    U16			       FieldIdx[1];
1014    /*			       Pad (if any)		       */
1015 } I2O_PARAM_OPERATION_SPECIFIC_TEMPLATE, *PI2O_PARAM_OPERATION_SPECIFIC_TEMPLATE;
1016 
1017 /* Operation Template for All Fields */
1018 
1019 typedef struct _I2O_PARAM_OPERATION_ALL_TEMPLATE {
1020    U16			       Operation;
1021    U16			       GroupNumber;
1022    U16			       FieldCount;
1023    /*			       Pad (if any)		       */
1024 } I2O_PARAM_OPERATION_ALL_TEMPLATE, *PI2O_PARAM_OPERATION_ALL_TEMPLATE;
1025 
1026 /* Operation Template for All List Fields */
1027 
1028 typedef struct _I2O_PARAM_OPERATION_ALL_LIST_TEMPLATE {
1029    U16			       Operation;
1030    U16			       GroupNumber;
1031    U16			       FieldCount;
1032    U16			       KeyCount;
1033    U8			       KeyValue;
1034    /*			       Pad (if any)		       */
1035 } I2O_PARAM_OPERATION_ALL_LIST_TEMPLATE, *PI2O_PARAM_OPERATION_ALL_LIST_TEMPLATE;
1036 
1037 /* Modify Operation Result Block Template Structure */
1038 
1039 typedef struct _I2O_PARAM_MODIFY_OPERATION_RESULT {
1040    U16			       BlockSize;
1041    U8			       BlockStatus;
1042    U8			       ErrorInfoSize;
1043    /*			       ErrorInformation (if any)   */
1044 } I2O_PARAM_MODIFY_OPERATION_RESULT, *PI2O_PARAM_MODIFY_OPERATION_RESULT;
1045 
1046 /* Operation Template for Row Delete  */
1047 
1048 typedef struct _I2O_PARAM_OPERATION_ROW_DELETE_TEMPLATE {
1049    U16			       Operation;
1050    U16			       GroupNumber;
1051    U16			       RowCount;
1052    U8			       KeyValue;
1053 } I2O_PARAM_OPERATION_ROW_DELETE_TEMPLATE, *PI2O_PARAM_OPERATION_ROW_DELETE_TEMPLATE;
1054 
1055 /* Operation Template for Table Clear  */
1056 
1057 typedef struct _I2O_PARAM_OPERATION_TABLE_CLEAR_TEMPLATE {
1058    U16			       Operation;
1059    U16			       GroupNumber;
1060 } I2O_PARAM_OPERATION_TABLE_CLEAR_TEMPLATE, *PI2O_PARAM_OPERATION_TABLE_CLEAR_TEMPLATE;
1061 
1062 /* Status codes and Error Information for Parameter functions */
1063 
1064 #define	  I2O_PARAMS_STATUS_SUCCESS		   0x00
1065 #define	  I2O_PARAMS_STATUS_BAD_KEY_ABORT	   0x01
1066 #define	  I2O_PARAMS_STATUS_BAD_KEY_CONTINUE	   0x02
1067 #define	  I2O_PARAMS_STATUS_BUFFER_FULL		   0x03
1068 #define	  I2O_PARAMS_STATUS_BUFFER_TOO_SMALL	   0x04
1069 #define	  I2O_PARAMS_STATUS_FIELD_UNREADABLE	   0x05
1070 #define	  I2O_PARAMS_STATUS_FIELD_UNWRITEABLE	   0x06
1071 #define	  I2O_PARAMS_STATUS_INSUFFICIENT_FIELDS	   0x07
1072 #define	  I2O_PARAMS_STATUS_INVALID_GROUP_ID	   0x08
1073 #define	  I2O_PARAMS_STATUS_INVALID_OPERATION	   0x09
1074 #define	  I2O_PARAMS_STATUS_NO_KEY_FIELD	   0x0A
1075 #define	  I2O_PARAMS_STATUS_NO_SUCH_FIELD	   0x0B
1076 #define	  I2O_PARAMS_STATUS_NON_DYNAMIC_GROUP	   0x0C
1077 #define	  I2O_PARAMS_STATUS_OPERATION_ERROR	   0x0D
1078 #define	  I2O_PARAMS_STATUS_SCALAR_ERROR	   0x0E
1079 #define	  I2O_PARAMS_STATUS_TABLE_ERROR		   0x0F
1080 #define	  I2O_PARAMS_STATUS_WRONG_GROUP_TYPE	   0x10
1081 
1082 
1083 /****************************************************************************/
1084 /* GROUP Parameter Groups */
1085 /****************************************************************************/
1086 
1087 /* GROUP Configuration and Operating Structures and Defines */
1088 
1089 /* Groups Numbers */
1090 
1091 #define	   I2O_UTIL_PARAMS_DESCRIPTOR_GROUP_NO		0xF000
1092 #define	   I2O_UTIL_PHYSICAL_DEVICE_TABLE_GROUP_NO	0xF001
1093 #define	   I2O_UTIL_CLAIMED_TABLE_GROUP_NO		0xF002
1094 #define	   I2O_UTIL_USER_TABLE_GROUP_NO			0xF003
1095 #define	   I2O_UTIL_PRIVATE_MESSAGE_EXTENSIONS_GROUP_NO 0xF005
1096 #define	   I2O_UTIL_AUTHORIZED_USER_TABLE_GROUP_NO	0xF006
1097 #define	   I2O_UTIL_DEVICE_IDENTITY_GROUP_NO		0xF100
1098 #define	   I2O_UTIL_DDM_IDENTITY_GROUP_NO		0xF101
1099 #define	   I2O_UTIL_USER_INFORMATION_GROUP_NO		0xF102
1100 #define	   I2O_UTIL_SGL_OPERATING_LIMITS_GROUP_NO	0xF103
1101 #define	   I2O_UTIL_SENSORS_GROUP_NO			0xF200
1102 
1103 /* UTIL Group F000h - GROUP DESCRIPTORS Parameter Group */
1104 
1105 #define	   I2O_UTIL_GROUP_PROPERTIES_GROUP_TABLE       0x01
1106 #define	   I2O_UTIL_GROUP_PROPERTIES_ROW_ADDITION      0x02
1107 #define	   I2O_UTIL_GROUP_PROPERTIES_ROW_DELETION      0x04
1108 #define	   I2O_UTIL_GROUP_PROPERTIES_CLEAR_OPERATION   0x08
1109 
1110 typedef struct _I2O_UTIL_GROUP_DESCRIPTOR_TABLE {
1111    U16			       GroupNumber;
1112    U16			       FieldCount;
1113    U16			       RowCount;
1114    U8			       Properties;
1115    U8			       reserved;
1116 } I2O_UTIL_GROUP_DESCRIPTOR_TABLE, *PI2O_UTIL_GROUP_DESCRIPTOR_TABLE;
1117 
1118 /* UTIL Group F001h - Physical Device Table Parameter Group */
1119 
1120 typedef struct _I2O_UTIL_PHYSICAL_DEVICE_TABLE {
1121    U32			       AdapterID;
1122 } I2O_UTIL_PHYSICAL_DEVICE_TABLE, *PI2O_UTIL_PHYSICAL_DEVICE_TABLE;
1123 
1124 /* UTIL Group F002h - Claimed Table Parameter Group */
1125 
1126 typedef struct _I2O_UTIL_CLAIMED_TABLE {
1127    U16			       ClaimedTID;
1128 } I2O_UTIL_CLAIMED_TABLE, *PI2O_UTIL_CLAIMED_TABLE;
1129 
1130 /* UTIL Group F003h - User Table Parameter Group */
1131 
1132 typedef struct _I2O_UTIL_USER_TABLE {
1133    U16			       Instance;
1134    U16			       UserTID;
1135    U8			       ClaimType;
1136    U8			       reserved1;
1137    U16			       reserved2;
1138 } I2O_UTIL_USER_TABLE, *PI2O_UTIL_USER_TABLE;
1139 
1140 /* UTIL Group F005h - Private Message Extensions Parameter Group */
1141 
1142 typedef struct _I2O_UTIL_PRIVATE_MESSAGE_EXTENSIONS_TABLE {
1143    U16			       ExtInstance;
1144    U16			       OrganizationID;
1145    U16			       XFunctionCode;
1146 } I2O_UTIL_PRIVATE_MESSAGE_EXTENSIONS_TABLE, *PI2O_UTIL_PRIVATE_MESSAGE_EXTENSIONS_TABLE;
1147 
1148 /* UTIL Group F006h - Authorized User Table Parameter Group */
1149 
1150 typedef struct _I2O_UTIL_AUTHORIZED_USER_TABLE {
1151    U16			       AlternateTID;
1152 } I2O_UTIL_AUTHORIZED_USER_TABLE, *PI2O_UTIL_AUTHORIZED_USER_TABLE;
1153 
1154 /* UTIL Group F100h - Device Identity Parameter Group */
1155 
1156 typedef struct _I2O_UTIL_DEVICE_IDENTITY_SCALAR {
1157    U32			       ClassID;
1158    U16			       OwnerTID;
1159    U16			       ParentTID;
1160    U8			       VendorInfo[I2O_DEVID_VENDOR_INFO_SZ];
1161    U8			       ProductInfo[I2O_DEVID_PRODUCT_INFO_SZ];
1162    U8			       Description[I2O_DEVID_DESCRIPTION_SZ];
1163    U8			       ProductRevLevel[I2O_DEVID_REV_LEVEL_SZ];
1164    U8			       SNFormat;
1165    U8			       SerialNumber[I2O_MAX_SERIAL_NUMBER_SZ];
1166 } I2O_UTIL_DEVICE_IDENTITY_SCALAR, *PI2O_UTIL_DEVICE_IDENTITY_SCALAR;
1167 
1168 /* UTIL Group F101h - DDM Identity Parameter Group */
1169 
1170 typedef struct _I2O_UTIL_DDM_IDENTITY_SCALAR {
1171    U16			       DdmTID;
1172    U8			       ModuleName[I2O_MODULE_NAME_SZ];
1173    U8			       ModuleRevLevel[I2O_DEVID_REV_LEVEL_SZ];
1174    U8			       SNFormat;
1175    U8			       SerialNumber[I2O_MAX_SERIAL_NUMBER_SZ];
1176 } I2O_UTIL_DDM_IDENTITY_SCALAR, *PI2O_UTIL_DDM_IDENTITY_SCALAR;
1177 
1178 /* UTIL Group F102h - User Information Parameter Group */
1179 
1180 #define	   I2O_USER_DEVICE_NAME_SZ		       64
1181 #define	   I2O_USER_SERVICE_NAME_SZ		       64
1182 #define	   I2O_USER_PHYSICAL_LOCATION_SZ	       64
1183 
1184 typedef struct _I2O_UTIL_USER_INFORMATION_SCALAR {
1185    U8			       DeviceName[I2O_USER_DEVICE_NAME_SZ];
1186    U8			       ServiceName[I2O_USER_SERVICE_NAME_SZ];
1187    U8			       PhysicalLocation[I2O_USER_PHYSICAL_LOCATION_SZ];
1188    U32			       InstanceNumber;
1189 } I2O_UTIL_USER_INFORMATION_SCALAR, *PI2O_UTIL_USER_INFORMATION_SCALAR;
1190 
1191 /* UTIL Group F103h - SGL Operating Limits Parameter Group */
1192 
1193 typedef struct _I2O_UTIL_SGL_OPERATING_LIMITS_SCALAR {
1194    U32			       SglChainSize;
1195    U32			       SglChainSizeMax;
1196    U32			       SglChainSizeTarget;
1197    U16			       SglFragCount;
1198    U16			       SglFragCountMax;
1199    U16			       SglFragCountTarget;
1200 } I2O_UTIL_SGL_OPERATING_LIMITS_SCALAR, *PI2O_UTIL_SGL_OPERATING_LIMITS_SCALAR;
1201 
1202 /* UTIL Group F200h - Sensors Parameter Group */
1203 
1204 #define	   I2O_SENSOR_COMPONENT_OTHER		       0x00
1205 #define	   I2O_SENSOR_COMPONENT_PLANAR_LOGIC_BOARD     0x01
1206 #define	   I2O_SENSOR_COMPONENT_CPU		       0x02
1207 #define	   I2O_SENSOR_COMPONENT_CHASSIS		       0x03
1208 #define	   I2O_SENSOR_COMPONENT_POWER_SUPPLY	       0x04
1209 #define	   I2O_SENSOR_COMPONENT_STORAGE		       0x05
1210 #define	   I2O_SENSOR_COMPONENT_EXTERNAL	       0x06
1211 
1212 #define	   I2O_SENSOR_SENSOR_CLASS_ANALOG	       0x00
1213 #define	   I2O_SENSOR_SENSOR_CLASS_DIGITAL	       0x01
1214 
1215 #define	   I2O_SENSOR_SENSOR_TYPE_OTHER		       0x00
1216 #define	   I2O_SENSOR_SENSOR_TYPE_THERMAL	       0x01
1217 #define	   I2O_SENSOR_SENSOR_TYPE_DC_VOLTAGE	       0x02
1218 #define	   I2O_SENSOR_SENSOR_TYPE_AC_VOLTAGE	       0x03
1219 #define	   I2O_SENSOR_SENSOR_TYPE_DC_CURRENT	       0x04
1220 #define	   I2O_SENSOR_SENSOR_TYPE_AC_CURRENT	       0x05
1221 #define	   I2O_SENSOR_SENSOR_TYPE_DOOR_OPEN	       0x06
1222 #define	   I2O_SENSOR_SENSOR_TYPE_FAN_OPERATIONAL      0x07
1223 
1224 #define	   I2O_SENSOR_SENSOR_STATE_NORMAL	       0x00
1225 #define	   I2O_SENSOR_SENSOR_STATE_ABNORMAL	       0x01
1226 #define	   I2O_SENSOR_SENSOR_STATE_UNKNOWN	       0x02
1227 #define	   I2O_SENSOR_SENSOR_STATE_LOW_CAT	       0x03
1228 #define	   I2O_SENSOR_SENSOR_STATE_LOW		       0x04
1229 #define	   I2O_SENSOR_SENSOR_STATE_LOW_WARNING	       0x05
1230 #define	   I2O_SENSOR_SENSOR_STATE_HIGH_WARNING	       0x06
1231 #define	   I2O_SENSOR_SENSOR_STATE_HIGH		       0x07
1232 #define	   I2O_SENSOR_SENSOR_STATE_HIGH_CAT	       0x08
1233 
1234 #define	   I2O_SENSOR_EVENT_ENABLE_STATE_CHANGE	       0x0001
1235 #define	   I2O_SENSOR_EVENT_ENABLE_LOW_CATASTROPHIC    0x0002
1236 #define	   I2O_SENSOR_EVENT_ENABLE_LOW_READING	       0x0004
1237 #define	   I2O_SENSOR_EVENT_ENABLE_LOW_WARNING	       0x0008
1238 #define	   I2O_SENSOR_EVENT_ENABLE_CHANGE_TO_NORMAL    0x0010
1239 #define	   I2O_SENSOR_EVENT_ENABLE_HIGH_WARNING	       0x0020
1240 #define	   I2O_SENSOR_EVENT_ENABLE_HIGH_READING	       0x0040
1241 #define	   I2O_SENSOR_EVENT_ENABLE_HIGH_CATASTROPHIC   0x0080
1242 
1243 
1244 typedef struct _I2O_UTIL_SENSORS_TABLE {
1245    U16			       SensorInstance;
1246    U8			       Component;
1247    U16			       ComponentInstance;
1248    U8			       SensorClass;
1249    U8			       SensorType;
1250    S8			       ScalingExponent;
1251    S32			       ActualReading;
1252    S32			       MinimumReading;
1253    S32			       Low2LowCatThreshold;
1254    S32			       LowCat2LowThreshold;
1255    S32			       LowWarn2LowThreshold;
1256    S32			       Low2LowWarnThreshold;
1257    S32			       Norm2LowWarnThreshold;
1258    S32			       LowWarn2NormThreshold;
1259    S32			       NominalReading;
1260    S32			       HiWarn2NormThreshold;
1261    S32			       Norm2HiWarnThreshold;
1262    S32			       High2HiWarnThreshold;
1263    S32			       HiWarn2HighThreshold;
1264    S32			       HiCat2HighThreshold;
1265    S32			       Hi2HiCatThreshold;
1266    S32			       MaximumReading;
1267    U8			       SensorState;
1268    U16			       EventEnable;
1269 } I2O_UTIL_SENSORS_TABLE, *PI2O_UTIL_SENSORS_TABLE;
1270 
1271 
1272 PRAGMA_PACK_POP
1273 
1274 PRAGMA_ALIGN_POP
1275 
1276 #endif	  /* I2O_MESSAGE_HDR */
1277