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