i2outil.h revision 96551
1/****************************************************************
2 * Copyright (c) 1996-2000 Distributed Processing Technology Corporation
3 * Copyright (c) 2000 Adaptec Corporation.
4 * All rights reserved.
5 *
6 * Copyright 1999 I2O Special Interest Group (I2O SIG).  All rights reserved.
7 * All rights reserved
8 *
9 * TERMS AND CONDITIONS OF USE
10 *
11 * Redistribution and use in source form, with or without modification, are
12 * permitted provided that redistributions of source code must retain the
13 * above copyright notice, this list of conditions and the following disclaimer.
14 *
15 * This software is provided `as is' by Distributed Processing Technology and
16 * any express or implied warranties, including, but not limited to, the
17 * implied warranties of merchantability and fitness for a particular purpose,
18 * are disclaimed. In no event shall Distributed Processing Technology be
19 * liable for any direct, indirect, incidental, special, exemplary or
20 * consequential damages (including, but not limited to, procurement of
21 * substitute goods or services; loss of use, data, or profits; or business
22 * interruptions) however caused and on any theory of liability, whether in
23 * contract, strict liability, or tort (including negligence or otherwise)
24 * arising in any way out of the use of this driver software, even if advised
25 * of the possibility of such damage.
26 *
27 * This header file, and any modifications of this header file, are provided
28 * contingent upon your agreement and adherence to the here-listed terms and
29 * conditions.  By accepting and/or using this header file, you agree to abide
30 * by these terms and conditions and that these terms and conditions will be
31 * construed and governed in accordance with the laws of the State of California,
32 * without reference to conflict-of-law provisions.  If you do not agree
33 * to these terms and conditions, please delete this file, and any copies,
34 * permanently, without making any use thereof.
35 *
36 * THIS HEADER FILE IS PROVIDED FREE OF CHARGE ON AN AS-IS BASIS WITHOUT
37 * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
38 * TO IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
39 * PURPOSE.  I2O SIG DOES NOT WARRANT THAT THIS HEADER FILE WILL MEET THE
40 * USER'S REQUIREMENTS OR THAT ITS OPERATION WILL BE UNINTERRUPTED OR
41 * ERROR-FREE.
42 *
43 * I2O SIG DISCLAIMS ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF
44 * ANY PROPRIETARY RIGHTS, RELATING TO THE IMPLEMENTATION OF THE I2O
45 * SPECIFICATIONS.  I2O SIG DOES NOT WARRANT OR REPRESENT THAT SUCH
46 * IMPLEMENTATIONS WILL NOT INFRINGE SUCH RIGHTS.
47 *
48 * THE USER OF THIS HEADER FILE SHALL HAVE NO RECOURSE TO I2O SIG FOR ANY
49 * ACTUAL OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO, LOST DATA
50 * OR LOST PROFITS ARISING OUT OF THE USE OR INABILITY TO USE THIS PROGRAM.
51 *
52 * I2O SIG grants the user of this header file a license to copy, distribute,
53 * and modify it, for any purpose, under the following terms.  Any copying,
54 * distribution, or modification of this header file must not delete or alter
55 * the copyright notice of I2O SIG or any of these Terms and Conditions.
56 *
57 * Any distribution of this header file must not include a charge for the
58 * header file (unless such charges are strictly for the physical acts of
59 * copying or transferring copies).  However, distribution of a product in
60 * which this header file is embedded may include a charge so long as any
61 * such charge does not include any charge for the header file itself.
62 *
63 * Any modification of this header file constitutes a derivative work based
64 * on this header file.  Any distribution of such derivative work: (1) must
65 * include prominent notices that the header file has been changed from the
66 * original, together with the dates of any changes; (2) automatically includes
67 * this same license to the original header file from I2O SIG, without any
68 * restriction thereon from the distributing user; and (3) must include a
69 * grant of license of the modified file under the same terms and conditions
70 * as these Terms and Conditions.
71 *
72 * The I2O SIG Web site can be found at: http://www.i2osig.org
73 *
74 * The I2O SIG encourages you to deposit derivative works based on this
75 * header file at the I2O SIG Web site.  Furthermore, to become a Registered
76 * Developer of the I2O SIG, sign up at the Web site or call 415.750.8352
77 * (United States).
78 *
79 * $FreeBSD: head/sys/dev/asr/i2outil.h 96551 2002-05-14 00:53:08Z obrien $
80 *
81 ****************************************************************/
82
83/*********************************************************************
84 * I2OUtil.h -- I2O Utility Class Message defintion file
85 *
86 * This file contains information presented in Chapter 6 of the I2O
87 * Specification.
88 **********************************************************************/
89
90#if !defined(I2O_UTILITY_HDR)
91#define	I2O_UTILITY_HDR
92
93#define	I2OUTIL_REV 1_5_4  /* I2OUtil header file revision string */
94
95#if ((defined(KERNEL) || defined(_KERNEL)) && defined(__FreeBSD__))
96# if (KERN_VERSION < 3)
97#  include   "i386/pci/i2omsg.h"      /* Include the Base Message file */
98# else
99#  include   "dev/asr/i2omsg.h"
100# endif
101#else
102# include   "i2omsg.h"      /* Include the Base Message file */
103#endif
104
105
106/*
107NOTES:
108
109   Gets, reads, receives, etc. are all even numbered functions.
110   Sets, writes, sends, etc. are all odd numbered functions.
111   Functions that both send and receive data can be either but an attempt is made
112       to use the function number that indicates the greater transfer amount.
113   Functions that do not send or receive data use odd function numbers.
114
115   Some functions are synonyms like read, receive and send, write.
116
117   All common functions will have a code of less than 0x80.
118   Unique functions to a class will start at 0x80.
119   Executive Functions start at 0xA0.
120
121   Utility Message function codes range from 0 - 0x1f
122   Base Message function codes range from 0x20 - 0xfe
123   Private Message function code is 0xff.
124*/
125
126PRAGMA_ALIGN_PUSH
127
128PRAGMA_PACK_PUSH
129
130/* Utility Message class functions. */
131
132#define	   I2O_UTIL_NOP                                0x00
133#define	   I2O_UTIL_ABORT                              0x01
134#define	   I2O_UTIL_CLAIM                              0x09
135#define	   I2O_UTIL_CLAIM_RELEASE                      0x0B
136#define	   I2O_UTIL_CONFIG_DIALOG                      0x10
137#define	   I2O_UTIL_DEVICE_RESERVE                     0x0D
138#define	   I2O_UTIL_DEVICE_RELEASE                     0x0F
139#define	   I2O_UTIL_EVENT_ACKNOWLEDGE                  0x14
140#define	   I2O_UTIL_EVENT_REGISTER                     0x13
141#define	   I2O_UTIL_LOCK                               0x17
142#define	   I2O_UTIL_LOCK_RELEASE                       0x19
143#define	   I2O_UTIL_PARAMS_GET                         0x06
144#define	   I2O_UTIL_PARAMS_SET                         0x05
145#define	   I2O_UTIL_REPLY_FAULT_NOTIFY                 0x15
146
147/****************************************************************************/
148
149/* ABORT Abort type defines. */
150
151#define	   I2O_ABORT_TYPE_EXACT_ABORT                  0x00
152#define	   I2O_ABORT_TYPE_FUNCTION_ABORT               0x01
153#define	   I2O_ABORT_TYPE_TRANSACTION_ABORT            0x02
154#define	   I2O_ABORT_TYPE_WILD_ABORT                   0x03
155#define	   I2O_ABORT_TYPE_CLEAN_EXACT_ABORT            0x04
156#define	   I2O_ABORT_TYPE_CLEAN_FUNCTION_ABORT         0x05
157#define	   I2O_ABORT_TYPE_CLEAN_TRANSACTION_ABORT      0x06
158#define	   I2O_ABORT_TYPE_CLEAN_WILD_ABORT             0x07
159
160/* UtilAbort Function Message Frame structure. */
161
162typedef struct _I2O_UTIL_ABORT_MESSAGE {
163    I2O_MESSAGE_FRAME          StdMessageFrame;
164    I2O_TRANSACTION_CONTEXT    TransactionContext;
165#   if (defined(_DPT_BIG_ENDIAN) || defined(sparc))
166        U32                    reserved;
167#   else
168        U16                    reserved;
169        U8                     AbortType;
170        U8                     FunctionToAbort;
171#   endif
172    I2O_TRANSACTION_CONTEXT    TransactionContextToAbort;
173} I2O_UTIL_ABORT_MESSAGE, *PI2O_UTIL_ABORT_MESSAGE;
174
175
176typedef struct _I2O_UTIL_ABORT_REPLY {
177    I2O_MESSAGE_FRAME          StdMessageFrame;
178    I2O_TRANSACTION_CONTEXT    TransactionContext;
179    U32                        CountOfAbortedMessages;
180} I2O_UTIL_ABORT_REPLY, *PI2O_UTIL_ABORT_REPLY;
181
182
183/****************************************************************************/
184
185/* Claim Flag defines */
186
187#define	   I2O_CLAIM_FLAGS_EXCLUSIVE                   0x0001 /* Reserved */
188#define	   I2O_CLAIM_FLAGS_RESET_SENSITIVE             0x0002
189#define	   I2O_CLAIM_FLAGS_STATE_SENSITIVE             0x0004
190#define	   I2O_CLAIM_FLAGS_CAPACITY_SENSITIVE          0x0008
191#define	   I2O_CLAIM_FLAGS_PEER_SERVICE_DISABLED       0x0010
192#define	   I2O_CLAIM_FLAGS_MGMT_SERVICE_DISABLED       0x0020
193
194/* Claim Type defines */
195
196#define	   I2O_CLAIM_TYPE_PRIMARY_USER                 0x01
197#define	   I2O_CLAIM_TYPE_AUTHORIZED_USER              0x02
198#define	   I2O_CLAIM_TYPE_SECONDARY_USER               0x03
199#define	   I2O_CLAIM_TYPE_MANAGEMENT_USER              0x04
200
201/* UtilClaim Function Message Frame structure. */
202
203typedef struct _I2O_UTIL_CLAIM_MESSAGE {
204    I2O_MESSAGE_FRAME          StdMessageFrame;
205    I2O_TRANSACTION_CONTEXT    TransactionContext;
206    U16                        ClaimFlags;
207    U8                         reserved;
208    U8                         ClaimType;
209} I2O_UTIL_CLAIM_MESSAGE, *PI2O_UTIL_CLAIM_MESSAGE;
210
211
212/****************************************************************************/
213
214/* Claim Release Flag defines */
215
216#define	   I2O_RELEASE_FLAGS_CONDITIONAL               0x0001
217
218/* UtilClaimRelease Function Message Frame structure. */
219
220typedef struct _I2O_UTIL_CLAIM_RELEASE_MESSAGE {
221    I2O_MESSAGE_FRAME          StdMessageFrame;
222    I2O_TRANSACTION_CONTEXT    TransactionContext;
223    U16                        ReleaseFlags;
224    U8                         reserved;
225    U8                         ClaimType;
226} I2O_UTIL_CLAIM_RELEASE_MESSAGE, *PI2O_UTIL_CLAIM_RELEASE_MESSAGE;
227
228
229/****************************************************************************/
230
231/*  UtilConfigDialog Function Message Frame structure */
232
233typedef struct _I2O_UTIL_CONFIG_DIALOG_MESSAGE {
234    I2O_MESSAGE_FRAME          StdMessageFrame;
235    I2O_TRANSACTION_CONTEXT    TransactionContext;
236    U32                        PageNumber;
237    I2O_SG_ELEMENT             SGL;
238} I2O_UTIL_CONFIG_DIALOG_MESSAGE, *PI2O_UTIL_CONFIG_DIALOG_MESSAGE;
239
240
241/****************************************************************************/
242
243/*  Event Acknowledge Function Message Frame structure */
244
245typedef struct _I2O_UTIL_EVENT_ACK_MESSAGE {
246    I2O_MESSAGE_FRAME          StdMessageFrame;
247    I2O_TRANSACTION_CONTEXT    TransactionContext;
248    U32                        EventIndicator;
249    U32                        EventData[1];
250} I2O_UTIL_EVENT_ACK_MESSAGE, *PI2O_UTIL_EVENT_ACK_MESSAGE;
251
252/* Event Ack Reply structure */
253
254typedef struct _I2O_UTIL_EVENT_ACK_REPLY {
255    I2O_MESSAGE_FRAME          StdMessageFrame;
256    I2O_TRANSACTION_CONTEXT    TransactionContext;
257    U32                        EventIndicator;
258    U32                        EventData[1];
259} I2O_UTIL_EVENT_ACK_REPLY, *PI2O_UTIL_EVENT_ACK_REPLY;
260
261
262/****************************************************************************/
263
264/* Event Indicator Mask Flags */
265
266#define	   I2O_EVENT_IND_STATE_CHANGE                  0x80000000
267#define	   I2O_EVENT_IND_GENERAL_WARNING               0x40000000
268#define	   I2O_EVENT_IND_CONFIGURATION_FLAG            0x20000000
269/* #define	   I2O_EVENT_IND_RESERVE_RELEASE               0x10000000 */
270#define	   I2O_EVENT_IND_LOCK_RELEASE                  0x10000000
271#define	   I2O_EVENT_IND_CAPABILITY_CHANGE             0x08000000
272#define	   I2O_EVENT_IND_DEVICE_RESET                  0x04000000
273#define	   I2O_EVENT_IND_EVENT_MASK_MODIFIED           0x02000000
274#define	   I2O_EVENT_IND_FIELD_MODIFIED                0x01000000
275#define	   I2O_EVENT_IND_VENDOR_EVENT                  0x00800000
276#define	   I2O_EVENT_IND_DEVICE_STATE                  0x00400000
277
278/* Event Data for generic Events */
279
280#define	   I2O_EVENT_STATE_CHANGE_NORMAL               0x00
281#define	   I2O_EVENT_STATE_CHANGE_SUSPENDED            0x01
282#define	   I2O_EVENT_STATE_CHANGE_RESTART              0x02
283#define	   I2O_EVENT_STATE_CHANGE_NA_RECOVER           0x03
284#define	   I2O_EVENT_STATE_CHANGE_NA_NO_RECOVER        0x04
285#define	   I2O_EVENT_STATE_CHANGE_QUIESCE_REQUEST      0x05
286#define	   I2O_EVENT_STATE_CHANGE_FAILED               0x10
287#define	   I2O_EVENT_STATE_CHANGE_FAULTED              0x11
288
289#define	   I2O_EVENT_GEN_WARNING_NORMAL                0x00
290#define	   I2O_EVENT_GEN_WARNING_ERROR_THRESHOLD       0x01
291#define	   I2O_EVENT_GEN_WARNING_MEDIA_FAULT           0x02
292
293#define	   I2O_EVENT_CAPABILITY_OTHER                  0x01
294#define	   I2O_EVENT_CAPABILITY_CHANGED                0x02
295
296#define	   I2O_EVENT_SENSOR_STATE_CHANGED              0x01
297
298
299/*  UtilEventRegister Function Message Frame structure */
300
301typedef struct _I2O_UTIL_EVENT_REGISTER_MESSAGE {
302    I2O_MESSAGE_FRAME          StdMessageFrame;
303    I2O_TRANSACTION_CONTEXT    TransactionContext;
304    U32                        EventMask;
305} I2O_UTIL_EVENT_REGISTER_MESSAGE, *PI2O_UTIL_EVENT_REGISTER_MESSAGE;
306
307/* UtilEventRegister Reply structure */
308
309typedef struct _I2O_UTIL_EVENT_REGISTER_REPLY {
310    I2O_MESSAGE_FRAME          StdMessageFrame;
311    I2O_TRANSACTION_CONTEXT    TransactionContext;
312    U32                        EventIndicator;
313    U32                        EventData[1];
314} I2O_UTIL_EVENT_REGISTER_REPLY, *PI2O_UTIL_EVENT_REGISTER_REPLY;
315
316
317/****************************************************************************/
318
319/* UtilLock Function Message Frame structure. */
320
321typedef struct _I2O_UTIL_LOCK_MESSAGE {
322    I2O_MESSAGE_FRAME          StdMessageFrame;
323    I2O_TRANSACTION_CONTEXT    TransactionContext;
324} I2O_UTIL_LOCK_MESSAGE, *PI2O_UTIL_LOCK_MESSAGE;
325
326/****************************************************************************/
327
328/* UtilLockRelease Function Message Frame structure. */
329
330typedef struct _I2O_UTIL_LOCK_RELEASE_MESSAGE {
331    I2O_MESSAGE_FRAME          StdMessageFrame;
332    I2O_TRANSACTION_CONTEXT    TransactionContext;
333} I2O_UTIL_LOCK_RELEASE_MESSAGE, *PI2O_UTIL_LOCK_RELEASE_MESSAGE;
334
335
336/****************************************************************************/
337
338/* UtilNOP Function Message Frame structure. */
339
340typedef struct _I2O_UTIL_NOP_MESSAGE {
341    I2O_MESSAGE_FRAME          StdMessageFrame;
342} I2O_UTIL_NOP_MESSAGE, *PI2O_UTIL_NOP_MESSAGE;
343
344
345/****************************************************************************/
346
347/* UtilParamsGet Message Frame structure. */
348
349typedef struct _I2O_UTIL_PARAMS_GET_MESSAGE {
350    I2O_MESSAGE_FRAME          StdMessageFrame;
351    I2O_TRANSACTION_CONTEXT    TransactionContext;
352    U32                        OperationFlags;
353    I2O_SG_ELEMENT             SGL;
354} I2O_UTIL_PARAMS_GET_MESSAGE, *PI2O_UTIL_PARAMS_GET_MESSAGE;
355
356
357/****************************************************************************/
358
359/* UtilParamsSet Message Frame structure. */
360
361typedef struct _I2O_UTIL_PARAMS_SET_MESSAGE {
362    I2O_MESSAGE_FRAME          StdMessageFrame;
363    I2O_TRANSACTION_CONTEXT    TransactionContext;
364    U32                        OperationFlags;
365    I2O_SG_ELEMENT             SGL;
366} I2O_UTIL_PARAMS_SET_MESSAGE, *PI2O_UTIL_PARAMS_SET_MESSAGE;
367
368
369/****************************************************************************/
370
371/* UtilReplyFaultNotify Message for Message Failure. */
372
373typedef struct _I2O_UTIL_REPLY_FAULT_NOTIFY_MESSAGE {
374    I2O_MESSAGE_FRAME          StdMessageFrame;
375    I2O_TRANSACTION_CONTEXT    TransactionContext;
376    U8                         LowestVersion;
377    U8                         HighestVersion;
378    BF                         Severity:I2O_FAILCODE_SEVERITY_SZ;
379    BF                         FailureCode:I2O_FAILCODE_CODE_SZ;
380    BF                         FailingIOP_ID:I2O_IOP_ID_SZ;
381    BF                         reserved:I2O_RESERVED_4BITS;
382    BF                         FailingHostUnitID:I2O_UNIT_ID_SZ;
383    U32                        AgeLimit;
384#if I2O_64BIT_CONTEXT
385    PI2O_MESSAGE_FRAME         OriginalMFA;
386#else
387    PI2O_MESSAGE_FRAME         OriginalMFALowPart;
388    U32                        OriginalMFAHighPart;  /* Always 0000 */
389#endif
390} I2O_UTIL_REPLY_FAULT_NOTIFY_MESSAGE, *PI2O_UTIL_REPLY_FAULT_NOTIFY_MESSAGE;
391
392
393/****************************************************************************/
394
395/* Device Reserve Function Message Frame structure. */
396/* NOTE:  This was previously called the Reserve Message */
397
398typedef struct _I2O_UTIL_DEVICE_RESERVE_MESSAGE {
399    I2O_MESSAGE_FRAME          StdMessageFrame;
400    I2O_TRANSACTION_CONTEXT    TransactionContext;
401} I2O_UTIL_DEVICE_RESERVE_MESSAGE, *PI2O_UTIL_DEVICE_RESERVE_MESSAGE;
402
403
404/****************************************************************************/
405
406/* Device Release Function Message Frame structure. */
407/* NOTE:  This was previously called the ReserveRelease Message */
408
409typedef struct _I2O_UTIL_DEVICE_RELEASE_MESSAGE {
410    I2O_MESSAGE_FRAME          StdMessageFrame;
411    I2O_TRANSACTION_CONTEXT    TransactionContext;
412} I2O_UTIL_DEVICE_RELEASE_MESSAGE, *PI2O_UTIL_DEVICE_RELEASE_MESSAGE;
413
414
415/****************************************************************************/
416
417PRAGMA_PACK_POP
418PRAGMA_ALIGN_POP
419
420#endif    /* I2O_UTILITY_HDR  */
421