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