Merge branch 'vendor/TCPDUMP' and update build for the update.
[dragonfly.git] / sys / dev / disk / mpt / mpilib / mpi_targ.h
1 /* $FreeBSD: src/sys/dev/mpt/mpilib/mpi_targ.h,v 1.1.2.2 2002/09/01 23:08:06 mjacob Exp $ */
2 /* $DragonFly: src/sys/dev/disk/mpt/mpilib/mpi_targ.h,v 1.2 2003/06/17 04:28:28 dillon Exp $ */
3 /*
4  * Copyright (c) 2000, 2001 by LSI Logic Corporation
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice immediately at the beginning of the file, without modification,
11  *    this list of conditions, and the following disclaimer.
12  * 2. The name of the author may not be used to endorse or promote products
13  *    derived from this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' 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 THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
19  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  *
27  *
28  *           Name:  MPI_TARG.H
29  *          Title:  MPI Target mode messages and structures
30  *  Creation Date:  June 22, 2000
31  *
32  *    MPI Version:  01.02.04
33  *
34  *  Version History
35  *  ---------------
36  *
37  *  Date      Version   Description
38  *  --------  --------  ------------------------------------------------------
39  *  05-08-00  00.10.01  Original release for 0.10 spec dated 4/26/2000.
40  *  06-06-00  01.00.01  Update version number for 1.0 release.
41  *  06-22-00  01.00.02  Added _MSG_TARGET_CMD_BUFFER_POST_REPLY structure.
42  *                      Corrected DECSRIPTOR typo to DESCRIPTOR.
43  *  11-02-00  01.01.01  Original release for post 1.0 work
44  *                      Modified target mode to use IoIndex instead of
45  *                      HostIndex and IocIndex. Added Alias.
46  *  01-09-01  01.01.02  Added defines for TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER
47  *                      and TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER.
48  *  02-20-01  01.01.03  Started using MPI_POINTER.
49  *                      Added structures for MPI_TARGET_SCSI_SPI_CMD_BUFFER and
50  *                      MPI_TARGET_FCP_CMD_BUFFER.
51  *  03-27-01  01.01.04  Added structure offset comments.
52  *  08-08-01  01.02.01  Original release for v1.2 work.
53  *  09-28-01  01.02.02  Added structure for MPI_TARGET_SCSI_SPI_STATUS_IU.
54  *                      Added PriorityReason field to some replies and
55  *                      defined more PriorityReason codes.
56  *                      Added some defines for to support previous version
57  *                      of MPI.
58  *  10-04-01  01.02.03  Added PriorityReason to MSG_TARGET_ERROR_REPLY.
59  *  11-01-01  01.02.04  Added define for TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY.
60  *  --------------------------------------------------------------------------
61  */
62
63 #ifndef MPI_TARG_H
64 #define MPI_TARG_H
65
66
67 /******************************************************************************
68 *
69 *        S C S I    T a r g e t    M e s s a g e s
70 *
71 *******************************************************************************/
72
73 typedef struct _CMD_BUFFER_DESCRIPTOR
74 {
75     U16                     IoIndex;                    /* 00h */
76     U16                     Reserved;                   /* 02h */
77     union                                               /* 04h */
78     {
79         U32                 PhysicalAddress32;
80         U64                 PhysicalAddress64;
81     } _u;
82 } CMD_BUFFER_DESCRIPTOR, MPI_POINTER PTR_CMD_BUFFER_DESCRIPTOR,
83   CmdBufferDescriptor_t, MPI_POINTER pCmdBufferDescriptor_t;
84
85
86 /****************************************************************************/
87 /* Target Command Buffer Post Request                                       */
88 /****************************************************************************/
89
90 typedef struct _MSG_TARGET_CMD_BUFFER_POST_REQUEST
91 {
92     U8                      BufferPostFlags;            /* 00h */
93     U8                      BufferCount;                /* 01h */
94     U8                      ChainOffset;                /* 02h */
95     U8                      Function;                   /* 03h */
96     U8                      BufferLength;               /* 04h */
97     U8                      Reserved;                   /* 05h */
98     U8                      Reserved1;                  /* 06h */
99     U8                      MsgFlags;                   /* 07h */
100     U32                     MsgContext;                 /* 08h */
101     CMD_BUFFER_DESCRIPTOR   Buffer[1];                  /* 0Ch */
102 } MSG_TARGET_CMD_BUFFER_POST_REQUEST, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REQUEST,
103   TargetCmdBufferPostRequest_t, MPI_POINTER pTargetCmdBufferPostRequest_t;
104
105 #define CMD_BUFFER_POST_FLAGS_PORT_MASK         (0x01)
106 #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_MASK    (0x80)
107 #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_32      (0)
108 #define CMD_BUFFER_POST_FLAGS_ADDR_MODE_64      (1)
109 #define CMD_BUFFER_POST_FLAGS_64_BIT_ADDR       (0x80)
110
111 #define CMD_BUFFER_POST_IO_INDEX_MASK           (0x00003FFF)
112 #define CMD_BUFFER_POST_IO_INDEX_MASK_0100      (0x000003FF) /* obsolete */
113
114
115 typedef struct _MSG_TARGET_CMD_BUFFER_POST_REPLY
116 {
117     U8                      BufferPostFlags;            /* 00h */
118     U8                      BufferCount;                /* 01h */
119     U8                      MsgLength;                  /* 02h */
120     U8                      Function;                   /* 03h */
121     U8                      BufferLength;               /* 04h */
122     U8                      Reserved;                   /* 05h */
123     U8                      Reserved1;                  /* 06h */
124     U8                      MsgFlags;                   /* 07h */
125     U32                     MsgContext;                 /* 08h */
126     U16                     Reserved2;                  /* 0Ch */
127     U16                     IOCStatus;                  /* 0Eh */
128     U32                     IOCLogInfo;                 /* 10h */
129 } MSG_TARGET_CMD_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_REPLY,
130   TargetCmdBufferPostReply_t, MPI_POINTER pTargetCmdBufferPostReply_t;
131
132 /* the following structure is obsolete as of MPI v1.2 */
133 typedef struct _MSG_PRIORITY_CMD_RECEIVED_REPLY
134 {
135     U16                     Reserved;                   /* 00h */
136     U8                      MsgLength;                  /* 02h */
137     U8                      Function;                   /* 03h */
138     U16                     Reserved1;                  /* 04h */
139     U8                      Reserved2;                  /* 06h */
140     U8                      MsgFlags;                   /* 07h */
141     U32                     MsgContext;                 /* 08h */
142     U8                      PriorityReason;             /* 0Ch */
143     U8                      Reserved3;                  /* 0Dh */
144     U16                     IOCStatus;                  /* 0Eh */
145     U32                     IOCLogInfo;                 /* 10h */
146     U32                     ReplyWord;                  /* 14h */
147 } MSG_PRIORITY_CMD_RECEIVED_REPLY, MPI_POINTER PTR_MSG_PRIORITY_CMD_RECEIVED_REPLY,
148   PriorityCommandReceivedReply_t, MPI_POINTER pPriorityCommandReceivedReply_t;
149
150 #define PRIORITY_REASON_NO_DISCONNECT           (0x00)
151 #define PRIORITY_REASON_SCSI_TASK_MANAGEMENT    (0x01)
152 #define PRIORITY_REASON_CMD_PARITY_ERR          (0x02)
153 #define PRIORITY_REASON_MSG_OUT_PARITY_ERR      (0x03)
154 #define PRIORITY_REASON_LQ_CRC_ERR              (0x04)
155 #define PRIORITY_REASON_CMD_CRC_ERR             (0x05)
156 #define PRIORITY_REASON_PROTOCOL_ERR            (0x06)
157 #define PRIORITY_REASON_DATA_OUT_PARITY_ERR     (0x07)
158 #define PRIORITY_REASON_DATA_OUT_CRC_ERR        (0x08)
159 #define PRIORITY_REASON_UNKNOWN                 (0xFF)
160
161
162 typedef struct _MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY
163 {
164     U16                     Reserved;                   /* 00h */
165     U8                      MsgLength;                  /* 02h */
166     U8                      Function;                   /* 03h */
167     U16                     Reserved1;                  /* 04h */
168     U8                      Reserved2;                  /* 06h */
169     U8                      MsgFlags;                   /* 07h */
170     U32                     MsgContext;                 /* 08h */
171     U8                      PriorityReason;             /* 0Ch */
172     U8                      Reserved3;                  /* 0Dh */
173     U16                     IOCStatus;                  /* 0Eh */
174     U32                     IOCLogInfo;                 /* 10h */
175     U32                     ReplyWord;                  /* 14h */
176 } MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
177   MPI_POINTER PTR_MSG_TARGET_CMD_BUFFER_POST_ERROR_REPLY,
178   TargetCmdBufferPostErrorReply_t, MPI_POINTER pTargetCmdBufferPostErrorReply_t;
179
180
181 typedef struct _MPI_TARGET_FCP_CMD_BUFFER
182 {
183     U8      FcpLun[8];                                  /* 00h */
184     U8      FcpCntl[4];                                 /* 08h */
185     U8      FcpCdb[16];                                 /* 0Ch */
186     U32     FcpDl;                                      /* 1Ch */
187 } MPI_TARGET_FCP_CMD_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_CMD_BUFFER,
188   MpiTargetFcpCmdBuffer, MPI_POINTER pMpiTargetFcpCmdBuffer;
189
190
191 typedef struct _MPI_TARGET_SCSI_SPI_CMD_BUFFER
192 {
193     /* SPI L_Q information unit */
194     U8      L_QType;                                    /* 00h */
195     U8      Reserved;                                   /* 01h */
196     U16     Tag;                                        /* 02h */
197     U8      LogicalUnitNumber[8];                       /* 04h */
198     U32     DataLength;                                 /* 0Ch */
199     /* SPI command information unit */
200     U8      ReservedFirstByteOfCommandIU;               /* 10h */
201     U8      TaskAttribute;                              /* 11h */
202     U8      TaskManagementFlags;                        /* 12h */
203     U8      AdditionalCDBLength;                        /* 13h */
204     U8      CDB[16];                                    /* 14h */
205 } MPI_TARGET_SCSI_SPI_CMD_BUFFER,
206   MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_CMD_BUFFER,
207   MpiTargetScsiSpiCmdBuffer, MPI_POINTER pMpiTargetScsiSpiCmdBuffer;
208
209
210 /****************************************************************************/
211 /* Target Assist Request                                                    */
212 /****************************************************************************/
213
214 typedef struct _MSG_TARGET_ASSIST_REQUEST
215 {
216     U8                      StatusCode;                 /* 00h */
217     U8                      TargetAssistFlags;          /* 01h */
218     U8                      ChainOffset;                /* 02h */
219     U8                      Function;                   /* 03h */
220     U16                     QueueTag;                   /* 04h */
221     U8                      Reserved;                   /* 06h */
222     U8                      MsgFlags;                   /* 07h */
223     U32                     MsgContext;                 /* 08h */
224     U32                     ReplyWord;                  /* 0Ch */
225     U8                      LUN[8];                     /* 10h */
226     U32                     RelativeOffset;             /* 18h */
227     U32                     DataLength;                 /* 1Ch */
228     SGE_IO_UNION            SGL[1];                     /* 20h */
229 } MSG_TARGET_ASSIST_REQUEST, MPI_POINTER PTR_MSG_TARGET_ASSIST_REQUEST,
230   TargetAssistRequest_t, MPI_POINTER pTargetAssistRequest_t;
231
232 #define TARGET_ASSIST_FLAGS_DATA_DIRECTION          (0x01)
233 #define TARGET_ASSIST_FLAGS_AUTO_STATUS             (0x02)
234 #define TARGET_ASSIST_FLAGS_HIGH_PRIORITY           (0x04)
235 #define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER       (0x80)
236
237
238 typedef struct _MSG_TARGET_ERROR_REPLY
239 {
240     U16                     Reserved;                   /* 00h */
241     U8                      MsgLength;                  /* 02h */
242     U8                      Function;                   /* 03h */
243     U16                     Reserved1;                  /* 04h */
244     U8                      Reserved2;                  /* 06h */
245     U8                      MsgFlags;                   /* 07h */
246     U32                     MsgContext;                 /* 08h */
247     U8                      PriorityReason;             /* 0Ch */
248     U8                      Reserved3;                  /* 0Dh */
249     U16                     IOCStatus;                  /* 0Eh */
250     U32                     IOCLogInfo;                 /* 10h */
251     U32                     ReplyWord;                  /* 14h */
252     U32                     TransferCount;              /* 18h */
253 } MSG_TARGET_ERROR_REPLY, MPI_POINTER PTR_MSG_TARGET_ERROR_REPLY,
254   TargetErrorReply_t, MPI_POINTER pTargetErrorReply_t;
255
256
257 /****************************************************************************/
258 /* Target Status Send Request                                               */
259 /****************************************************************************/
260
261 typedef struct _MSG_TARGET_STATUS_SEND_REQUEST
262 {
263     U8                      StatusCode;                 /* 00h */
264     U8                      StatusFlags;                /* 01h */
265     U8                      ChainOffset;                /* 02h */
266     U8                      Function;                   /* 03h */
267     U16                     QueueTag;                   /* 04h */
268     U8                      Reserved;                   /* 06h */
269     U8                      MsgFlags;                   /* 07h */
270     U32                     MsgContext;                 /* 08h */
271     U32                     ReplyWord;                  /* 0Ch */
272     U8                      LUN[8];                     /* 10h */
273     SGE_SIMPLE_UNION        StatusDataSGE;              /* 18h */
274 } MSG_TARGET_STATUS_SEND_REQUEST, MPI_POINTER PTR_MSG_TARGET_STATUS_SEND_REQUEST,
275   TargetStatusSendRequest_t, MPI_POINTER pTargetStatusSendRequest_t;
276
277 #define TARGET_STATUS_SEND_FLAGS_AUTO_GOOD_STATUS   (0x01)
278 #define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY      (0x04)
279 #define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER  (0x80)
280
281 typedef struct _MPI_TARGET_FCP_RSP_BUFFER
282 {
283     U8      Reserved0[8];                               /* 00h */
284     U8      FcpStatus;                                  /* 08h */
285     U8      FcpFlags;                                   /* 09h */
286     U8      Reserved1[2];                               /* 0Ah */
287     U32     FcpResid;                                   /* 0Ch */
288     U32     FcpSenseLength;                             /* 10h */
289     U32     FcpResponseLength;                          /* 14h */
290     U8      FcpResponseData[8];                         /* 18h */
291     U8      FcpSenseData[32]; /* Pad to 64 bytes */     /* 20h */
292 } MPI_TARGET_FCP_RSP_BUFFER, MPI_POINTER PTR_MPI_TARGET_FCP_RSP_BUFFER,
293   MpiTargetFcpRspBuffer, MPI_POINTER pMpiTargetFcpRspBuffer;
294
295 typedef struct _MPI_TARGET_SCSI_SPI_STATUS_IU
296 {
297     U8      Reserved0;                                  /* 00h */
298     U8      Reserved1;                                  /* 01h */
299     U8      Valid;                                      /* 02h */
300     U8      Status;                                     /* 03h */
301     U32     SenseDataListLength;                        /* 04h */
302     U32     PktFailuresListLength;                      /* 08h */
303     U8      SenseData[52]; /* Pad the IU to 64 bytes */ /* 0Ch */
304 } MPI_TARGET_SCSI_SPI_STATUS_IU, MPI_POINTER PTR_MPI_TARGET_SCSI_SPI_STATUS_IU,
305   TargetScsiSpiStatusIU_t, MPI_POINTER pTargetScsiSpiStatusIU_t;
306
307 /****************************************************************************/
308 /* Target Mode Abort Request                                                */
309 /****************************************************************************/
310
311 typedef struct _MSG_TARGET_MODE_ABORT_REQUEST
312 {
313     U8                      AbortType;                  /* 00h */
314     U8                      Reserved;                   /* 01h */
315     U8                      ChainOffset;                /* 02h */
316     U8                      Function;                   /* 03h */
317     U16                     Reserved1;                  /* 04h */
318     U8                      Reserved2;                  /* 06h */
319     U8                      MsgFlags;                   /* 07h */
320     U32                     MsgContext;                 /* 08h */
321     U32                     ReplyWord;                  /* 0Ch */
322     U32                     MsgContextToAbort;          /* 10h */
323 } MSG_TARGET_MODE_ABORT, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT,
324   TargetModeAbort_t, MPI_POINTER pTargetModeAbort_t;
325
326 #define TARGET_MODE_ABORT_TYPE_ALL_CMD_BUFFERS      (0x00)
327 #define TARGET_MODE_ABORT_TYPE_ALL_IO               (0x01)
328 #define TARGET_MODE_ABORT_TYPE_EXACT_IO             (0x02)
329 #define TARGET_MODE_ABORT_TYPE_EXACT_IO_REQUEST     (0x03)
330
331 /* Target Mode Abort Reply */
332
333 typedef struct _MSG_TARGET_MODE_ABORT_REPLY
334 {
335     U16                     Reserved;                   /* 00h */
336     U8                      MsgLength;                  /* 02h */
337     U8                      Function;                   /* 03h */
338     U16                     Reserved1;                  /* 04h */
339     U8                      Reserved2;                  /* 06h */
340     U8                      MsgFlags;                   /* 07h */
341     U32                     MsgContext;                 /* 08h */
342     U16                     Reserved3;                  /* 0Ch */
343     U16                     IOCStatus;                  /* 0Eh */
344     U32                     IOCLogInfo;                 /* 10h */
345     U32                     AbortCount;                 /* 14h */
346 } MSG_TARGET_MODE_ABORT_REPLY, MPI_POINTER PTR_MSG_TARGET_MODE_ABORT_REPLY,
347   TargetModeAbortReply_t, MPI_POINTER pTargetModeAbortReply_t;
348
349
350 /****************************************************************************/
351 /* Target Mode Context Reply                                                */
352 /****************************************************************************/
353
354 #define TARGET_MODE_REPLY_IO_INDEX_MASK         (0x00003FFF)
355 #define TARGET_MODE_REPLY_IO_INDEX_SHIFT        (0)
356 #define TARGET_MODE_REPLY_INITIATOR_INDEX_MASK  (0x03FFC000)
357 #define TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT (14)
358 #define TARGET_MODE_REPLY_ALIAS_MASK            (0x0C000000)
359 #define TARGET_MODE_REPLY_ALIAS_SHIFT           (26)
360 #define TARGET_MODE_REPLY_PORT_MASK             (0x10000000)
361 #define TARGET_MODE_REPLY_PORT_SHIFT            (28)
362
363
364 #define GET_IO_INDEX(x)     (((x) & TARGET_MODE_REPLY_IO_INDEX_MASK)           \
365                                     >> TARGET_MODE_REPLY_IO_INDEX_SHIFT)
366
367 #define SET_IO_INDEX(t, i)                                                     \
368             ((t) = ((t) & ~TARGET_MODE_REPLY_IO_INDEX_MASK) |                  \
369                               (((i) << TARGET_MODE_REPLY_IO_INDEX_SHIFT) &     \
370                                              TARGET_MODE_REPLY_IO_INDEX_MASK))
371
372 #define GET_INITIATOR_INDEX(x) (((x) & TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) \
373                                    >> TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT)
374
375 #define SET_INITIATOR_INDEX(t, ii)                                             \
376         ((t) = ((t) & ~TARGET_MODE_REPLY_INITIATOR_INDEX_MASK) |               \
377                         (((ii) << TARGET_MODE_REPLY_INITIATOR_INDEX_SHIFT) &   \
378                                       TARGET_MODE_REPLY_INITIATOR_INDEX_MASK))
379
380 #define GET_ALIAS(x) (((x) & TARGET_MODE_REPLY_ALIAS_MASK)                     \
381                                                >> TARGET_MODE_REPLY_ALIAS_SHIFT)
382
383 #define SET_ALIAS(t, a)  ((t) = ((t) & ~TARGET_MODE_REPLY_ALIAS_MASK) |        \
384                                     (((a) << TARGET_MODE_REPLY_ALIAS_SHIFT) &  \
385                                                  TARGET_MODE_REPLY_ALIAS_MASK))
386
387 #define GET_PORT(x) (((x) & TARGET_MODE_REPLY_PORT_MASK)                       \
388                                                >> TARGET_MODE_REPLY_PORT_SHIFT)
389
390 #define SET_PORT(t, p)  ((t) = ((t) & ~TARGET_MODE_REPLY_PORT_MASK) |          \
391                                     (((p) << TARGET_MODE_REPLY_PORT_SHIFT) &   \
392                                                   TARGET_MODE_REPLY_PORT_MASK))
393
394 /* the following obsolete values are for MPI v1.0 support */
395 #define TARGET_MODE_REPLY_0100_MASK_HOST_INDEX       (0x000003FF)
396 #define TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX      (0)
397 #define TARGET_MODE_REPLY_0100_MASK_IOC_INDEX        (0x001FF800)
398 #define TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX       (11)
399 #define TARGET_MODE_REPLY_0100_PORT_MASK             (0x00400000)
400 #define TARGET_MODE_REPLY_0100_PORT_SHIFT            (22)
401 #define TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX  (0x1F800000)
402 #define TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX (23)
403
404 #define GET_HOST_INDEX_0100(x) (((x) & TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) \
405                                   >> TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX)
406
407 #define SET_HOST_INDEX_0100(t, hi)                                             \
408             ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_HOST_INDEX) |           \
409                          (((hi) << TARGET_MODE_REPLY_0100_SHIFT_HOST_INDEX) &  \
410                                       TARGET_MODE_REPLY_0100_MASK_HOST_INDEX))
411
412 #define GET_IOC_INDEX_0100(x)   (((x) & TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) \
413                                   >> TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX)
414
415 #define SET_IOC_INDEX_0100(t, ii)                                              \
416             ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_IOC_INDEX) |            \
417                         (((ii) << TARGET_MODE_REPLY_0100_SHIFT_IOC_INDEX) &    \
418                                      TARGET_MODE_REPLY_0100_MASK_IOC_INDEX))
419
420 #define GET_INITIATOR_INDEX_0100(x)                                            \
421             (((x) & TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX)               \
422                               >> TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX)
423
424 #define SET_INITIATOR_INDEX_0100(t, ii)                                        \
425         ((t) = ((t) & ~TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX) |          \
426                    (((ii) << TARGET_MODE_REPLY_0100_SHIFT_INITIATOR_INDEX) &   \
427                                 TARGET_MODE_REPLY_0100_MASK_INITIATOR_INDEX))
428
429
430 #endif
431