i2odep.h revision 65312
1/* $FreeBSD: head/sys/dev/asr/i2odep.h 65312 2000-09-01 07:51:25Z msmith $ */
2/****************************************************************************
3 *
4 * Copyright (c) 1996-2000 Distributed Processing Technology Corporation
5 * Copyright (c) 2000 Adaptec Corporation.
6 * All rights reserved.
7 *
8 * Copyright (c) 1998 I2O Special Interest Group (I2O SIG)
9 * All rights reserved
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 information is provided on an as-is basis without warranty of any
28 * kind, either express or implied, including but not limited to, implied
29 * warranties or merchantability and fitness for a particular purpose. I2O SIG
30 * does not warrant that this program will meet the user's requirements or
31 * that the operation of these programs will be uninterrupted or error-free.
32 * The I2O SIG disclaims all liability, including liability for infringement
33 * of any proprietary rights, relating to implementation of information in
34 * this specification. The I2O SIG does not warrant or represent that such
35 * implementations(s) will not infringe such rights. Acceptance and use of
36 * this program constitutes the user's understanding that he will have no
37 * recourse to I2O SIG for any actual or consequential damages including, but
38 * not limited to, loss profits arising out of use or inability to use this
39 * program.
40 *
41 * This information is provided for the purpose of recompilation of the
42 * driver code provided by Distributed Processing Technology only. It is
43 * NOT to be used for any other purpose.
44 *
45 * To develop other products based upon I2O definitions, it is necessary to
46 * become a "Registered Developer" of the I2O SIG. This can be done by calling
47 * 415-750-8352 in the US, or via http://www.i2osig.org.
48 *
49 **************************************************************************/
50
51/*
52 * This template provides place holders for architecture and compiler
53 * dependencies. It should be filled in and renamed as i2odep.h.
54 * i2odep.h is included by i2otypes.h. <xxx> marks the places to fill.
55 */
56
57#ifndef __INCi2odeph
58#define __INCi2odeph
59
60#define I2ODEP_REV 1_5_4
61
62/*
63 * Pragma macros. These are to assure appropriate alignment between
64 * host/IOP as defined by the I2O Specification. Each one of the shared
65 * header files includes these macros.
66 */
67
68#define PRAGMA_ALIGN_PUSH
69#define PRAGMA_ALIGN_POP
70#define PRAGMA_PACK_PUSH
71#define PRAGMA_PACK_POP
72
73/* Setup the basics */
74
75typedef    signed char    S8;
76typedef    signed short   S16;
77
78typedef    unsigned char  U8;
79typedef    unsigned short U16;
80
81typedef    unsigned long  U32;
82typedef    unsigned short S32;
83
84
85/* Bitfields */
86
87#if (defined(__BORLANDC__))
88typedef    U16 BF;
89#else
90typedef    U32 BF;
91#endif
92
93
94/* VOID */
95
96#ifndef __VOID
97#if (defined(_DPT_ARC))
98# define VOID void
99#else
100 typedef    void  VOID;
101#endif
102#define __VOID
103#endif
104
105
106/* Boolean */
107
108#ifndef __BOOL
109#define __BOOL
110
111typedef unsigned char BOOL;
112#endif
113
114#if (!defined(__FAR__))
115# if (defined(__BORLANDC__))
116#  define __FAR__ far
117# else
118#  define __FAR__
119# endif
120#endif
121
122/* NULL */
123
124#if (!defined(NULL))
125# define NULL  ((VOID __FAR__ *)0L)
126#endif
127
128
129#if (defined(__SPARC__) || defined(__linux__))
130typedef char                   CHAR;
131typedef char                   *pCHAR;
132typedef char                   INT8;
133typedef char                   *pINT8;
134typedef unsigned char          UINT8;
135typedef unsigned char          *pUINT8;
136typedef short                  INT16;
137typedef short                  *pINT16;
138typedef unsigned short         UINT16;
139typedef unsigned short         *pUINT16;
140typedef long                   INT32;
141typedef long                   *pINT32;
142typedef unsigned long          UINT32;
143typedef unsigned long          *pUINT32;
144//typedef SCSI_REQUEST_BLOCK     OS_REQUEST_T;
145//typedef PSCSI_REQUEST_BLOCK    pOS_REQUEST_T;
146#define STATIC                 static
147#ifndef __NEAR__
148# if (defined(__BORLANDC__))
149#  define __NEAR__ near
150# else
151#  define __NEAR__
152# endif
153#endif
154#define pVOID                  void *
155#define pBOOLEAN               BOOLEAN *
156#endif
157
158
159/*
160 * Copyright (c) 1996-2000 Distributed Processing Technology Corporation
161 * Copyright (c) 2000 Adaptec Corporation.
162 * All rights reserved.
163 */
164/*
165 *      Define some generalized portability macros
166 *      These macros follow the following parameterization:
167 *          _F_getXXX(pointer,primaryElement<,offset>,referredElement)
168 *          _F_setXXX(pointer,primaryElement<,offset>,referredElement,newValue)
169 *      These parameters are shortened to u, w, x, y and z to reduce clutter.
170 */
171#if (defined(__BORLANDC__))
172# define I2O_TID_MASK         ((U16)((1L<<I2O_TID_SZ)-1))
173/* First 12 bits */
174# define _F_getTID(w,x,y)     (*((U16 __FAR__ *)(&((w)->x))) & I2O_TID_MASK)
175# define _F_setTID(w,x,y,z)   (*((U16 __FAR__ *)(&((w)->x)))\
176                               &= 0xFFFF - I2O_TID_MASK);\
177                              (*((U16 __FAR__ *)(&((w)->x)))\
178                               |=(U16)(z)&I2O_TID_MASK)
179/* Seconds 12 bits (optimized with the assumption of 12 & 12) */
180# define _F_getTID1(w,x,y)    ((*(U16 __FAR__ *)(((U8 __FAR__ *)(&((w)->x)))\
181                               + (I2O_TID_SZ/8)))\
182                                >> (I2O_TID_SZ-((I2O_TID_SZ/8)*8)))
183# define _F_setTID1(w,x,y,z)  ((*((U16 __FAR__ *)(((U8 __FAR__ *)(&((w)->x)))\
184                               + (I2O_TID_SZ/8)))) &= (0xFFFF >> I2O_TID_SZ));\
185                              ((*((U16 __FAR__ *)(((U8 __FAR__ *)(&((w)->x)))\
186                               + (I2O_TID_SZ/8)))) |= (z)\
187                                << (I2O_TID_SZ-((I2O_TID_SZ/8)*8)))
188/* Last 8 bits */
189# define _F_getFunc(w,x,y)    (*(((U8 __FAR__ *)(&((w)->x)))\
190                               + ((I2O_TID_SZ+I2O_TID_SZ)/8)))
191# define _F_setFunc(w,x,y,z)  (_F_getFunc(w,x,y) = (z))
192# define I2O_SG_COUNT_MASK    ((U32)((1L<<I2O_SG_COUNT_SZ)-1))
193/* First 24 bits */
194# define _F_getCount(w,x,y)   (*((U32 __FAR__ *)(&((w)->x)))&I2O_SG_COUNT_MASK)
195/*
196 * The following is less efficient because of compiler inefficiencies:
197 *
198 * # define _F_setCount(w,x,y,z)  *((U16 __FAR__ *)(&((w)->x))) = (U16)(z);\
199 *                              ((U8 __FAR__ *)(&((w)->x)))[2]= (U8)((z)>>16L)
200 *
201 * so we will use the apparently more code intensive:
202 */
203# define _F_setCount(w,x,y,z) (*((U32 __FAR__ *)(&((w)->x)))\
204                               &= 0xFFFFFFFFL - I2O_SG_COUNT_MASK);\
205                              (*((U32 __FAR__ *)(&((w)->x)))\
206                               |= (z) & I2O_SG_COUNT_MASK)
207/* Last 8 bits */
208# define _F_getFlags(w,x,y)   (*(((U8 __FAR__ *)(&((w)->x)))\
209                               + (I2O_SG_COUNT_SZ/8)))
210# define _F_setFlags(w,x,y,z) (_F_getFlags(w,x,y) = (z))
211/* Other accesses that are simpler */
212# define _F_get1bit(w,x,y,z)     ((U8)((w)->z))
213# define _F_set1bit(w,x,y,z,u)   ((w)->z = (u))
214# define _F_get1bit1(w,x,y,z)    ((U8)((w)->z))
215# define _F_set1bit1(w,x,y,z,u)  ((w)->z = (u))
216# define _F_get4bit4(w,x,y,z)    ((U8)((w)->z))
217# define _F_set4bit4(w,x,y,z,u)  ((w)->z = (u))
218# define _F_get8bit(w,x,y,z)     ((U8)((w)->z))
219# define _F_set8bit(w,x,y,z,u)   ((w)->z = (u))
220# define _F_get12bit(w,x,y,z)    ((U16)((w)->z))
221# define _F_set12bit(w,x,y,z,u)  ((w)->z = (u))
222# define _F_get12bit4(w,x,y,z)   ((U16)((w)->z))
223# define _F_set12bit4(w,x,y,z,u) ((w)->z = (u))
224# define _F_get16bit(w,x,y,z)    ((U16)((w)->z))
225# define _F_set16bit(w,x,y,z,u)  ((w)->z = (u))
226#elif (defined(_DPT_BIG_ENDIAN))
227/* First 12 bits */
228# define _F_getTID(w,x,y)     getL12bit(w,x,0)
229# define _F_setTID(w,x,y,z)   setL12bit(w,x,0,z)
230# define _F_getTID1(w,x,y)    getL12bit1(w,x,0)
231# define _F_setTID1(w,x,y,z)  setL12bit1(w,x,0,z)
232# define _F_getFunc(w,x,y)    getL8bit(w,x,3)
233# define _F_setFunc(w,x,y,z)  setL8bit(w,x,3,z)
234# define _F_getCount(w,x,y)   getL24bit1(w,x,0)
235# define _F_setCount(w,x,y,z) setL24bit1(w,x,0,z)
236# define _F_getFlags(w,x,y)   getL8bit(w,x,3)
237# define _F_setFlags(w,x,y,z) setL8bit(w,x,3,z)
238/* Other accesses that are simpler */
239# define _F_get1bit(w,x,y,z)     getL1bit(w,x,y)
240# define _F_set1bit(w,x,y,z,u)   setL1bit(w,x,y,u)
241# define _F_get1bit1(w,x,y,z)    getL1bit1(w,x,y)
242# define _F_set1bit1(w,x,y,z,u)  setL1bit1(w,x,y,u)
243# define _F_get4bit4(w,x,y,z)    getL4bit(w,x,y)
244# define _F_set4bit4(w,x,y,z,u)  setL4bit(w,x,y,u)
245# define _F_get8bit(w,x,y,z)     getL8bit(w,x,y)
246# define _F_set8bit(w,x,y,z,u)   setL8bit(w,x,y,u)
247# define _F_get12bit(w,x,y,z)    getL12bit(w,x,y)
248# define _F_set12bit(w,x,y,z,u)  setL12bit(w,x,y,z)
249# define _F_get12bit4(w,x,y,z)   getL12bit1(w,x,(y)-1)
250# define _F_set12bit4(w,x,y,z,u) setL12bit1(w,x,(y)-1,u)
251# define _F_get16bit(w,x,y,z)    getL16bit(w,x,y)
252# define _F_set16bit(w,x,y,z,u)  setL16bit(w,x,y,u)
253#else
254# define _F_getTID(w,x,y)     ((U16)((w)->y))
255# define _F_setTID(w,x,y,z)   ((w)->y = (z))
256# define _F_getTID1(w,x,y)    ((U16)((w)->y))
257# define _F_setTID1(w,x,y,z)  ((w)->y = (z))
258# define _F_getFunc(w,x,y)    ((U8)((w)->y))
259# define _F_setFunc(w,x,y,z)  ((w)->y = (z))
260# define _F_getCount(w,x,y)   ((U32)((w)->y))
261# define _F_setCount(w,x,y,z) ((w)->y = (z))
262# define _F_getFlags(w,x,y)   ((U8)((w)->y))
263# define _F_setFlags(w,x,y,z) ((w)->y = (z))
264# define _F_get1bit(w,x,y,z)     ((U8)((w)->z))
265# define _F_set1bit(w,x,y,z,u)   ((w)->z = (u))
266# define _F_get1bit1(w,x,y,z)    ((U8)((w)->z))
267# define _F_set1bit1(w,x,y,z,u)  ((w)->z = (u))
268# define _F_get4bit4(w,x,y,z)    ((U8)((w)->z))
269# define _F_set4bit4(w,x,y,z,u)  ((w)->z = (u))
270# define _F_get8bit(w,x,y,z)     ((U8)((w)->z))
271# define _F_set8bit(w,x,y,z,u)   ((w)->z = (u))
272# define _F_get12bit(w,x,y,z)    ((U16)((w)->z))
273# define _F_set12bit(w,x,y,z,u)  ((w)->z = (u))
274# define _F_get12bit4(w,x,y,z)   ((U16)((w)->z))
275# define _F_set12bit4(w,x,y,z,u) ((w)->z = (u))
276# define _F_get16bit(w,x,y,z)    ((U16)((w)->z))
277# define _F_set16bit(w,x,y,z,u)  ((w)->z = (u))
278#endif
279
280/*
281 *      Define some specific portability macros
282 *      These macros follow the following parameterization:
283 *              XXX_getYYY (pointer)
284 *              XXX_setYYY (pointer, newValue)
285 *      These parameters are shortened to x and y to reduce clutter.
286 */
287
288/*
289 * General SGE
290 */
291#define I2O_FLAGS_COUNT_getCount(x)   _F_getCount(x,Count,Count)
292#define I2O_FLAGS_COUNT_setCount(x,y) _F_setCount(x,Count,Count,y)
293#define I2O_FLAGS_COUNT_getFlags(x)   _F_getFlags(x,Count,Flags)
294#define I2O_FLAGS_COUNT_setFlags(x,y) _F_setFlags(x,Count,Flags,y)
295
296/*
297 * I2O_SGE_SIMPLE_ELEMENT
298 */
299#define I2O_SGE_SIMPLE_ELEMENT_getPhysicalAddress(x) \
300        getLU4((&(x)->PhysicalAddress),0)
301#define I2O_SGE_SIMPLE_ELEMENT_setPhysicalAddress(x,y) \
302        setLU4((&(x)->PhysicalAddress),0,y)
303/*
304 * I2O_SGE_LONG_TRANSACTION_ELEMENT
305 */
306#define I2O_SGE_LONG_TRANSACTION_ELEMENT_getLongElementLength(x)\
307        _F_getCount(x,LongElementLength,LongElementLength)
308#define I2O_SGE_LONG_TRANSACTION_ELEMENT_setLongElementLength(x,y)\
309        _F_setCount(x,LongElementLength,LongElementLength,y)
310#define I2O_SGE_LONG_TRANSACTION_ELEMENT_getFlags(x)\
311        _F_getFlags(x,LongElementLength,Flags)
312#define I2O_SGE_LONG_TRANSACTION_ELEMENT_setFlags(x,y)\
313        _F_setFlags(x,LongElementLength,Flags,y)
314
315/*
316 * I2O_SGE_LONG_TRANSPORT_ELEMENT
317 */
318#define I2O_SGE_LONG_TRANSPORT_ELEMENT_getLongElementLength(x)\
319        _F_getCount(x,LongElementLength,LongElementLength)
320#define I2O_SGE_LONG_TRANSPORT_ELEMENT_setLongElementLength(x,y)\
321        _F_setCount(x,LongElementLength,LongElementLength,y)
322#define I2O_SGE_LONG_TRANSPORT_ELEMENT_getFlags(x)\
323        _F_getFlags(x,LongElementLength,Flags)
324#define I2O_SGE_LONG_TRANSPORT_ELEMENT_setFlags(x,y)\
325        _F_setFlags(x,LongElementLength,Flags,y)
326
327/*
328 * I2O_EXEC_ADAPTER_ASSIGN_MESSAGE
329 */
330#define I2O_EXEC_ADAPTER_ASSIGN_MESSAGE_getDdmTID(x)\
331        _F_getTID(x,DdmTID,DdmTID)
332#define I2O_EXEC_ADAPTER_ASSIGN_MESSAGE_setDdmTID(x,y)\
333        _F_setTID(x,DDdmTID,DdmTID,y)
334#define I2O_EXEC_ADAPTER_ASSIGN_MESSAGE_getOperationFlags(x)\
335        _F_getFunc(x,DdmTID,OperationFlags)
336#define I2O_EXEC_ADAPTER_ASSIGN_MESSAGE_setOperationFlags(x,y)\
337        _F_setFunc(x,DdmTID,OperationFlags,y)
338
339/*
340 * I2O_EXEC_BIOS_INFO_SET_MESSAGE
341 */
342#define I2O_EXEC_BIOS_INFO_SET_MESSAGE_getDeviceTID(x)\
343        _F_getTID(x,DeviceTID,DeviceTID)
344#define I2O_EXEC_BIOS_INFO_SET_MESSAGE_setDeviceTID(x,y)\
345        _F_setTID(x,DeviceTID,DeviceTID,y)
346#define I2O_EXEC_BIOS_INFO_SET_MESSAGE_getBiosInfo(x)\
347        _F_getFunc(x,DeviceTID,BiosInfo)
348#define I2O_EXEC_BIOS_INFO_SET_MESSAGE_setBiosInfo(x,y)  \
349        _F_setFunc(x,DeviceTID,BiosInfo,y)
350
351/*
352 * I2O_ALIAS_CONNECT_SETUP
353 */
354#define I2O_ALIAS_CONNECT_SETUP_getIOP1AliasForTargetDevice(x)\
355        _F_getTID(x,IOP1AliasForTargetDevice,IOP1AliasForTargetDevice)
356#define I2O_ALIAS_CONNECT_SETUP_setIOP1AliasForTargetDevice(x,y)\
357        _F_setTID(x,IOP1AliasForTargetDevice,IOP1AliasForTargetDevice,y)
358#define I2O_ALIAS_CONNECT_SETUP_getIOP2AliasForInitiatorDevice(x)\
359        _F_getTID1(x,IOP1AliasForTargetDevice,IOP2AliasForInitiatorDevice)
360#define I2O_ALIAS_CONNECT_SETUP_setIOP2AliasForInitiatorDevice(x,y)\
361        _F_setTID1(x,IOP1AliasForTargetDevice,IOP2AliasForInitiatorDevice,y)
362
363/*
364 * I2O_OBJECT_CONNECT_SETUP
365 */
366#define I2O_OBJECT_CONNECT_SETUP_getTargetDevice(x)\
367        _F_getTID(x,TargetDevice,TargetDevice)
368#define I2O_OBJECT_CONNECT_SETUP_setTargetDevice(x,y)\
369        _F_setTID(x,TargetDevice,TargetDevice,y)
370#define I2O_OBJECT_CONNECT_SETUP_getInitiatorDevice(x)\
371        _F_getTID1(x,TargetDevice,InitiatorDevice)
372#define I2O_OBJECT_CONNECT_SETUP_setInitiatorDevice(x,y)\
373        _F_setTID1(x,TargetDevice,InitiatorDevice,y)
374#define I2O_OBJECT_CONNECT_SETUP_getOperationFlags(x)\
375        _F_getFunc(x,TargetDevice,OperationFlags)
376#define I2O_OBJECT_CONNECT_SETUP_setOperationFlags(x,y)\
377        _F_setFunc(x,TargetDevice,OperationFlags,y)
378
379/*
380 * I2O_OBJECT_CONNECT_REPLY
381 */
382#define I2O_OBJECT_CONNECT_REPLY_getTargetDevice(x)\
383        _F_getTID(x,TargetDevice,TargetDevice)
384#define I2O_OBJECT_CONNECT_REPLY_setTargetDevice(x,y)\
385        _F_setTID(x,TargetDevice,TargetDevice,y)
386#define I2O_OBJECT_CONNECT_REPLY_getInitiatorDevice(x)\
387        _F_getTID1(x,TargetDevice,InitiatorDevice)
388#define I2O_OBJECT_CONNECT_REPLY_setInitiatorDevice(x,y)\
389        _F_setTID1(x,TargetDevice,InitiatorDevice,y)
390#define I2O_OBJECT_CONNECT_REPLY_getReplyStatusCode(x)\
391        _F_getFunc(x,TargetDevice,ReplyStatusCode)
392#define I2O_OBJECT_CONNECT_REPLY_setReplyStatusCode(x,y)\
393        _F_setFunc(x,TargetDevice,ReplyStatusCode,y)
394
395/*
396 * I2O_EXEC_DEVICE_ASSIGN_MESSAGE
397 */
398#define I2O_EXEC_DEVICE_ASSIGN_MESSAGE_getDeviceTID(x)\
399        _F_getTID(x,Object.DeviceTID,Object.DeviceTID)
400#define I2O_EXEC_DEVICE_ASSIGN_MESSAGE_setDeviceTID(x,y)\
401        _F_setTID(x,Object.DeviceTID,Object.DeviceTID,y)
402#define I2O_EXEC_DEVICE_ASSIGN_MESSAGE_getIOP_ID(x)\
403        _F_getTID1(x,Object.DeviceTID,Object.IOP_ID)
404#define I2O_EXEC_DEVICE_ASSIGN_MESSAGE_setIOP_ID(x,y)\
405        _F_setTID1(x,Object.DeviceTID,Object.IOP_ID,y)
406#define I2O_EXEC_DEVICE_ASSIGN_MESSAGE_getOperationFlags(x)\
407        _F_getFunc(x,Object.DeviceTID,Object.OperationFlags)
408#define I2O_EXEC_DEVICE_ASSIGN_MESSAGE_setOperationFlags(x,y)\
409        _F_setFunc(x,Object.DeviceTID,Object.OperationFlags,y)
410
411/*
412 * I2O_EXEC_DEVICE_RELEASE_MESSAGE
413 */
414#define I2O_EXEC_DEVICE_RELEASE_MESSAGE_getDeviceTID(x)\
415        _F_getTID(x,Object.DeviceTID,Object.DeviceTID)
416#define I2O_EXEC_DEVICE_RELEASE_MESSAGE_setDeviceTID(x,y)\
417        _F_setTID(x,Object.DeviceTID,Object.DeviceTID,y)
418#define I2O_EXEC_DEVICE_RELEASE_MESSAGE_getIOP_ID(x)\
419        _F_getTID1(x,Object.DeviceTID,Object.IOP_ID)
420#define I2O_EXEC_DEVICE_RELEASE_MESSAGE_setIOP_ID(x,y)\
421        _F_setTID1(x,Object.DeviceTID,Object.IOP_ID,y)
422#define I2O_EXEC_DEVICE_RELEASE_MESSAGE_getOperationFlags(x)\
423        _F_getFunc(x,Object.DeviceTID,Object.OperationFlags)
424#define I2O_EXEC_DEVICE_RELEASE_MESSAGE_setOperationFlags(x,y)\
425        _F_setFunc(x,Object.DeviceTID,Object.OperationFlags,y)
426
427/*
428 * I2O_EXEC_IOP_RESET_MESSAGE
429 */
430#define I2O_EXEC_IOP_RESET_MESSAGE_getTargetAddress(x)\
431        _F_getTID(x,TargetAddress,TargetAddress)
432#define I2O_EXEC_IOP_RESET_MESSAGE_setTargetAddress(x,y)\
433        _F_setTID(x,TargetAddress,TargetAddress,y)
434#define I2O_EXEC_IOP_RESET_MESSAGE_getInitiatorAddress(x)\
435        _F_getTID1(x,TargetAddress,InitiatorAddress)
436#define I2O_EXEC_IOP_RESET_MESSAGE_setInitiatorAddress(x,y)\
437        _F_setTID1(x,TargetAddress,InitiatorAddress,y)
438#define I2O_EXEC_IOP_RESET_MESSAGE_getFunction(x)\
439        _F_getFunc(x,TargetAddress,Function)
440#define I2O_EXEC_IOP_RESET_MESSAGE_setFunction(x,y)\
441        _F_setFunc(x,TargetAddress,Function,y)
442#define I2O_EXEC_IOP_RESET_MESSAGE_getVersionOffset(x)\
443                getU1((&(x)->VersionOffset),0)
444#define I2O_EXEC_IOP_RESET_MESSAGE_setVersionOffset(x,y)\
445                setU1((&(x)->VersionOffset),0,y)
446#define I2O_EXEC_IOP_RESET_MESSAGE_getMsgFlags(x)\
447                getU1((&(x)->VersionOffset),1)
448#define I2O_EXEC_IOP_RESET_MESSAGE_setMsgFlags(x,y)\
449                setU1((&(x)->VersionOffset),1,y)
450#define I2O_EXEC_IOP_RESET_MESSAGE_getMessageSize(x)\
451                getLU2((&(x)->VersionOffset),2)
452#define I2O_EXEC_IOP_RESET_MESSAGE_setMessageSize(x,y)\
453                setLU2((&(x)->VersionOffset),2,y)
454#define I2O_EXEC_IOP_RESET_MESSAGE_getStatusWordLowAddress(x)\
455                getLU4((&(x)->StatusWordLowAddress),0)
456#define I2O_EXEC_IOP_RESET_MESSAGE_setStatusWordLowAddress(x,y)\
457                setLU4((&(x)->StatusWordLowAddress),0,y)
458#define I2O_EXEC_IOP_RESET_MESSAGE_getStatusWordHighAddress(x)\
459                getLU4((&(x)->StatusWordHighAddress),0)
460#define I2O_EXEC_IOP_RESET_MESSAGE_setStatusWordHighAddress(x,y)\
461                setLU4((&(x)->StatusWordHighAddress),0,y)
462
463
464/*
465 * I2O_EXEC_STATUS_GET_MESSAGE
466 */
467#define I2O_EXEC_STATUS_GET_MESSAGE_getVersionOffset(x)\
468                getU1((&(x)->VersionOffset),0)
469#define I2O_EXEC_STATUS_GET_MESSAGE_setVersionOffset(x,y)\
470                setU1((&(x)->VersionOffset),0,y)
471#define I2O_EXEC_STATUS_GET_MESSAGE_getMsgFlags(x)\
472                getU1((&(x)->VersionOffset),1)
473#define I2O_EXEC_STATUS_GET_MESSAGE_setMsgFlags(x,y)\
474                setU1((&(x)->VersionOffset),1,y)
475#define I2O_EXEC_STATUS_GET_MESSAGE_getMessageSize(x)\
476                getLU2((&(x)->VersionOffset),2)
477#define I2O_EXEC_STATUS_GET_MESSAGE_setMessageSize(x,y)\
478                setLU2((&(x)->VersionOffset),2,y)
479#define I2O_EXEC_STATUS_GET_MESSAGE_getReplyBufferAddressLow(x)\
480                getLU4((&(x)->ReplyBufferAddressLow),0)
481#define I2O_EXEC_STATUS_GET_MESSAGE_setReplyBufferAddressLow(x,y)\
482                setLU4((&(x)->ReplyBufferAddressLow),0,y)
483#define I2O_EXEC_STATUS_GET_MESSAGE_getReplyBufferAddressHigh(x)\
484                getLU4((&(x)->ReplyBufferAddressHigh),0)
485#define I2O_EXEC_STATUS_GET_MESSAGE_setReplyBufferAddressHigh(x,y)\
486                setLU4((&(x)->ReplyBufferAddressHigh),0,y)
487#define I2O_EXEC_STATUS_GET_MESSAGE_getReplyBufferLength(x)\
488                getLU4((&(x)->ReplyBufferLength),0)
489#define I2O_EXEC_STATUS_GET_MESSAGE_setReplyBufferLength(x,y)\
490                setLU4((&(x)->ReplyBufferLength),0,y)
491#define I2O_EXEC_STATUS_GET_MESSAGE_getTargetAddress(x)\
492                _F_getTID(x,TargetAddress,TargetAddress)
493#define I2O_EXEC_STATUS_GET_MESSAGE_setTargetAddress(x,y)\
494                _F_setTID(x,TargetAddress,TargetAddress,y)
495#define I2O_EXEC_STATUS_GET_MESSAGE_getInitiatorAddress(x)\
496                _F_getTID1(x,TargetAddress,InitiatorAddress)
497#define I2O_EXEC_STATUS_GET_MESSAGE_setInitiatorAddress(x,y)\
498                _F_setTID1(x,TargetAddress,InitiatorAddress,y)
499#define I2O_EXEC_STATUS_GET_MESSAGE_getFunction(x)\
500                _F_getFunc(x,TargetAddress,Function)
501#define I2O_EXEC_STATUS_GET_MESSAGE_setFunction(x,y)\
502                _F_setFunc(x,TargetAddress,Function,y)
503
504/*
505 * I2O_MESSAGE_FRAME
506 */
507#define I2O_MESSAGE_FRAME_getVersionOffset(x)\
508                getU1((&((x)->VersionOffset)),0)
509#define I2O_MESSAGE_FRAME_setVersionOffset(x,y)\
510                setU1(((&(x)->VersionOffset)),0,y)
511#define I2O_MESSAGE_FRAME_getMsgFlags(x)\
512                getU1((&((x)->VersionOffset)),1)
513#define I2O_MESSAGE_FRAME_setMsgFlags(x,y)\
514                setU1((&((x)->VersionOffset)),1,y)
515#define I2O_MESSAGE_FRAME_getMessageSize(x)\
516                getLU2((&((x)->VersionOffset)),2)
517#define I2O_MESSAGE_FRAME_setMessageSize(x,y)\
518                setLU2((&((x)->VersionOffset)),2,y)
519#define I2O_MESSAGE_FRAME_getTargetAddress(x)\
520                _F_getTID(x,TargetAddress,TargetAddress)
521#define I2O_MESSAGE_FRAME_setTargetAddress(x,y)\
522                _F_setTID(x,TargetAddress,TargetAddress,y)
523#define I2O_MESSAGE_FRAME_getInitiatorAddress(x)\
524                _F_getTID1(x,TargetAddress,InitiatorAddress)
525#define I2O_MESSAGE_FRAME_setInitiatorAddress(x,y)\
526                _F_setTID1(x,TargetAddress,InitiatorAddress,y)
527#define I2O_MESSAGE_FRAME_getFunction(x)\
528                _F_getFunc(x,TargetAddress,Function)
529#define I2O_MESSAGE_FRAME_setFunction(x,y)\
530                _F_setFunc(x,TargetAddress,Function,y)
531/* 32 bit only for now */
532#define I2O_MESSAGE_FRAME_getInitiatorContext(x)\
533                (x)->InitiatorContext
534#define I2O_MESSAGE_FRAME_setInitiatorContext(x,y)\
535                ((x)->InitiatorContext = (y))
536/*
537 *	We are spilling the 64 bit Context field into the Transaction
538 *	context of the specific frames. Synchronous commands (resetIop
539 *	et al) do not have this field, so beware. Also, Failed Reply frames
540 *	can not contain the 64 bit context, the software must reference
541 *	the PreservedMFA and pick up the 64 bit context from the incoming
542 *	message frame. The software must make no reference to the
543 *	TransactionContext field at all.
544 */
545#if defined(_MSC_VER) && _MSC_VER >= 800
546#ifndef u_int64_t
547#define u_int64_t unsigned __int64
548#endif
549#endif
550#define I2O_MESSAGE_FRAME_getInitiatorContext64(x)\
551		(*((u_int64_t *)(&((x)->InitiatorContext))))
552#define I2O_MESSAGE_FRAME_setInitiatorContext64(x,y)\
553		((*((u_int64_t *)(&((x)->InitiatorContext))))=(y))
554
555/*
556 * I2O_EXEC_OUTBOUND_INIT_MESSAGE
557 */
558#define I2O_EXEC_OUTBOUND_INIT_MESSAGE_getHostPageFrameSize(x)\
559                getLU4((&(x)->HostPageFrameSize),0)
560#define I2O_EXEC_OUTBOUND_INIT_MESSAGE_setHostPageFrameSize(x,y)\
561                setLU4((&(x)->HostPageFrameSize),0,y)
562#define I2O_EXEC_OUTBOUND_INIT_MESSAGE_getInitCode(x)\
563                getU1((&(x)->InitCode),0)
564#define I2O_EXEC_OUTBOUND_INIT_MESSAGE_setInitCode(x,y)\
565                setU1((&(x)->InitCode),0,y)
566#define I2O_EXEC_OUTBOUND_INIT_MESSAGE_getreserved(x)\
567                getU1((&(x)->reserved),0)
568#define I2O_EXEC_OUTBOUND_INIT_MESSAGE_setreserved(x,y)\
569                setU1((&(x)->reserved),0,y)
570#define I2O_EXEC_OUTBOUND_INIT_MESSAGE_getOutboundMFrameSize(x)\
571                getLU2((&(x)->OutboundMFrameSize),0)
572#define I2O_EXEC_OUTBOUND_INIT_MESSAGE_setOutboundMFrameSize(x,y)\
573                setLU2((&(x)->OutboundMFrameSize),0,y)
574
575/*
576 * I2O_EXEC_SYS_TAB_SET_MESSAGE
577 */
578#define I2O_EXEC_SYS_TAB_SET_MESSAGE_getIOP_ID(x)\
579                _F_get12bit(x,IOP_ID,IOP_ID)
580#define I2O_EXEC_SYS_TAB_SET_MESSAGE_setIOP_ID(x,y)\
581                _F_set12bit(x,IOP_ID,IOP_ID,y)
582/* #define I2O_EXEC_SYS_TAB_SET_MESSAGE_getreserved1(x) */
583#define I2O_EXEC_SYS_TAB_SET_MESSAGE_getHostUnitID(x)\
584                _F_get16bit(x,IOP_ID,2,HostUnitID)
585#define I2O_EXEC_SYS_TAB_SET_MESSAGE_setHostUnitID(x,y)\
586                _F_set16bit(x,IOP_ID,2,HostUnitID,y)
587#define I2O_EXEC_SYS_TAB_SET_MESSAGE_getSegmentNumber(x)\
588                _F_get12bit(x,SegmentNumber,SegmentNumber)
589#define I2O_EXEC_SYS_TAB_SET_MESSAGE_setSegmentNumber(x,y)\
590                _F_get12bit(x,SegmentNumber,SegmentNumber,y)
591
592/*      later
593 * I2O_EXEC_SYS_ENABLE_MESSAGE
594 */
595
596/*
597 * I2O_CLASS_ID
598 */
599#define I2O_CLASS_ID_getClass(x)\
600                _F_get12bit(x,Class,0,Class)
601#define I2O_CLASS_ID_setClass(x,y)\
602                _F_set12bit(x,Class,0,Class,y)
603#define I2O_CLASS_ID_getVersion(x)\
604                _F_get4bit4(x,Class,1,Version)
605#define I2O_CLASS_ID_setVersion(x,y)\
606                _F_set4bit4(x,Class,1,Version,y)
607#define I2O_CLASS_ID_getOrganizationID(x)\
608                _F_get16bit(x,Class,2,OrganizationID)
609#define I2O_CLASS_ID_setOrganizationID(x,y)\
610                _F_set16bit(x,Class,2,OrganizationID,y)
611
612/*
613 * I2O_SET_SYSTAB_HEADER
614 */
615#define I2O_SET_SYSTAB_HEADER_getNumberEntries(x)\
616                getU1((&((x)->NumberEntries)),0)
617#define I2O_SET_SYSTAB_HEADER_setNumberEntries(x,y)\
618                setU1((&(x)->NumberEntries),0,y)
619#define I2O_SET_SYSTAB_HEADER_getSysTabVersion(x)\
620                getU1((&((x)->SysTabVersion)),0)
621#define I2O_SET_SYSTAB_HEADER_setSysTabVersion(x,y)\
622                setU1((&(x)->SysTabVersion),0,y)
623/*  U16 reserved		*/
624/*  U32 CurrentChangeIndicator	*/
625
626
627
628
629/*
630 * I2O_IOP_ENTRY
631 */
632#define I2O_IOP_ENTRY_getOrganizationID(x)\
633                getLU2((&((x)->OrganizationID)),0)
634#define I2O_IOP_ENTRY_setOrganizationID(x,y)\
635                setLU2((&((x)->OrganizationID)),0,y)
636/* #define I2O_IOP_ENTRY_getreserved U16; */
637#define I2O_IOP_ENTRY_getIOP_ID(x)\
638                _F_get12bit(x,IOP_ID,0,IOP_ID)
639#define I2O_IOP_ENTRY_setIOP_ID(x,y)\
640                _F_set12bit(x,IOP_ID,0,IOP_ID,y)
641/*   BF                          reserved3:I2O_RESERVED_4BITS;	*/
642/*   BF                          reserved1:I2O_RESERVED_16BITS;	*/
643#define I2O_IOP_ENTRY_getSegmentNumber(x)\
644                _F_get12bit(x,SegmentNumber,0,SegmentNumber)
645#define I2O_IOP_ENTRY_setSegmentNumber(x,y)\
646                _F_set12bit(x,SegmentNumber,0,SegmentNumber,y)
647#define I2O_IOP_ENTRY_getI2oVersion(x)\
648                _F_get4bit4(x,SegmentNumber,1,I2oVersion)
649#define I2O_IOP_ENTRY_setI2oVersion(x,y)\
650                _F_set4bit4(x,SegmentNumber,1,I2oVersion,y)
651#define I2O_IOP_ENTRY_getIopState(x)\
652                _F_get8bit(x,SegmentNumber,2,IopState)
653#define I2O_IOP_ENTRY_setIopState(x,y)\
654                _F_set8bit(x,SegmentNumber,2,IopState,y)
655#define I2O_IOP_ENTRY_getMessengerType(x)\
656                _F_get8bit(x,SegmentNumber,3,MessengerType)
657#define I2O_IOP_ENTRY_setMessengerType(x,y)\
658                _F_set8bit(x,SegmentNumber,3,MessengerType,y)
659#define I2O_IOP_ENTRY_getInboundMessageFrameSize(x)\
660                getLU2((&((x)->InboundMessageFrameSize)),0)
661#define I2O_IOP_ENTRY_setInboundMessageFrameSize(x,y)\
662                setLU2((&((x)->InboundMessageFrameSize)),0,y)
663#define I2O_IOP_ENTRY_getreserved2(x)\
664                getLU2((&((x)->reserved2)),0)
665#define I2O_IOP_ENTRY_setreserved2(x,y)\
666                setLU2((&((x)->reserved2)),0,y)
667#define I2O_IOP_ENTRY_getLastChanged(x)\
668                getLU4((&((x)->LastChanged)),0)
669#define I2O_IOP_ENTRY_setLastChanged(x,y)\
670                setLU4((&((x)->LastChanged)),0,y)
671#define I2O_IOP_ENTRY_getIopCapabilities(x)\
672                getLU4((&((x)->IopCapabilities)),0)
673#define I2O_IOP_ENTRY_setIopCapabilities(x,y)\
674                setLU4((&((x)->IopCapabilities)),0,y)
675
676/* might want to declare I2O_MESSENGER_INFO struct */
677
678#define I2O_IOP_ENTRY_getInboundMessagePortAddressLow(x)\
679                getLU4((&((x)->MessengerInfo.InboundMessagePortAddressLow)),0)
680#define I2O_IOP_ENTRY_setInboundMessagePortAddressLow(x,y)\
681                setLU4((&((x)->MessengerInfo.InboundMessagePortAddressLow)),0,y)
682
683#define I2O_IOP_ENTRY_getInboundMessagePortAddressHigh(x)\
684                getLU4((&((x)->MessengerInfo.InboundMessagePortAddressHigh)),0)
685#define I2O_IOP_ENTRY_setInboundMessagePortAddressHigh(x,y)\
686                setLU4((&((x)->MessengerInfo.InboundMessagePortAddressHigh)),0,y)
687
688/*
689 *  I2O_HRT
690 */
691#define I2O_HRT_getNumberEntries(x)\
692                getLU2((&((x)->NumberEntries)),0)
693#define I2O_HRT_setNumberEntries(x,y)\
694                setLU2((&(x)->NumberEntries),0,y)
695#define I2O_HRT_getEntryLength(x)\
696                getU1((&(x)->EntryLength),0)
697#define I2O_HRT_setEntryLength(x,y)\
698                setU1((&(x)->EntryLength),0,y)
699#define I2O_HRT_getHRTVersion(x)\
700                getU1((&(x)->HRTVersion),0)
701#define I2O_HRT_setHRTVersion(x,y)\
702                setU1((&(x)->HRTVersion),0,y)
703#define I2O_HRT_getCurrentChangeIndicator(x)\
704                getLU4((&(x)->CurrentChangeIndicator),0)
705#define I2O_HRT_setCurrentChangeIndicator(x,y)\
706                setLU4((&(x)->CurrentChangeIndicator),0,y)
707#define I2O_HRT_getHRTEntryPtr(x,y)\
708                ((&((x)->HRTEntry[0+y])))
709
710/*
711 *  I2O_HRT_ENTRY
712 */
713#define I2O_HRT_ENTRY_getAdapterID(x)\
714                getLU4((&((x)->AdapterID)),0)
715#define I2O_HRT_ENTRY_setAdapterID(x,y)\
716                setLU4((&(x)->AdapterID),0,y)
717#define I2O_HRT_ENTRY_getControllingTID(x)\
718                _F_get12bit(x,ControllingTID,ControllingTID)
719#define I2O_HRT_ENTRY_setControllingTID(x,y)\
720                _F_set12bit(x,ControllingTID,ControllingTID,y)
721#define I2O_HRT_ENTRY_getAdapterState(x)\
722                _F_get4bit4(x,ControllingTID,1,AdapterState)
723#define I2O_HRT_ENTRY_setIAdapterState(x,y)\
724                _F_set4bit4(x,ControllingTID,1,AdapterState,y)
725#define I2O_HRT_ENTRY_getBusNumber(x)\
726                _F_get8bit(x,ControllingTID,2,BusNumber)
727#define I2O_HRT_ENTRY_setBusNumber(x,y)\
728                _F_set8bit(x,ControllingTID,2,BusNumber,y)
729#define I2O_HRT_ENTRY_getBusType(x)\
730                _F_get8bit(x,ControllingTID,3,BusType)
731#define I2O_HRT_ENTRY_setBusType(x,y)\
732                _F_set8bit(x,ControllingTID,3,BusType,y)
733#define I2O_HRT_ENTRY_getPCIBusPtr(x,y)\
734                (&((x)->uBus.PCIBus))
735
736/*
737 *  I2O_LCT
738 */
739#define I2O_LCT_getTableSize(x)\
740                _F_get16bit(x,TableSize,0,TableSize)
741#define I2O_LCT_setTableSize(x,y)\
742                _F_set16bit(x,TableSize,0,TableSize,y)
743#define I2O_LCT_getBootDeviceTID(x)\
744                _F_get12bit(x,TableSize,2,BootDeviceTID)
745#define I2O_LCT_setBootDeviceTID(x,y)\
746                _F_set12bit(x,TableSize,2,BootDeviceTID,y)
747#define I2O_LCT_getLctVer(x)\
748                _F_get4bit4(x,TableSize,3,LctVer)
749#define I2O_LCT_setLctVer(x,y)\
750                _F_set4bit4(x,TableSize,3,LctVer,y)
751#define I2O_LCT_getIopFlags(x)\
752                getLU4((&(x)->IopFlags),0)
753#define I2O_LCT_setIopFlags(x,y)\
754                setLU4((&(x)->IopFlags),0,y)
755#define I2O_LCT_getCurrentChangeIndicator(x)\
756                getLU4((&(x)->CurrentChangeIndicator),0)
757#define I2O_LCT_setCurrentChangeIndicator(x,y)\
758                setLU4((&(x)->CurrentChangeIndicator),0,y)
759#define I2O_LCT_getLCTEntryPtr(x,y)\
760                (&((x)->LCTEntry[0+y]))
761
762/*
763 *  I2O_LCT_ENTRY
764 */
765#define I2O_LCT_ENTRY_getTableEntrySize(x)\
766                _F_get16bit(x,TableEntrySize,0,TableEntrySize)
767#define I2O_LCT_ENTRY_setTableEntrySize(x,y)\
768                _F_set16bit(x,TableEntrySize,0,TableEntrySize,y)
769#define I2O_LCT_ENTRY_getLocalTID(x)\
770                _F_get12bit(x,TableEntrySize,2,LocalTID)
771#define I2O_LCT_ENTRY_setLocalTID(x,y)\
772                _F_set12bit(x,TableEntrySize,2,LocalTID,y)
773/*    BF                  4        reserved:I2O_4BIT_VERSION_SZ; */
774#define I2O_LCT_ENTRY_getChangeIndicator(x)\
775                getLU4((&(x)->ChangeIndicator),0)
776#define I2O_LCT_ENTRY_setChangeIndicator(x,y)\
777                setLU4((&(x)->ChangeIndicator),0,y)
778#define I2O_LCT_ENTRY_getDeviceFlags(x)\
779                getLU4((&(x)->DeviceFlags),0)
780#define I2O_LCT_ENTRY_setDeviceFlags(x,y)\
781                setLU4((&(x)->DeviceFlags),0,y)
782#define I2O_LCT_ENTRY_getClassIDPtr(x)\
783                (&((x)->ClassID))
784#define I2O_LCT_ENTRY_getSubClassInfo(x)\
785                getLU4((&(x)->SubClassInfo),0)
786#define I2O_LCT_ENTRY_setSubClassInfo(x,y)\
787                setLU4((&(x)->SubClassInfo),0,y)
788#define I2O_LCT_ENTRY_getUserTID(x)\
789                _F_getTID(x,UserTID,UserTID)
790#define I2O_LCT_ENTRY_setUserTID(x,y)\
791                _F_setTID(x,UserTID,UserTID,y)
792#define I2O_LCT_ENTRY_getParentTID(x)\
793                _F_getTID1(x,UserTID,ParentTID)
794#define I2O_LCT_ENTRY_setParentTID(x,y)\
795                _F_getTID1(x,UserTID,ParentTID,y)
796#define I2O_LCT_ENTRY_getBiosInfo(x)\
797                _F_getFunc(x,UserTID,BiosInfo)
798#define I2O_LCT_ENTRY_setBiosInfo(x,y)\
799                _F_setFunc(x,UserTID,BiosInfo,y)
800/*  2 ulong   U8                    8      IdentityTag[I2O_IDENTITY_TAG_SZ]; */
801#define I2O_LCT_ENTRY_getEventCapabilities(x)\
802                getLU4((&(x)->EventCapabilities),0)
803#define I2O_LCT_ENTRY_setEventCapabilities(x,y)\
804                setLU4((&(x)->EventCapabilities),0,y)
805
806/*
807 *  I2O_PARAM_OPERATIONS_LIST_HEADER
808 */
809#define I2O_PARAM_OPERATIONS_LIST_HEADER_getOperationCount(x)\
810                getLU2((&(x)->OperationCount),0)
811#define I2O_PARAM_OPERATIONS_LIST_HEADER_setOperationCount(x,y)\
812                setLU2((&(x)->OperationCount),0,y)
813#define I2O_PARAM_OPERATIONS_LIST_HEADER_getReserved(x)\
814                getLU2((&(x)->Reserved),0)
815#define I2O_PARAM_OPERATIONS_LIST_HEADER_setReserved(x,y)\
816                setLU2((&(x)->Reserved),0,y)
817
818/*
819 *  I2O_PARAM_OPERATION_ALL_TEMPLATE
820 */
821#define I2O_PARAM_OPERATION_ALL_TEMPLATE_getOperation(x)\
822                getLU2((&(x)->Operation),0)
823#define I2O_PARAM_OPERATION_ALL_TEMPLATE_setOperation(x,y)\
824                setLU2((&(x)->Operation),0,y)
825#define I2O_PARAM_OPERATION_ALL_TEMPLATE_getGroupNumber(x)\
826                getLU2((&(x)->GroupNumber),0)
827#define I2O_PARAM_OPERATION_ALL_TEMPLATE_setGroupNumber(x,y)\
828                setLU2((&(x)->GroupNumber),0,y)
829#define I2O_PARAM_OPERATION_ALL_TEMPLATE_getFieldCount(x)\
830                getLU2((&(x)->FieldCount),0)
831#define I2O_PARAM_OPERATION_ALL_TEMPLATE_setFieldCount(x,y)\
832                setLU2((&(x)->FieldCount),0,y)
833
834/*
835 *  I2O_PARAM_RESULTS_LIST_HEADER
836 */
837#define I2O_PARAM_RESULTS_LIST_HEADER_getResultCount(x)\
838                getLU2((&(x)->ResultCount),0)
839#define I2O_PARAM_RESULTS_LIST_HEADER_setResultCount(x,y)\
840                setLU2((&(x)->ResultCount),0,y)
841#define I2O_PARAM_RESULTS_LIST_HEADER_getReserved(x)\
842                getLU2((&(x)->Reserved),0)
843#define I2O_PARAM_RESULTS_LIST_HEADER_setReserved(x,y)\
844                setLU2((&(x)->Reserved),0,y)
845
846/*  later
847 *  I2O_HBA_ADAPTER_RESET_MESSAGE
848 */
849
850
851/*  LATER
852 *  I2O_SCSI_DEVICE_RESET_MESSAGE
853 */
854
855
856/*  LATER
857 *  I2O_HBA_BUS_RESET_MESSAGE
858 */
859
860
861/*
862 *  I2O_EXEC_LCT_NOTIFY_MESSAGE
863 */
864/*    I2O_MESSAGE_FRAME           StdMessageFrame; */
865/*    I2O_TRANSACTION_CONTEXT     TransactionContext; */
866#define I2O_EXEC_LCT_NOTIFY_MESSAGE_getClassIdentifier(x)\
867                getLU4((&(x)->ClassIdentifier),0)
868#define I2O_EXEC_LCT_NOTIFY_MESSAGE_setClassIdentifier(x,y)\
869                setLU4((&(x)->ClassIdentifier),0,y)
870#define I2O_EXEC_LCT_NOTIFY_MESSAGE_getLastReportedChangeIndicator(x)\
871                getLU4((&(x)->LastReportedChangeIndicator),0)
872#define I2O_EXEC_LCT_NOTIFY_MESSAGE_setLastReportedChangeIndicator(x,y)\
873                setLU4((&(x)->LastReportedChangeIndicator),0,y)
874/*    I2O_SG_ELEMENT              SGL; */
875
876
877
878/*
879 *  I2O_UTIL_PARAMS_GET_MESSAGE
880 */
881/*     I2O_MESSAGE_FRAME          StdMessageFrame;	*/
882/*     I2O_TRANSACTION_CONTEXT    TransactionContext;	*/
883#define I2O_UTIL_PARAMS_GET_MESSAGE_getOperationFlags(x)\
884                getLU4((&(x)->OperationFlags),0)
885#define I2O_UTIL_PARAMS_GET_MESSAGE_setOperationFlags(x,y)\
886                setLU4((&(x)->OperationFlags),0,y)
887/*     I2O_SG_ELEMENT             SGL;			*/
888
889
890/*
891 *  I2O_SCSI_SCB_ABORT_MESSAGE
892 */
893#define I2O_SCSI_SCB_ABORT_MESSAGE_getStdMessageFramePtr(x)\
894                (&((x)->StdMessageFrame))
895#define I2O_SCSI_SCB_ABORT_MESSAGE_getTransactionContext(x)\
896                (x)->TransactionContext
897#define I2O_SCSI_SCB_ABORT_MESSAGE_setTransactionContext(x,y)\
898                ((x)->TransactionContext = (y))
899#define I2O_SCSI_SCB_ABORT_MESSAGE_getTransactionContextToAbort(x)\
900                (x)->TransactionContextToAbort
901#define I2O_SCSI_SCB_ABORT_MESSAGE_setTransactionContextToAbort(x,y)\
902                ((x)->TransactionContextToAbort = (y))
903
904
905/*
906 *  I2O_DPT_DEVICE_INFO_SCALAR
907 */
908#define I2O_DPT_DEVICE_INFO_SCALAR_getDeviceType(x)\
909                getU1((&(x)->DeviceType),0)
910#define I2O_DPT_DEVICE_INFO_SCALAR_setDeviceType(x,y)\
911                setU1((&(x)->DeviceType),0,y)
912#define I2O_DPT_DEVICE_INFO_SCALAR_getFlags(x)\
913                getU1((&(x)->Flags),0)
914#define I2O_DPT_DEVICE_INFO_SCALAR_setFlags(x,y)\
915                setU1((&(x)->Flags),0,y)
916#define I2O_DPT_DEVICE_INFO_SCALAR_getBus(x)\
917                getLU2((&(x)->Bus),0)
918#define I2O_DPT_DEVICE_INFO_SCALAR_setBus(x,y)\
919                setLU2((&(x)->Bus),0,y)
920#define I2O_DPT_DEVICE_INFO_SCALAR_getIdentifier(x)\
921                getLU4((&(x)->Identifier),0)
922#define I2O_DPT_DEVICE_INFO_SCALAR_setIdentifier(x,y)\
923                setLU4((&(x)->Identifier),0,y)
924/*     U8          LunInfo[8]; // SCSI-2 8-bit scalar LUN goes into offset 1 */
925#define I2O_DPT_DEVICE_INFO_SCALAR_getLunInfo(x)\
926                getU1((&(x)->LunInfo[0]),1)
927#define I2O_DPT_DEVICE_INFO_SCALAR_setLunInfo(x,y)\
928                setU1((&(x)->LunInfo[0]),1,y)
929
930/*
931 *       I2O_DPT_EXEC_IOP_BUFFERS_SCALAR
932 */
933#define I2O_DPT_EXEC_IOP_BUFFERS_SCALAR_getSerialOutputOffset(x)\
934                getLU4((&(x)->SerialOutputOffset),0)
935#define I2O_DPT_EXEC_IOP_BUFFERS_SCALAR_getSerialOutputSizet(x)\
936                getLU4((&(x)->SerialOutputSize),0)
937#define I2O_DPT_EXEC_IOP_BUFFERS_SCALAR_getSerialHeaderSize(x)\
938                getLU4((&(x)->SerialHeaderSize),0)
939#define I2O_DPT_EXEC_IOP_BUFFERS_SCALAR_getSerialFlagsSupported(x)\
940                getLU4((&(x)->SerialFlagsSupported),0)
941
942/*
943 *  I2O_PRIVATE_MESSAGE_FRAME
944 */
945/* typedef struct _I2O_PRIVATE_MESSAGE_FRAME { */
946/*    I2O_MESSAGE_FRAME           StdMessageFrame; */
947/*    I2O_TRANSACTION_CONTEXT     TransactionContext; */
948/*    U16                         XFunctionCode; */
949/*    U16                         OrganizationID; */
950/*                                PrivatePayload[]; */
951/* } I2O_PRIVATE_MESSAGE_FRAME, *PI2O_PRIVATE_MESSAGE_FRAME; */
952#define I2O_PRIVATE_MESSAGE_FRAME_getTransactionContext(x) \
953                (x)->TransactionContext
954#define I2O_PRIVATE_MESSAGE_FRAME_setTransactionContext(x,y) \
955                ((x)->TransactionContext = (y))
956#define I2O_PRIVATE_MESSAGE_FRAME_getXFunctionCode(x) \
957                getLU2((&(x)->XFunctionCode),0)
958#define I2O_PRIVATE_MESSAGE_FRAME_setXFunctionCode(x,y) \
959                setLU2((&(x)->XFunctionCode),0,y)
960#define I2O_PRIVATE_MESSAGE_FRAME_getOrganizationID(x) \
961                getLU2((&(x)->OrganizationID),0)
962#define I2O_PRIVATE_MESSAGE_FRAME_setOrganizationID(x,y) \
963                setLU2((&(x)->OrganizationID),0,y)
964/* typedef struct _PRIVATE_SCSI_SCB_EXECUTE_MESSAGE {
965 *     I2O_PRIVATE_MESSAGE_FRAME PRIVATE_SCSI_SCB_EXECUTE_MESSAGE;
966 *     BF                        TID:16; // Upper four bits currently are zero
967 *     // Command is interpreted by the host
968 *     BF                        Interpret:1;
969 *     // if TRUE, deal with Physical Firmware Array information
970 *     BF                        Physical:1;
971 *     BF                        Reserved1:14;
972 *     U8                        CDBLength;
973 *     U8                        Reserved;
974 *     I2O_SCB_FLAGS             SCBFlags;
975 *     U8                        CDB[  I2O_SCSI_CDB_LENGTH=16  ];
976 *     U32                       ByteCount;
977 *     I2O_SG_ELEMENT            SGL;
978 * } PRIVATE_SCSI_SCB_EXECUTE_MESSAGE, * PPRIVATE_SCSI_SCB_EXECUTE_MESSAGE;
979 */
980/*
981 *       PRIVATE_SCSI_SCB_EXECUTE_MESSAGE
982 */
983#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_getPRIVATE_SCSI_SCB_EXECUTE_MESSAGEPtr(x)\
984                (&((x)->PRIVATE_SCSI_SCB_EXECUTE_MESSAGE))
985#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_getCDBLength(x)\
986                getU1((&(x)->CDBLength),0)
987#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_setCDBLength(x,y)\
988                setU1((&(x)->CDBLength),0,y)
989#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_getReserved(x)\
990                getU1((&(x)->Reserved),0)
991#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_setReserved(x,y)\
992                setU1((&(x)->Reserved),0,y)
993#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_getSCBFlags(x)\
994                getLU2((&(x)->SCBFlags),0)
995#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_setSCBFlags(x,y)\
996                setLU2((&(x)->SCBFlags),0,y)
997#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_getByteCount(x)\
998                getLU4((&((x)->ByteCount)),0)
999#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_setByteCount(x,y)\
1000                setLU4((&((x)->ByteCount)),0,y)
1001#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_getTID(x)\
1002                _F_get16bit(x,TID,0,TID)
1003#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_setTID(x,y)\
1004                _F_set16bit(x,TID,0,TID,y)
1005#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_getInterpret(x)\
1006                _F_get1bit(x,TID,2,Interpret)
1007#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_setInterpret(x,y)\
1008                _F_set1bit(x,TID,2,Interpret,y)
1009#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_getPhysical(x)\
1010                _F_get1bit1(x,TID,2,Physical)
1011#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_setPhysical(x,y)\
1012                _F_set1bit1(x,TID,2,Physical,y)
1013#define PRIVATE_SCSI_SCB_EXECUTE_MESSAGE_getCDBPtr(x)\
1014                (&((x)->CDB[0]))
1015
1016
1017/*
1018 *  PRIVATE_FLASH_REGION_MESSAGE
1019 */
1020#define PRIVATE_FLASH_REGION_MESSAGE_getFlashRegion(x) \
1021                getLU4((&((x)->FlashRegion)),0)
1022#define PRIVATE_FLASH_REGION_MESSAGE_setFlashRegion(x,y) \
1023                setLU4((&((x)->FlashRegion)),0,y)
1024#define PRIVATE_FLASH_REGION_MESSAGE_getRegionOffset(x) \
1025                getLU4((&((x)->RegionOffset)),0)
1026#define PRIVATE_FLASH_REGION_MESSAGE_setRegionOffset(x,y) \
1027                setLU4((&((x)->RegionOffset)),0,y)
1028#define PRIVATE_FLASH_REGION_MESSAGE_getByteCount(x) \
1029                getLU4((&((x)->ByteCount)),0)
1030#define PRIVATE_FLASH_REGION_MESSAGE_setByteCount(x,y) \
1031                setLU4((&((x)->ByteCount)),0,y)
1032
1033/*
1034 *  I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR
1035 */
1036#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_getSCSIType(x)\
1037                getU1((&(x)->SCSIType),0)
1038#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_setSCSIType(x,y)\
1039                setU1((&(x)->SCSIType),0,y)
1040#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_getProtectionManagement(x)\
1041                getU1((&(x)->ProtectionManagement),0)
1042#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_setProtectionManagement(x,y)\
1043                setU1((&(x)->ProtectionManagement),0,y)
1044#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_getSettings(x)\
1045                getU1((&(x)->Settings),0)
1046#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_setSettings(x,y)\
1047                setU1((&(x)->Settings),0,y)
1048#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_getReserved1(x)\
1049                getU1((&(x)->Reserved1),0)
1050#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_setReserved1(x,y)\
1051                setU1((&(x)->Reserved1),0,y)
1052#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_getInitiatorID(x)\
1053                getLU4((&(x)->InitiatorID),0)
1054#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_setInitiatorID(x,y)\
1055                setLU4((&(x)->InitiatorID),0,y)
1056#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_getScanLun0Only(x)\
1057                getLU4((&(x)->ScanLun0Only),0)
1058#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_setScanLun0Only(x,y)\
1059                setLU4((&(x)->ScanLun0Only),0,y)
1060#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_getDisableDevice(x)\
1061                getLU2((&(x)->DisableDevice),0)
1062#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_setDisableDevice(x,y)\
1063                setLU2((&(x)->DisableDevice),0,y)
1064#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_getMaxOffset(x)\
1065                getU1((&(x)->MaxOffset),0)
1066#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_setMaxOffset(x,y)\
1067                setU1((&(x)->MaxOffset),0,y)
1068#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_getMaxDataWidth(x)\
1069                getU1((&(x)->MaxDataWidth),0)
1070#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_setMaxDataWidth(x,y)\
1071                setU1((&(x)->MaxDataWidth),0,y)
1072#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_getMaxSyncRate(x)\
1073                getLU4((&(x)->MaxSyncRate),0)
1074#define I2O_HBA_SCSI_CONTROLLER_INFO_SCALAR_setMaxSyncRate(x,y)\
1075                setLU4((&(x)->MaxSyncRate),0,y)
1076
1077/*
1078 *  I2O_SCSI_ERROR_REPLY_MESSAGE_FRAME
1079 */
1080#define I2O_SCSI_ERROR_REPLY_MESSAGE_FRAME_getStdReplyFramePtr(x)\
1081                (&((x)->StdReplyFrame))
1082#define I2O_SCSI_ERROR_REPLY_MESSAGE_FRAME_getTransferCount(x)\
1083                getLU4((&(x)->TransferCount),0)
1084#define I2O_SCSI_ERROR_REPLY_MESSAGE_FRAME_setTransferCount(x,y)\
1085                setLU4((&(x)->TransferCount),0,y)
1086#define I2O_SCSI_ERROR_REPLY_MESSAGE_FRAME_getAutoSenseTransferCount(x)\
1087                getLU4((&(x)->AutoSenseTransferCount),0)
1088#define I2O_SCSI_ERROR_REPLY_MESSAGE_FRAME_setAutoSenseTransferCount(x,y)\
1089                setLU4((&(x)->AutoSenseTransferCount),0,y)
1090
1091/*
1092 *  I2O_SINGLE_REPLY_MESSAGE_FRAME
1093 */
1094#define I2O_SINGLE_REPLY_MESSAGE_FRAME_getStdMessageFramePtr(x)\
1095                (&((x)->StdMessageFrame))
1096#define I2O_SINGLE_REPLY_MESSAGE_FRAME_getTransactionContext(x)\
1097                (x)->TransactionContext
1098#define I2O_SINGLE_REPLY_MESSAGE_FRAME_setTransactionContext(x,y)\
1099                ((x)->TransactionContext = (y))
1100#define I2O_SINGLE_REPLY_MESSAGE_FRAME_getDetailedStatusCode(x)\
1101                getLU2((&((x)->DetailedStatusCode)),0)
1102#define I2O_SINGLE_REPLY_MESSAGE_FRAME_setDetailedStatusCode(x,y)\
1103                setLU2((&((x)->DetailedStatusCode)),0,y)
1104#define I2O_SINGLE_REPLY_MESSAGE_FRAME_getreserved(x)\
1105                getU1((&((x)->reserved)),0)
1106#define I2O_SINGLE_REPLY_MESSAGE_FRAME_setreserved(x,y)\
1107                setU1((&((x)->reserved)),0,y)
1108#define I2O_SINGLE_REPLY_MESSAGE_FRAME_getReqStatus(x)\
1109                getU1((&((x)->ReqStatus)),0)
1110#define I2O_SINGLE_REPLY_MESSAGE_FRAME_setReqStatus(x,y)\
1111                setU1((&((x)->ReqStatus)),0,y)
1112
1113
1114/*
1115 *  I2O_SCSI_SCB_EXECUTE_MESSAGE
1116 */
1117#define I2O_SCSI_SCB_EXECUTE_MESSAGE_getStdMessageFramePtr(x)\
1118                (&((x)->StdMessageFrame))
1119#define I2O_SCSI_SCB_EXECUTE_MESSAGE_getTransactionContext(x)\
1120                (x)->TransactionContext
1121#define I2O_SCSI_SCB_EXECUTE_MESSAGE_setTransactionContext(x,y)\
1122                ((x)->TransactionContext = (y))
1123#define I2O_SCSI_SCB_EXECUTE_MESSAGE_getCDBLength(x)\
1124                getU1((&((x)->CDBLength)),0)
1125#define I2O_SCSI_SCB_EXECUTE_MESSAGE_setCDBLength(x,y)\
1126                setU1((&((x)->CDBLength)),0,y)
1127#define I2O_SCSI_SCB_EXECUTE_MESSAGE_getReserved(x)\
1128                getU1((&((x)->Reserved)),0)
1129#define I2O_SCSI_SCB_EXECUTE_MESSAGE_setReserved(x,y)\
1130                setU1((&((x)->Reserved)),0,y)
1131#define I2O_SCSI_SCB_EXECUTE_MESSAGE_getSCBFlags(x)\
1132                getLU2((&((x)->SCBFlags)),0)
1133#define I2O_SCSI_SCB_EXECUTE_MESSAGE_setSCBFlags(x,y)\
1134                setLU2((&((x)->SCBFlags)),0,y)
1135#define I2O_SCSI_SCB_EXECUTE_MESSAGE_getByteCount(x)\
1136                getLU2((&((x)->ByteCount)),0)
1137#define I2O_SCSI_SCB_EXECUTE_MESSAGE_setByteCount(x,y)\
1138                setLU2((&((x)->ByteCount)),0,y)
1139/*  define for these */
1140/*     U8                      CDB[16];	*/
1141/*     I2O_SG_ELEMENT          SGL;	*/
1142
1143
1144/*
1145 *  I2O_FAILURE_REPLY_MESSAGE_FRAME
1146 */
1147#define I2O_FAILURE_REPLY_MESSAGE_FRAME_getStdMessageFramePtr(x)\
1148                (&((x)->StdMessageFrame))
1149#define I2O_FAILURE_REPLY_MESSAGE_FRAME_getTransactionContext(x)\
1150                (x)->TransactionContext
1151#define I2O_FAILURE_REPLY_MESSAGE_FRAME_setTransactionContext(x,y)\
1152                ((x)->TransactionContext = (y))
1153#define I2O_FAILURE_REPLY_MESSAGE_FRAME_getLowestVersion(x)\
1154                getU1((&((x)->LowestVersion)),0)
1155#define I2O_FAILURE_REPLY_MESSAGE_FRAME_setLowestVersion(x,y)\
1156                setU1((&((x)->LowestVersion)),0,y)
1157#define I2O_FAILURE_REPLY_MESSAGE_FRAME_getHighestVersion(x)\
1158                getU1((&((x)->HighestVersion)),0)
1159#define I2O_FAILURE_REPLY_MESSAGE_FRAME_setHighestVersion(x,y)\
1160                setU1((&((x)->HighestVersion)),0,y)
1161#define I2O_FAILURE_REPLY_MESSAGE_FRAME_getAgeLimit(x)\
1162                getLU4((&((x)->AgeLimit)),0)
1163#define I2O_FAILURE_REPLY_MESSAGE_FRAME_setAgeLimit(x,y)\
1164                setLU4((&((x)->AgeLimit)),0,y)
1165#define I2O_FAILURE_REPLY_MESSAGE_FRAME_getSeverity(x)\
1166                _F_get8bit(x,Severity,0,Severity)
1167#define I2O_FAILURE_REPLY_MESSAGE_FRAME_setSeverity(x,y)\
1168                _F_set8bit(x,Severity,0,Severity,y)
1169#define I2O_FAILURE_REPLY_MESSAGE_FRAME_getFailureCode(x)\
1170                _F_get8bit(x,Severity,1,FailureCode)
1171#define I2O_FAILURE_REPLY_MESSAGE_FRAME_setFailureCode(x,y)\
1172                _F_get8bit(x,Severity,1,FailureCode,y)
1173/*
1174 * #define I2O_FAILURE_REPLY_MESSAGE_FRAME_getFailingHostUnitID(x)\
1175 *               _F_get16bit(x,reserved,1,FailingHostUnitID)
1176 * #define I2O_FAILURE_REPLY_MESSAGE_FRAME_setFailingHostUnitID(x,y)\
1177 *               _F_set16bit(x,reserved,1,FailingHostUnitID,y)
1178 */
1179#define I2O_FAILURE_REPLY_MESSAGE_FRAME_getPreservedMFA(x)\
1180                getLU4((&((x)->PreservedMFA)),0)
1181#define I2O_FAILURE_REPLY_MESSAGE_FRAME_setPreservedMFA(x,y)\
1182                setLU4((&((x)->PreservedMFA)),0,y)
1183
1184
1185
1186/*
1187 *  I2O_EXEC_STATUS_GET_REPLY
1188 */
1189#define I2O_EXEC_STATUS_GET_REPLY_getOrganizationID(x)\
1190                getLU2((&(x)->OrganizationID),0)
1191#define I2O_EXEC_STATUS_GET_REPLY_setOrganizationID(x,y)\
1192                setLU2((&(x)->OrganizationID),0,y)
1193/* #define I2O_EXEC_STATUS_GET_REPLY_getreserved; */
1194#define I2O_EXEC_STATUS_GET_REPLY_getIOP_ID(x)\
1195                _F_get12bit(x,IOP_ID,0,IOP_ID)
1196#define I2O_EXEC_STATUS_GET_REPLY_setIOP_ID(x,y)\
1197                _F_set12bit(x,IOP_ID,0,IOP_ID,y)
1198/* #define I2O_EXEC_STATUS_GET_REPLY_getreserved1(x) */
1199#define I2O_EXEC_STATUS_GET_REPLY_getHostUnitID(x)\
1200                _F_get16bit(x,IOP_ID,2,HostUnitID)
1201#define I2O_EXEC_STATUS_GET_REPLY_setHostUnitID(x,y)\
1202                _F_set16bit(x,IOP_ID,2,HostUnitID,y)
1203#define I2O_EXEC_STATUS_GET_REPLY_getSegmentNumber(x)\
1204                _F_get12bit(x,SegmentNumber,0,SegmentNumber)
1205#define I2O_EXEC_STATUS_GET_REPLY_setSegmentNumber(x,y)\
1206                _F_set12bit(x,SegmentNumber,0,SegmentNumber,y)
1207#define I2O_EXEC_STATUS_GET_REPLY_getI2oVersion(x)\
1208                _F_get4bit4(x,SegmentNumber,1,I2oVersion)
1209#define I2O_EXEC_STATUS_GET_REPLY_setI2oVersion(x,y)\
1210                _F_set4bit4(x,SegmentNumber,1,I2oVersion,y)
1211#define I2O_EXEC_STATUS_GET_REPLY_getIopState(x)\
1212                _F_get8bit(x,SegmentNumver,2,IopState)
1213#define I2O_EXEC_STATUS_GET_REPLY_setIopState(x,y)\
1214                _F_set8bit(x,SegmentNumver,2,IopState,y)
1215#define I2O_EXEC_STATUS_GET_REPLY_getMessengerType(x)\
1216                _F_get8bit(x,SegmentNumber,3,MessengerType)
1217#define I2O_EXEC_STATUS_GET_REPLY_setMessengerType(x,y)\
1218                _F_get8bit(x,SegmentNumber,3,MessengerType,y)
1219#define I2O_EXEC_STATUS_GET_REPLY_getInboundMFrameSize(x)\
1220                getLU2((&(x)->InboundMFrameSize),0)
1221#define I2O_EXEC_STATUS_GET_REPLY_setInboundMFrameSize(x,y)\
1222                setLU2((&(x)->InboundMFrameSize),0,y)
1223#define I2O_EXEC_STATUS_GET_REPLY_getInitCode(x)\
1224                getU1((&(x)->InitCode),0)
1225#define I2O_EXEC_STATUS_GET_REPLY_setInitCode(x,y)\
1226                setU1((&(x)->InitCode),0,y)
1227/* #define I2O_EXEC_STATUS_GET_REPLY_getreserved2(x) */
1228#define I2O_EXEC_STATUS_GET_REPLY_getMaxInboundMFrames(x)\
1229                getLU4((&(x)->MaxInboundMFrames),0)
1230#define I2O_EXEC_STATUS_GET_REPLY_setMaxInboundMFrames(x,y)\
1231                setLU4((&(x)->MaxInboundMFrames),0,y)
1232#define I2O_EXEC_STATUS_GET_REPLY_getCurrentInboundMFrames(x)\
1233                getLU4((&(x)->CurrentInboundMFrames),0)
1234#define I2O_EXEC_STATUS_GET_REPLY_setCurrentInboundMFrames(x,y)\
1235                setLU4((&(x)->CurrentInboundMFrames),0,y)
1236#define I2O_EXEC_STATUS_GET_REPLY_getMaxOutboundMFrames(x)\
1237                getLU4((&(x)->MaxOutboundMFrames),0)
1238#define I2O_EXEC_STATUS_GET_REPLY_setMaxOutboundMFrames(x,y)\
1239                setLU4((&(x)->MaxOutboundMFrames),0,y)
1240/* #define I2O_EXEC_STATUS_GET_REPLY_getProductIDString(x) */
1241#define I2O_EXEC_STATUS_GET_REPLY_getExpectedLCTSize(x)\
1242                getLU4((&(x)->ExpectedLCTSize),0)
1243#define I2O_EXEC_STATUS_GET_REPLY_setExpectedLCTSize(x,y)\
1244                setLU4((&(x)->ExpectedLCTSize),0,y)
1245#define I2O_EXEC_STATUS_GET_REPLY_getIopCapabilities(x)\
1246                getLU4((&(x)->IopCapabilities),0)
1247#define I2O_EXEC_STATUS_GET_REPLY_setIopCapabilities(x,y)\
1248                setLU4((&(x)->IopCapabilities),0,y)
1249#define I2O_EXEC_STATUS_GET_REPLY_getDesiredPrivateMemSize(x)\
1250                getLU4((&(x)->DesiredPrivateMemSize),0)
1251#define I2O_EXEC_STATUS_GET_REPLY_setDesiredPrivateMemSize(x,y)\
1252                setLU4((&(x)->DesiredPrivateMemSize),0,y)
1253#define I2O_EXEC_STATUS_GET_REPLY_getCurrentPrivateMemSize(x)\
1254                getLU4((&(x)->CurrentPrivateMemSize),0)
1255#define I2O_EXEC_STATUS_GET_REPLY_setCurrentPrivateMemSize(x,y)\
1256                setLU4((&(x)->CurrentPrivateMemSize),0,y)
1257#define I2O_EXEC_STATUS_GET_REPLY_getCurrentPrivateMemBase(x)\
1258                getLU4((&(x)->CurrentPrivateMemBase),0)
1259#define I2O_EXEC_STATUS_GET_REPLY_setCurrentPrivateMemBase(x,y)\
1260                setLU4((&(x)->CurrentPrivateMemBase),0,y)
1261#define I2O_EXEC_STATUS_GET_REPLY_getDesiredPrivateIOSize(x)\
1262                getLU4((&(x)->DesiredPrivateIOSize),0)
1263#define I2O_EXEC_STATUS_GET_REPLY_setDesiredPrivateIOSize(x,y)\
1264                setLU4((&(x)->DesiredPrivateIOSize),0,y)
1265#define I2O_EXEC_STATUS_GET_REPLY_getCurrentPrivateIOSize(x)\
1266                getLU4((&(x)->CurrentPrivateIOSize),0)
1267#define I2O_EXEC_STATUS_GET_REPLY_setCurrentPrivateIOSize(x,y)\
1268                setLU4((&(x)->CurrentPrivateIOSize),0,y)
1269#define I2O_EXEC_STATUS_GET_REPLY_getCurrentPrivateIOBase(x)\
1270                getLU4((&(x)->CurrentPrivateIOBase),0)
1271#define I2O_EXEC_STATUS_GET_REPLY_setCurrentPrivateIOBase(x,y)\
1272                setLU4((&(x)->CurrentPrivateIOBase),0,y)
1273/* #define I2O_EXEC_STATUS_GET_REPLY_getreserved3(x) */
1274#define I2O_EXEC_STATUS_GET_REPLY_getSyncByte(x)\
1275                getU1((&(x)->SyncByte),0)
1276#define I2O_EXEC_STATUS_GET_REPLY_setSyncByte(x,y)\
1277                setU1((&(x)->SyncByte),0,y)
1278
1279
1280
1281/*
1282 *  I2O_HBA_BUS_QUIESCE_MESSAGE
1283 */
1284#define I2O_HBA_BUS_QUIESCE_MESSAGE_getStdMessageFramePtr(x)\
1285                (&((x)->StdMessageFrame))
1286#define I2O_HBA_BUS_QUIESCE_MESSAGE_getTransactionContext(x)\
1287                getBU4((&((x)->TransactionContext)),0)
1288#define I2O_HBA_BUS_QUIESCE_MESSAGE_setTransactionContext(x,y)\
1289                setBU4((&((x)->TransactionContext)),0,y)
1290#define I2O_HBA_BUS_QUIESCE_MESSAGE_getFlags(x)\
1291                getLU4((&(x)->Flags),0)
1292#define I2O_HBA_BUS_QUIESCE_MESSAGE_setFlags(x,y)\
1293                setLU4((&(x)->Flags),0,y)
1294
1295
1296#endif /* __INCi2odeph */
1297