xref: /titanic_41/usr/src/uts/common/sys/scsi/adapters/mpt_sas/mpi/mpi2_targ.h (revision 6824ee06c346d29bf3a2627dcbb6d0d2f4c7b9d7)
1 /*-
2  * Copyright (c) 2013 LSI Corp.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the author nor the names of any co-contributors
14  *    may be used to endorse or promote products derived from this software
15  *    without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27  * SUCH DAMAGE.
28  */
29 
30 /*
31  *  Copyright (c) 2000-2012 LSI Corporation.
32  *
33  *
34  *           Name:  mpi2_targ.h
35  *          Title:  MPI Target mode messages and structures
36  *  Creation Date:  September 8, 2006
37  *
38  *  mpi2_targ.h Version: 02.00.06
39  *
40  *  NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
41  *        prefix are for use only on MPI v2.5 products, and must not be used
42  *        with MPI v2.0 products. Unless otherwise noted, names beginning with
43  *        MPI2 or Mpi2 are for use with both MPI v2.0 and MPI v2.5 products.
44  *
45  *  Version History
46  *  ---------------
47  *
48  *  Date      Version   Description
49  *  --------  --------  ------------------------------------------------------
50  *  04-30-07  02.00.00  Corresponds to Fusion-MPT MPI Specification Rev A.
51  *  08-31-07  02.00.01  Added Command Buffer Data Location Address Space bits to
52  *                      BufferPostFlags field of CommandBufferPostBase Request.
53  *  02-29-08  02.00.02  Modified various names to make them 32-character unique.
54  *  10-02-08  02.00.03  Removed NextCmdBufferOffset from
55  *                      MPI2_TARGET_CMD_BUF_POST_BASE_REQUEST.
56  *                      Target Status Send Request only takes a single SGE for
57  *                      response data.
58  *  02-10-10  02.00.04  Added comment to MPI2_TARGET_SSP_RSP_IU structure.
59  *  11-18-11  02.00.05  Incorporating additions for MPI v2.5.
60  *  11-27-12  02.00.06  Added InitiatorDevHandle field to MPI2_TARGET_MODE_ABORT
61  *                      request message structure.
62  *                      Added AbortType MPI2_TARGET_MODE_ABORT_DEVHANDLE and
63  *                      MPI2_TARGET_MODE_ABORT_ALL_COMMANDS.
64  *  --------------------------------------------------------------------------
65  */
66 
67 #ifndef MPI2_TARG_H
68 #define MPI2_TARG_H
69 
70 
71 /******************************************************************************
72 *
73 *        SCSI Target Messages
74 *
75 *******************************************************************************/
76 
77 /****************************************************************************
78 *  Target Command Buffer Post Base Request
79 ****************************************************************************/
80 
81 typedef struct _MPI2_TARGET_CMD_BUF_POST_BASE_REQUEST
82 {
83     U8                      BufferPostFlags;        /* 0x00 */
84     U8                      Reserved1;              /* 0x01 */
85     U8                      ChainOffset;            /* 0x02 */
86     U8                      Function;               /* 0x03 */
87     U16                     TotalCmdBuffers;        /* 0x04 */
88     U8                      Reserved;               /* 0x06 */
89     U8                      MsgFlags;               /* 0x07 */
90     U8                      VP_ID;                  /* 0x08 */
91     U8                      VF_ID;                  /* 0x09 */
92     U16                     Reserved2;              /* 0x0A */
93     U32                     Reserved3;              /* 0x0C */
94     U16                     CmdBufferLength;        /* 0x10 */
95     U16                     Reserved4;              /* 0x12 */
96     U32                     BaseAddressLow;         /* 0x14 */
97     U32                     BaseAddressHigh;        /* 0x18 */
98 } MPI2_TARGET_CMD_BUF_POST_BASE_REQUEST,
99   MPI2_POINTER PTR_MPI2_TARGET_CMD_BUF_POST_BASE_REQUEST,
100   Mpi2TargetCmdBufferPostBaseRequest_t,
101   MPI2_POINTER pMpi2TargetCmdBufferPostBaseRequest_t;
102 
103 /* values for the BufferPostflags field */
104 #define MPI2_CMD_BUF_POST_BASE_ADDRESS_SPACE_MASK            (0x0C)
105 #define MPI2_CMD_BUF_POST_BASE_SYSTEM_ADDRESS_SPACE          (0x00)
106 #define MPI2_CMD_BUF_POST_BASE_IOCDDR_ADDRESS_SPACE          (0x04)
107 #define MPI2_CMD_BUF_POST_BASE_IOCPLB_ADDRESS_SPACE          (0x08)
108 #define MPI2_CMD_BUF_POST_BASE_IOCPLBNTA_ADDRESS_SPACE       (0x0C)
109 
110 #define MPI2_CMD_BUF_POST_BASE_FLAGS_AUTO_POST_ALL           (0x01)
111 
112 
113 /****************************************************************************
114 *  Target Command Buffer Post List Request
115 ****************************************************************************/
116 
117 typedef struct _MPI2_TARGET_CMD_BUF_POST_LIST_REQUEST
118 {
119     U16                     Reserved;               /* 0x00 */
120     U8                      ChainOffset;            /* 0x02 */
121     U8                      Function;               /* 0x03 */
122     U16                     CmdBufferCount;         /* 0x04 */
123     U8                      Reserved1;              /* 0x06 */
124     U8                      MsgFlags;               /* 0x07 */
125     U8                      VP_ID;                  /* 0x08 */
126     U8                      VF_ID;                  /* 0x09 */
127     U16                     Reserved2;              /* 0x0A */
128     U32                     Reserved3;              /* 0x0C */
129     U16                     IoIndex[2];             /* 0x10 */
130 } MPI2_TARGET_CMD_BUF_POST_LIST_REQUEST,
131   MPI2_POINTER PTR_MPI2_TARGET_CMD_BUF_POST_LIST_REQUEST,
132   Mpi2TargetCmdBufferPostListRequest_t,
133   MPI2_POINTER pMpi2TargetCmdBufferPostListRequest_t;
134 
135 /****************************************************************************
136 *  Target Command Buffer Post Base List Reply
137 ****************************************************************************/
138 
139 typedef struct _MPI2_TARGET_BUF_POST_BASE_LIST_REPLY
140 {
141     U8                      Flags;                  /* 0x00 */
142     U8                      Reserved;               /* 0x01 */
143     U8                      MsgLength;              /* 0x02 */
144     U8                      Function;               /* 0x03 */
145     U16                     Reserved1;              /* 0x04 */
146     U8                      Reserved2;              /* 0x06 */
147     U8                      MsgFlags;               /* 0x07 */
148     U8                      VP_ID;                  /* 0x08 */
149     U8                      VF_ID;                  /* 0x09 */
150     U16                     Reserved3;              /* 0x0A */
151     U16                     Reserved4;              /* 0x0C */
152     U16                     IOCStatus;              /* 0x0E */
153     U32                     IOCLogInfo;             /* 0x10 */
154     U16                     IoIndex;                /* 0x14 */
155     U16                     Reserved5;              /* 0x16 */
156     U32                     Reserved6;              /* 0x18 */
157 } MPI2_TARGET_BUF_POST_BASE_LIST_REPLY,
158   MPI2_POINTER PTR_MPI2_TARGET_BUF_POST_BASE_LIST_REPLY,
159   Mpi2TargetCmdBufferPostBaseListReply_t,
160   MPI2_POINTER pMpi2TargetCmdBufferPostBaseListReply_t;
161 
162 /* Flags defines */
163 #define MPI2_CMD_BUF_POST_REPLY_IOINDEX_VALID       (0x01)
164 
165 
166 /****************************************************************************
167 *  Command Buffer Formats (with 16 byte CDB)
168 ****************************************************************************/
169 
170 typedef struct _MPI2_TARGET_SSP_CMD_BUFFER
171 {
172     U8      FrameType;                                  /* 0x00 */
173     U8      Reserved1;                                  /* 0x01 */
174     U16     InitiatorConnectionTag;                     /* 0x02 */
175     U32     HashedSourceSASAddress;                     /* 0x04 */
176     U16     Reserved2;                                  /* 0x08 */
177     U16     Flags;                                      /* 0x0A */
178     U32     Reserved3;                                  /* 0x0C */
179     U16     Tag;                                        /* 0x10 */
180     U16     TargetPortTransferTag;                      /* 0x12 */
181     U32     DataOffset;                                 /* 0x14 */
182     /* COMMAND information unit starts here */
183     U8      LogicalUnitNumber[8];                       /* 0x18 */
184     U8      Reserved4;                                  /* 0x20 */
185     U8      TaskAttribute; /* lower 3 bits */           /* 0x21 */
186     U8      Reserved5;                                  /* 0x22 */
187     U8      AdditionalCDBLength; /* upper 5 bits */     /* 0x23 */
188     U8      CDB[16];                                    /* 0x24 */
189     /* Additional CDB bytes extend past the CDB field */
190 } MPI2_TARGET_SSP_CMD_BUFFER, MPI2_POINTER PTR_MPI2_TARGET_SSP_CMD_BUFFER,
191   Mpi2TargetSspCmdBuffer, MPI2_POINTER pMp2iTargetSspCmdBuffer;
192 
193 typedef struct _MPI2_TARGET_SSP_TASK_BUFFER
194 {
195     U8      FrameType;                                  /* 0x00 */
196     U8      Reserved1;                                  /* 0x01 */
197     U16     InitiatorConnectionTag;                     /* 0x02 */
198     U32     HashedSourceSASAddress;                     /* 0x04 */
199     U16     Reserved2;                                  /* 0x08 */
200     U16     Flags;                                      /* 0x0A */
201     U32     Reserved3;                                  /* 0x0C */
202     U16     Tag;                                        /* 0x10 */
203     U16     TargetPortTransferTag;                      /* 0x12 */
204     U32     DataOffset;                                 /* 0x14 */
205     /* TASK information unit starts here */
206     U8      LogicalUnitNumber[8];                       /* 0x18 */
207     U16     Reserved4;                                  /* 0x20 */
208     U8      TaskManagementFunction;                     /* 0x22 */
209     U8      Reserved5;                                  /* 0x23 */
210     U16     ManagedTaskTag;                             /* 0x24 */
211     U16     Reserved6;                                  /* 0x26 */
212     U32     Reserved7;                                  /* 0x28 */
213     U32     Reserved8;                                  /* 0x2C */
214     U32     Reserved9;                                  /* 0x30 */
215 } MPI2_TARGET_SSP_TASK_BUFFER, MPI2_POINTER PTR_MPI2_TARGET_SSP_TASK_BUFFER,
216   Mpi2TargetSspTaskBuffer, MPI2_POINTER pMpi2TargetSspTaskBuffer;
217 
218 /* mask and shift for HashedSourceSASAddress field */
219 #define MPI2_TARGET_HASHED_SAS_ADDRESS_MASK     (0xFFFFFF00)
220 #define MPI2_TARGET_HASHED_SAS_ADDRESS_SHIFT    (8)
221 
222 
223 /****************************************************************************
224 *   MPI v2.0 Target Assist Request
225 ****************************************************************************/
226 
227 typedef struct _MPI2_TARGET_ASSIST_REQUEST
228 {
229     U8                  Reserved1;                          /* 0x00 */
230     U8                  TargetAssistFlags;                  /* 0x01 */
231     U8                  ChainOffset;                        /* 0x02 */
232     U8                  Function;                           /* 0x03 */
233     U16                 QueueTag;                           /* 0x04 */
234     U8                  Reserved2;                          /* 0x06 */
235     U8                  MsgFlags;                           /* 0x07 */
236     U8                  VP_ID;                              /* 0x08 */
237     U8                  VF_ID;                              /* 0x09 */
238     U16                 Reserved3;                          /* 0x0A */
239     U16                 IoIndex;                            /* 0x0C */
240     U16                 InitiatorConnectionTag;             /* 0x0E */
241     U16                 SGLFlags;                           /* 0x10 */
242     U8                  SequenceNumber;                     /* 0x12 */
243     U8                  Reserved4;                          /* 0x13 */
244     U8                  SGLOffset0;                         /* 0x14 */
245     U8                  SGLOffset1;                         /* 0x15 */
246     U8                  SGLOffset2;                         /* 0x16 */
247     U8                  SGLOffset3;                         /* 0x17 */
248     U32                 SkipCount;                          /* 0x18 */
249     U32                 DataLength;                         /* 0x1C */
250     U32                 BidirectionalDataLength;            /* 0x20 */
251     U16                 IoFlags;                            /* 0x24 */
252     U16                 EEDPFlags;                          /* 0x26 */
253     U32                 EEDPBlockSize;                      /* 0x28 */
254     U32                 SecondaryReferenceTag;              /* 0x2C */
255     U16                 SecondaryApplicationTag;            /* 0x30 */
256     U16                 ApplicationTagTranslationMask;      /* 0x32 */
257     U32                 PrimaryReferenceTag;                /* 0x34 */
258     U16                 PrimaryApplicationTag;              /* 0x38 */
259     U16                 PrimaryApplicationTagMask;          /* 0x3A */
260     U32                 RelativeOffset;                     /* 0x3C */
261     U32                 Reserved5;                          /* 0x40 */
262     U32                 Reserved6;                          /* 0x44 */
263     U32                 Reserved7;                          /* 0x48 */
264     U32                 Reserved8;                          /* 0x4C */
265     MPI2_SGE_IO_UNION   SGL[1];                             /* 0x50 */
266 } MPI2_TARGET_ASSIST_REQUEST, MPI2_POINTER PTR_MPI2_TARGET_ASSIST_REQUEST,
267   Mpi2TargetAssistRequest_t, MPI2_POINTER pMpi2TargetAssistRequest_t;
268 
269 /* Target Assist TargetAssistFlags bits */
270 
271 #define MPI2_TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER      (0x80)
272 #define MPI2_TARGET_ASSIST_FLAGS_TLR                    (0x10)
273 #define MPI2_TARGET_ASSIST_FLAGS_RETRANSMIT             (0x04)
274 #define MPI2_TARGET_ASSIST_FLAGS_AUTO_STATUS            (0x02)
275 #define MPI2_TARGET_ASSIST_FLAGS_DATA_DIRECTION         (0x01)
276 
277 /* Target Assist SGLFlags bits */
278 
279 /* base values for Data Location Address Space */
280 #define MPI2_TARGET_ASSIST_SGLFLAGS_ADDR_MASK           (0x0C)
281 #define MPI2_TARGET_ASSIST_SGLFLAGS_SYSTEM_ADDR         (0x00)
282 #define MPI2_TARGET_ASSIST_SGLFLAGS_IOCDDR_ADDR         (0x04)
283 #define MPI2_TARGET_ASSIST_SGLFLAGS_IOCPLB_ADDR         (0x08)
284 #define MPI2_TARGET_ASSIST_SGLFLAGS_PLBNTA_ADDR         (0x0C)
285 
286 /* base values for Type */
287 #define MPI2_TARGET_ASSIST_SGLFLAGS_TYPE_MASK           (0x03)
288 #define MPI2_TARGET_ASSIST_SGLFLAGS_MPI_TYPE            (0x00)
289 #define MPI2_TARGET_ASSIST_SGLFLAGS_32IEEE_TYPE         (0x01)
290 #define MPI2_TARGET_ASSIST_SGLFLAGS_64IEEE_TYPE         (0x02)
291 
292 /* shift values for each sub-field */
293 #define MPI2_TARGET_ASSIST_SGLFLAGS_SGL3_SHIFT          (12)
294 #define MPI2_TARGET_ASSIST_SGLFLAGS_SGL2_SHIFT          (8)
295 #define MPI2_TARGET_ASSIST_SGLFLAGS_SGL1_SHIFT          (4)
296 #define MPI2_TARGET_ASSIST_SGLFLAGS_SGL0_SHIFT          (0)
297 
298 /* Target Assist IoFlags bits */
299 
300 #define MPI2_TARGET_ASSIST_IOFLAGS_BIDIRECTIONAL        (0x0800)
301 #define MPI2_TARGET_ASSIST_IOFLAGS_MULTICAST            (0x0400)
302 #define MPI2_TARGET_ASSIST_IOFLAGS_RECEIVE_FIRST        (0x0200)
303 
304 /* Target Assist EEDPFlags bits */
305 
306 #define MPI2_TA_EEDPFLAGS_INC_PRI_REFTAG            (0x8000)
307 #define MPI2_TA_EEDPFLAGS_INC_SEC_REFTAG            (0x4000)
308 #define MPI2_TA_EEDPFLAGS_INC_PRI_APPTAG            (0x2000)
309 #define MPI2_TA_EEDPFLAGS_INC_SEC_APPTAG            (0x1000)
310 
311 #define MPI2_TA_EEDPFLAGS_CHECK_REFTAG              (0x0400)
312 #define MPI2_TA_EEDPFLAGS_CHECK_APPTAG              (0x0200)
313 #define MPI2_TA_EEDPFLAGS_CHECK_GUARD               (0x0100)
314 
315 #define MPI2_TA_EEDPFLAGS_PASSTHRU_REFTAG           (0x0008)
316 
317 #define MPI2_TA_EEDPFLAGS_MASK_OP                   (0x0007)
318 #define MPI2_TA_EEDPFLAGS_NOOP_OP                   (0x0000)
319 #define MPI2_TA_EEDPFLAGS_CHECK_OP                  (0x0001)
320 #define MPI2_TA_EEDPFLAGS_STRIP_OP                  (0x0002)
321 #define MPI2_TA_EEDPFLAGS_CHECK_REMOVE_OP           (0x0003)
322 #define MPI2_TA_EEDPFLAGS_INSERT_OP                 (0x0004)
323 #define MPI2_TA_EEDPFLAGS_REPLACE_OP                (0x0006)
324 #define MPI2_TA_EEDPFLAGS_CHECK_REGEN_OP            (0x0007)
325 
326 
327 /****************************************************************************
328 *   MPI v2.5 Target Assist Request
329 ****************************************************************************/
330 
331 typedef struct _MPI25_TARGET_ASSIST_REQUEST
332 {
333     U8                  Reserved1;                          /* 0x00 */
334     U8                  TargetAssistFlags;                  /* 0x01 */
335     U8                  ChainOffset;                        /* 0x02 */
336     U8                  Function;                           /* 0x03 */
337     U16                 QueueTag;                           /* 0x04 */
338     U8                  Reserved2;                          /* 0x06 */
339     U8                  MsgFlags;                           /* 0x07 */
340     U8                  VP_ID;                              /* 0x08 */
341     U8                  VF_ID;                              /* 0x09 */
342     U16                 Reserved3;                          /* 0x0A */
343     U16                 IoIndex;                            /* 0x0C */
344     U16                 InitiatorConnectionTag;             /* 0x0E */
345     U8                  DMAFlags;                           /* 0x10 */
346     U8                  Reserved9;                          /* 0x11 */
347     U8                  SequenceNumber;                     /* 0x12 */
348     U8                  Reserved4;                          /* 0x13 */
349     U8                  SGLOffset0;                         /* 0x14 */
350     U8                  SGLOffset1;                         /* 0x15 */
351     U8                  SGLOffset2;                         /* 0x16 */
352     U8                  SGLOffset3;                         /* 0x17 */
353     U32                 SkipCount;                          /* 0x18 */
354     U32                 DataLength;                         /* 0x1C */
355     U32                 BidirectionalDataLength;            /* 0x20 */
356     U16                 IoFlags;                            /* 0x24 */
357     U16                 EEDPFlags;                          /* 0x26 */
358     U16                 EEDPBlockSize;                      /* 0x28 */
359     U16                 Reserved10;                         /* 0x2A */
360     U32                 SecondaryReferenceTag;              /* 0x2C */
361     U16                 SecondaryApplicationTag;            /* 0x30 */
362     U16                 ApplicationTagTranslationMask;      /* 0x32 */
363     U32                 PrimaryReferenceTag;                /* 0x34 */
364     U16                 PrimaryApplicationTag;              /* 0x38 */
365     U16                 PrimaryApplicationTagMask;          /* 0x3A */
366     U32                 RelativeOffset;                     /* 0x3C */
367     U32                 Reserved5;                          /* 0x40 */
368     U32                 Reserved6;                          /* 0x44 */
369     U32                 Reserved7;                          /* 0x48 */
370     U32                 Reserved8;                          /* 0x4C */
371     MPI25_SGE_IO_UNION  SGL;                                /* 0x50 */
372 } MPI25_TARGET_ASSIST_REQUEST, MPI2_POINTER PTR_MPI25_TARGET_ASSIST_REQUEST,
373   Mpi25TargetAssistRequest_t, MPI2_POINTER pMpi25TargetAssistRequest_t;
374 
375 /* use MPI2_TARGET_ASSIST_FLAGS_ defines for the Flags field */
376 
377 /* Defines for the DMAFlags field
378  *  Each setting affects 4 SGLS, from SGL0 to SGL3.
379  *      D = Data
380  *      C = Cache DIF
381  *      I = Interleaved
382  *      H = Host DIF
383  */
384 #define MPI25_TA_DMAFLAGS_OP_MASK                   (0x0F)
385 #define MPI25_TA_DMAFLAGS_OP_D_D_D_D                (0x00)
386 #define MPI25_TA_DMAFLAGS_OP_D_D_D_C                (0x01)
387 #define MPI25_TA_DMAFLAGS_OP_D_D_D_I                (0x02)
388 #define MPI25_TA_DMAFLAGS_OP_D_D_C_C                (0x03)
389 #define MPI25_TA_DMAFLAGS_OP_D_D_C_I                (0x04)
390 #define MPI25_TA_DMAFLAGS_OP_D_D_I_I                (0x05)
391 #define MPI25_TA_DMAFLAGS_OP_D_C_C_C                (0x06)
392 #define MPI25_TA_DMAFLAGS_OP_D_C_C_I                (0x07)
393 #define MPI25_TA_DMAFLAGS_OP_D_C_I_I                (0x08)
394 #define MPI25_TA_DMAFLAGS_OP_D_I_I_I                (0x09)
395 #define MPI25_TA_DMAFLAGS_OP_D_H_D_D                (0x0A)
396 #define MPI25_TA_DMAFLAGS_OP_D_H_D_C                (0x0B)
397 #define MPI25_TA_DMAFLAGS_OP_D_H_D_I                (0x0C)
398 #define MPI25_TA_DMAFLAGS_OP_D_H_C_C                (0x0D)
399 #define MPI25_TA_DMAFLAGS_OP_D_H_C_I                (0x0E)
400 #define MPI25_TA_DMAFLAGS_OP_D_H_I_I                (0x0F)
401 
402 /* defines for the IoFlags field */
403 #define MPI25_TARGET_ASSIST_IOFLAGS_BIDIRECTIONAL       (0x0800)
404 #define MPI25_TARGET_ASSIST_IOFLAGS_RECEIVE_FIRST       (0x0200)
405 
406 /* defines for the EEDPFlags field */
407 #define MPI25_TA_EEDPFLAGS_INC_PRI_REFTAG               (0x8000)
408 #define MPI25_TA_EEDPFLAGS_INC_SEC_REFTAG               (0x4000)
409 #define MPI25_TA_EEDPFLAGS_INC_PRI_APPTAG               (0x2000)
410 #define MPI25_TA_EEDPFLAGS_INC_SEC_APPTAG               (0x1000)
411 
412 #define MPI25_TA_EEDPFLAGS_CHECK_REFTAG                 (0x0400)
413 #define MPI25_TA_EEDPFLAGS_CHECK_APPTAG                 (0x0200)
414 #define MPI25_TA_EEDPFLAGS_CHECK_GUARD                  (0x0100)
415 
416 #define MPI25_TA_EEDPFLAGS_ESCAPE_MODE_MASK             (0x00C0)
417 #define MPI25_TA_EEDPFLAGS_COMPATIBLE_MODE              (0x0000)
418 #define MPI25_TA_EEDPFLAGS_DO_NOT_DISABLE_MODE          (0x0040)
419 #define MPI25_TA_EEDPFLAGS_APPTAG_DISABLE_MODE          (0x0080)
420 #define MPI25_TA_EEDPFLAGS_APPTAG_REFTAG_DISABLE_MODE   (0x00C0)
421 
422 #define MPI25_TA_EEDPFLAGS_HOST_GUARD_METHOD_MASK       (0x0030)
423 #define MPI25_TA_EEDPFLAGS_T10_CRC_HOST_GUARD           (0x0000)
424 #define MPI25_TA_EEDPFLAGS_IP_CHKSUM_HOST_GUARD         (0x0010)
425 
426 #define MPI25_TA_EEDPFLAGS_PASSTHRU_REFTAG              (0x0008)
427 
428 #define MPI25_TA_EEDPFLAGS_MASK_OP                      (0x0007)
429 #define MPI25_TA_EEDPFLAGS_NOOP_OP                      (0x0000)
430 #define MPI25_TA_EEDPFLAGS_CHECK_OP                     (0x0001)
431 #define MPI25_TA_EEDPFLAGS_STRIP_OP                     (0x0002)
432 #define MPI25_TA_EEDPFLAGS_CHECK_REMOVE_OP              (0x0003)
433 #define MPI25_TA_EEDPFLAGS_INSERT_OP                    (0x0004)
434 #define MPI25_TA_EEDPFLAGS_REPLACE_OP                   (0x0006)
435 #define MPI25_TA_EEDPFLAGS_CHECK_REGEN_OP               (0x0007)
436 
437 
438 /****************************************************************************
439 *  Target Status Send Request
440 ****************************************************************************/
441 
442 typedef struct _MPI2_TARGET_STATUS_SEND_REQUEST
443 {
444     U8                      Reserved1;                  /* 0x00 */
445     U8                      StatusFlags;                /* 0x01 */
446     U8                      ChainOffset;                /* 0x02 */
447     U8                      Function;                   /* 0x03 */
448     U16                     QueueTag;                   /* 0x04 */
449     U8                      Reserved2;                  /* 0x06 */
450     U8                      MsgFlags;                   /* 0x07 */
451     U8                      VP_ID;                      /* 0x08 */
452     U8                      VF_ID;                      /* 0x09 */
453     U16                     Reserved3;                  /* 0x0A */
454     U16                     IoIndex;                    /* 0x0C */
455     U16                     InitiatorConnectionTag;     /* 0x0E */
456     U16                     SGLFlags;                   /* 0x10 */ /* MPI v2.0 only. Reserved on MPI v2.5. */
457     U16                     Reserved4;                  /* 0x12 */
458     U8                      SGLOffset0;                 /* 0x14 */
459     U8                      Reserved5;                  /* 0x15 */
460     U16                     Reserved6;                  /* 0x16 */
461     U32                     Reserved7;                  /* 0x18 */
462     U32                     Reserved8;                  /* 0x1C */
463     MPI2_SIMPLE_SGE_UNION   StatusDataSGE;              /* 0x20 */ /* MPI v2.5: This must be an IEEE Simple Element 64. */
464 } MPI2_TARGET_STATUS_SEND_REQUEST,
465   MPI2_POINTER PTR_MPI2_TARGET_STATUS_SEND_REQUEST,
466   Mpi2TargetStatusSendRequest_t, MPI2_POINTER pMpi2TargetStatusSendRequest_t;
467 
468 /* Target Status Send StatusFlags bits */
469 
470 #define MPI2_TSS_FLAGS_REPOST_CMD_BUFFER            (0x80)
471 #define MPI2_TSS_FLAGS_RETRANSMIT                   (0x04)
472 #define MPI2_TSS_FLAGS_AUTO_GOOD_STATUS             (0x01)
473 
474 /* Target Status Send SGLFlags bits - MPI v2.0 only */
475 /* Data Location Address Space */
476 #define MPI2_TSS_SGLFLAGS_ADDR_MASK                 (0x0C)
477 #define MPI2_TSS_SGLFLAGS_SYSTEM_ADDR               (0x00)
478 #define MPI2_TSS_SGLFLAGS_IOCDDR_ADDR               (0x04)
479 #define MPI2_TSS_SGLFLAGS_IOCPLB_ADDR               (0x08)
480 #define MPI2_TSS_SGLFLAGS_IOCPLBNTA_ADDR            (0x0C)
481 /* Type */
482 #define MPI2_TSS_SGLFLAGS_TYPE_MASK                 (0x03)
483 #define MPI2_TSS_SGLFLAGS_MPI_TYPE                  (0x00)
484 #define MPI2_TSS_SGLFLAGS_IEEE32_TYPE               (0x01)
485 #define MPI2_TSS_SGLFLAGS_IEEE64_TYPE               (0x02)
486 
487 
488 
489 /*
490  * NOTE: The SSP status IU is big-endian. When used on a little-endian system,
491  * this structure properly orders the bytes.
492  */
493 typedef struct _MPI2_TARGET_SSP_RSP_IU
494 {
495     U32     Reserved0[6]; /* reserved for SSP header */ /* 0x00 */
496 
497     /* start of RESPONSE information unit */
498     U32     Reserved1;                                  /* 0x18 */
499     U32     Reserved2;                                  /* 0x1C */
500     U16     Reserved3;                                  /* 0x20 */
501     U8      DataPres; /* lower 2 bits */                /* 0x22 */
502     U8      Status;                                     /* 0x23 */
503     U32     Reserved4;                                  /* 0x24 */
504     U32     SenseDataLength;                            /* 0x28 */
505     U32     ResponseDataLength;                         /* 0x2C */
506 
507     /* start of Response or Sense Data (size may vary dynamically) */
508     U8      ResponseSenseData[4];                       /* 0x30 */
509 } MPI2_TARGET_SSP_RSP_IU, MPI2_POINTER PTR_MPI2_TARGET_SSP_RSP_IU,
510   Mpi2TargetSspRspIu_t, MPI2_POINTER pMpi2TargetSspRspIu_t;
511 
512 
513 /****************************************************************************
514 *  Target Standard Reply - used with Target Assist or Target Status Send
515 ****************************************************************************/
516 
517 typedef struct _MPI2_TARGET_STANDARD_REPLY
518 {
519     U16                     Reserved;                   /* 0x00 */
520     U8                      MsgLength;                  /* 0x02 */
521     U8                      Function;                   /* 0x03 */
522     U16                     Reserved1;                  /* 0x04 */
523     U8                      Reserved2;                  /* 0x06 */
524     U8                      MsgFlags;                   /* 0x07 */
525     U8                      VP_ID;                      /* 0x08 */
526     U8                      VF_ID;                      /* 0x09 */
527     U16                     Reserved3;                  /* 0x0A */
528     U16                     Reserved4;                  /* 0x0C */
529     U16                     IOCStatus;                  /* 0x0E */
530     U32                     IOCLogInfo;                 /* 0x10 */
531     U16                     IoIndex;                    /* 0x14 */
532     U16                     Reserved5;                  /* 0x16 */
533     U32                     TransferCount;              /* 0x18 */
534     U32                     BidirectionalTransferCount; /* 0x1C */
535 } MPI2_TARGET_STANDARD_REPLY, MPI2_POINTER PTR_MPI2_TARGET_STANDARD_REPLY,
536   Mpi2TargetErrorReply_t, MPI2_POINTER pMpi2TargetErrorReply_t;
537 
538 
539 /****************************************************************************
540 *  Target Mode Abort Request
541 ****************************************************************************/
542 
543 typedef struct _MPI2_TARGET_MODE_ABORT_REQUEST
544 {
545     U8                      AbortType;                  /* 0x00 */
546     U8                      Reserved1;                  /* 0x01 */
547     U8                      ChainOffset;                /* 0x02 */
548     U8                      Function;                   /* 0x03 */
549     U16                     Reserved2;                  /* 0x04 */
550     U8                      Reserved3;                  /* 0x06 */
551     U8                      MsgFlags;                   /* 0x07 */
552     U8                      VP_ID;                      /* 0x08 */
553     U8                      VF_ID;                      /* 0x09 */
554     U16                     Reserved4;                  /* 0x0A */
555     U16                     IoIndexToAbort;             /* 0x0C */
556     U16                     InitiatorDevHandle;         /* 0x0E */
557     U32                     MidToAbort;                 /* 0x10 */
558 } MPI2_TARGET_MODE_ABORT, MPI2_POINTER PTR_MPI2_TARGET_MODE_ABORT,
559   Mpi2TargetModeAbort_t, MPI2_POINTER pMpi2TargetModeAbort_t;
560 
561 /* Target Mode Abort AbortType values */
562 
563 #define MPI2_TARGET_MODE_ABORT_ALL_CMD_BUFFERS      (0x00)
564 #define MPI2_TARGET_MODE_ABORT_ALL_IO               (0x01)
565 #define MPI2_TARGET_MODE_ABORT_EXACT_IO             (0x02)
566 #define MPI2_TARGET_MODE_ABORT_EXACT_IO_REQUEST     (0x03)
567 #define MPI2_TARGET_MODE_ABORT_IO_REQUEST_AND_IO    (0x04)
568 #define MPI2_TARGET_MODE_ABORT_DEVHANDLE            (0x05)
569 #define MPI2_TARGET_MODE_ABORT_ALL_COMMANDS         (0x06)
570 
571 
572 /****************************************************************************
573 *  Target Mode Abort Reply
574 ****************************************************************************/
575 
576 typedef struct _MPI2_TARGET_MODE_ABORT_REPLY
577 {
578     U16                     Reserved;                   /* 0x00 */
579     U8                      MsgLength;                  /* 0x02 */
580     U8                      Function;                   /* 0x03 */
581     U16                     Reserved1;                  /* 0x04 */
582     U8                      Reserved2;                  /* 0x06 */
583     U8                      MsgFlags;                   /* 0x07 */
584     U8                      VP_ID;                      /* 0x08 */
585     U8                      VF_ID;                      /* 0x09 */
586     U16                     Reserved3;                  /* 0x0A */
587     U16                     Reserved4;                  /* 0x0C */
588     U16                     IOCStatus;                  /* 0x0E */
589     U32                     IOCLogInfo;                 /* 0x10 */
590     U32                     AbortCount;                 /* 0x14 */
591 } MPI2_TARGET_MODE_ABORT_REPLY, MPI2_POINTER PTR_MPI2_TARGET_MODE_ABORT_REPLY,
592   Mpi2TargetModeAbortReply_t, MPI2_POINTER pMpi2TargetModeAbortReply_t;
593 
594 
595 #endif
596 
597