1 |
1275 |
phoenix |
/*
|
2 |
|
|
* Copyright (c) 2000-2003 LSI Logic Corporation.
|
3 |
|
|
*
|
4 |
|
|
*
|
5 |
|
|
* Name: MPI.H
|
6 |
|
|
* Title: MPI Message independent structures and definitions
|
7 |
|
|
* Creation Date: July 27, 2000
|
8 |
|
|
*
|
9 |
|
|
* MPI.H Version: 01.02.10
|
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 MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH definition.
|
18 |
|
|
* 06-06-00 01.00.01 Update MPI_VERSION_MAJOR and MPI_VERSION_MINOR.
|
19 |
|
|
* 06-22-00 01.00.02 Added MPI_IOCSTATUS_LAN_ definitions.
|
20 |
|
|
* Removed LAN_SUSPEND function definition.
|
21 |
|
|
* Added MPI_MSGFLAGS_CONTINUATION_REPLY definition.
|
22 |
|
|
* 06-30-00 01.00.03 Added MPI_CONTEXT_REPLY_TYPE_LAN definition.
|
23 |
|
|
* Added MPI_GET/SET_CONTEXT_REPLY_TYPE macros.
|
24 |
|
|
* 07-27-00 01.00.04 Added MPI_FAULT_ definitions.
|
25 |
|
|
* Removed MPI_IOCSTATUS_MSG/DATA_XFER_ERROR definitions.
|
26 |
|
|
* Added MPI_IOCSTATUS_INTERNAL_ERROR definition.
|
27 |
|
|
* Added MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH.
|
28 |
|
|
* 11-02-00 01.01.01 Original release for post 1.0 work.
|
29 |
|
|
* 12-04-00 01.01.02 Added new function codes.
|
30 |
|
|
* 01-09-01 01.01.03 Added more definitions to the system interface section
|
31 |
|
|
* Added MPI_IOCSTATUS_TARGET_STS_DATA_NOT_SENT.
|
32 |
|
|
* 01-25-01 01.01.04 Changed MPI_VERSION_MINOR from 0x00 to 0x01.
|
33 |
|
|
* 02-20-01 01.01.05 Started using MPI_POINTER.
|
34 |
|
|
* Fixed value for MPI_DIAG_RW_ENABLE.
|
35 |
|
|
* Added defines for MPI_DIAG_PREVENT_IOC_BOOT and
|
36 |
|
|
* MPI_DIAG_CLEAR_FLASH_BAD_SIG.
|
37 |
|
|
* Obsoleted MPI_IOCSTATUS_TARGET_FC_ defines.
|
38 |
|
|
* 02-27-01 01.01.06 Removed MPI_HOST_INDEX_REGISTER define.
|
39 |
|
|
* Added function codes for RAID.
|
40 |
|
|
* 04-09-01 01.01.07 Added alternate define for MPI_DOORBELL_ACTIVE,
|
41 |
|
|
* MPI_DOORBELL_USED, to better match the spec.
|
42 |
|
|
* 08-08-01 01.02.01 Original release for v1.2 work.
|
43 |
|
|
* Changed MPI_VERSION_MINOR from 0x01 to 0x02.
|
44 |
|
|
* Added define MPI_FUNCTION_TOOLBOX.
|
45 |
|
|
* 09-28-01 01.02.02 New function code MPI_SCSI_ENCLOSURE_PROCESSOR.
|
46 |
|
|
* 11-01-01 01.02.03 Changed name to MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR.
|
47 |
|
|
* 03-14-02 01.02.04 Added MPI_HEADER_VERSION_ defines.
|
48 |
|
|
* 05-31-02 01.02.05 Bumped MPI_HEADER_VERSION_UNIT.
|
49 |
|
|
* 07-12-02 01.02.06 Added define for MPI_FUNCTION_MAILBOX.
|
50 |
|
|
* 09-16-02 01.02.07 Bumped value for MPI_HEADER_VERSION_UNIT.
|
51 |
|
|
* 11-15-02 01.02.08 Added define MPI_IOCSTATUS_TARGET_INVALID_IO_INDEX and
|
52 |
|
|
* obsoleted define MPI_IOCSTATUS_TARGET_INVALID_IOCINDEX.
|
53 |
|
|
* 04-01-03 01.02.09 New IOCStatus code: MPI_IOCSTATUS_FC_EXCHANGE_CANCELED
|
54 |
|
|
* 06-26-03 01.02.10 Bumped MPI_HEADER_VERSION_UNIT value.
|
55 |
|
|
* --------------------------------------------------------------------------
|
56 |
|
|
*/
|
57 |
|
|
|
58 |
|
|
#ifndef MPI_H
|
59 |
|
|
#define MPI_H
|
60 |
|
|
|
61 |
|
|
|
62 |
|
|
/*****************************************************************************
|
63 |
|
|
*
|
64 |
|
|
* M P I V e r s i o n D e f i n i t i o n s
|
65 |
|
|
*
|
66 |
|
|
*****************************************************************************/
|
67 |
|
|
|
68 |
|
|
#define MPI_VERSION_MAJOR (0x01)
|
69 |
|
|
#define MPI_VERSION_MINOR (0x02)
|
70 |
|
|
#define MPI_VERSION_MAJOR_MASK (0xFF00)
|
71 |
|
|
#define MPI_VERSION_MAJOR_SHIFT (8)
|
72 |
|
|
#define MPI_VERSION_MINOR_MASK (0x00FF)
|
73 |
|
|
#define MPI_VERSION_MINOR_SHIFT (0)
|
74 |
|
|
#define MPI_VERSION ((MPI_VERSION_MAJOR << MPI_VERSION_MAJOR_SHIFT) | \
|
75 |
|
|
MPI_VERSION_MINOR)
|
76 |
|
|
|
77 |
|
|
#define MPI_VERSION_01_00 (0x0100)
|
78 |
|
|
#define MPI_VERSION_01_01 (0x0101)
|
79 |
|
|
#define MPI_VERSION_01_02 (0x0102)
|
80 |
|
|
/* Note: The major versions of 0xe0 through 0xff are reserved */
|
81 |
|
|
|
82 |
|
|
/* versioning for this MPI header set */
|
83 |
|
|
#define MPI_HEADER_VERSION_UNIT (0x0C)
|
84 |
|
|
#define MPI_HEADER_VERSION_DEV (0x00)
|
85 |
|
|
#define MPI_HEADER_VERSION_UNIT_MASK (0xFF00)
|
86 |
|
|
#define MPI_HEADER_VERSION_UNIT_SHIFT (8)
|
87 |
|
|
#define MPI_HEADER_VERSION_DEV_MASK (0x00FF)
|
88 |
|
|
#define MPI_HEADER_VERSION_DEV_SHIFT (0)
|
89 |
|
|
#define MPI_HEADER_VERSION ((MPI_HEADER_VERSION_UNIT << 8) | MPI_HEADER_VERSION_DEV)
|
90 |
|
|
|
91 |
|
|
/*****************************************************************************
|
92 |
|
|
*
|
93 |
|
|
* I O C S t a t e D e f i n i t i o n s
|
94 |
|
|
*
|
95 |
|
|
*****************************************************************************/
|
96 |
|
|
|
97 |
|
|
#define MPI_IOC_STATE_RESET (0x00000000)
|
98 |
|
|
#define MPI_IOC_STATE_READY (0x10000000)
|
99 |
|
|
#define MPI_IOC_STATE_OPERATIONAL (0x20000000)
|
100 |
|
|
#define MPI_IOC_STATE_FAULT (0x40000000)
|
101 |
|
|
|
102 |
|
|
#define MPI_IOC_STATE_MASK (0xF0000000)
|
103 |
|
|
#define MPI_IOC_STATE_SHIFT (28)
|
104 |
|
|
|
105 |
|
|
/* Fault state codes (product independent range 0x8000-0xFFFF) */
|
106 |
|
|
|
107 |
|
|
#define MPI_FAULT_REQUEST_MESSAGE_PCI_PARITY_ERROR (0x8111)
|
108 |
|
|
#define MPI_FAULT_REQUEST_MESSAGE_PCI_BUS_FAULT (0x8112)
|
109 |
|
|
#define MPI_FAULT_REPLY_MESSAGE_PCI_PARITY_ERROR (0x8113)
|
110 |
|
|
#define MPI_FAULT_REPLY_MESSAGE_PCI_BUS_FAULT (0x8114)
|
111 |
|
|
#define MPI_FAULT_DATA_SEND_PCI_PARITY_ERROR (0x8115)
|
112 |
|
|
#define MPI_FAULT_DATA_SEND_PCI_BUS_FAULT (0x8116)
|
113 |
|
|
#define MPI_FAULT_DATA_RECEIVE_PCI_PARITY_ERROR (0x8117)
|
114 |
|
|
#define MPI_FAULT_DATA_RECEIVE_PCI_BUS_FAULT (0x8118)
|
115 |
|
|
|
116 |
|
|
|
117 |
|
|
/*****************************************************************************
|
118 |
|
|
*
|
119 |
|
|
* P C I S y s t e m I n t e r f a c e R e g i s t e r s
|
120 |
|
|
*
|
121 |
|
|
*****************************************************************************/
|
122 |
|
|
|
123 |
|
|
/* S y s t e m D o o r b e l l */
|
124 |
|
|
#define MPI_DOORBELL_OFFSET (0x00000000)
|
125 |
|
|
#define MPI_DOORBELL_ACTIVE (0x08000000) /* DoorbellUsed */
|
126 |
|
|
#define MPI_DOORBELL_USED (MPI_DOORBELL_ACTIVE)
|
127 |
|
|
#define MPI_DOORBELL_ACTIVE_SHIFT (27)
|
128 |
|
|
#define MPI_DOORBELL_WHO_INIT_MASK (0x07000000)
|
129 |
|
|
#define MPI_DOORBELL_WHO_INIT_SHIFT (24)
|
130 |
|
|
#define MPI_DOORBELL_FUNCTION_MASK (0xFF000000)
|
131 |
|
|
#define MPI_DOORBELL_FUNCTION_SHIFT (24)
|
132 |
|
|
#define MPI_DOORBELL_ADD_DWORDS_MASK (0x00FF0000)
|
133 |
|
|
#define MPI_DOORBELL_ADD_DWORDS_SHIFT (16)
|
134 |
|
|
#define MPI_DOORBELL_DATA_MASK (0x0000FFFF)
|
135 |
|
|
|
136 |
|
|
|
137 |
|
|
#define MPI_WRITE_SEQUENCE_OFFSET (0x00000004)
|
138 |
|
|
#define MPI_WRSEQ_KEY_VALUE_MASK (0x0000000F)
|
139 |
|
|
#define MPI_WRSEQ_1ST_KEY_VALUE (0x04)
|
140 |
|
|
#define MPI_WRSEQ_2ND_KEY_VALUE (0x0B)
|
141 |
|
|
#define MPI_WRSEQ_3RD_KEY_VALUE (0x02)
|
142 |
|
|
#define MPI_WRSEQ_4TH_KEY_VALUE (0x07)
|
143 |
|
|
#define MPI_WRSEQ_5TH_KEY_VALUE (0x0D)
|
144 |
|
|
|
145 |
|
|
#define MPI_DIAGNOSTIC_OFFSET (0x00000008)
|
146 |
|
|
#define MPI_DIAG_CLEAR_FLASH_BAD_SIG (0x00000400)
|
147 |
|
|
#define MPI_DIAG_PREVENT_IOC_BOOT (0x00000200)
|
148 |
|
|
#define MPI_DIAG_DRWE (0x00000080)
|
149 |
|
|
#define MPI_DIAG_FLASH_BAD_SIG (0x00000040)
|
150 |
|
|
#define MPI_DIAG_RESET_HISTORY (0x00000020)
|
151 |
|
|
#define MPI_DIAG_RW_ENABLE (0x00000010)
|
152 |
|
|
#define MPI_DIAG_RESET_ADAPTER (0x00000004)
|
153 |
|
|
#define MPI_DIAG_DISABLE_ARM (0x00000002)
|
154 |
|
|
#define MPI_DIAG_MEM_ENABLE (0x00000001)
|
155 |
|
|
|
156 |
|
|
#define MPI_TEST_BASE_ADDRESS_OFFSET (0x0000000C)
|
157 |
|
|
|
158 |
|
|
#define MPI_DIAG_RW_DATA_OFFSET (0x00000010)
|
159 |
|
|
|
160 |
|
|
#define MPI_DIAG_RW_ADDRESS_OFFSET (0x00000014)
|
161 |
|
|
|
162 |
|
|
#define MPI_HOST_INTERRUPT_STATUS_OFFSET (0x00000030)
|
163 |
|
|
#define MPI_HIS_IOP_DOORBELL_STATUS (0x80000000)
|
164 |
|
|
#define MPI_HIS_REPLY_MESSAGE_INTERRUPT (0x00000008)
|
165 |
|
|
#define MPI_HIS_DOORBELL_INTERRUPT (0x00000001)
|
166 |
|
|
|
167 |
|
|
#define MPI_HOST_INTERRUPT_MASK_OFFSET (0x00000034)
|
168 |
|
|
#define MPI_HIM_RIM (0x00000008)
|
169 |
|
|
#define MPI_HIM_DIM (0x00000001)
|
170 |
|
|
|
171 |
|
|
#define MPI_REQUEST_QUEUE_OFFSET (0x00000040)
|
172 |
|
|
#define MPI_REQUEST_POST_FIFO_OFFSET (0x00000040)
|
173 |
|
|
|
174 |
|
|
#define MPI_REPLY_QUEUE_OFFSET (0x00000044)
|
175 |
|
|
#define MPI_REPLY_POST_FIFO_OFFSET (0x00000044)
|
176 |
|
|
#define MPI_REPLY_FREE_FIFO_OFFSET (0x00000044)
|
177 |
|
|
|
178 |
|
|
|
179 |
|
|
|
180 |
|
|
/*****************************************************************************
|
181 |
|
|
*
|
182 |
|
|
* M e s s a g e F r a m e D e s c r i p t o r s
|
183 |
|
|
*
|
184 |
|
|
*****************************************************************************/
|
185 |
|
|
|
186 |
|
|
#define MPI_REQ_MF_DESCRIPTOR_NB_MASK (0x00000003)
|
187 |
|
|
#define MPI_REQ_MF_DESCRIPTOR_F_BIT (0x00000004)
|
188 |
|
|
#define MPI_REQ_MF_DESCRIPTOR_ADDRESS_MASK (0xFFFFFFF8)
|
189 |
|
|
|
190 |
|
|
#define MPI_ADDRESS_REPLY_A_BIT (0x80000000)
|
191 |
|
|
#define MPI_ADDRESS_REPLY_ADDRESS_MASK (0x7FFFFFFF)
|
192 |
|
|
|
193 |
|
|
#define MPI_CONTEXT_REPLY_A_BIT (0x80000000)
|
194 |
|
|
#define MPI_CONTEXT_REPLY_TYPE_MASK (0x60000000)
|
195 |
|
|
#define MPI_CONTEXT_REPLY_TYPE_SCSI_INIT (0x00)
|
196 |
|
|
#define MPI_CONTEXT_REPLY_TYPE_SCSI_TARGET (0x01)
|
197 |
|
|
#define MPI_CONTEXT_REPLY_TYPE_LAN (0x02)
|
198 |
|
|
#define MPI_CONTEXT_REPLY_TYPE_SHIFT (29)
|
199 |
|
|
#define MPI_CONTEXT_REPLY_CONTEXT_MASK (0x1FFFFFFF)
|
200 |
|
|
|
201 |
|
|
|
202 |
|
|
/****************************************************************************/
|
203 |
|
|
/* Context Reply macros */
|
204 |
|
|
/****************************************************************************/
|
205 |
|
|
|
206 |
|
|
#define MPI_GET_CONTEXT_REPLY_TYPE(x) (((x) & MPI_CONTEXT_REPLY_TYPE_MASK) \
|
207 |
|
|
>> MPI_CONTEXT_REPLY_TYPE_SHIFT)
|
208 |
|
|
|
209 |
|
|
#define MPI_SET_CONTEXT_REPLY_TYPE(x, typ) \
|
210 |
|
|
((x) = ((x) & ~MPI_CONTEXT_REPLY_TYPE_MASK) | \
|
211 |
|
|
(((typ) << MPI_CONTEXT_REPLY_TYPE_SHIFT) & \
|
212 |
|
|
MPI_CONTEXT_REPLY_TYPE_MASK))
|
213 |
|
|
|
214 |
|
|
|
215 |
|
|
/*****************************************************************************
|
216 |
|
|
*
|
217 |
|
|
* M e s s a g e F u n c t i o n s
|
218 |
|
|
* 0x80 -> 0x8F reserved for private message use per product
|
219 |
|
|
*
|
220 |
|
|
*
|
221 |
|
|
*****************************************************************************/
|
222 |
|
|
|
223 |
|
|
#define MPI_FUNCTION_SCSI_IO_REQUEST (0x00)
|
224 |
|
|
#define MPI_FUNCTION_SCSI_TASK_MGMT (0x01)
|
225 |
|
|
#define MPI_FUNCTION_IOC_INIT (0x02)
|
226 |
|
|
#define MPI_FUNCTION_IOC_FACTS (0x03)
|
227 |
|
|
#define MPI_FUNCTION_CONFIG (0x04)
|
228 |
|
|
#define MPI_FUNCTION_PORT_FACTS (0x05)
|
229 |
|
|
#define MPI_FUNCTION_PORT_ENABLE (0x06)
|
230 |
|
|
#define MPI_FUNCTION_EVENT_NOTIFICATION (0x07)
|
231 |
|
|
#define MPI_FUNCTION_EVENT_ACK (0x08)
|
232 |
|
|
#define MPI_FUNCTION_FW_DOWNLOAD (0x09)
|
233 |
|
|
#define MPI_FUNCTION_TARGET_CMD_BUFFER_POST (0x0A)
|
234 |
|
|
#define MPI_FUNCTION_TARGET_ASSIST (0x0B)
|
235 |
|
|
#define MPI_FUNCTION_TARGET_STATUS_SEND (0x0C)
|
236 |
|
|
#define MPI_FUNCTION_TARGET_MODE_ABORT (0x0D)
|
237 |
|
|
#define MPI_FUNCTION_TARGET_FC_BUF_POST_LINK_SRVC (0x0E) /* obsolete name */
|
238 |
|
|
#define MPI_FUNCTION_TARGET_FC_RSP_LINK_SRVC (0x0F) /* obsolete name */
|
239 |
|
|
#define MPI_FUNCTION_TARGET_FC_EX_SEND_LINK_SRVC (0x10) /* obsolete name */
|
240 |
|
|
#define MPI_FUNCTION_TARGET_FC_ABORT (0x11) /* obsolete name */
|
241 |
|
|
#define MPI_FUNCTION_FC_LINK_SRVC_BUF_POST (0x0E)
|
242 |
|
|
#define MPI_FUNCTION_FC_LINK_SRVC_RSP (0x0F)
|
243 |
|
|
#define MPI_FUNCTION_FC_EX_LINK_SRVC_SEND (0x10)
|
244 |
|
|
#define MPI_FUNCTION_FC_ABORT (0x11)
|
245 |
|
|
#define MPI_FUNCTION_FW_UPLOAD (0x12)
|
246 |
|
|
#define MPI_FUNCTION_FC_COMMON_TRANSPORT_SEND (0x13)
|
247 |
|
|
#define MPI_FUNCTION_FC_PRIMITIVE_SEND (0x14)
|
248 |
|
|
|
249 |
|
|
#define MPI_FUNCTION_RAID_ACTION (0x15)
|
250 |
|
|
#define MPI_FUNCTION_RAID_SCSI_IO_PASSTHROUGH (0x16)
|
251 |
|
|
|
252 |
|
|
#define MPI_FUNCTION_TOOLBOX (0x17)
|
253 |
|
|
|
254 |
|
|
#define MPI_FUNCTION_SCSI_ENCLOSURE_PROCESSOR (0x18)
|
255 |
|
|
|
256 |
|
|
#define MPI_FUNCTION_MAILBOX (0x19)
|
257 |
|
|
|
258 |
|
|
#define MPI_FUNCTION_LAN_SEND (0x20)
|
259 |
|
|
#define MPI_FUNCTION_LAN_RECEIVE (0x21)
|
260 |
|
|
#define MPI_FUNCTION_LAN_RESET (0x22)
|
261 |
|
|
|
262 |
|
|
#define MPI_FUNCTION_IOC_MESSAGE_UNIT_RESET (0x40)
|
263 |
|
|
#define MPI_FUNCTION_IO_UNIT_RESET (0x41)
|
264 |
|
|
#define MPI_FUNCTION_HANDSHAKE (0x42)
|
265 |
|
|
#define MPI_FUNCTION_REPLY_FRAME_REMOVAL (0x43)
|
266 |
|
|
|
267 |
|
|
|
268 |
|
|
|
269 |
|
|
/*****************************************************************************
|
270 |
|
|
*
|
271 |
|
|
* S c a t t e r G a t h e r E l e m e n t s
|
272 |
|
|
*
|
273 |
|
|
*****************************************************************************/
|
274 |
|
|
|
275 |
|
|
/****************************************************************************/
|
276 |
|
|
/* Simple element structures */
|
277 |
|
|
/****************************************************************************/
|
278 |
|
|
|
279 |
|
|
typedef struct _SGE_SIMPLE32
|
280 |
|
|
{
|
281 |
|
|
U32 FlagsLength;
|
282 |
|
|
U32 Address;
|
283 |
|
|
} SGE_SIMPLE32, MPI_POINTER PTR_SGE_SIMPLE32,
|
284 |
|
|
SGESimple32_t, MPI_POINTER pSGESimple32_t;
|
285 |
|
|
|
286 |
|
|
typedef struct _SGE_SIMPLE64
|
287 |
|
|
{
|
288 |
|
|
U32 FlagsLength;
|
289 |
|
|
U64 Address;
|
290 |
|
|
} SGE_SIMPLE64, MPI_POINTER PTR_SGE_SIMPLE64,
|
291 |
|
|
SGESimple64_t, MPI_POINTER pSGESimple64_t;
|
292 |
|
|
|
293 |
|
|
typedef struct _SGE_SIMPLE_UNION
|
294 |
|
|
{
|
295 |
|
|
U32 FlagsLength;
|
296 |
|
|
union
|
297 |
|
|
{
|
298 |
|
|
U32 Address32;
|
299 |
|
|
U64 Address64;
|
300 |
|
|
}u;
|
301 |
|
|
} SGESimpleUnion_t, MPI_POINTER pSGESimpleUnion_t,
|
302 |
|
|
SGE_SIMPLE_UNION, MPI_POINTER PTR_SGE_SIMPLE_UNION;
|
303 |
|
|
|
304 |
|
|
/****************************************************************************/
|
305 |
|
|
/* Chain element structures */
|
306 |
|
|
/****************************************************************************/
|
307 |
|
|
|
308 |
|
|
typedef struct _SGE_CHAIN32
|
309 |
|
|
{
|
310 |
|
|
U16 Length;
|
311 |
|
|
U8 NextChainOffset;
|
312 |
|
|
U8 Flags;
|
313 |
|
|
U32 Address;
|
314 |
|
|
} SGE_CHAIN32, MPI_POINTER PTR_SGE_CHAIN32,
|
315 |
|
|
SGEChain32_t, MPI_POINTER pSGEChain32_t;
|
316 |
|
|
|
317 |
|
|
typedef struct _SGE_CHAIN64
|
318 |
|
|
{
|
319 |
|
|
U16 Length;
|
320 |
|
|
U8 NextChainOffset;
|
321 |
|
|
U8 Flags;
|
322 |
|
|
U64 Address;
|
323 |
|
|
} SGE_CHAIN64, MPI_POINTER PTR_SGE_CHAIN64,
|
324 |
|
|
SGEChain64_t, MPI_POINTER pSGEChain64_t;
|
325 |
|
|
|
326 |
|
|
typedef struct _SGE_CHAIN_UNION
|
327 |
|
|
{
|
328 |
|
|
U16 Length;
|
329 |
|
|
U8 NextChainOffset;
|
330 |
|
|
U8 Flags;
|
331 |
|
|
union
|
332 |
|
|
{
|
333 |
|
|
U32 Address32;
|
334 |
|
|
U64 Address64;
|
335 |
|
|
}u;
|
336 |
|
|
} SGE_CHAIN_UNION, MPI_POINTER PTR_SGE_CHAIN_UNION,
|
337 |
|
|
SGEChainUnion_t, MPI_POINTER pSGEChainUnion_t;
|
338 |
|
|
|
339 |
|
|
/****************************************************************************/
|
340 |
|
|
/* Transaction Context element */
|
341 |
|
|
/****************************************************************************/
|
342 |
|
|
|
343 |
|
|
typedef struct _SGE_TRANSACTION32
|
344 |
|
|
{
|
345 |
|
|
U8 Reserved;
|
346 |
|
|
U8 ContextSize;
|
347 |
|
|
U8 DetailsLength;
|
348 |
|
|
U8 Flags;
|
349 |
|
|
U32 TransactionContext[1];
|
350 |
|
|
U32 TransactionDetails[1];
|
351 |
|
|
} SGE_TRANSACTION32, MPI_POINTER PTR_SGE_TRANSACTION32,
|
352 |
|
|
SGETransaction32_t, MPI_POINTER pSGETransaction32_t;
|
353 |
|
|
|
354 |
|
|
typedef struct _SGE_TRANSACTION64
|
355 |
|
|
{
|
356 |
|
|
U8 Reserved;
|
357 |
|
|
U8 ContextSize;
|
358 |
|
|
U8 DetailsLength;
|
359 |
|
|
U8 Flags;
|
360 |
|
|
U32 TransactionContext[2];
|
361 |
|
|
U32 TransactionDetails[1];
|
362 |
|
|
} SGE_TRANSACTION64, MPI_POINTER PTR_SGE_TRANSACTION64,
|
363 |
|
|
SGETransaction64_t, MPI_POINTER pSGETransaction64_t;
|
364 |
|
|
|
365 |
|
|
typedef struct _SGE_TRANSACTION96
|
366 |
|
|
{
|
367 |
|
|
U8 Reserved;
|
368 |
|
|
U8 ContextSize;
|
369 |
|
|
U8 DetailsLength;
|
370 |
|
|
U8 Flags;
|
371 |
|
|
U32 TransactionContext[3];
|
372 |
|
|
U32 TransactionDetails[1];
|
373 |
|
|
} SGE_TRANSACTION96, MPI_POINTER PTR_SGE_TRANSACTION96,
|
374 |
|
|
SGETransaction96_t, MPI_POINTER pSGETransaction96_t;
|
375 |
|
|
|
376 |
|
|
typedef struct _SGE_TRANSACTION128
|
377 |
|
|
{
|
378 |
|
|
U8 Reserved;
|
379 |
|
|
U8 ContextSize;
|
380 |
|
|
U8 DetailsLength;
|
381 |
|
|
U8 Flags;
|
382 |
|
|
U32 TransactionContext[4];
|
383 |
|
|
U32 TransactionDetails[1];
|
384 |
|
|
} SGE_TRANSACTION128, MPI_POINTER PTR_SGE_TRANSACTION128,
|
385 |
|
|
SGETransaction_t128, MPI_POINTER pSGETransaction_t128;
|
386 |
|
|
|
387 |
|
|
typedef struct _SGE_TRANSACTION_UNION
|
388 |
|
|
{
|
389 |
|
|
U8 Reserved;
|
390 |
|
|
U8 ContextSize;
|
391 |
|
|
U8 DetailsLength;
|
392 |
|
|
U8 Flags;
|
393 |
|
|
union
|
394 |
|
|
{
|
395 |
|
|
U32 TransactionContext32[1];
|
396 |
|
|
U32 TransactionContext64[2];
|
397 |
|
|
U32 TransactionContext96[3];
|
398 |
|
|
U32 TransactionContext128[4];
|
399 |
|
|
}u;
|
400 |
|
|
U32 TransactionDetails[1];
|
401 |
|
|
} SGE_TRANSACTION_UNION, MPI_POINTER PTR_SGE_TRANSACTION_UNION,
|
402 |
|
|
SGETransactionUnion_t, MPI_POINTER pSGETransactionUnion_t;
|
403 |
|
|
|
404 |
|
|
|
405 |
|
|
/****************************************************************************/
|
406 |
|
|
/* SGE IO types union for IO SGL's */
|
407 |
|
|
/****************************************************************************/
|
408 |
|
|
|
409 |
|
|
typedef struct _SGE_IO_UNION
|
410 |
|
|
{
|
411 |
|
|
union
|
412 |
|
|
{
|
413 |
|
|
SGE_SIMPLE_UNION Simple;
|
414 |
|
|
SGE_CHAIN_UNION Chain;
|
415 |
|
|
} u;
|
416 |
|
|
} SGE_IO_UNION, MPI_POINTER PTR_SGE_IO_UNION,
|
417 |
|
|
SGEIOUnion_t, MPI_POINTER pSGEIOUnion_t;
|
418 |
|
|
|
419 |
|
|
/****************************************************************************/
|
420 |
|
|
/* SGE union for SGL's with Simple and Transaction elements */
|
421 |
|
|
/****************************************************************************/
|
422 |
|
|
|
423 |
|
|
typedef struct _SGE_TRANS_SIMPLE_UNION
|
424 |
|
|
{
|
425 |
|
|
union
|
426 |
|
|
{
|
427 |
|
|
SGE_SIMPLE_UNION Simple;
|
428 |
|
|
SGE_TRANSACTION_UNION Transaction;
|
429 |
|
|
} u;
|
430 |
|
|
} SGE_TRANS_SIMPLE_UNION, MPI_POINTER PTR_SGE_TRANS_SIMPLE_UNION,
|
431 |
|
|
SGETransSimpleUnion_t, MPI_POINTER pSGETransSimpleUnion_t;
|
432 |
|
|
|
433 |
|
|
/****************************************************************************/
|
434 |
|
|
/* All SGE types union */
|
435 |
|
|
/****************************************************************************/
|
436 |
|
|
|
437 |
|
|
typedef struct _SGE_MPI_UNION
|
438 |
|
|
{
|
439 |
|
|
union
|
440 |
|
|
{
|
441 |
|
|
SGE_SIMPLE_UNION Simple;
|
442 |
|
|
SGE_CHAIN_UNION Chain;
|
443 |
|
|
SGE_TRANSACTION_UNION Transaction;
|
444 |
|
|
} u;
|
445 |
|
|
} SGE_MPI_UNION, MPI_POINTER PTR_SGE_MPI_UNION,
|
446 |
|
|
MPI_SGE_UNION_t, MPI_POINTER pMPI_SGE_UNION_t,
|
447 |
|
|
SGEAllUnion_t, MPI_POINTER pSGEAllUnion_t;
|
448 |
|
|
|
449 |
|
|
|
450 |
|
|
/****************************************************************************/
|
451 |
|
|
/* SGE field definition and masks */
|
452 |
|
|
/****************************************************************************/
|
453 |
|
|
|
454 |
|
|
/* Flags field bit definitions */
|
455 |
|
|
|
456 |
|
|
#define MPI_SGE_FLAGS_LAST_ELEMENT (0x80)
|
457 |
|
|
#define MPI_SGE_FLAGS_END_OF_BUFFER (0x40)
|
458 |
|
|
#define MPI_SGE_FLAGS_ELEMENT_TYPE_MASK (0x30)
|
459 |
|
|
#define MPI_SGE_FLAGS_LOCAL_ADDRESS (0x08)
|
460 |
|
|
#define MPI_SGE_FLAGS_DIRECTION (0x04)
|
461 |
|
|
#define MPI_SGE_FLAGS_ADDRESS_SIZE (0x02)
|
462 |
|
|
#define MPI_SGE_FLAGS_END_OF_LIST (0x01)
|
463 |
|
|
|
464 |
|
|
#define MPI_SGE_FLAGS_SHIFT (24)
|
465 |
|
|
|
466 |
|
|
#define MPI_SGE_LENGTH_MASK (0x00FFFFFF)
|
467 |
|
|
#define MPI_SGE_CHAIN_LENGTH_MASK (0x0000FFFF)
|
468 |
|
|
|
469 |
|
|
/* Element Type */
|
470 |
|
|
|
471 |
|
|
#define MPI_SGE_FLAGS_TRANSACTION_ELEMENT (0x00)
|
472 |
|
|
#define MPI_SGE_FLAGS_SIMPLE_ELEMENT (0x10)
|
473 |
|
|
#define MPI_SGE_FLAGS_CHAIN_ELEMENT (0x30)
|
474 |
|
|
#define MPI_SGE_FLAGS_ELEMENT_MASK (0x30)
|
475 |
|
|
|
476 |
|
|
/* Address location */
|
477 |
|
|
|
478 |
|
|
#define MPI_SGE_FLAGS_SYSTEM_ADDRESS (0x00)
|
479 |
|
|
|
480 |
|
|
/* Direction */
|
481 |
|
|
|
482 |
|
|
#define MPI_SGE_FLAGS_IOC_TO_HOST (0x00)
|
483 |
|
|
#define MPI_SGE_FLAGS_HOST_TO_IOC (0x04)
|
484 |
|
|
|
485 |
|
|
/* Address Size */
|
486 |
|
|
|
487 |
|
|
#define MPI_SGE_FLAGS_32_BIT_ADDRESSING (0x00)
|
488 |
|
|
#define MPI_SGE_FLAGS_64_BIT_ADDRESSING (0x02)
|
489 |
|
|
|
490 |
|
|
/* Context Size */
|
491 |
|
|
|
492 |
|
|
#define MPI_SGE_FLAGS_32_BIT_CONTEXT (0x00)
|
493 |
|
|
#define MPI_SGE_FLAGS_64_BIT_CONTEXT (0x02)
|
494 |
|
|
#define MPI_SGE_FLAGS_96_BIT_CONTEXT (0x04)
|
495 |
|
|
#define MPI_SGE_FLAGS_128_BIT_CONTEXT (0x06)
|
496 |
|
|
|
497 |
|
|
#define MPI_SGE_CHAIN_OFFSET_MASK (0x00FF0000)
|
498 |
|
|
#define MPI_SGE_CHAIN_OFFSET_SHIFT (16)
|
499 |
|
|
|
500 |
|
|
|
501 |
|
|
/****************************************************************************/
|
502 |
|
|
/* SGE operation Macros */
|
503 |
|
|
/****************************************************************************/
|
504 |
|
|
|
505 |
|
|
/* SIMPLE FlagsLength manipulations... */
|
506 |
|
|
#define MPI_SGE_SET_FLAGS(f) ((U32)(f) << MPI_SGE_FLAGS_SHIFT)
|
507 |
|
|
#define MPI_SGE_GET_FLAGS(fl) (((fl) & ~MPI_SGE_LENGTH_MASK) >> MPI_SGE_FLAGS_SHIFT)
|
508 |
|
|
#define MPI_SGE_LENGTH(fl) ((fl) & MPI_SGE_LENGTH_MASK)
|
509 |
|
|
#define MPI_SGE_CHAIN_LENGTH(fl) ((fl) & MPI_SGE_CHAIN_LENGTH_MASK)
|
510 |
|
|
|
511 |
|
|
#define MPI_SGE_SET_FLAGS_LENGTH(f,l) (MPI_SGE_SET_FLAGS(f) | MPI_SGE_LENGTH(l))
|
512 |
|
|
|
513 |
|
|
#define MPI_pSGE_GET_FLAGS(psg) MPI_SGE_GET_FLAGS((psg)->FlagsLength)
|
514 |
|
|
#define MPI_pSGE_GET_LENGTH(psg) MPI_SGE_LENGTH((psg)->FlagsLength)
|
515 |
|
|
#define MPI_pSGE_SET_FLAGS_LENGTH(psg,f,l) (psg)->FlagsLength = MPI_SGE_SET_FLAGS_LENGTH(f,l)
|
516 |
|
|
/* CAUTION - The following are READ-MODIFY-WRITE! */
|
517 |
|
|
#define MPI_pSGE_SET_FLAGS(psg,f) (psg)->FlagsLength |= MPI_SGE_SET_FLAGS(f)
|
518 |
|
|
#define MPI_pSGE_SET_LENGTH(psg,l) (psg)->FlagsLength |= MPI_SGE_LENGTH(l)
|
519 |
|
|
|
520 |
|
|
#define MPI_GET_CHAIN_OFFSET(x) ((x&MPI_SGE_CHAIN_OFFSET_MASK)>>MPI_SGE_CHAIN_OFFSET_SHIFT)
|
521 |
|
|
|
522 |
|
|
|
523 |
|
|
|
524 |
|
|
/*****************************************************************************
|
525 |
|
|
*
|
526 |
|
|
* S t a n d a r d M e s s a g e S t r u c t u r e s
|
527 |
|
|
*
|
528 |
|
|
*****************************************************************************/
|
529 |
|
|
|
530 |
|
|
/****************************************************************************/
|
531 |
|
|
/* Standard message request header for all request messages */
|
532 |
|
|
/****************************************************************************/
|
533 |
|
|
|
534 |
|
|
typedef struct _MSG_REQUEST_HEADER
|
535 |
|
|
{
|
536 |
|
|
U8 Reserved[2]; /* function specific */
|
537 |
|
|
U8 ChainOffset;
|
538 |
|
|
U8 Function;
|
539 |
|
|
U8 Reserved1[3]; /* function specific */
|
540 |
|
|
U8 MsgFlags;
|
541 |
|
|
U32 MsgContext;
|
542 |
|
|
} MSG_REQUEST_HEADER, MPI_POINTER PTR_MSG_REQUEST_HEADER,
|
543 |
|
|
MPIHeader_t, MPI_POINTER pMPIHeader_t;
|
544 |
|
|
|
545 |
|
|
|
546 |
|
|
/****************************************************************************/
|
547 |
|
|
/* Default Reply */
|
548 |
|
|
/****************************************************************************/
|
549 |
|
|
|
550 |
|
|
typedef struct _MSG_DEFAULT_REPLY
|
551 |
|
|
{
|
552 |
|
|
U8 Reserved[2]; /* function specific */
|
553 |
|
|
U8 MsgLength;
|
554 |
|
|
U8 Function;
|
555 |
|
|
U8 Reserved1[3]; /* function specific */
|
556 |
|
|
U8 MsgFlags;
|
557 |
|
|
U32 MsgContext;
|
558 |
|
|
U8 Reserved2[2]; /* function specific */
|
559 |
|
|
U16 IOCStatus;
|
560 |
|
|
U32 IOCLogInfo;
|
561 |
|
|
} MSG_DEFAULT_REPLY, MPI_POINTER PTR_MSG_DEFAULT_REPLY,
|
562 |
|
|
MPIDefaultReply_t, MPI_POINTER pMPIDefaultReply_t;
|
563 |
|
|
|
564 |
|
|
|
565 |
|
|
/* MsgFlags definition for all replies */
|
566 |
|
|
|
567 |
|
|
#define MPI_MSGFLAGS_CONTINUATION_REPLY (0x80)
|
568 |
|
|
|
569 |
|
|
|
570 |
|
|
/*****************************************************************************
|
571 |
|
|
*
|
572 |
|
|
* I O C S t a t u s V a l u e s
|
573 |
|
|
*
|
574 |
|
|
*****************************************************************************/
|
575 |
|
|
|
576 |
|
|
/****************************************************************************/
|
577 |
|
|
/* Common IOCStatus values for all replies */
|
578 |
|
|
/****************************************************************************/
|
579 |
|
|
|
580 |
|
|
#define MPI_IOCSTATUS_SUCCESS (0x0000)
|
581 |
|
|
#define MPI_IOCSTATUS_INVALID_FUNCTION (0x0001)
|
582 |
|
|
#define MPI_IOCSTATUS_BUSY (0x0002)
|
583 |
|
|
#define MPI_IOCSTATUS_INVALID_SGL (0x0003)
|
584 |
|
|
#define MPI_IOCSTATUS_INTERNAL_ERROR (0x0004)
|
585 |
|
|
#define MPI_IOCSTATUS_RESERVED (0x0005)
|
586 |
|
|
#define MPI_IOCSTATUS_INSUFFICIENT_RESOURCES (0x0006)
|
587 |
|
|
#define MPI_IOCSTATUS_INVALID_FIELD (0x0007)
|
588 |
|
|
#define MPI_IOCSTATUS_INVALID_STATE (0x0008)
|
589 |
|
|
|
590 |
|
|
/****************************************************************************/
|
591 |
|
|
/* Config IOCStatus values */
|
592 |
|
|
/****************************************************************************/
|
593 |
|
|
|
594 |
|
|
#define MPI_IOCSTATUS_CONFIG_INVALID_ACTION (0x0020)
|
595 |
|
|
#define MPI_IOCSTATUS_CONFIG_INVALID_TYPE (0x0021)
|
596 |
|
|
#define MPI_IOCSTATUS_CONFIG_INVALID_PAGE (0x0022)
|
597 |
|
|
#define MPI_IOCSTATUS_CONFIG_INVALID_DATA (0x0023)
|
598 |
|
|
#define MPI_IOCSTATUS_CONFIG_NO_DEFAULTS (0x0024)
|
599 |
|
|
#define MPI_IOCSTATUS_CONFIG_CANT_COMMIT (0x0025)
|
600 |
|
|
|
601 |
|
|
/****************************************************************************/
|
602 |
|
|
/* SCSIIO Reply (SPI & FCP) initiator values */
|
603 |
|
|
/****************************************************************************/
|
604 |
|
|
|
605 |
|
|
#define MPI_IOCSTATUS_SCSI_RECOVERED_ERROR (0x0040)
|
606 |
|
|
#define MPI_IOCSTATUS_SCSI_INVALID_BUS (0x0041)
|
607 |
|
|
#define MPI_IOCSTATUS_SCSI_INVALID_TARGETID (0x0042)
|
608 |
|
|
#define MPI_IOCSTATUS_SCSI_DEVICE_NOT_THERE (0x0043)
|
609 |
|
|
#define MPI_IOCSTATUS_SCSI_DATA_OVERRUN (0x0044)
|
610 |
|
|
#define MPI_IOCSTATUS_SCSI_DATA_UNDERRUN (0x0045)
|
611 |
|
|
#define MPI_IOCSTATUS_SCSI_IO_DATA_ERROR (0x0046)
|
612 |
|
|
#define MPI_IOCSTATUS_SCSI_PROTOCOL_ERROR (0x0047)
|
613 |
|
|
#define MPI_IOCSTATUS_SCSI_TASK_TERMINATED (0x0048)
|
614 |
|
|
#define MPI_IOCSTATUS_SCSI_RESIDUAL_MISMATCH (0x0049)
|
615 |
|
|
#define MPI_IOCSTATUS_SCSI_TASK_MGMT_FAILED (0x004A)
|
616 |
|
|
#define MPI_IOCSTATUS_SCSI_IOC_TERMINATED (0x004B)
|
617 |
|
|
#define MPI_IOCSTATUS_SCSI_EXT_TERMINATED (0x004C)
|
618 |
|
|
|
619 |
|
|
/****************************************************************************/
|
620 |
|
|
/* SCSI (SPI & FCP) target values */
|
621 |
|
|
/****************************************************************************/
|
622 |
|
|
|
623 |
|
|
#define MPI_IOCSTATUS_TARGET_PRIORITY_IO (0x0060)
|
624 |
|
|
#define MPI_IOCSTATUS_TARGET_INVALID_PORT (0x0061)
|
625 |
|
|
#define MPI_IOCSTATUS_TARGET_INVALID_IOCINDEX (0x0062) /* obsolete */
|
626 |
|
|
#define MPI_IOCSTATUS_TARGET_INVALID_IO_INDEX (0x0062)
|
627 |
|
|
#define MPI_IOCSTATUS_TARGET_ABORTED (0x0063)
|
628 |
|
|
#define MPI_IOCSTATUS_TARGET_NO_CONN_RETRYABLE (0x0064)
|
629 |
|
|
#define MPI_IOCSTATUS_TARGET_NO_CONNECTION (0x0065)
|
630 |
|
|
#define MPI_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH (0x006A)
|
631 |
|
|
#define MPI_IOCSTATUS_TARGET_STS_DATA_NOT_SENT (0x006B)
|
632 |
|
|
|
633 |
|
|
/****************************************************************************/
|
634 |
|
|
/* Additional FCP target values */
|
635 |
|
|
/****************************************************************************/
|
636 |
|
|
|
637 |
|
|
#define MPI_IOCSTATUS_TARGET_FC_ABORTED (0x0066) /* obsolete */
|
638 |
|
|
#define MPI_IOCSTATUS_TARGET_FC_RX_ID_INVALID (0x0067) /* obsolete */
|
639 |
|
|
#define MPI_IOCSTATUS_TARGET_FC_DID_INVALID (0x0068) /* obsolete */
|
640 |
|
|
#define MPI_IOCSTATUS_TARGET_FC_NODE_LOGGED_OUT (0x0069) /* obsolete */
|
641 |
|
|
|
642 |
|
|
/****************************************************************************/
|
643 |
|
|
/* Fibre Channel Direct Access values */
|
644 |
|
|
/****************************************************************************/
|
645 |
|
|
|
646 |
|
|
#define MPI_IOCSTATUS_FC_ABORTED (0x0066)
|
647 |
|
|
#define MPI_IOCSTATUS_FC_RX_ID_INVALID (0x0067)
|
648 |
|
|
#define MPI_IOCSTATUS_FC_DID_INVALID (0x0068)
|
649 |
|
|
#define MPI_IOCSTATUS_FC_NODE_LOGGED_OUT (0x0069)
|
650 |
|
|
#define MPI_IOCSTATUS_FC_EXCHANGE_CANCELED (0x006C)
|
651 |
|
|
|
652 |
|
|
/****************************************************************************/
|
653 |
|
|
/* LAN values */
|
654 |
|
|
/****************************************************************************/
|
655 |
|
|
|
656 |
|
|
#define MPI_IOCSTATUS_LAN_DEVICE_NOT_FOUND (0x0080)
|
657 |
|
|
#define MPI_IOCSTATUS_LAN_DEVICE_FAILURE (0x0081)
|
658 |
|
|
#define MPI_IOCSTATUS_LAN_TRANSMIT_ERROR (0x0082)
|
659 |
|
|
#define MPI_IOCSTATUS_LAN_TRANSMIT_ABORTED (0x0083)
|
660 |
|
|
#define MPI_IOCSTATUS_LAN_RECEIVE_ERROR (0x0084)
|
661 |
|
|
#define MPI_IOCSTATUS_LAN_RECEIVE_ABORTED (0x0085)
|
662 |
|
|
#define MPI_IOCSTATUS_LAN_PARTIAL_PACKET (0x0086)
|
663 |
|
|
#define MPI_IOCSTATUS_LAN_CANCELED (0x0087)
|
664 |
|
|
|
665 |
|
|
|
666 |
|
|
/****************************************************************************/
|
667 |
|
|
/* IOCStatus flag to indicate that log info is available */
|
668 |
|
|
/****************************************************************************/
|
669 |
|
|
|
670 |
|
|
#define MPI_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE (0x8000)
|
671 |
|
|
#define MPI_IOCSTATUS_MASK (0x7FFF)
|
672 |
|
|
|
673 |
|
|
/****************************************************************************/
|
674 |
|
|
/* LogInfo Types */
|
675 |
|
|
/****************************************************************************/
|
676 |
|
|
|
677 |
|
|
#define MPI_IOCLOGINFO_TYPE_MASK (0xF0000000)
|
678 |
|
|
#define MPI_IOCLOGINFO_TYPE_NONE (0x0)
|
679 |
|
|
#define MPI_IOCLOGINFO_TYPE_SCSI (0x1)
|
680 |
|
|
#define MPI_IOCLOGINFO_TYPE_FC (0x2)
|
681 |
|
|
#define MPI_IOCLOGINFO_LOG_DATA_MASK (0x0FFFFFFF)
|
682 |
|
|
|
683 |
|
|
|
684 |
|
|
#endif
|