Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / sys / dev / disk / mpt / mpilib / mpi_fc.h
1 /* $FreeBSD: src/sys/dev/mpt/mpilib/mpi_fc.h,v 1.1.2.2 2002/09/01 23:08:06 mjacob Exp $ */
2 /* $DragonFly: src/sys/dev/disk/mpt/mpilib/mpi_fc.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_FC.H
29  *          Title:  MPI Fibre Channel messages and structures
30  *  Creation Date:  June 12, 2000
31  *
32  *    MPI Version:  01.02.02
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-12-00  01.00.02  Added _MSG_FC_ABORT_REPLY structure.
42  *  11-02-00  01.01.01  Original release for post 1.0 work
43  *  12-04-00  01.01.02  Added messages for Common Transport Send and
44  *                      Primitive Send.
45  *  01-09-01  01.01.03  Modifed some of the new flags to have an MPI prefix
46  *                      and modified the FcPrimitiveSend flags.
47  *  01-25-01  01.01.04  Move InitiatorIndex in LinkServiceRsp reply to a larger
48  *                      field.
49  *                      Added FC_ABORT_TYPE_CT_SEND_REQUEST and
50  *                      FC_ABORT_TYPE_EXLINKSEND_REQUEST for FcAbort request.
51  *                      Added MPI_FC_PRIM_SEND_FLAGS_STOP_SEND.
52  *  02-20-01  01.01.05  Started using MPI_POINTER.
53  *  03-27-01  01.01.06  Added Flags field to MSG_LINK_SERVICE_BUFFER_POST_REPLY
54  *                      and defined MPI_LS_BUF_POST_REPLY_FLAG_NO_RSP_NEEDED.
55  *                      Added MPI_FC_PRIM_SEND_FLAGS_RESET_LINK define.
56  *                      Added structure offset comments.
57  *  04-09-01  01.01.07  Added RspLength field to MSG_LINK_SERVICE_RSP_REQUEST.
58  *  08-08-01  01.02.01  Original release for v1.2 work.
59  *  09-28-01  01.02.02  Change name of reserved field in
60  *                      MSG_LINK_SERVICE_RSP_REPLY.
61  *  --------------------------------------------------------------------------
62  */
63
64 #ifndef MPI_FC_H
65 #define MPI_FC_H
66
67
68 /*****************************************************************************
69 *
70 *        F C    T a r g e t    M o d e    M e s s a g e s
71 *
72 *****************************************************************************/
73
74 /****************************************************************************/
75 /* Link Service Buffer Post messages                                        */
76 /****************************************************************************/
77
78 typedef struct _MSG_LINK_SERVICE_BUFFER_POST_REQUEST
79 {
80     U8                      BufferPostFlags;    /* 00h */
81     U8                      BufferCount;        /* 01h */
82     U8                      ChainOffset;        /* 02h */
83     U8                      Function;           /* 03h */
84     U16                     Reserved;           /* 04h */
85     U8                      Reserved1;          /* 06h */
86     U8                      MsgFlags;           /* 07h */
87     U32                     MsgContext;         /* 08h */
88     SGE_TRANS_SIMPLE_UNION  SGL;
89 } MSG_LINK_SERVICE_BUFFER_POST_REQUEST,
90  MPI_POINTER PTR_MSG_LINK_SERVICE_BUFFER_POST_REQUEST,
91   LinkServiceBufferPostRequest_t, MPI_POINTER pLinkServiceBufferPostRequest_t;
92
93 #define LINK_SERVICE_BUFFER_POST_FLAGS_PORT_MASK (0x01)
94
95 typedef struct _WWNFORMAT
96 {
97     U32                     PortNameHigh;       /* 00h */
98     U32                     PortNameLow;        /* 04h */
99     U32                     NodeNameHigh;       /* 08h */
100     U32                     NodeNameLow;        /* 0Ch */
101 } WWNFORMAT,
102   WwnFormat_t;
103
104 /* Link Service Buffer Post Reply */
105 typedef struct _MSG_LINK_SERVICE_BUFFER_POST_REPLY
106 {
107     U8                      Flags;              /* 00h */
108     U8                      Reserved;           /* 01h */
109     U8                      MsgLength;          /* 02h */
110     U8                      Function;           /* 03h */
111     U16                     Reserved1;          /* 04h */
112     U8                      PortNumber;         /* 06h */
113     U8                      MsgFlags;           /* 07h */
114     U32                     MsgContext;         /* 08h */
115     U16                     Reserved2;          /* 0Ch */
116     U16                     IOCStatus;          /* 0Eh */
117     U32                     IOCLogInfo;         /* 10h */
118     U32                     TransferLength;     /* 14h */
119     U32                     TransactionContext; /* 18h */
120     U32                     Rctl_Did;           /* 1Ch */
121     U32                     Csctl_Sid;          /* 20h */
122     U32                     Type_Fctl;          /* 24h */
123     U16                     SeqCnt;             /* 28h */
124     U8                      Dfctl;              /* 2Ah */
125     U8                      SeqId;              /* 2Bh */
126     U16                     Rxid;               /* 2Ch */
127     U16                     Oxid;               /* 2Eh */
128     U32                     Parameter;          /* 30h */
129     WWNFORMAT               Wwn;                /* 34h */
130 } MSG_LINK_SERVICE_BUFFER_POST_REPLY, MPI_POINTER PTR_MSG_LINK_SERVICE_BUFFER_POST_REPLY,
131   LinkServiceBufferPostReply_t, MPI_POINTER pLinkServiceBufferPostReply_t;
132
133 #define MPI_LS_BUF_POST_REPLY_FLAG_NO_RSP_NEEDED    (0x80)
134
135 #define MPI_FC_DID_MASK                             (0x00FFFFFF)
136 #define MPI_FC_DID_SHIFT                            (0)
137 #define MPI_FC_RCTL_MASK                            (0xFF000000)
138 #define MPI_FC_RCTL_SHIFT                           (24)
139 #define MPI_FC_SID_MASK                             (0x00FFFFFF)
140 #define MPI_FC_SID_SHIFT                            (0)
141 #define MPI_FC_CSCTL_MASK                           (0xFF000000)
142 #define MPI_FC_CSCTL_SHIFT                          (24)
143 #define MPI_FC_FCTL_MASK                            (0x00FFFFFF)
144 #define MPI_FC_FCTL_SHIFT                           (0)
145 #define MPI_FC_TYPE_MASK                            (0xFF000000)
146 #define MPI_FC_TYPE_SHIFT                           (24)
147
148 /* obsolete name for the above */
149 #define FCP_TARGET_DID_MASK                         (0x00FFFFFF)
150 #define FCP_TARGET_DID_SHIFT                        (0)
151 #define FCP_TARGET_RCTL_MASK                        (0xFF000000)
152 #define FCP_TARGET_RCTL_SHIFT                       (24)
153 #define FCP_TARGET_SID_MASK                         (0x00FFFFFF)
154 #define FCP_TARGET_SID_SHIFT                        (0)
155 #define FCP_TARGET_CSCTL_MASK                       (0xFF000000)
156 #define FCP_TARGET_CSCTL_SHIFT                      (24)
157 #define FCP_TARGET_FCTL_MASK                        (0x00FFFFFF)
158 #define FCP_TARGET_FCTL_SHIFT                       (0)
159 #define FCP_TARGET_TYPE_MASK                        (0xFF000000)
160 #define FCP_TARGET_TYPE_SHIFT                       (24)
161
162
163 /****************************************************************************/
164 /* Link Service Response messages                                           */
165 /****************************************************************************/
166
167 typedef struct _MSG_LINK_SERVICE_RSP_REQUEST
168 {
169     U8                      RspFlags;           /* 00h */
170     U8                      RspLength;          /* 01h */
171     U8                      ChainOffset;        /* 02h */
172     U8                      Function;           /* 03h */
173     U16                     Reserved1;          /* 04h */
174     U8                      Reserved2;          /* 06h */
175     U8                      MsgFlags;           /* 07h */
176     U32                     MsgContext;         /* 08h */
177     U32                     Rctl_Did;           /* 0Ch */
178     U32                     Csctl_Sid;          /* 10h */
179     U32                     Type_Fctl;          /* 14h */
180     U16                     SeqCnt;             /* 18h */
181     U8                      Dfctl;              /* 1Ah */
182     U8                      SeqId;              /* 1Bh */
183     U16                     Rxid;               /* 1Ch */
184     U16                     Oxid;               /* 1Eh */
185     U32                     Parameter;          /* 20h */
186     SGE_SIMPLE_UNION        SGL;                /* 24h */
187 } MSG_LINK_SERVICE_RSP_REQUEST, MPI_POINTER PTR_MSG_LINK_SERVICE_RSP_REQUEST,
188   LinkServiceRspRequest_t, MPI_POINTER pLinkServiceRspRequest_t;
189
190 #define LINK_SERVICE_RSP_FLAGS_IMMEDIATE        (0x80)
191 #define LINK_SERVICE_RSP_FLAGS_PORT_MASK        (0x01)
192
193
194 /* Link Service Response Reply  */
195 typedef struct _MSG_LINK_SERVICE_RSP_REPLY
196 {
197     U16                     Reserved;           /* 00h */
198     U8                      MsgLength;          /* 02h */
199     U8                      Function;           /* 03h */
200     U16                     Reserved1;          /* 04h */
201     U8                      Reserved_0100_InitiatorIndex; /* 06h */ /* obsolete InitiatorIndex */
202     U8                      MsgFlags;           /* 07h */
203     U32                     MsgContext;         /* 08h */
204     U16                     Reserved3;          /* 0Ch */
205     U16                     IOCStatus;          /* 0Eh */
206     U32                     IOCLogInfo;         /* 10h */
207     U32                     InitiatorIndex;     /* 14h */
208 } MSG_LINK_SERVICE_RSP_REPLY, MPI_POINTER PTR_MSG_LINK_SERVICE_RSP_REPLY,
209   LinkServiceRspReply_t, MPI_POINTER pLinkServiceRspReply_t;
210
211
212 /****************************************************************************/
213 /* Extended Link Service Send messages                                      */
214 /****************************************************************************/
215
216 typedef struct _MSG_EXLINK_SERVICE_SEND_REQUEST
217 {
218     U8                      SendFlags;          /* 00h */
219     U8                      Reserved;           /* 01h */
220     U8                      ChainOffset;        /* 02h */
221     U8                      Function;           /* 03h */
222     U32                     MsgFlags_Did;       /* 04h */
223     U32                     MsgContext;         /* 08h */
224     U32                     ElsCommandCode;     /* 0Ch */
225     SGE_SIMPLE_UNION        SGL;                /* 10h */
226 } MSG_EXLINK_SERVICE_SEND_REQUEST, MPI_POINTER PTR_MSG_EXLINK_SERVICE_SEND_REQUEST,
227   ExLinkServiceSendRequest_t, MPI_POINTER pExLinkServiceSendRequest_t;
228
229 #define EX_LINK_SERVICE_SEND_DID_MASK           (0x00FFFFFF)
230 #define EX_LINK_SERVICE_SEND_DID_SHIFT          (0)
231 #define EX_LINK_SERVICE_SEND_MSGFLAGS_MASK      (0xFF000000)
232 #define EX_LINK_SERVICE_SEND_MSGFLAGS_SHIFT     (24)
233
234
235 /* Extended Link Service Send Reply */
236 typedef struct _MSG_EXLINK_SERVICE_SEND_REPLY
237 {
238     U16                     Reserved;           /* 00h */
239     U8                      MsgLength;          /* 02h */
240     U8                      Function;           /* 03h */
241     U16                     Reserved1;          /* 04h */
242     U8                      Reserved2;          /* 06h */
243     U8                      MsgFlags;           /* 07h */
244     U32                     MsgContext;         /* 08h */
245     U16                     Reserved3;          /* 0Ch */
246     U16                     IOCStatus;          /* 0Eh */
247     U32                     IOCLogInfo;         /* 10h */
248     U32                     ResponseLength;     /* 14h */
249 } MSG_EXLINK_SERVICE_SEND_REPLY, MPI_POINTER PTR_MSG_EXLINK_SERVICE_SEND_REPLY,
250   ExLinkServiceSendReply_t, MPI_POINTER pExLinkServiceSendReply_t;
251
252 /****************************************************************************/
253 /* FC Abort messages                                                        */
254 /****************************************************************************/
255
256 typedef struct _MSG_FC_ABORT_REQUEST
257 {
258     U8                      AbortFlags;                 /* 00h */
259     U8                      AbortType;                  /* 01h */
260     U8                      ChainOffset;                /* 02h */
261     U8                      Function;                   /* 03h */
262     U16                     Reserved1;                  /* 04h */
263     U8                      Reserved2;                  /* 06h */
264     U8                      MsgFlags;                   /* 07h */
265     U32                     MsgContext;                 /* 08h */
266     U32                     TransactionContextToAbort;  /* 0Ch */
267 } MSG_FC_ABORT_REQUEST, MPI_POINTER PTR_MSG_FC_ABORT_REQUEST,
268   FcAbortRequest_t, MPI_POINTER pFcAbortRequest_t;
269
270 #define FC_ABORT_FLAG_PORT_MASK                 (0x01)
271
272 #define FC_ABORT_TYPE_ALL_FC_BUFFERS            (0x00)
273 #define FC_ABORT_TYPE_EXACT_FC_BUFFER           (0x01)
274 #define FC_ABORT_TYPE_CT_SEND_REQUEST           (0x02)
275 #define FC_ABORT_TYPE_EXLINKSEND_REQUEST        (0x03)
276
277 /* FC Abort Reply */
278 typedef struct _MSG_FC_ABORT_REPLY
279 {
280     U16                     Reserved;           /* 00h */
281     U8                      MsgLength;          /* 02h */
282     U8                      Function;           /* 03h */
283     U16                     Reserved1;          /* 04h */
284     U8                      Reserved2;          /* 06h */
285     U8                      MsgFlags;           /* 07h */
286     U32                     MsgContext;         /* 08h */
287     U16                     Reserved3;          /* 0Ch */
288     U16                     IOCStatus;          /* 0Eh */
289     U32                     IOCLogInfo;         /* 10h */
290 } MSG_FC_ABORT_REPLY, MPI_POINTER PTR_MSG_FC_ABORT_REPLY,
291   FcAbortReply_t, MPI_POINTER pFcAbortReply_t;
292
293
294 /****************************************************************************/
295 /* FC Common Transport Send messages                                        */
296 /****************************************************************************/
297
298 typedef struct _MSG_FC_COMMON_TRANSPORT_SEND_REQUEST
299 {
300     U8                      SendFlags;          /* 00h */
301     U8                      Reserved;           /* 01h */
302     U8                      ChainOffset;        /* 02h */
303     U8                      Function;           /* 03h */
304     U32                     MsgFlags_Did;       /* 04h */
305     U32                     MsgContext;         /* 08h */
306     U16                     CTCommandCode;      /* 0Ch */
307     U8                      FsType;             /* 0Eh */
308     U8                      Reserved1;          /* 0Fh */
309     SGE_SIMPLE_UNION        SGL;                /* 10h */
310 } MSG_FC_COMMON_TRANSPORT_SEND_REQUEST,
311  MPI_POINTER PTR_MSG_FC_COMMON_TRANSPORT_SEND_REQUEST,
312   FcCommonTransportSendRequest_t, MPI_POINTER pFcCommonTransportSendRequest_t;
313
314 #define MPI_FC_CT_SEND_DID_MASK                 (0x00FFFFFF)
315 #define MPI_FC_CT_SEND_DID_SHIFT                (0)
316 #define MPI_FC_CT_SEND_MSGFLAGS_MASK            (0xFF000000)
317 #define MPI_FC_CT_SEND_MSGFLAGS_SHIFT           (24)
318
319
320 /* FC Common Transport Send Reply */
321 typedef struct _MSG_FC_COMMON_TRANSPORT_SEND_REPLY
322 {
323     U16                     Reserved;           /* 00h */
324     U8                      MsgLength;          /* 02h */
325     U8                      Function;           /* 03h */
326     U16                     Reserved1;          /* 04h */
327     U8                      Reserved2;          /* 06h */
328     U8                      MsgFlags;           /* 07h */
329     U32                     MsgContext;         /* 08h */
330     U16                     Reserved3;          /* 0Ch */
331     U16                     IOCStatus;          /* 0Eh */
332     U32                     IOCLogInfo;         /* 10h */
333     U32                     ResponseLength;     /* 14h */
334 } MSG_FC_COMMON_TRANSPORT_SEND_REPLY, MPI_POINTER PTR_MSG_FC_COMMON_TRANSPORT_SEND_REPLY,
335   FcCommonTransportSendReply_t, MPI_POINTER pFcCommonTransportSendReply_t;
336
337
338 /****************************************************************************/
339 /* FC Primitive Send messages                                               */
340 /****************************************************************************/
341
342 typedef struct _MSG_FC_PRIMITIVE_SEND_REQUEST
343 {
344     U8                      SendFlags;          /* 00h */
345     U8                      Reserved;           /* 01h */
346     U8                      ChainOffset;        /* 02h */
347     U8                      Function;           /* 03h */
348     U16                     Reserved1;          /* 04h */
349     U8                      Reserved2;          /* 06h */
350     U8                      MsgFlags;           /* 07h */
351     U32                     MsgContext;         /* 08h */
352     U8                      FcPrimitive[4];     /* 0Ch */
353 } MSG_FC_PRIMITIVE_SEND_REQUEST, MPI_POINTER PTR_MSG_FC_PRIMITIVE_SEND_REQUEST,
354   FcPrimitiveSendRequest_t, MPI_POINTER pFcPrimitiveSendRequest_t;
355
356 #define MPI_FC_PRIM_SEND_FLAGS_PORT_MASK       (0x01)
357 #define MPI_FC_PRIM_SEND_FLAGS_RESET_LINK      (0x04)
358 #define MPI_FC_PRIM_SEND_FLAGS_STOP_SEND       (0x08)
359 #define MPI_FC_PRIM_SEND_FLAGS_SEND_ONCE       (0x10)
360 #define MPI_FC_PRIM_SEND_FLAGS_SEND_AROUND     (0x20)
361 #define MPI_FC_PRIM_SEND_FLAGS_UNTIL_FULL      (0x40)
362 #define MPI_FC_PRIM_SEND_FLAGS_FOREVER         (0x80)
363
364 /* FC Primitive Send Reply */
365 typedef struct _MSG_FC_PRIMITIVE_SEND_REPLY
366 {
367     U8                      SendFlags;          /* 00h */
368     U8                      Reserved;           /* 01h */
369     U8                      MsgLength;          /* 02h */
370     U8                      Function;           /* 03h */
371     U16                     Reserved1;          /* 04h */
372     U8                      Reserved2;          /* 06h */
373     U8                      MsgFlags;           /* 07h */
374     U32                     MsgContext;         /* 08h */
375     U16                     Reserved3;          /* 0Ch */
376     U16                     IOCStatus;          /* 0Eh */
377     U32                     IOCLogInfo;         /* 10h */
378 } MSG_FC_PRIMITIVE_SEND_REPLY, MPI_POINTER PTR_MSG_FC_PRIMITIVE_SEND_REPLY,
379   FcPrimitiveSendReply_t, MPI_POINTER pFcPrimitiveSendReply_t;
380
381 #endif
382