Linux-2.6.12-rc2
[linux-flexiantxendom0-natty.git] / drivers / message / fusion / lsi / mpi_lan.h
1 /*
2  *  Copyright (c) 2000-2003 LSI Logic Corporation.
3  *
4  *
5  *           Name:  mpi_lan.h
6  *          Title:  MPI LAN messages and structures
7  *  Creation Date:  June 30, 2000
8  *
9  *    mpi_lan.h Version:  01.05.xx
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  *  05-24-00  00.10.02  Added LANStatus field to _MSG_LAN_SEND_REPLY.
18  *                      Added LANStatus field to _MSG_LAN_RECEIVE_POST_REPLY.
19  *                      Moved ListCount field in _MSG_LAN_RECEIVE_POST_REPLY.
20  *  06-06-00  01.00.01  Update version number for 1.0 release.
21  *  06-12-00  01.00.02  Added MPI_ to BUCKETSTATUS_ definitions.
22  *  06-22-00  01.00.03  Major changes to match new LAN definition in 1.0 spec.
23  *  06-30-00  01.00.04  Added Context Reply definitions per revised proposal.
24  *                      Changed transaction context usage to bucket/buffer.
25  *  07-05-00  01.00.05  Removed LAN_RECEIVE_POST_BUCKET_CONTEXT_MASK definition
26  *                      to lan private header file
27  *  11-02-00  01.01.01  Original release for post 1.0 work
28  *  02-20-01  01.01.02  Started using MPI_POINTER.
29  *  03-27-01  01.01.03  Added structure offset comments.
30  *  08-08-01  01.02.01  Original release for v1.2 work.
31  *  --------------------------------------------------------------------------
32  */
33
34 #ifndef MPI_LAN_H
35 #define MPI_LAN_H
36
37
38 /******************************************************************************
39 *
40 *               L A N    M e s s a g e s
41 *
42 *******************************************************************************/
43
44 /* LANSend messages */
45
46 typedef struct _MSG_LAN_SEND_REQUEST
47 {
48     U16                     Reserved;           /* 00h */
49     U8                      ChainOffset;        /* 02h */
50     U8                      Function;           /* 03h */
51     U16                     Reserved2;          /* 04h */
52     U8                      PortNumber;         /* 06h */
53     U8                      MsgFlags;           /* 07h */
54     U32                     MsgContext;         /* 08h */
55     SGE_MPI_UNION           SG_List[1];         /* 0Ch */
56 } MSG_LAN_SEND_REQUEST, MPI_POINTER PTR_MSG_LAN_SEND_REQUEST,
57   LANSendRequest_t, MPI_POINTER pLANSendRequest_t;
58
59
60 typedef struct _MSG_LAN_SEND_REPLY
61 {
62     U16                     Reserved;           /* 00h */
63     U8                      MsgLength;          /* 02h */
64     U8                      Function;           /* 03h */
65     U8                      Reserved2;          /* 04h */
66     U8                      NumberOfContexts;   /* 05h */
67     U8                      PortNumber;         /* 06h */
68     U8                      MsgFlags;           /* 07h */
69     U32                     MsgContext;         /* 08h */
70     U16                     Reserved3;          /* 0Ch */
71     U16                     IOCStatus;          /* 0Eh */
72     U32                     IOCLogInfo;         /* 10h */
73     U32                     BufferContext;      /* 14h */
74 } MSG_LAN_SEND_REPLY, MPI_POINTER PTR_MSG_LAN_SEND_REPLY,
75   LANSendReply_t, MPI_POINTER pLANSendReply_t;
76
77
78 /* LANReceivePost */
79
80 typedef struct _MSG_LAN_RECEIVE_POST_REQUEST
81 {
82     U16                     Reserved;           /* 00h */
83     U8                      ChainOffset;        /* 02h */
84     U8                      Function;           /* 03h */
85     U16                     Reserved2;          /* 04h */
86     U8                      PortNumber;         /* 06h */
87     U8                      MsgFlags;           /* 07h */
88     U32                     MsgContext;         /* 08h */
89     U32                     BucketCount;        /* 0Ch */
90     SGE_MPI_UNION           SG_List[1];         /* 10h */
91 } MSG_LAN_RECEIVE_POST_REQUEST, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REQUEST,
92   LANReceivePostRequest_t, MPI_POINTER pLANReceivePostRequest_t;
93
94
95 typedef struct _MSG_LAN_RECEIVE_POST_REPLY
96 {
97     U16                     Reserved;           /* 00h */
98     U8                      MsgLength;          /* 02h */
99     U8                      Function;           /* 03h */
100     U8                      Reserved2;          /* 04h */
101     U8                      NumberOfContexts;   /* 05h */
102     U8                      PortNumber;         /* 06h */
103     U8                      MsgFlags;           /* 07h */
104     U32                     MsgContext;         /* 08h */
105     U16                     Reserved3;          /* 0Ch */
106     U16                     IOCStatus;          /* 0Eh */
107     U32                     IOCLogInfo;         /* 10h */
108     U32                     BucketsRemaining;   /* 14h */
109     U32                     PacketOffset;       /* 18h */
110     U32                     PacketLength;       /* 1Ch */
111     U32                     BucketContext[1];   /* 20h */
112 } MSG_LAN_RECEIVE_POST_REPLY, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REPLY,
113   LANReceivePostReply_t, MPI_POINTER pLANReceivePostReply_t;
114
115
116 /* LANReset */
117
118 typedef struct _MSG_LAN_RESET_REQUEST
119 {
120     U16                     Reserved;           /* 00h */
121     U8                      ChainOffset;        /* 02h */
122     U8                      Function;           /* 03h */
123     U16                     Reserved2;          /* 04h */
124     U8                      PortNumber;         /* 05h */
125     U8                      MsgFlags;           /* 07h */
126     U32                     MsgContext;         /* 08h */
127 } MSG_LAN_RESET_REQUEST, MPI_POINTER PTR_MSG_LAN_RESET_REQUEST,
128   LANResetRequest_t, MPI_POINTER pLANResetRequest_t;
129
130
131 typedef struct _MSG_LAN_RESET_REPLY
132 {
133     U16                     Reserved;           /* 00h */
134     U8                      MsgLength;          /* 02h */
135     U8                      Function;           /* 03h */
136     U16                     Reserved2;          /* 04h */
137     U8                      PortNumber;         /* 06h */
138     U8                      MsgFlags;           /* 07h */
139     U32                     MsgContext;         /* 08h */
140     U16                     Reserved3;          /* 0Ch */
141     U16                     IOCStatus;          /* 0Eh */
142     U32                     IOCLogInfo;         /* 10h */
143 } MSG_LAN_RESET_REPLY, MPI_POINTER PTR_MSG_LAN_RESET_REPLY,
144   LANResetReply_t, MPI_POINTER pLANResetReply_t;
145
146
147 /****************************************************************************/
148 /* LAN Context Reply defines and macros                                     */
149 /****************************************************************************/
150
151 #define LAN_REPLY_PACKET_LENGTH_MASK            (0x0000FFFF)
152 #define LAN_REPLY_PACKET_LENGTH_SHIFT           (0)
153 #define LAN_REPLY_BUCKET_CONTEXT_MASK           (0x07FF0000)
154 #define LAN_REPLY_BUCKET_CONTEXT_SHIFT          (16)
155 #define LAN_REPLY_BUFFER_CONTEXT_MASK           (0x07FFFFFF)
156 #define LAN_REPLY_BUFFER_CONTEXT_SHIFT          (0)
157 #define LAN_REPLY_FORM_MASK                     (0x18000000)
158 #define LAN_REPLY_FORM_RECEIVE_SINGLE           (0x00)
159 #define LAN_REPLY_FORM_RECEIVE_MULTIPLE         (0x01)
160 #define LAN_REPLY_FORM_SEND_SINGLE              (0x02)
161 #define LAN_REPLY_FORM_MESSAGE_CONTEXT          (0x03)
162 #define LAN_REPLY_FORM_SHIFT                    (27)
163
164 #define GET_LAN_PACKET_LENGTH(x)    (((x) & LAN_REPLY_PACKET_LENGTH_MASK)   \
165                                         >> LAN_REPLY_PACKET_LENGTH_SHIFT)
166
167 #define SET_LAN_PACKET_LENGTH(x, lth)                                       \
168             ((x) = ((x) & ~LAN_REPLY_PACKET_LENGTH_MASK) |                  \
169                             (((lth) << LAN_REPLY_PACKET_LENGTH_SHIFT) &     \
170                                         LAN_REPLY_PACKET_LENGTH_MASK))
171
172 #define GET_LAN_BUCKET_CONTEXT(x)   (((x) & LAN_REPLY_BUCKET_CONTEXT_MASK)  \
173                                         >> LAN_REPLY_BUCKET_CONTEXT_SHIFT)
174
175 #define SET_LAN_BUCKET_CONTEXT(x, ctx)                                      \
176             ((x) = ((x) & ~LAN_REPLY_BUCKET_CONTEXT_MASK) |                 \
177                             (((ctx) << LAN_REPLY_BUCKET_CONTEXT_SHIFT) &    \
178                                         LAN_REPLY_BUCKET_CONTEXT_MASK))
179
180 #define GET_LAN_BUFFER_CONTEXT(x)   (((x) & LAN_REPLY_BUFFER_CONTEXT_MASK)  \
181                                         >> LAN_REPLY_BUFFER_CONTEXT_SHIFT)
182
183 #define SET_LAN_BUFFER_CONTEXT(x, ctx)                                      \
184             ((x) = ((x) & ~LAN_REPLY_BUFFER_CONTEXT_MASK) |                 \
185                             (((ctx) << LAN_REPLY_BUFFER_CONTEXT_SHIFT) &    \
186                                         LAN_REPLY_BUFFER_CONTEXT_MASK))
187
188 #define GET_LAN_FORM(x)             (((x) & LAN_REPLY_FORM_MASK)            \
189                                         >> LAN_REPLY_FORM_SHIFT)
190
191 #define SET_LAN_FORM(x, frm)                                                \
192             ((x) = ((x) & ~LAN_REPLY_FORM_MASK) |                           \
193                             (((frm) << LAN_REPLY_FORM_SHIFT) &              \
194                                         LAN_REPLY_FORM_MASK))
195
196
197 /****************************************************************************/
198 /* LAN Current Device State defines                                         */
199 /****************************************************************************/
200
201 #define MPI_LAN_DEVICE_STATE_RESET                     (0x00)
202 #define MPI_LAN_DEVICE_STATE_OPERATIONAL               (0x01)
203
204
205 /****************************************************************************/
206 /* LAN Loopback defines                                                     */
207 /****************************************************************************/
208
209 #define MPI_LAN_TX_MODES_ENABLE_LOOPBACK_SUPPRESSION   (0x01)
210
211 #endif
212