xref: /freebsd/sys/dev/mps/mpi/mpi2.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1d043c564SKenneth D. Merry /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3718cf2ccSPedro F. Giffuni  *
4ef065d89SStephen McConnell  * Copyright (c) 2006-2015 LSI Corp.
5ef065d89SStephen McConnell  * Copyright (c) 2013-2015 Avago Technologies
6d043c564SKenneth D. Merry  * All rights reserved.
7d043c564SKenneth D. Merry  *
8d043c564SKenneth D. Merry  * Redistribution and use in source and binary forms, with or without
9d043c564SKenneth D. Merry  * modification, are permitted provided that the following conditions
10d043c564SKenneth D. Merry  * are met:
11d043c564SKenneth D. Merry  * 1. Redistributions of source code must retain the above copyright
12d043c564SKenneth D. Merry  *    notice, this list of conditions and the following disclaimer.
13d043c564SKenneth D. Merry  * 2. Redistributions in binary form must reproduce the above copyright
14d043c564SKenneth D. Merry  *    notice, this list of conditions and the following disclaimer in the
15d043c564SKenneth D. Merry  *    documentation and/or other materials provided with the distribution.
16d043c564SKenneth D. Merry  *
17d043c564SKenneth D. Merry  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18d043c564SKenneth D. Merry  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19d043c564SKenneth D. Merry  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20d043c564SKenneth D. Merry  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21d043c564SKenneth D. Merry  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22d043c564SKenneth D. Merry  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23d043c564SKenneth D. Merry  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24d043c564SKenneth D. Merry  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25d043c564SKenneth D. Merry  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26d043c564SKenneth D. Merry  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27d043c564SKenneth D. Merry  * SUCH DAMAGE.
28d043c564SKenneth D. Merry  *
29ef065d89SStephen McConnell  * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
30d043c564SKenneth D. Merry  */
31d043c564SKenneth D. Merry 
32d3c7b9a0SKenneth D. Merry /*
33ef065d89SStephen McConnell  *  Copyright (c) 2006-2015 LSI Corporation.
34ef065d89SStephen McConnell  *  Copyright (c) 2013-2015 Avago Technologies
35d3c7b9a0SKenneth D. Merry  *
36d3c7b9a0SKenneth D. Merry  *
37d3c7b9a0SKenneth D. Merry  *           Name:  mpi2.h
38d3c7b9a0SKenneth D. Merry  *          Title:  MPI Message independent structures and definitions
39d3c7b9a0SKenneth D. Merry  *                  including System Interface Register Set and
40d3c7b9a0SKenneth D. Merry  *                  scatter/gather formats.
41d3c7b9a0SKenneth D. Merry  *  Creation Date:  June 21, 2006
42d3c7b9a0SKenneth D. Merry  *
43d043c564SKenneth D. Merry  *  mpi2.h Version:  02.00.18
44d3c7b9a0SKenneth D. Merry  *
45d3c7b9a0SKenneth D. Merry  *  Version History
46d3c7b9a0SKenneth D. Merry  *  ---------------
47d3c7b9a0SKenneth D. Merry  *
48d3c7b9a0SKenneth D. Merry  *  Date      Version   Description
49d3c7b9a0SKenneth D. Merry  *  --------  --------  ------------------------------------------------------
50d3c7b9a0SKenneth D. Merry  *  04-30-07  02.00.00  Corresponds to Fusion-MPT MPI Specification Rev A.
51d3c7b9a0SKenneth D. Merry  *  06-04-07  02.00.01  Bumped MPI2_HEADER_VERSION_UNIT.
52d3c7b9a0SKenneth D. Merry  *  06-26-07  02.00.02  Bumped MPI2_HEADER_VERSION_UNIT.
53d3c7b9a0SKenneth D. Merry  *  08-31-07  02.00.03  Bumped MPI2_HEADER_VERSION_UNIT.
54d3c7b9a0SKenneth D. Merry  *                      Moved ReplyPostHostIndex register to offset 0x6C of the
55d3c7b9a0SKenneth D. Merry  *                      MPI2_SYSTEM_INTERFACE_REGS and modified the define for
56d3c7b9a0SKenneth D. Merry  *                      MPI2_REPLY_POST_HOST_INDEX_OFFSET.
57d3c7b9a0SKenneth D. Merry  *                      Added union of request descriptors.
58d3c7b9a0SKenneth D. Merry  *                      Added union of reply descriptors.
59d3c7b9a0SKenneth D. Merry  *  10-31-07  02.00.04  Bumped MPI2_HEADER_VERSION_UNIT.
60d3c7b9a0SKenneth D. Merry  *                      Added define for MPI2_VERSION_02_00.
61d3c7b9a0SKenneth D. Merry  *                      Fixed the size of the FunctionDependent5 field in the
62d3c7b9a0SKenneth D. Merry  *                      MPI2_DEFAULT_REPLY structure.
63d3c7b9a0SKenneth D. Merry  *  12-18-07  02.00.05  Bumped MPI2_HEADER_VERSION_UNIT.
64d3c7b9a0SKenneth D. Merry  *                      Removed the MPI-defined Fault Codes and extended the
65d3c7b9a0SKenneth D. Merry  *                      product specific codes up to 0xEFFF.
66d3c7b9a0SKenneth D. Merry  *                      Added a sixth key value for the WriteSequence register
67d3c7b9a0SKenneth D. Merry  *                      and changed the flush value to 0x0.
68d3c7b9a0SKenneth D. Merry  *                      Added message function codes for Diagnostic Buffer Post
69d3c7b9a0SKenneth D. Merry  *                      and Diagnsotic Release.
70d3c7b9a0SKenneth D. Merry  *                      New IOCStatus define: MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED
71d3c7b9a0SKenneth D. Merry  *                      Moved MPI2_VERSION_UNION from mpi2_ioc.h.
72d3c7b9a0SKenneth D. Merry  *  02-29-08  02.00.06  Bumped MPI2_HEADER_VERSION_UNIT.
73d3c7b9a0SKenneth D. Merry  *  03-03-08  02.00.07  Bumped MPI2_HEADER_VERSION_UNIT.
74d3c7b9a0SKenneth D. Merry  *  05-21-08  02.00.08  Bumped MPI2_HEADER_VERSION_UNIT.
75d3c7b9a0SKenneth D. Merry  *                      Added #defines for marking a reply descriptor as unused.
76d3c7b9a0SKenneth D. Merry  *  06-27-08  02.00.09  Bumped MPI2_HEADER_VERSION_UNIT.
77d3c7b9a0SKenneth D. Merry  *  10-02-08  02.00.10  Bumped MPI2_HEADER_VERSION_UNIT.
78d3c7b9a0SKenneth D. Merry  *                      Moved LUN field defines from mpi2_init.h.
79d3c7b9a0SKenneth D. Merry  *  01-19-09  02.00.11  Bumped MPI2_HEADER_VERSION_UNIT.
80d3c7b9a0SKenneth D. Merry  *  05-06-09  02.00.12  Bumped MPI2_HEADER_VERSION_UNIT.
81d3c7b9a0SKenneth D. Merry  *                      In all request and reply descriptors, replaced VF_ID
82d3c7b9a0SKenneth D. Merry  *                      field with MSIxIndex field.
83d3c7b9a0SKenneth D. Merry  *                      Removed DevHandle field from
84d3c7b9a0SKenneth D. Merry  *                      MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR and made those
85d3c7b9a0SKenneth D. Merry  *                      bytes reserved.
86d3c7b9a0SKenneth D. Merry  *                      Added RAID Accelerator functionality.
87d3c7b9a0SKenneth D. Merry  *  07-30-09  02.00.13  Bumped MPI2_HEADER_VERSION_UNIT.
88d3c7b9a0SKenneth D. Merry  *  10-28-09  02.00.14  Bumped MPI2_HEADER_VERSION_UNIT.
89d3c7b9a0SKenneth D. Merry  *                      Added MSI-x index mask and shift for Reply Post Host
90d3c7b9a0SKenneth D. Merry  *                      Index register.
91d3c7b9a0SKenneth D. Merry  *                      Added function code for Host Based Discovery Action.
92d043c564SKenneth D. Merry  *  02-10-10  02.00.15  Bumped MPI2_HEADER_VERSION_UNIT.
93d043c564SKenneth D. Merry  *                      Added define for MPI2_FUNCTION_PWR_MGMT_CONTROL.
94d043c564SKenneth D. Merry  *                      Added defines for product-specific range of message
95d043c564SKenneth D. Merry  *                      function codes, 0xF0 to 0xFF.
96d043c564SKenneth D. Merry  *  05-12-10  02.00.16  Bumped MPI2_HEADER_VERSION_UNIT.
97d043c564SKenneth D. Merry  *                      Added alternative defines for the SGE Direction bit.
98d043c564SKenneth D. Merry  *  08-11-10  02.00.17  Bumped MPI2_HEADER_VERSION_UNIT.
99d043c564SKenneth D. Merry  *  11-10-10  02.00.18  Bumped MPI2_HEADER_VERSION_UNIT.
100d043c564SKenneth D. Merry  *                      Added MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR define.
101d3c7b9a0SKenneth D. Merry  *  --------------------------------------------------------------------------
102d3c7b9a0SKenneth D. Merry  */
103d3c7b9a0SKenneth D. Merry 
104d3c7b9a0SKenneth D. Merry #ifndef MPI2_H
105d3c7b9a0SKenneth D. Merry #define MPI2_H
106d3c7b9a0SKenneth D. Merry 
107d3c7b9a0SKenneth D. Merry /*****************************************************************************
108d3c7b9a0SKenneth D. Merry *
109d3c7b9a0SKenneth D. Merry *        MPI Version Definitions
110d3c7b9a0SKenneth D. Merry *
111d3c7b9a0SKenneth D. Merry *****************************************************************************/
112d3c7b9a0SKenneth D. Merry 
113d3c7b9a0SKenneth D. Merry #define MPI2_VERSION_MAJOR                  (0x02)
114d3c7b9a0SKenneth D. Merry #define MPI2_VERSION_MINOR                  (0x00)
115d3c7b9a0SKenneth D. Merry #define MPI2_VERSION_MAJOR_MASK             (0xFF00)
116d3c7b9a0SKenneth D. Merry #define MPI2_VERSION_MAJOR_SHIFT            (8)
117d3c7b9a0SKenneth D. Merry #define MPI2_VERSION_MINOR_MASK             (0x00FF)
118d3c7b9a0SKenneth D. Merry #define MPI2_VERSION_MINOR_SHIFT            (0)
119d3c7b9a0SKenneth D. Merry #define MPI2_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) |   \
120d3c7b9a0SKenneth D. Merry                                       MPI2_VERSION_MINOR)
121d3c7b9a0SKenneth D. Merry 
122d3c7b9a0SKenneth D. Merry #define MPI2_VERSION_02_00                  (0x0200)
123d3c7b9a0SKenneth D. Merry 
124d3c7b9a0SKenneth D. Merry /* versioning for this MPI header set */
125d043c564SKenneth D. Merry #define MPI2_HEADER_VERSION_UNIT            (0x12)
126d3c7b9a0SKenneth D. Merry #define MPI2_HEADER_VERSION_DEV             (0x00)
127d3c7b9a0SKenneth D. Merry #define MPI2_HEADER_VERSION_UNIT_MASK       (0xFF00)
128d3c7b9a0SKenneth D. Merry #define MPI2_HEADER_VERSION_UNIT_SHIFT      (8)
129d3c7b9a0SKenneth D. Merry #define MPI2_HEADER_VERSION_DEV_MASK        (0x00FF)
130d3c7b9a0SKenneth D. Merry #define MPI2_HEADER_VERSION_DEV_SHIFT       (0)
131d3c7b9a0SKenneth D. Merry #define MPI2_HEADER_VERSION ((MPI2_HEADER_VERSION_UNIT << 8) | MPI2_HEADER_VERSION_DEV)
132d3c7b9a0SKenneth D. Merry 
133d3c7b9a0SKenneth D. Merry /*****************************************************************************
134d3c7b9a0SKenneth D. Merry *
135d3c7b9a0SKenneth D. Merry *        IOC State Definitions
136d3c7b9a0SKenneth D. Merry *
137d3c7b9a0SKenneth D. Merry *****************************************************************************/
138d3c7b9a0SKenneth D. Merry 
139d3c7b9a0SKenneth D. Merry #define MPI2_IOC_STATE_RESET               (0x00000000)
140d3c7b9a0SKenneth D. Merry #define MPI2_IOC_STATE_READY               (0x10000000)
141d3c7b9a0SKenneth D. Merry #define MPI2_IOC_STATE_OPERATIONAL         (0x20000000)
142d3c7b9a0SKenneth D. Merry #define MPI2_IOC_STATE_FAULT               (0x40000000)
143d3c7b9a0SKenneth D. Merry 
144d3c7b9a0SKenneth D. Merry #define MPI2_IOC_STATE_MASK                (0xF0000000)
145d3c7b9a0SKenneth D. Merry #define MPI2_IOC_STATE_SHIFT               (28)
146d3c7b9a0SKenneth D. Merry 
147d3c7b9a0SKenneth D. Merry /* Fault state range for prodcut specific codes */
148d3c7b9a0SKenneth D. Merry #define MPI2_FAULT_PRODUCT_SPECIFIC_MIN                 (0x0000)
149d3c7b9a0SKenneth D. Merry #define MPI2_FAULT_PRODUCT_SPECIFIC_MAX                 (0xEFFF)
150d3c7b9a0SKenneth D. Merry 
151d3c7b9a0SKenneth D. Merry /*****************************************************************************
152d3c7b9a0SKenneth D. Merry *
153d3c7b9a0SKenneth D. Merry *        System Interface Register Definitions
154d3c7b9a0SKenneth D. Merry *
155d3c7b9a0SKenneth D. Merry *****************************************************************************/
156d3c7b9a0SKenneth D. Merry 
157d3c7b9a0SKenneth D. Merry typedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS
158d3c7b9a0SKenneth D. Merry {
159d3c7b9a0SKenneth D. Merry     U32         Doorbell;                   /* 0x00 */
160d3c7b9a0SKenneth D. Merry     U32         WriteSequence;              /* 0x04 */
161d3c7b9a0SKenneth D. Merry     U32         HostDiagnostic;             /* 0x08 */
162d3c7b9a0SKenneth D. Merry     U32         Reserved1;                  /* 0x0C */
163d3c7b9a0SKenneth D. Merry     U32         DiagRWData;                 /* 0x10 */
164d3c7b9a0SKenneth D. Merry     U32         DiagRWAddressLow;           /* 0x14 */
165d3c7b9a0SKenneth D. Merry     U32         DiagRWAddressHigh;          /* 0x18 */
166d3c7b9a0SKenneth D. Merry     U32         Reserved2[5];               /* 0x1C */
167d3c7b9a0SKenneth D. Merry     U32         HostInterruptStatus;        /* 0x30 */
168d3c7b9a0SKenneth D. Merry     U32         HostInterruptMask;          /* 0x34 */
169d3c7b9a0SKenneth D. Merry     U32         DCRData;                    /* 0x38 */
170d3c7b9a0SKenneth D. Merry     U32         DCRAddress;                 /* 0x3C */
171d3c7b9a0SKenneth D. Merry     U32         Reserved3[2];               /* 0x40 */
172d3c7b9a0SKenneth D. Merry     U32         ReplyFreeHostIndex;         /* 0x48 */
173d3c7b9a0SKenneth D. Merry     U32         Reserved4[8];               /* 0x4C */
174d3c7b9a0SKenneth D. Merry     U32         ReplyPostHostIndex;         /* 0x6C */
175d3c7b9a0SKenneth D. Merry     U32         Reserved5;                  /* 0x70 */
176d3c7b9a0SKenneth D. Merry     U32         HCBSize;                    /* 0x74 */
177d3c7b9a0SKenneth D. Merry     U32         HCBAddressLow;              /* 0x78 */
178d3c7b9a0SKenneth D. Merry     U32         HCBAddressHigh;             /* 0x7C */
179d3c7b9a0SKenneth D. Merry     U32         Reserved6[16];              /* 0x80 */
180d3c7b9a0SKenneth D. Merry     U32         RequestDescriptorPostLow;   /* 0xC0 */
181d3c7b9a0SKenneth D. Merry     U32         RequestDescriptorPostHigh;  /* 0xC4 */
182d3c7b9a0SKenneth D. Merry     U32         Reserved7[14];              /* 0xC8 */
183d3c7b9a0SKenneth D. Merry } MPI2_SYSTEM_INTERFACE_REGS, MPI2_POINTER PTR_MPI2_SYSTEM_INTERFACE_REGS,
184d3c7b9a0SKenneth D. Merry   Mpi2SystemInterfaceRegs_t, MPI2_POINTER pMpi2SystemInterfaceRegs_t;
185d3c7b9a0SKenneth D. Merry 
186d3c7b9a0SKenneth D. Merry /*
187d3c7b9a0SKenneth D. Merry  * Defines for working with the Doorbell register.
188d3c7b9a0SKenneth D. Merry  */
189d3c7b9a0SKenneth D. Merry #define MPI2_DOORBELL_OFFSET                    (0x00000000)
190d3c7b9a0SKenneth D. Merry 
191d3c7b9a0SKenneth D. Merry /* IOC --> System values */
192d3c7b9a0SKenneth D. Merry #define MPI2_DOORBELL_USED                      (0x08000000)
193d3c7b9a0SKenneth D. Merry #define MPI2_DOORBELL_WHO_INIT_MASK             (0x07000000)
194d3c7b9a0SKenneth D. Merry #define MPI2_DOORBELL_WHO_INIT_SHIFT            (24)
195d3c7b9a0SKenneth D. Merry #define MPI2_DOORBELL_FAULT_CODE_MASK           (0x0000FFFF)
196d3c7b9a0SKenneth D. Merry #define MPI2_DOORBELL_DATA_MASK                 (0x0000FFFF)
197d3c7b9a0SKenneth D. Merry 
198d3c7b9a0SKenneth D. Merry /* System --> IOC values */
199d3c7b9a0SKenneth D. Merry #define MPI2_DOORBELL_FUNCTION_MASK             (0xFF000000)
200d3c7b9a0SKenneth D. Merry #define MPI2_DOORBELL_FUNCTION_SHIFT            (24)
201d3c7b9a0SKenneth D. Merry #define MPI2_DOORBELL_ADD_DWORDS_MASK           (0x00FF0000)
202d3c7b9a0SKenneth D. Merry #define MPI2_DOORBELL_ADD_DWORDS_SHIFT          (16)
203d3c7b9a0SKenneth D. Merry 
204d3c7b9a0SKenneth D. Merry /*
205d3c7b9a0SKenneth D. Merry  * Defines for the WriteSequence register
206d3c7b9a0SKenneth D. Merry  */
207d3c7b9a0SKenneth D. Merry #define MPI2_WRITE_SEQUENCE_OFFSET              (0x00000004)
208d3c7b9a0SKenneth D. Merry #define MPI2_WRSEQ_KEY_VALUE_MASK               (0x0000000F)
209d3c7b9a0SKenneth D. Merry #define MPI2_WRSEQ_FLUSH_KEY_VALUE              (0x0)
210d3c7b9a0SKenneth D. Merry #define MPI2_WRSEQ_1ST_KEY_VALUE                (0xF)
211d3c7b9a0SKenneth D. Merry #define MPI2_WRSEQ_2ND_KEY_VALUE                (0x4)
212d3c7b9a0SKenneth D. Merry #define MPI2_WRSEQ_3RD_KEY_VALUE                (0xB)
213d3c7b9a0SKenneth D. Merry #define MPI2_WRSEQ_4TH_KEY_VALUE                (0x2)
214d3c7b9a0SKenneth D. Merry #define MPI2_WRSEQ_5TH_KEY_VALUE                (0x7)
215d3c7b9a0SKenneth D. Merry #define MPI2_WRSEQ_6TH_KEY_VALUE                (0xD)
216d3c7b9a0SKenneth D. Merry 
217d3c7b9a0SKenneth D. Merry /*
218d3c7b9a0SKenneth D. Merry  * Defines for the HostDiagnostic register
219d3c7b9a0SKenneth D. Merry  */
220d3c7b9a0SKenneth D. Merry #define MPI2_HOST_DIAGNOSTIC_OFFSET             (0x00000008)
221d3c7b9a0SKenneth D. Merry 
222d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_BOOT_DEVICE_SELECT_MASK       (0x00001800)
223d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_BOOT_DEVICE_SELECT_DEFAULT    (0x00000000)
224d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_BOOT_DEVICE_SELECT_HCDW       (0x00000800)
225d3c7b9a0SKenneth D. Merry 
226d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_CLEAR_FLASH_BAD_SIG           (0x00000400)
227d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_FORCE_HCB_ON_RESET            (0x00000200)
228d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_HCB_MODE                      (0x00000100)
229d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_DIAG_WRITE_ENABLE             (0x00000080)
230d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_FLASH_BAD_SIG                 (0x00000040)
231d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_RESET_HISTORY                 (0x00000020)
232d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_DIAG_RW_ENABLE                (0x00000010)
233d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_RESET_ADAPTER                 (0x00000004)
234d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_HOLD_IOC_RESET                (0x00000002)
235d3c7b9a0SKenneth D. Merry 
236d3c7b9a0SKenneth D. Merry /*
237d3c7b9a0SKenneth D. Merry  * Offsets for DiagRWData and address
238d3c7b9a0SKenneth D. Merry  */
239d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_RW_DATA_OFFSET                (0x00000010)
240d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_RW_ADDRESS_LOW_OFFSET         (0x00000014)
241d3c7b9a0SKenneth D. Merry #define MPI2_DIAG_RW_ADDRESS_HIGH_OFFSET        (0x00000018)
242d3c7b9a0SKenneth D. Merry 
243d3c7b9a0SKenneth D. Merry /*
244d3c7b9a0SKenneth D. Merry  * Defines for the HostInterruptStatus register
245d3c7b9a0SKenneth D. Merry  */
246d3c7b9a0SKenneth D. Merry #define MPI2_HOST_INTERRUPT_STATUS_OFFSET       (0x00000030)
247d3c7b9a0SKenneth D. Merry #define MPI2_HIS_SYS2IOC_DB_STATUS              (0x80000000)
248d3c7b9a0SKenneth D. Merry #define MPI2_HIS_IOP_DOORBELL_STATUS            MPI2_HIS_SYS2IOC_DB_STATUS
249d3c7b9a0SKenneth D. Merry #define MPI2_HIS_RESET_IRQ_STATUS               (0x40000000)
250d3c7b9a0SKenneth D. Merry #define MPI2_HIS_REPLY_DESCRIPTOR_INTERRUPT     (0x00000008)
251d3c7b9a0SKenneth D. Merry #define MPI2_HIS_IOC2SYS_DB_STATUS              (0x00000001)
252d3c7b9a0SKenneth D. Merry #define MPI2_HIS_DOORBELL_INTERRUPT             MPI2_HIS_IOC2SYS_DB_STATUS
253d3c7b9a0SKenneth D. Merry 
254d3c7b9a0SKenneth D. Merry /*
255d3c7b9a0SKenneth D. Merry  * Defines for the HostInterruptMask register
256d3c7b9a0SKenneth D. Merry  */
257d3c7b9a0SKenneth D. Merry #define MPI2_HOST_INTERRUPT_MASK_OFFSET         (0x00000034)
258d3c7b9a0SKenneth D. Merry #define MPI2_HIM_RESET_IRQ_MASK                 (0x40000000)
259d3c7b9a0SKenneth D. Merry #define MPI2_HIM_REPLY_INT_MASK                 (0x00000008)
260d3c7b9a0SKenneth D. Merry #define MPI2_HIM_RIM                            MPI2_HIM_REPLY_INT_MASK
261d3c7b9a0SKenneth D. Merry #define MPI2_HIM_IOC2SYS_DB_MASK                (0x00000001)
262d3c7b9a0SKenneth D. Merry #define MPI2_HIM_DIM                            MPI2_HIM_IOC2SYS_DB_MASK
263d3c7b9a0SKenneth D. Merry 
264d3c7b9a0SKenneth D. Merry /*
265d3c7b9a0SKenneth D. Merry  * Offsets for DCRData and address
266d3c7b9a0SKenneth D. Merry  */
267d3c7b9a0SKenneth D. Merry #define MPI2_DCR_DATA_OFFSET                    (0x00000038)
268d3c7b9a0SKenneth D. Merry #define MPI2_DCR_ADDRESS_OFFSET                 (0x0000003C)
269d3c7b9a0SKenneth D. Merry 
270d3c7b9a0SKenneth D. Merry /*
271d3c7b9a0SKenneth D. Merry  * Offset for the Reply Free Queue
272d3c7b9a0SKenneth D. Merry  */
273d3c7b9a0SKenneth D. Merry #define MPI2_REPLY_FREE_HOST_INDEX_OFFSET       (0x00000048)
274d3c7b9a0SKenneth D. Merry 
275d3c7b9a0SKenneth D. Merry /*
276d3c7b9a0SKenneth D. Merry  * Defines for the Reply Descriptor Post Queue
277d3c7b9a0SKenneth D. Merry  */
278d3c7b9a0SKenneth D. Merry #define MPI2_REPLY_POST_HOST_INDEX_OFFSET       (0x0000006C)
279d3c7b9a0SKenneth D. Merry #define MPI2_REPLY_POST_HOST_INDEX_MASK         (0x00FFFFFF)
280d3c7b9a0SKenneth D. Merry #define MPI2_RPHI_MSIX_INDEX_MASK               (0xFF000000)
281d3c7b9a0SKenneth D. Merry #define MPI2_RPHI_MSIX_INDEX_SHIFT              (24)
282d3c7b9a0SKenneth D. Merry 
283d3c7b9a0SKenneth D. Merry /*
284d3c7b9a0SKenneth D. Merry  * Defines for the HCBSize and address
285d3c7b9a0SKenneth D. Merry  */
286d3c7b9a0SKenneth D. Merry #define MPI2_HCB_SIZE_OFFSET                    (0x00000074)
287d3c7b9a0SKenneth D. Merry #define MPI2_HCB_SIZE_SIZE_MASK                 (0xFFFFF000)
288d3c7b9a0SKenneth D. Merry #define MPI2_HCB_SIZE_HCB_ENABLE                (0x00000001)
289d3c7b9a0SKenneth D. Merry 
290d3c7b9a0SKenneth D. Merry #define MPI2_HCB_ADDRESS_LOW_OFFSET             (0x00000078)
291d3c7b9a0SKenneth D. Merry #define MPI2_HCB_ADDRESS_HIGH_OFFSET            (0x0000007C)
292d3c7b9a0SKenneth D. Merry 
293d3c7b9a0SKenneth D. Merry /*
294d3c7b9a0SKenneth D. Merry  * Offsets for the Request Queue
295d3c7b9a0SKenneth D. Merry  */
296d3c7b9a0SKenneth D. Merry #define MPI2_REQUEST_DESCRIPTOR_POST_LOW_OFFSET     (0x000000C0)
297d3c7b9a0SKenneth D. Merry #define MPI2_REQUEST_DESCRIPTOR_POST_HIGH_OFFSET    (0x000000C4)
298d3c7b9a0SKenneth D. Merry 
299d3c7b9a0SKenneth D. Merry /*****************************************************************************
300d3c7b9a0SKenneth D. Merry *
301d3c7b9a0SKenneth D. Merry *        Message Descriptors
302d3c7b9a0SKenneth D. Merry *
303d3c7b9a0SKenneth D. Merry *****************************************************************************/
304d3c7b9a0SKenneth D. Merry 
305d3c7b9a0SKenneth D. Merry /* Request Descriptors */
306d3c7b9a0SKenneth D. Merry 
307d3c7b9a0SKenneth D. Merry /* Default Request Descriptor */
308d3c7b9a0SKenneth D. Merry typedef struct _MPI2_DEFAULT_REQUEST_DESCRIPTOR
309d3c7b9a0SKenneth D. Merry {
310d3c7b9a0SKenneth D. Merry     U8              RequestFlags;               /* 0x00 */
311d3c7b9a0SKenneth D. Merry     U8              MSIxIndex;                  /* 0x01 */
312d3c7b9a0SKenneth D. Merry     U16             SMID;                       /* 0x02 */
313d3c7b9a0SKenneth D. Merry     U16             LMID;                       /* 0x04 */
314d3c7b9a0SKenneth D. Merry     U16             DescriptorTypeDependent;    /* 0x06 */
315d3c7b9a0SKenneth D. Merry } MPI2_DEFAULT_REQUEST_DESCRIPTOR,
316d3c7b9a0SKenneth D. Merry   MPI2_POINTER PTR_MPI2_DEFAULT_REQUEST_DESCRIPTOR,
317d3c7b9a0SKenneth D. Merry   Mpi2DefaultRequestDescriptor_t, MPI2_POINTER pMpi2DefaultRequestDescriptor_t;
318d3c7b9a0SKenneth D. Merry 
319d3c7b9a0SKenneth D. Merry /* defines for the RequestFlags field */
320d3c7b9a0SKenneth D. Merry #define MPI2_REQ_DESCRIPT_FLAGS_TYPE_MASK               (0x0E)
321d3c7b9a0SKenneth D. Merry #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO                 (0x00)
322d3c7b9a0SKenneth D. Merry #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_TARGET             (0x02)
323d3c7b9a0SKenneth D. Merry #define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY           (0x06)
324d3c7b9a0SKenneth D. Merry #define MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE            (0x08)
325d3c7b9a0SKenneth D. Merry #define MPI2_REQ_DESCRIPT_FLAGS_RAID_ACCELERATOR        (0x0A)
326d3c7b9a0SKenneth D. Merry 
327d3c7b9a0SKenneth D. Merry #define MPI2_REQ_DESCRIPT_FLAGS_IOC_FIFO_MARKER (0x01)
328d3c7b9a0SKenneth D. Merry 
329d3c7b9a0SKenneth D. Merry /* High Priority Request Descriptor */
330d3c7b9a0SKenneth D. Merry typedef struct _MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR
331d3c7b9a0SKenneth D. Merry {
332d3c7b9a0SKenneth D. Merry     U8              RequestFlags;               /* 0x00 */
333d3c7b9a0SKenneth D. Merry     U8              MSIxIndex;                  /* 0x01 */
334d3c7b9a0SKenneth D. Merry     U16             SMID;                       /* 0x02 */
335d3c7b9a0SKenneth D. Merry     U16             LMID;                       /* 0x04 */
336d3c7b9a0SKenneth D. Merry     U16             Reserved1;                  /* 0x06 */
337d3c7b9a0SKenneth D. Merry } MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR,
338d3c7b9a0SKenneth D. Merry   MPI2_POINTER PTR_MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR,
339d3c7b9a0SKenneth D. Merry   Mpi2HighPriorityRequestDescriptor_t,
340d3c7b9a0SKenneth D. Merry   MPI2_POINTER pMpi2HighPriorityRequestDescriptor_t;
341d3c7b9a0SKenneth D. Merry 
342d3c7b9a0SKenneth D. Merry /* SCSI IO Request Descriptor */
343d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SCSI_IO_REQUEST_DESCRIPTOR
344d3c7b9a0SKenneth D. Merry {
345d3c7b9a0SKenneth D. Merry     U8              RequestFlags;               /* 0x00 */
346d3c7b9a0SKenneth D. Merry     U8              MSIxIndex;                  /* 0x01 */
347d3c7b9a0SKenneth D. Merry     U16             SMID;                       /* 0x02 */
348d3c7b9a0SKenneth D. Merry     U16             LMID;                       /* 0x04 */
349d3c7b9a0SKenneth D. Merry     U16             DevHandle;                  /* 0x06 */
350d3c7b9a0SKenneth D. Merry } MPI2_SCSI_IO_REQUEST_DESCRIPTOR,
351d3c7b9a0SKenneth D. Merry   MPI2_POINTER PTR_MPI2_SCSI_IO_REQUEST_DESCRIPTOR,
352d3c7b9a0SKenneth D. Merry   Mpi2SCSIIORequestDescriptor_t, MPI2_POINTER pMpi2SCSIIORequestDescriptor_t;
353d3c7b9a0SKenneth D. Merry 
354d3c7b9a0SKenneth D. Merry /* SCSI Target Request Descriptor */
355d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR
356d3c7b9a0SKenneth D. Merry {
357d3c7b9a0SKenneth D. Merry     U8              RequestFlags;               /* 0x00 */
358d3c7b9a0SKenneth D. Merry     U8              MSIxIndex;                  /* 0x01 */
359d3c7b9a0SKenneth D. Merry     U16             SMID;                       /* 0x02 */
360d3c7b9a0SKenneth D. Merry     U16             LMID;                       /* 0x04 */
361d3c7b9a0SKenneth D. Merry     U16             IoIndex;                    /* 0x06 */
362d3c7b9a0SKenneth D. Merry } MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR,
363d3c7b9a0SKenneth D. Merry   MPI2_POINTER PTR_MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR,
364d3c7b9a0SKenneth D. Merry   Mpi2SCSITargetRequestDescriptor_t,
365d3c7b9a0SKenneth D. Merry   MPI2_POINTER pMpi2SCSITargetRequestDescriptor_t;
366d3c7b9a0SKenneth D. Merry 
367d3c7b9a0SKenneth D. Merry /* RAID Accelerator Request Descriptor */
368d3c7b9a0SKenneth D. Merry typedef struct _MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR
369d3c7b9a0SKenneth D. Merry {
370d3c7b9a0SKenneth D. Merry     U8              RequestFlags;               /* 0x00 */
371d3c7b9a0SKenneth D. Merry     U8              MSIxIndex;                  /* 0x01 */
372d3c7b9a0SKenneth D. Merry     U16             SMID;                       /* 0x02 */
373d3c7b9a0SKenneth D. Merry     U16             LMID;                       /* 0x04 */
374d3c7b9a0SKenneth D. Merry     U16             Reserved;                   /* 0x06 */
375d3c7b9a0SKenneth D. Merry } MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR,
376d3c7b9a0SKenneth D. Merry   MPI2_POINTER PTR_MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR,
377d3c7b9a0SKenneth D. Merry   Mpi2RAIDAcceleratorRequestDescriptor_t,
378d3c7b9a0SKenneth D. Merry   MPI2_POINTER pMpi2RAIDAcceleratorRequestDescriptor_t;
379d3c7b9a0SKenneth D. Merry 
380d3c7b9a0SKenneth D. Merry /* union of Request Descriptors */
381d3c7b9a0SKenneth D. Merry typedef union _MPI2_REQUEST_DESCRIPTOR_UNION
382d3c7b9a0SKenneth D. Merry {
383d3c7b9a0SKenneth D. Merry     MPI2_DEFAULT_REQUEST_DESCRIPTOR             Default;
384d3c7b9a0SKenneth D. Merry     MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR       HighPriority;
385d3c7b9a0SKenneth D. Merry     MPI2_SCSI_IO_REQUEST_DESCRIPTOR             SCSIIO;
386d3c7b9a0SKenneth D. Merry     MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR         SCSITarget;
387d3c7b9a0SKenneth D. Merry     MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR          RAIDAccelerator;
388d3c7b9a0SKenneth D. Merry     U64                                         Words;
389d3c7b9a0SKenneth D. Merry } MPI2_REQUEST_DESCRIPTOR_UNION, MPI2_POINTER PTR_MPI2_REQUEST_DESCRIPTOR_UNION,
390d3c7b9a0SKenneth D. Merry   Mpi2RequestDescriptorUnion_t, MPI2_POINTER pMpi2RequestDescriptorUnion_t;
391d3c7b9a0SKenneth D. Merry 
392d3c7b9a0SKenneth D. Merry /* Reply Descriptors */
393d3c7b9a0SKenneth D. Merry 
394d3c7b9a0SKenneth D. Merry /* Default Reply Descriptor */
395d3c7b9a0SKenneth D. Merry typedef struct _MPI2_DEFAULT_REPLY_DESCRIPTOR
396d3c7b9a0SKenneth D. Merry {
397d3c7b9a0SKenneth D. Merry     U8              ReplyFlags;                 /* 0x00 */
398d3c7b9a0SKenneth D. Merry     U8              MSIxIndex;                  /* 0x01 */
399d3c7b9a0SKenneth D. Merry     U16             DescriptorTypeDependent1;   /* 0x02 */
400d3c7b9a0SKenneth D. Merry     U32             DescriptorTypeDependent2;   /* 0x04 */
401d3c7b9a0SKenneth D. Merry } MPI2_DEFAULT_REPLY_DESCRIPTOR, MPI2_POINTER PTR_MPI2_DEFAULT_REPLY_DESCRIPTOR,
402d3c7b9a0SKenneth D. Merry   Mpi2DefaultReplyDescriptor_t, MPI2_POINTER pMpi2DefaultReplyDescriptor_t;
403d3c7b9a0SKenneth D. Merry 
404d3c7b9a0SKenneth D. Merry /* defines for the ReplyFlags field */
405d3c7b9a0SKenneth D. Merry #define MPI2_RPY_DESCRIPT_FLAGS_TYPE_MASK                   (0x0F)
406d3c7b9a0SKenneth D. Merry #define MPI2_RPY_DESCRIPT_FLAGS_SCSI_IO_SUCCESS             (0x00)
407d3c7b9a0SKenneth D. Merry #define MPI2_RPY_DESCRIPT_FLAGS_ADDRESS_REPLY               (0x01)
408d3c7b9a0SKenneth D. Merry #define MPI2_RPY_DESCRIPT_FLAGS_TARGETASSIST_SUCCESS        (0x02)
409d3c7b9a0SKenneth D. Merry #define MPI2_RPY_DESCRIPT_FLAGS_TARGET_COMMAND_BUFFER       (0x03)
410d3c7b9a0SKenneth D. Merry #define MPI2_RPY_DESCRIPT_FLAGS_RAID_ACCELERATOR_SUCCESS    (0x05)
411d3c7b9a0SKenneth D. Merry #define MPI2_RPY_DESCRIPT_FLAGS_UNUSED                      (0x0F)
412d3c7b9a0SKenneth D. Merry 
413d3c7b9a0SKenneth D. Merry /* values for marking a reply descriptor as unused */
414d3c7b9a0SKenneth D. Merry #define MPI2_RPY_DESCRIPT_UNUSED_WORD0_MARK             (0xFFFFFFFF)
415d3c7b9a0SKenneth D. Merry #define MPI2_RPY_DESCRIPT_UNUSED_WORD1_MARK             (0xFFFFFFFF)
416d3c7b9a0SKenneth D. Merry 
417d3c7b9a0SKenneth D. Merry /* Address Reply Descriptor */
418d3c7b9a0SKenneth D. Merry typedef struct _MPI2_ADDRESS_REPLY_DESCRIPTOR
419d3c7b9a0SKenneth D. Merry {
420d3c7b9a0SKenneth D. Merry     U8              ReplyFlags;                 /* 0x00 */
421d3c7b9a0SKenneth D. Merry     U8              MSIxIndex;                  /* 0x01 */
422d3c7b9a0SKenneth D. Merry     U16             SMID;                       /* 0x02 */
423d3c7b9a0SKenneth D. Merry     U32             ReplyFrameAddress;          /* 0x04 */
424d3c7b9a0SKenneth D. Merry } MPI2_ADDRESS_REPLY_DESCRIPTOR, MPI2_POINTER PTR_MPI2_ADDRESS_REPLY_DESCRIPTOR,
425d3c7b9a0SKenneth D. Merry   Mpi2AddressReplyDescriptor_t, MPI2_POINTER pMpi2AddressReplyDescriptor_t;
426d3c7b9a0SKenneth D. Merry 
427d3c7b9a0SKenneth D. Merry #define MPI2_ADDRESS_REPLY_SMID_INVALID                 (0x00)
428d3c7b9a0SKenneth D. Merry 
429d3c7b9a0SKenneth D. Merry /* SCSI IO Success Reply Descriptor */
430d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR
431d3c7b9a0SKenneth D. Merry {
432d3c7b9a0SKenneth D. Merry     U8              ReplyFlags;                 /* 0x00 */
433d3c7b9a0SKenneth D. Merry     U8              MSIxIndex;                  /* 0x01 */
434d3c7b9a0SKenneth D. Merry     U16             SMID;                       /* 0x02 */
435d3c7b9a0SKenneth D. Merry     U16             TaskTag;                    /* 0x04 */
436d3c7b9a0SKenneth D. Merry     U16             Reserved1;                  /* 0x06 */
437d3c7b9a0SKenneth D. Merry } MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR,
438d3c7b9a0SKenneth D. Merry   MPI2_POINTER PTR_MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR,
439d3c7b9a0SKenneth D. Merry   Mpi2SCSIIOSuccessReplyDescriptor_t,
440d3c7b9a0SKenneth D. Merry   MPI2_POINTER pMpi2SCSIIOSuccessReplyDescriptor_t;
441d3c7b9a0SKenneth D. Merry 
442d3c7b9a0SKenneth D. Merry /* TargetAssist Success Reply Descriptor */
443d3c7b9a0SKenneth D. Merry typedef struct _MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR
444d3c7b9a0SKenneth D. Merry {
445d3c7b9a0SKenneth D. Merry     U8              ReplyFlags;                 /* 0x00 */
446d3c7b9a0SKenneth D. Merry     U8              MSIxIndex;                  /* 0x01 */
447d3c7b9a0SKenneth D. Merry     U16             SMID;                       /* 0x02 */
448d3c7b9a0SKenneth D. Merry     U8              SequenceNumber;             /* 0x04 */
449d3c7b9a0SKenneth D. Merry     U8              Reserved1;                  /* 0x05 */
450d3c7b9a0SKenneth D. Merry     U16             IoIndex;                    /* 0x06 */
451d3c7b9a0SKenneth D. Merry } MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR,
452d3c7b9a0SKenneth D. Merry   MPI2_POINTER PTR_MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR,
453d3c7b9a0SKenneth D. Merry   Mpi2TargetAssistSuccessReplyDescriptor_t,
454d3c7b9a0SKenneth D. Merry   MPI2_POINTER pMpi2TargetAssistSuccessReplyDescriptor_t;
455d3c7b9a0SKenneth D. Merry 
456d3c7b9a0SKenneth D. Merry /* Target Command Buffer Reply Descriptor */
457d3c7b9a0SKenneth D. Merry typedef struct _MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR
458d3c7b9a0SKenneth D. Merry {
459d3c7b9a0SKenneth D. Merry     U8              ReplyFlags;                 /* 0x00 */
460d3c7b9a0SKenneth D. Merry     U8              MSIxIndex;                  /* 0x01 */
461d3c7b9a0SKenneth D. Merry     U8              VP_ID;                      /* 0x02 */
462d3c7b9a0SKenneth D. Merry     U8              Flags;                      /* 0x03 */
463d3c7b9a0SKenneth D. Merry     U16             InitiatorDevHandle;         /* 0x04 */
464d3c7b9a0SKenneth D. Merry     U16             IoIndex;                    /* 0x06 */
465d3c7b9a0SKenneth D. Merry } MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR,
466d3c7b9a0SKenneth D. Merry   MPI2_POINTER PTR_MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR,
467d3c7b9a0SKenneth D. Merry   Mpi2TargetCommandBufferReplyDescriptor_t,
468d3c7b9a0SKenneth D. Merry   MPI2_POINTER pMpi2TargetCommandBufferReplyDescriptor_t;
469d3c7b9a0SKenneth D. Merry 
470d3c7b9a0SKenneth D. Merry /* defines for Flags field */
471d3c7b9a0SKenneth D. Merry #define MPI2_RPY_DESCRIPT_TCB_FLAGS_PHYNUM_MASK     (0x3F)
472d3c7b9a0SKenneth D. Merry 
473d3c7b9a0SKenneth D. Merry /* RAID Accelerator Success Reply Descriptor */
474d3c7b9a0SKenneth D. Merry typedef struct _MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR
475d3c7b9a0SKenneth D. Merry {
476d3c7b9a0SKenneth D. Merry     U8              ReplyFlags;                 /* 0x00 */
477d3c7b9a0SKenneth D. Merry     U8              MSIxIndex;                  /* 0x01 */
478d3c7b9a0SKenneth D. Merry     U16             SMID;                       /* 0x02 */
479d3c7b9a0SKenneth D. Merry     U32             Reserved;                   /* 0x04 */
480d3c7b9a0SKenneth D. Merry } MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR,
481d3c7b9a0SKenneth D. Merry   MPI2_POINTER PTR_MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR,
482d3c7b9a0SKenneth D. Merry   Mpi2RAIDAcceleratorSuccessReplyDescriptor_t,
483d3c7b9a0SKenneth D. Merry   MPI2_POINTER pMpi2RAIDAcceleratorSuccessReplyDescriptor_t;
484d3c7b9a0SKenneth D. Merry 
485d3c7b9a0SKenneth D. Merry /* union of Reply Descriptors */
486d3c7b9a0SKenneth D. Merry typedef union _MPI2_REPLY_DESCRIPTORS_UNION
487d3c7b9a0SKenneth D. Merry {
488d3c7b9a0SKenneth D. Merry     MPI2_DEFAULT_REPLY_DESCRIPTOR                   Default;
489d3c7b9a0SKenneth D. Merry     MPI2_ADDRESS_REPLY_DESCRIPTOR                   AddressReply;
490d3c7b9a0SKenneth D. Merry     MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR           SCSIIOSuccess;
491d3c7b9a0SKenneth D. Merry     MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR      TargetAssistSuccess;
492d3c7b9a0SKenneth D. Merry     MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR     TargetCommandBuffer;
493d3c7b9a0SKenneth D. Merry     MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR  RAIDAcceleratorSuccess;
494d3c7b9a0SKenneth D. Merry     U64                                             Words;
495d3c7b9a0SKenneth D. Merry } MPI2_REPLY_DESCRIPTORS_UNION, MPI2_POINTER PTR_MPI2_REPLY_DESCRIPTORS_UNION,
496d3c7b9a0SKenneth D. Merry   Mpi2ReplyDescriptorsUnion_t, MPI2_POINTER pMpi2ReplyDescriptorsUnion_t;
497d3c7b9a0SKenneth D. Merry 
498d3c7b9a0SKenneth D. Merry /*****************************************************************************
499d3c7b9a0SKenneth D. Merry *
500d3c7b9a0SKenneth D. Merry *        Message Functions
501d3c7b9a0SKenneth D. Merry *
502d3c7b9a0SKenneth D. Merry *****************************************************************************/
503d3c7b9a0SKenneth D. Merry 
504d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_SCSI_IO_REQUEST               (0x00) /* SCSI IO */
505d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_SCSI_TASK_MGMT                (0x01) /* SCSI Task Management */
506d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_IOC_INIT                      (0x02) /* IOC Init */
507d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_IOC_FACTS                     (0x03) /* IOC Facts */
508d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_CONFIG                        (0x04) /* Configuration */
509d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_PORT_FACTS                    (0x05) /* Port Facts */
510d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_PORT_ENABLE                   (0x06) /* Port Enable */
511d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_EVENT_NOTIFICATION            (0x07) /* Event Notification */
512d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_EVENT_ACK                     (0x08) /* Event Acknowledge */
513d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_FW_DOWNLOAD                   (0x09) /* FW Download */
514d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_TARGET_ASSIST                 (0x0B) /* Target Assist */
515d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_TARGET_STATUS_SEND            (0x0C) /* Target Status Send */
516d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_TARGET_MODE_ABORT             (0x0D) /* Target Mode Abort */
517d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_FW_UPLOAD                     (0x12) /* FW Upload */
518d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_RAID_ACTION                   (0x15) /* RAID Action */
519d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_RAID_SCSI_IO_PASSTHROUGH      (0x16) /* SCSI IO RAID Passthrough */
520d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_TOOLBOX                       (0x17) /* Toolbox */
521d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR      (0x18) /* SCSI Enclosure Processor */
522d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_SMP_PASSTHROUGH               (0x1A) /* SMP Passthrough */
523d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_SAS_IO_UNIT_CONTROL           (0x1B) /* SAS IO Unit Control */
524d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_SATA_PASSTHROUGH              (0x1C) /* SATA Passthrough */
525d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_DIAG_BUFFER_POST              (0x1D) /* Diagnostic Buffer Post */
526d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_DIAG_RELEASE                  (0x1E) /* Diagnostic Release */
527d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_TARGET_CMD_BUF_BASE_POST      (0x24) /* Target Command Buffer Post Base */
528d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_TARGET_CMD_BUF_LIST_POST      (0x25) /* Target Command Buffer Post List */
529d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_RAID_ACCELERATOR              (0x2C) /* RAID Accelerator */
530d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_HOST_BASED_DISCOVERY_ACTION   (0x2F) /* Host Based Discovery Action */
531d043c564SKenneth D. Merry #define MPI2_FUNCTION_PWR_MGMT_CONTROL              (0x30) /* Power Management Control */
532d043c564SKenneth D. Merry #define MPI2_FUNCTION_MIN_PRODUCT_SPECIFIC          (0xF0) /* beginning of product-specific range */
533d043c564SKenneth D. Merry #define MPI2_FUNCTION_MAX_PRODUCT_SPECIFIC          (0xFF) /* end of product-specific range */
534d3c7b9a0SKenneth D. Merry 
535d3c7b9a0SKenneth D. Merry /* Doorbell functions */
536d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET        (0x40)
537d3c7b9a0SKenneth D. Merry #define MPI2_FUNCTION_HANDSHAKE                     (0x42)
538d3c7b9a0SKenneth D. Merry 
539d3c7b9a0SKenneth D. Merry /*****************************************************************************
540d3c7b9a0SKenneth D. Merry *
541d3c7b9a0SKenneth D. Merry *        IOC Status Values
542d3c7b9a0SKenneth D. Merry *
543d3c7b9a0SKenneth D. Merry *****************************************************************************/
544d3c7b9a0SKenneth D. Merry 
545d3c7b9a0SKenneth D. Merry /* mask for IOCStatus status value */
546d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_MASK                     (0x7FFF)
547d3c7b9a0SKenneth D. Merry 
548d3c7b9a0SKenneth D. Merry /****************************************************************************
549d3c7b9a0SKenneth D. Merry *  Common IOCStatus values for all replies
550d3c7b9a0SKenneth D. Merry ****************************************************************************/
551d3c7b9a0SKenneth D. Merry 
552d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SUCCESS                      (0x0000)
553d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_INVALID_FUNCTION             (0x0001)
554d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_BUSY                         (0x0002)
555d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_INVALID_SGL                  (0x0003)
556d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_INTERNAL_ERROR               (0x0004)
557d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_INVALID_VPID                 (0x0005)
558d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_INSUFFICIENT_RESOURCES       (0x0006)
559d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_INVALID_FIELD                (0x0007)
560d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_INVALID_STATE                (0x0008)
561d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_OP_STATE_NOT_SUPPORTED       (0x0009)
562d3c7b9a0SKenneth D. Merry 
563d3c7b9a0SKenneth D. Merry /****************************************************************************
564d3c7b9a0SKenneth D. Merry *  Config IOCStatus values
565d3c7b9a0SKenneth D. Merry ****************************************************************************/
566d3c7b9a0SKenneth D. Merry 
567d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_CONFIG_INVALID_ACTION        (0x0020)
568d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_CONFIG_INVALID_TYPE          (0x0021)
569d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_CONFIG_INVALID_PAGE          (0x0022)
570d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_CONFIG_INVALID_DATA          (0x0023)
571d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_CONFIG_NO_DEFAULTS           (0x0024)
572d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_CONFIG_CANT_COMMIT           (0x0025)
573d3c7b9a0SKenneth D. Merry 
574d3c7b9a0SKenneth D. Merry /****************************************************************************
575d3c7b9a0SKenneth D. Merry *  SCSI IO Reply
576d3c7b9a0SKenneth D. Merry ****************************************************************************/
577d3c7b9a0SKenneth D. Merry 
578d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SCSI_RECOVERED_ERROR         (0x0040)
579d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SCSI_INVALID_DEVHANDLE       (0x0042)
580d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE        (0x0043)
581d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SCSI_DATA_OVERRUN            (0x0044)
582d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SCSI_DATA_UNDERRUN           (0x0045)
583d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SCSI_IO_DATA_ERROR           (0x0046)
584d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR          (0x0047)
585d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SCSI_TASK_TERMINATED         (0x0048)
586d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SCSI_RESIDUAL_MISMATCH       (0x0049)
587d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SCSI_TASK_MGMT_FAILED        (0x004A)
588d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SCSI_IOC_TERMINATED          (0x004B)
589d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SCSI_EXT_TERMINATED          (0x004C)
590d3c7b9a0SKenneth D. Merry 
591d3c7b9a0SKenneth D. Merry /****************************************************************************
592d3c7b9a0SKenneth D. Merry *  For use by SCSI Initiator and SCSI Target end-to-end data protection
593d3c7b9a0SKenneth D. Merry ****************************************************************************/
594d3c7b9a0SKenneth D. Merry 
595d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_EEDP_GUARD_ERROR             (0x004D)
596d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR           (0x004E)
597d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR           (0x004F)
598d3c7b9a0SKenneth D. Merry 
599d3c7b9a0SKenneth D. Merry /****************************************************************************
600d3c7b9a0SKenneth D. Merry *  SCSI Target values
601d3c7b9a0SKenneth D. Merry ****************************************************************************/
602d3c7b9a0SKenneth D. Merry 
603d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_TARGET_INVALID_IO_INDEX      (0x0062)
604d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_TARGET_ABORTED               (0x0063)
605d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_TARGET_NO_CONN_RETRYABLE     (0x0064)
606d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_TARGET_NO_CONNECTION         (0x0065)
607d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH   (0x006A)
608d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_TARGET_DATA_OFFSET_ERROR     (0x006D)
609d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_TARGET_TOO_MUCH_WRITE_DATA   (0x006E)
610d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_TARGET_IU_TOO_SHORT          (0x006F)
611d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_TARGET_ACK_NAK_TIMEOUT       (0x0070)
612d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_TARGET_NAK_RECEIVED          (0x0071)
613d3c7b9a0SKenneth D. Merry 
614d3c7b9a0SKenneth D. Merry /****************************************************************************
615d3c7b9a0SKenneth D. Merry *  Serial Attached SCSI values
616d3c7b9a0SKenneth D. Merry ****************************************************************************/
617d3c7b9a0SKenneth D. Merry 
618d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SAS_SMP_REQUEST_FAILED       (0x0090)
619d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_SAS_SMP_DATA_OVERRUN         (0x0091)
620d3c7b9a0SKenneth D. Merry 
621d3c7b9a0SKenneth D. Merry /****************************************************************************
622d3c7b9a0SKenneth D. Merry *  Diagnostic Buffer Post / Diagnostic Release values
623d3c7b9a0SKenneth D. Merry ****************************************************************************/
624d3c7b9a0SKenneth D. Merry 
625d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED          (0x00A0)
626d3c7b9a0SKenneth D. Merry 
627d3c7b9a0SKenneth D. Merry /****************************************************************************
628d3c7b9a0SKenneth D. Merry *  RAID Accelerator values
629d3c7b9a0SKenneth D. Merry ****************************************************************************/
630d3c7b9a0SKenneth D. Merry 
631d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_RAID_ACCEL_ERROR             (0x00B0)
632d3c7b9a0SKenneth D. Merry 
633d3c7b9a0SKenneth D. Merry /****************************************************************************
634d3c7b9a0SKenneth D. Merry *  IOCStatus flag to indicate that log info is available
635d3c7b9a0SKenneth D. Merry ****************************************************************************/
636d3c7b9a0SKenneth D. Merry 
637d3c7b9a0SKenneth D. Merry #define MPI2_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE      (0x8000)
638d3c7b9a0SKenneth D. Merry 
639d3c7b9a0SKenneth D. Merry /****************************************************************************
640d3c7b9a0SKenneth D. Merry *  IOCLogInfo Types
641d3c7b9a0SKenneth D. Merry ****************************************************************************/
642d3c7b9a0SKenneth D. Merry 
643d3c7b9a0SKenneth D. Merry #define MPI2_IOCLOGINFO_TYPE_MASK               (0xF0000000)
644d3c7b9a0SKenneth D. Merry #define MPI2_IOCLOGINFO_TYPE_SHIFT              (28)
645d3c7b9a0SKenneth D. Merry #define MPI2_IOCLOGINFO_TYPE_NONE               (0x0)
646d3c7b9a0SKenneth D. Merry #define MPI2_IOCLOGINFO_TYPE_SCSI               (0x1)
647d3c7b9a0SKenneth D. Merry #define MPI2_IOCLOGINFO_TYPE_FC                 (0x2)
648d3c7b9a0SKenneth D. Merry #define MPI2_IOCLOGINFO_TYPE_SAS                (0x3)
649d3c7b9a0SKenneth D. Merry #define MPI2_IOCLOGINFO_TYPE_ISCSI              (0x4)
650d3c7b9a0SKenneth D. Merry #define MPI2_IOCLOGINFO_LOG_DATA_MASK           (0x0FFFFFFF)
651d3c7b9a0SKenneth D. Merry 
652d3c7b9a0SKenneth D. Merry /*****************************************************************************
653d3c7b9a0SKenneth D. Merry *
654d3c7b9a0SKenneth D. Merry *        Standard Message Structures
655d3c7b9a0SKenneth D. Merry *
656d3c7b9a0SKenneth D. Merry *****************************************************************************/
657d3c7b9a0SKenneth D. Merry 
658d3c7b9a0SKenneth D. Merry /****************************************************************************
659d3c7b9a0SKenneth D. Merry * Request Message Header for all request messages
660d3c7b9a0SKenneth D. Merry ****************************************************************************/
661d3c7b9a0SKenneth D. Merry 
662d3c7b9a0SKenneth D. Merry typedef struct _MPI2_REQUEST_HEADER
663d3c7b9a0SKenneth D. Merry {
664d3c7b9a0SKenneth D. Merry     U16             FunctionDependent1;         /* 0x00 */
665d3c7b9a0SKenneth D. Merry     U8              ChainOffset;                /* 0x02 */
666d3c7b9a0SKenneth D. Merry     U8              Function;                   /* 0x03 */
667d3c7b9a0SKenneth D. Merry     U16             FunctionDependent2;         /* 0x04 */
668d3c7b9a0SKenneth D. Merry     U8              FunctionDependent3;         /* 0x06 */
669d3c7b9a0SKenneth D. Merry     U8              MsgFlags;                   /* 0x07 */
670d3c7b9a0SKenneth D. Merry     U8              VP_ID;                      /* 0x08 */
671d3c7b9a0SKenneth D. Merry     U8              VF_ID;                      /* 0x09 */
672d3c7b9a0SKenneth D. Merry     U16             Reserved1;                  /* 0x0A */
673d3c7b9a0SKenneth D. Merry } MPI2_REQUEST_HEADER, MPI2_POINTER PTR_MPI2_REQUEST_HEADER,
674d3c7b9a0SKenneth D. Merry   MPI2RequestHeader_t, MPI2_POINTER pMPI2RequestHeader_t;
675d3c7b9a0SKenneth D. Merry 
676d3c7b9a0SKenneth D. Merry /****************************************************************************
677d3c7b9a0SKenneth D. Merry *  Default Reply
678d3c7b9a0SKenneth D. Merry ****************************************************************************/
679d3c7b9a0SKenneth D. Merry 
680d3c7b9a0SKenneth D. Merry typedef struct _MPI2_DEFAULT_REPLY
681d3c7b9a0SKenneth D. Merry {
682d3c7b9a0SKenneth D. Merry     U16             FunctionDependent1;         /* 0x00 */
683d3c7b9a0SKenneth D. Merry     U8              MsgLength;                  /* 0x02 */
684d3c7b9a0SKenneth D. Merry     U8              Function;                   /* 0x03 */
685d3c7b9a0SKenneth D. Merry     U16             FunctionDependent2;         /* 0x04 */
686d3c7b9a0SKenneth D. Merry     U8              FunctionDependent3;         /* 0x06 */
687d3c7b9a0SKenneth D. Merry     U8              MsgFlags;                   /* 0x07 */
688d3c7b9a0SKenneth D. Merry     U8              VP_ID;                      /* 0x08 */
689d3c7b9a0SKenneth D. Merry     U8              VF_ID;                      /* 0x09 */
690d3c7b9a0SKenneth D. Merry     U16             Reserved1;                  /* 0x0A */
691d3c7b9a0SKenneth D. Merry     U16             FunctionDependent5;         /* 0x0C */
692d3c7b9a0SKenneth D. Merry     U16             IOCStatus;                  /* 0x0E */
693d3c7b9a0SKenneth D. Merry     U32             IOCLogInfo;                 /* 0x10 */
694d3c7b9a0SKenneth D. Merry } MPI2_DEFAULT_REPLY, MPI2_POINTER PTR_MPI2_DEFAULT_REPLY,
695d3c7b9a0SKenneth D. Merry   MPI2DefaultReply_t, MPI2_POINTER pMPI2DefaultReply_t;
696d3c7b9a0SKenneth D. Merry 
697d3c7b9a0SKenneth D. Merry /* common version structure/union used in messages and configuration pages */
698d3c7b9a0SKenneth D. Merry 
699d3c7b9a0SKenneth D. Merry typedef struct _MPI2_VERSION_STRUCT
700d3c7b9a0SKenneth D. Merry {
701d3c7b9a0SKenneth D. Merry     U8                      Dev;                        /* 0x00 */
702d3c7b9a0SKenneth D. Merry     U8                      Unit;                       /* 0x01 */
703d3c7b9a0SKenneth D. Merry     U8                      Minor;                      /* 0x02 */
704d3c7b9a0SKenneth D. Merry     U8                      Major;                      /* 0x03 */
705d3c7b9a0SKenneth D. Merry } MPI2_VERSION_STRUCT;
706d3c7b9a0SKenneth D. Merry 
707d3c7b9a0SKenneth D. Merry typedef union _MPI2_VERSION_UNION
708d3c7b9a0SKenneth D. Merry {
709d3c7b9a0SKenneth D. Merry     MPI2_VERSION_STRUCT     Struct;
710d3c7b9a0SKenneth D. Merry     U32                     Word;
711d3c7b9a0SKenneth D. Merry } MPI2_VERSION_UNION;
712d3c7b9a0SKenneth D. Merry 
713d3c7b9a0SKenneth D. Merry /* LUN field defines, common to many structures */
714d3c7b9a0SKenneth D. Merry #define MPI2_LUN_FIRST_LEVEL_ADDRESSING             (0x0000FFFF)
715d3c7b9a0SKenneth D. Merry #define MPI2_LUN_SECOND_LEVEL_ADDRESSING            (0xFFFF0000)
716d3c7b9a0SKenneth D. Merry #define MPI2_LUN_THIRD_LEVEL_ADDRESSING             (0x0000FFFF)
717d3c7b9a0SKenneth D. Merry #define MPI2_LUN_FOURTH_LEVEL_ADDRESSING            (0xFFFF0000)
718d3c7b9a0SKenneth D. Merry #define MPI2_LUN_LEVEL_1_WORD                       (0xFF00)
719d3c7b9a0SKenneth D. Merry #define MPI2_LUN_LEVEL_1_DWORD                      (0x0000FF00)
720d3c7b9a0SKenneth D. Merry 
721d3c7b9a0SKenneth D. Merry /*****************************************************************************
722d3c7b9a0SKenneth D. Merry *
723d3c7b9a0SKenneth D. Merry *        Fusion-MPT MPI Scatter Gather Elements
724d3c7b9a0SKenneth D. Merry *
725d3c7b9a0SKenneth D. Merry *****************************************************************************/
726d3c7b9a0SKenneth D. Merry 
727d3c7b9a0SKenneth D. Merry /****************************************************************************
728d3c7b9a0SKenneth D. Merry *  MPI Simple Element structures
729d3c7b9a0SKenneth D. Merry ****************************************************************************/
730d3c7b9a0SKenneth D. Merry 
731d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SGE_SIMPLE32
732d3c7b9a0SKenneth D. Merry {
733d3c7b9a0SKenneth D. Merry     U32                     FlagsLength;
734d3c7b9a0SKenneth D. Merry     U32                     Address;
735d3c7b9a0SKenneth D. Merry } MPI2_SGE_SIMPLE32, MPI2_POINTER PTR_MPI2_SGE_SIMPLE32,
736d3c7b9a0SKenneth D. Merry   Mpi2SGESimple32_t, MPI2_POINTER pMpi2SGESimple32_t;
737d3c7b9a0SKenneth D. Merry 
738d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SGE_SIMPLE64
739d3c7b9a0SKenneth D. Merry {
740d3c7b9a0SKenneth D. Merry     U32                     FlagsLength;
741d3c7b9a0SKenneth D. Merry     U64                     Address;
742d3c7b9a0SKenneth D. Merry } MPI2_SGE_SIMPLE64, MPI2_POINTER PTR_MPI2_SGE_SIMPLE64,
743d3c7b9a0SKenneth D. Merry   Mpi2SGESimple64_t, MPI2_POINTER pMpi2SGESimple64_t;
744d3c7b9a0SKenneth D. Merry 
745d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SGE_SIMPLE_UNION
746d3c7b9a0SKenneth D. Merry {
747d3c7b9a0SKenneth D. Merry     U32                     FlagsLength;
748d3c7b9a0SKenneth D. Merry     union
749d3c7b9a0SKenneth D. Merry     {
750d3c7b9a0SKenneth D. Merry         U32                 Address32;
751d3c7b9a0SKenneth D. Merry         U64                 Address64;
752d3c7b9a0SKenneth D. Merry     } u;
753d3c7b9a0SKenneth D. Merry } MPI2_SGE_SIMPLE_UNION, MPI2_POINTER PTR_MPI2_SGE_SIMPLE_UNION,
754d3c7b9a0SKenneth D. Merry   Mpi2SGESimpleUnion_t, MPI2_POINTER pMpi2SGESimpleUnion_t;
755d3c7b9a0SKenneth D. Merry 
756d3c7b9a0SKenneth D. Merry /****************************************************************************
757d3c7b9a0SKenneth D. Merry *  MPI Chain Element structures
758d3c7b9a0SKenneth D. Merry ****************************************************************************/
759d3c7b9a0SKenneth D. Merry 
760d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SGE_CHAIN32
761d3c7b9a0SKenneth D. Merry {
762d3c7b9a0SKenneth D. Merry     U16                     Length;
763d3c7b9a0SKenneth D. Merry     U8                      NextChainOffset;
764d3c7b9a0SKenneth D. Merry     U8                      Flags;
765d3c7b9a0SKenneth D. Merry     U32                     Address;
766d3c7b9a0SKenneth D. Merry } MPI2_SGE_CHAIN32, MPI2_POINTER PTR_MPI2_SGE_CHAIN32,
767d3c7b9a0SKenneth D. Merry   Mpi2SGEChain32_t, MPI2_POINTER pMpi2SGEChain32_t;
768d3c7b9a0SKenneth D. Merry 
769d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SGE_CHAIN64
770d3c7b9a0SKenneth D. Merry {
771d3c7b9a0SKenneth D. Merry     U16                     Length;
772d3c7b9a0SKenneth D. Merry     U8                      NextChainOffset;
773d3c7b9a0SKenneth D. Merry     U8                      Flags;
774d3c7b9a0SKenneth D. Merry     U64                     Address;
775d3c7b9a0SKenneth D. Merry } MPI2_SGE_CHAIN64, MPI2_POINTER PTR_MPI2_SGE_CHAIN64,
776d3c7b9a0SKenneth D. Merry   Mpi2SGEChain64_t, MPI2_POINTER pMpi2SGEChain64_t;
777d3c7b9a0SKenneth D. Merry 
778d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SGE_CHAIN_UNION
779d3c7b9a0SKenneth D. Merry {
780d3c7b9a0SKenneth D. Merry     U16                     Length;
781d3c7b9a0SKenneth D. Merry     U8                      NextChainOffset;
782d3c7b9a0SKenneth D. Merry     U8                      Flags;
783d3c7b9a0SKenneth D. Merry     union
784d3c7b9a0SKenneth D. Merry     {
785d3c7b9a0SKenneth D. Merry         U32                 Address32;
786d3c7b9a0SKenneth D. Merry         U64                 Address64;
787d3c7b9a0SKenneth D. Merry     } u;
788d3c7b9a0SKenneth D. Merry } MPI2_SGE_CHAIN_UNION, MPI2_POINTER PTR_MPI2_SGE_CHAIN_UNION,
789d3c7b9a0SKenneth D. Merry   Mpi2SGEChainUnion_t, MPI2_POINTER pMpi2SGEChainUnion_t;
790d3c7b9a0SKenneth D. Merry 
791d3c7b9a0SKenneth D. Merry /****************************************************************************
792d3c7b9a0SKenneth D. Merry *  MPI Transaction Context Element structures
793d3c7b9a0SKenneth D. Merry ****************************************************************************/
794d3c7b9a0SKenneth D. Merry 
795d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SGE_TRANSACTION32
796d3c7b9a0SKenneth D. Merry {
797d3c7b9a0SKenneth D. Merry     U8                      Reserved;
798d3c7b9a0SKenneth D. Merry     U8                      ContextSize;
799d3c7b9a0SKenneth D. Merry     U8                      DetailsLength;
800d3c7b9a0SKenneth D. Merry     U8                      Flags;
801d3c7b9a0SKenneth D. Merry     U32                     TransactionContext[1];
802d3c7b9a0SKenneth D. Merry     U32                     TransactionDetails[1];
803d3c7b9a0SKenneth D. Merry } MPI2_SGE_TRANSACTION32, MPI2_POINTER PTR_MPI2_SGE_TRANSACTION32,
804d3c7b9a0SKenneth D. Merry   Mpi2SGETransaction32_t, MPI2_POINTER pMpi2SGETransaction32_t;
805d3c7b9a0SKenneth D. Merry 
806d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SGE_TRANSACTION64
807d3c7b9a0SKenneth D. Merry {
808d3c7b9a0SKenneth D. Merry     U8                      Reserved;
809d3c7b9a0SKenneth D. Merry     U8                      ContextSize;
810d3c7b9a0SKenneth D. Merry     U8                      DetailsLength;
811d3c7b9a0SKenneth D. Merry     U8                      Flags;
812d3c7b9a0SKenneth D. Merry     U32                     TransactionContext[2];
813d3c7b9a0SKenneth D. Merry     U32                     TransactionDetails[1];
814d3c7b9a0SKenneth D. Merry } MPI2_SGE_TRANSACTION64, MPI2_POINTER PTR_MPI2_SGE_TRANSACTION64,
815d3c7b9a0SKenneth D. Merry   Mpi2SGETransaction64_t, MPI2_POINTER pMpi2SGETransaction64_t;
816d3c7b9a0SKenneth D. Merry 
817d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SGE_TRANSACTION96
818d3c7b9a0SKenneth D. Merry {
819d3c7b9a0SKenneth D. Merry     U8                      Reserved;
820d3c7b9a0SKenneth D. Merry     U8                      ContextSize;
821d3c7b9a0SKenneth D. Merry     U8                      DetailsLength;
822d3c7b9a0SKenneth D. Merry     U8                      Flags;
823d3c7b9a0SKenneth D. Merry     U32                     TransactionContext[3];
824d3c7b9a0SKenneth D. Merry     U32                     TransactionDetails[1];
825d3c7b9a0SKenneth D. Merry } MPI2_SGE_TRANSACTION96, MPI2_POINTER PTR_MPI2_SGE_TRANSACTION96,
826d3c7b9a0SKenneth D. Merry   Mpi2SGETransaction96_t, MPI2_POINTER pMpi2SGETransaction96_t;
827d3c7b9a0SKenneth D. Merry 
828d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SGE_TRANSACTION128
829d3c7b9a0SKenneth D. Merry {
830d3c7b9a0SKenneth D. Merry     U8                      Reserved;
831d3c7b9a0SKenneth D. Merry     U8                      ContextSize;
832d3c7b9a0SKenneth D. Merry     U8                      DetailsLength;
833d3c7b9a0SKenneth D. Merry     U8                      Flags;
834d3c7b9a0SKenneth D. Merry     U32                     TransactionContext[4];
835d3c7b9a0SKenneth D. Merry     U32                     TransactionDetails[1];
836d3c7b9a0SKenneth D. Merry } MPI2_SGE_TRANSACTION128, MPI2_POINTER PTR_MPI2_SGE_TRANSACTION128,
837d3c7b9a0SKenneth D. Merry   Mpi2SGETransaction_t128, MPI2_POINTER pMpi2SGETransaction_t128;
838d3c7b9a0SKenneth D. Merry 
839d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SGE_TRANSACTION_UNION
840d3c7b9a0SKenneth D. Merry {
841d3c7b9a0SKenneth D. Merry     U8                      Reserved;
842d3c7b9a0SKenneth D. Merry     U8                      ContextSize;
843d3c7b9a0SKenneth D. Merry     U8                      DetailsLength;
844d3c7b9a0SKenneth D. Merry     U8                      Flags;
845d3c7b9a0SKenneth D. Merry     union
846d3c7b9a0SKenneth D. Merry     {
847d3c7b9a0SKenneth D. Merry         U32                 TransactionContext32[1];
848d3c7b9a0SKenneth D. Merry         U32                 TransactionContext64[2];
849d3c7b9a0SKenneth D. Merry         U32                 TransactionContext96[3];
850d3c7b9a0SKenneth D. Merry         U32                 TransactionContext128[4];
851d3c7b9a0SKenneth D. Merry     } u;
852d3c7b9a0SKenneth D. Merry     U32                     TransactionDetails[1];
853d3c7b9a0SKenneth D. Merry } MPI2_SGE_TRANSACTION_UNION, MPI2_POINTER PTR_MPI2_SGE_TRANSACTION_UNION,
854d3c7b9a0SKenneth D. Merry   Mpi2SGETransactionUnion_t, MPI2_POINTER pMpi2SGETransactionUnion_t;
855d3c7b9a0SKenneth D. Merry 
856d3c7b9a0SKenneth D. Merry /****************************************************************************
857d3c7b9a0SKenneth D. Merry *  MPI SGE union for IO SGL's
858d3c7b9a0SKenneth D. Merry ****************************************************************************/
859d3c7b9a0SKenneth D. Merry 
860d3c7b9a0SKenneth D. Merry typedef struct _MPI2_MPI_SGE_IO_UNION
861d3c7b9a0SKenneth D. Merry {
862d3c7b9a0SKenneth D. Merry     union
863d3c7b9a0SKenneth D. Merry     {
864d3c7b9a0SKenneth D. Merry         MPI2_SGE_SIMPLE_UNION   Simple;
865d3c7b9a0SKenneth D. Merry         MPI2_SGE_CHAIN_UNION    Chain;
866d3c7b9a0SKenneth D. Merry     } u;
867d3c7b9a0SKenneth D. Merry } MPI2_MPI_SGE_IO_UNION, MPI2_POINTER PTR_MPI2_MPI_SGE_IO_UNION,
868d3c7b9a0SKenneth D. Merry   Mpi2MpiSGEIOUnion_t, MPI2_POINTER pMpi2MpiSGEIOUnion_t;
869d3c7b9a0SKenneth D. Merry 
870d3c7b9a0SKenneth D. Merry /****************************************************************************
871d3c7b9a0SKenneth D. Merry *  MPI SGE union for SGL's with Simple and Transaction elements
872d3c7b9a0SKenneth D. Merry ****************************************************************************/
873d3c7b9a0SKenneth D. Merry 
874d3c7b9a0SKenneth D. Merry typedef struct _MPI2_SGE_TRANS_SIMPLE_UNION
875d3c7b9a0SKenneth D. Merry {
876d3c7b9a0SKenneth D. Merry     union
877d3c7b9a0SKenneth D. Merry     {
878d3c7b9a0SKenneth D. Merry         MPI2_SGE_SIMPLE_UNION       Simple;
879d3c7b9a0SKenneth D. Merry         MPI2_SGE_TRANSACTION_UNION  Transaction;
880d3c7b9a0SKenneth D. Merry     } u;
881d3c7b9a0SKenneth D. Merry } MPI2_SGE_TRANS_SIMPLE_UNION, MPI2_POINTER PTR_MPI2_SGE_TRANS_SIMPLE_UNION,
882d3c7b9a0SKenneth D. Merry   Mpi2SGETransSimpleUnion_t, MPI2_POINTER pMpi2SGETransSimpleUnion_t;
883d3c7b9a0SKenneth D. Merry 
884d3c7b9a0SKenneth D. Merry /****************************************************************************
885d3c7b9a0SKenneth D. Merry *  All MPI SGE types union
886d3c7b9a0SKenneth D. Merry ****************************************************************************/
887d3c7b9a0SKenneth D. Merry 
888d3c7b9a0SKenneth D. Merry typedef struct _MPI2_MPI_SGE_UNION
889d3c7b9a0SKenneth D. Merry {
890d3c7b9a0SKenneth D. Merry     union
891d3c7b9a0SKenneth D. Merry     {
892d3c7b9a0SKenneth D. Merry         MPI2_SGE_SIMPLE_UNION       Simple;
893d3c7b9a0SKenneth D. Merry         MPI2_SGE_CHAIN_UNION        Chain;
894d3c7b9a0SKenneth D. Merry         MPI2_SGE_TRANSACTION_UNION  Transaction;
895d3c7b9a0SKenneth D. Merry     } u;
896d3c7b9a0SKenneth D. Merry } MPI2_MPI_SGE_UNION, MPI2_POINTER PTR_MPI2_MPI_SGE_UNION,
897d3c7b9a0SKenneth D. Merry   Mpi2MpiSgeUnion_t, MPI2_POINTER pMpi2MpiSgeUnion_t;
898d3c7b9a0SKenneth D. Merry 
899d3c7b9a0SKenneth D. Merry /****************************************************************************
900d3c7b9a0SKenneth D. Merry *  MPI SGE field definition and masks
901d3c7b9a0SKenneth D. Merry ****************************************************************************/
902d3c7b9a0SKenneth D. Merry 
903d3c7b9a0SKenneth D. Merry /* Flags field bit definitions */
904d3c7b9a0SKenneth D. Merry 
905d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_LAST_ELEMENT             (0x80)
906d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_END_OF_BUFFER            (0x40)
907d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_ELEMENT_TYPE_MASK        (0x30)
908d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_LOCAL_ADDRESS            (0x08)
909d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_DIRECTION                (0x04)
910d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_ADDRESS_SIZE             (0x02)
911d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_END_OF_LIST              (0x01)
912d3c7b9a0SKenneth D. Merry 
913d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_SHIFT                    (24)
914d3c7b9a0SKenneth D. Merry 
915d3c7b9a0SKenneth D. Merry #define MPI2_SGE_LENGTH_MASK                    (0x00FFFFFF)
916d3c7b9a0SKenneth D. Merry #define MPI2_SGE_CHAIN_LENGTH_MASK              (0x0000FFFF)
917d3c7b9a0SKenneth D. Merry 
918d3c7b9a0SKenneth D. Merry /* Element Type */
919d3c7b9a0SKenneth D. Merry 
920d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_TRANSACTION_ELEMENT      (0x00)
921d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_SIMPLE_ELEMENT           (0x10)
922d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_CHAIN_ELEMENT            (0x30)
923d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_ELEMENT_MASK             (0x30)
924d3c7b9a0SKenneth D. Merry 
925d3c7b9a0SKenneth D. Merry /* Address location */
926d3c7b9a0SKenneth D. Merry 
927d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_SYSTEM_ADDRESS           (0x00)
928d3c7b9a0SKenneth D. Merry 
929d3c7b9a0SKenneth D. Merry /* Direction */
930d3c7b9a0SKenneth D. Merry 
931d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_IOC_TO_HOST              (0x00)
932d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_HOST_TO_IOC              (0x04)
933d3c7b9a0SKenneth D. Merry 
934d043c564SKenneth D. Merry #define MPI2_SGE_FLAGS_DEST                     (MPI2_SGE_FLAGS_IOC_TO_HOST)
935d043c564SKenneth D. Merry #define MPI2_SGE_FLAGS_SOURCE                   (MPI2_SGE_FLAGS_HOST_TO_IOC)
936d043c564SKenneth D. Merry 
937d3c7b9a0SKenneth D. Merry /* Address Size */
938d3c7b9a0SKenneth D. Merry 
939d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_32_BIT_ADDRESSING        (0x00)
940d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_64_BIT_ADDRESSING        (0x02)
941d3c7b9a0SKenneth D. Merry 
942d3c7b9a0SKenneth D. Merry /* Context Size */
943d3c7b9a0SKenneth D. Merry 
944d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_32_BIT_CONTEXT           (0x00)
945d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_64_BIT_CONTEXT           (0x02)
946d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_96_BIT_CONTEXT           (0x04)
947d3c7b9a0SKenneth D. Merry #define MPI2_SGE_FLAGS_128_BIT_CONTEXT          (0x06)
948d3c7b9a0SKenneth D. Merry 
949d3c7b9a0SKenneth D. Merry #define MPI2_SGE_CHAIN_OFFSET_MASK              (0x00FF0000)
950d3c7b9a0SKenneth D. Merry #define MPI2_SGE_CHAIN_OFFSET_SHIFT             (16)
951d3c7b9a0SKenneth D. Merry 
952d3c7b9a0SKenneth D. Merry /****************************************************************************
953d3c7b9a0SKenneth D. Merry *  MPI SGE operation Macros
954d3c7b9a0SKenneth D. Merry ****************************************************************************/
955d3c7b9a0SKenneth D. Merry 
956d3c7b9a0SKenneth D. Merry /* SIMPLE FlagsLength manipulations... */
957d3c7b9a0SKenneth D. Merry #define MPI2_SGE_SET_FLAGS(f)          ((U32)(f) << MPI2_SGE_FLAGS_SHIFT)
958d3c7b9a0SKenneth D. Merry #define MPI2_SGE_GET_FLAGS(f)          (((f) & ~MPI2_SGE_LENGTH_MASK) >> MPI2_SGE_FLAGS_SHIFT)
959d3c7b9a0SKenneth D. Merry #define MPI2_SGE_LENGTH(f)             ((f) & MPI2_SGE_LENGTH_MASK)
960d3c7b9a0SKenneth D. Merry #define MPI2_SGE_CHAIN_LENGTH(f)       ((f) & MPI2_SGE_CHAIN_LENGTH_MASK)
961d3c7b9a0SKenneth D. Merry 
962d3c7b9a0SKenneth D. Merry #define MPI2_SGE_SET_FLAGS_LENGTH(f,l) (MPI2_SGE_SET_FLAGS(f) | MPI2_SGE_LENGTH(l))
963d3c7b9a0SKenneth D. Merry 
964d3c7b9a0SKenneth D. Merry #define MPI2_pSGE_GET_FLAGS(psg)            MPI2_SGE_GET_FLAGS((psg)->FlagsLength)
965d3c7b9a0SKenneth D. Merry #define MPI2_pSGE_GET_LENGTH(psg)           MPI2_SGE_LENGTH((psg)->FlagsLength)
966d3c7b9a0SKenneth D. Merry #define MPI2_pSGE_SET_FLAGS_LENGTH(psg,f,l) (psg)->FlagsLength = MPI2_SGE_SET_FLAGS_LENGTH(f,l)
967d3c7b9a0SKenneth D. Merry 
968d3c7b9a0SKenneth D. Merry /* CAUTION - The following are READ-MODIFY-WRITE! */
969d3c7b9a0SKenneth D. Merry #define MPI2_pSGE_SET_FLAGS(psg,f)      (psg)->FlagsLength |= MPI2_SGE_SET_FLAGS(f)
970d3c7b9a0SKenneth D. Merry #define MPI2_pSGE_SET_LENGTH(psg,l)     (psg)->FlagsLength |= MPI2_SGE_LENGTH(l)
971d3c7b9a0SKenneth D. Merry 
972d3c7b9a0SKenneth D. Merry #define MPI2_GET_CHAIN_OFFSET(x)    ((x & MPI2_SGE_CHAIN_OFFSET_MASK) >> MPI2_SGE_CHAIN_OFFSET_SHIFT)
973d3c7b9a0SKenneth D. Merry 
974d3c7b9a0SKenneth D. Merry /*****************************************************************************
975d3c7b9a0SKenneth D. Merry *
976d3c7b9a0SKenneth D. Merry *        Fusion-MPT IEEE Scatter Gather Elements
977d3c7b9a0SKenneth D. Merry *
978d3c7b9a0SKenneth D. Merry *****************************************************************************/
979d3c7b9a0SKenneth D. Merry 
980d3c7b9a0SKenneth D. Merry /****************************************************************************
981d3c7b9a0SKenneth D. Merry *  IEEE Simple Element structures
982d3c7b9a0SKenneth D. Merry ****************************************************************************/
983d3c7b9a0SKenneth D. Merry 
984d3c7b9a0SKenneth D. Merry typedef struct _MPI2_IEEE_SGE_SIMPLE32
985d3c7b9a0SKenneth D. Merry {
986d3c7b9a0SKenneth D. Merry     U32                     Address;
987d3c7b9a0SKenneth D. Merry     U32                     FlagsLength;
988d3c7b9a0SKenneth D. Merry } MPI2_IEEE_SGE_SIMPLE32, MPI2_POINTER PTR_MPI2_IEEE_SGE_SIMPLE32,
989d3c7b9a0SKenneth D. Merry   Mpi2IeeeSgeSimple32_t, MPI2_POINTER pMpi2IeeeSgeSimple32_t;
990d3c7b9a0SKenneth D. Merry 
991d3c7b9a0SKenneth D. Merry typedef struct _MPI2_IEEE_SGE_SIMPLE64
992d3c7b9a0SKenneth D. Merry {
993d3c7b9a0SKenneth D. Merry     U64                     Address;
994d3c7b9a0SKenneth D. Merry     U32                     Length;
995d3c7b9a0SKenneth D. Merry     U16                     Reserved1;
996d3c7b9a0SKenneth D. Merry     U8                      Reserved2;
997d3c7b9a0SKenneth D. Merry     U8                      Flags;
998d3c7b9a0SKenneth D. Merry } MPI2_IEEE_SGE_SIMPLE64, MPI2_POINTER PTR_MPI2_IEEE_SGE_SIMPLE64,
999d3c7b9a0SKenneth D. Merry   Mpi2IeeeSgeSimple64_t, MPI2_POINTER pMpi2IeeeSgeSimple64_t;
1000d3c7b9a0SKenneth D. Merry 
1001d3c7b9a0SKenneth D. Merry typedef union _MPI2_IEEE_SGE_SIMPLE_UNION
1002d3c7b9a0SKenneth D. Merry {
1003d3c7b9a0SKenneth D. Merry     MPI2_IEEE_SGE_SIMPLE32  Simple32;
1004d3c7b9a0SKenneth D. Merry     MPI2_IEEE_SGE_SIMPLE64  Simple64;
1005d3c7b9a0SKenneth D. Merry } MPI2_IEEE_SGE_SIMPLE_UNION, MPI2_POINTER PTR_MPI2_IEEE_SGE_SIMPLE_UNION,
1006d3c7b9a0SKenneth D. Merry   Mpi2IeeeSgeSimpleUnion_t, MPI2_POINTER pMpi2IeeeSgeSimpleUnion_t;
1007d3c7b9a0SKenneth D. Merry 
1008d3c7b9a0SKenneth D. Merry /****************************************************************************
1009d3c7b9a0SKenneth D. Merry *  IEEE Chain Element structures
1010d3c7b9a0SKenneth D. Merry ****************************************************************************/
1011d3c7b9a0SKenneth D. Merry 
1012d3c7b9a0SKenneth D. Merry typedef MPI2_IEEE_SGE_SIMPLE32  MPI2_IEEE_SGE_CHAIN32;
1013d3c7b9a0SKenneth D. Merry 
1014d3c7b9a0SKenneth D. Merry typedef MPI2_IEEE_SGE_SIMPLE64  MPI2_IEEE_SGE_CHAIN64;
1015d3c7b9a0SKenneth D. Merry 
1016d3c7b9a0SKenneth D. Merry typedef union _MPI2_IEEE_SGE_CHAIN_UNION
1017d3c7b9a0SKenneth D. Merry {
1018d3c7b9a0SKenneth D. Merry     MPI2_IEEE_SGE_CHAIN32   Chain32;
1019d3c7b9a0SKenneth D. Merry     MPI2_IEEE_SGE_CHAIN64   Chain64;
1020d3c7b9a0SKenneth D. Merry } MPI2_IEEE_SGE_CHAIN_UNION, MPI2_POINTER PTR_MPI2_IEEE_SGE_CHAIN_UNION,
1021d3c7b9a0SKenneth D. Merry   Mpi2IeeeSgeChainUnion_t, MPI2_POINTER pMpi2IeeeSgeChainUnion_t;
1022d3c7b9a0SKenneth D. Merry 
1023d3c7b9a0SKenneth D. Merry /****************************************************************************
1024d3c7b9a0SKenneth D. Merry *  All IEEE SGE types union
1025d3c7b9a0SKenneth D. Merry ****************************************************************************/
1026d3c7b9a0SKenneth D. Merry 
1027d3c7b9a0SKenneth D. Merry typedef struct _MPI2_IEEE_SGE_UNION
1028d3c7b9a0SKenneth D. Merry {
1029d3c7b9a0SKenneth D. Merry     union
1030d3c7b9a0SKenneth D. Merry     {
1031d3c7b9a0SKenneth D. Merry         MPI2_IEEE_SGE_SIMPLE_UNION  Simple;
1032d3c7b9a0SKenneth D. Merry         MPI2_IEEE_SGE_CHAIN_UNION   Chain;
1033d3c7b9a0SKenneth D. Merry     } u;
1034d3c7b9a0SKenneth D. Merry } MPI2_IEEE_SGE_UNION, MPI2_POINTER PTR_MPI2_IEEE_SGE_UNION,
1035d3c7b9a0SKenneth D. Merry   Mpi2IeeeSgeUnion_t, MPI2_POINTER pMpi2IeeeSgeUnion_t;
1036d3c7b9a0SKenneth D. Merry 
1037d3c7b9a0SKenneth D. Merry /****************************************************************************
1038d3c7b9a0SKenneth D. Merry *  IEEE SGE field definitions and masks
1039d3c7b9a0SKenneth D. Merry ****************************************************************************/
1040d3c7b9a0SKenneth D. Merry 
1041d3c7b9a0SKenneth D. Merry /* Flags field bit definitions */
1042d3c7b9a0SKenneth D. Merry 
1043d3c7b9a0SKenneth D. Merry #define MPI2_IEEE_SGE_FLAGS_ELEMENT_TYPE_MASK   (0x80)
1044d3c7b9a0SKenneth D. Merry 
1045d3c7b9a0SKenneth D. Merry #define MPI2_IEEE32_SGE_FLAGS_SHIFT             (24)
1046d3c7b9a0SKenneth D. Merry 
1047d3c7b9a0SKenneth D. Merry #define MPI2_IEEE32_SGE_LENGTH_MASK             (0x00FFFFFF)
1048d3c7b9a0SKenneth D. Merry 
1049d3c7b9a0SKenneth D. Merry /* Element Type */
1050d3c7b9a0SKenneth D. Merry 
1051d3c7b9a0SKenneth D. Merry #define MPI2_IEEE_SGE_FLAGS_SIMPLE_ELEMENT      (0x00)
1052d3c7b9a0SKenneth D. Merry #define MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT       (0x80)
1053d3c7b9a0SKenneth D. Merry 
1054d3c7b9a0SKenneth D. Merry /* Data Location Address Space */
1055d3c7b9a0SKenneth D. Merry 
1056d3c7b9a0SKenneth D. Merry #define MPI2_IEEE_SGE_FLAGS_ADDR_MASK           (0x03)
1057d043c564SKenneth D. Merry #define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR         (0x00) /* IEEE Simple Element only */
1058d043c564SKenneth D. Merry #define MPI2_IEEE_SGE_FLAGS_IOCDDR_ADDR         (0x01) /* IEEE Simple Element only */
1059d3c7b9a0SKenneth D. Merry #define MPI2_IEEE_SGE_FLAGS_IOCPLB_ADDR         (0x02)
1060d043c564SKenneth D. Merry #define MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR      (0x03) /* IEEE Simple Element only */
1061d043c564SKenneth D. Merry #define MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR   (0x03) /* IEEE Chain Element only */
1062d3c7b9a0SKenneth D. Merry 
1063d3c7b9a0SKenneth D. Merry /****************************************************************************
1064d3c7b9a0SKenneth D. Merry *  IEEE SGE operation Macros
1065d3c7b9a0SKenneth D. Merry ****************************************************************************/
1066d3c7b9a0SKenneth D. Merry 
1067d3c7b9a0SKenneth D. Merry /* SIMPLE FlagsLength manipulations... */
1068d3c7b9a0SKenneth D. Merry #define MPI2_IEEE32_SGE_SET_FLAGS(f)     ((U32)(f) << MPI2_IEEE32_SGE_FLAGS_SHIFT)
1069d3c7b9a0SKenneth D. Merry #define MPI2_IEEE32_SGE_GET_FLAGS(f)     (((f) & ~MPI2_IEEE32_SGE_LENGTH_MASK) >> MPI2_IEEE32_SGE_FLAGS_SHIFT)
1070d3c7b9a0SKenneth D. Merry #define MPI2_IEEE32_SGE_LENGTH(f)        ((f) & MPI2_IEEE32_SGE_LENGTH_MASK)
1071d3c7b9a0SKenneth D. Merry 
1072d3c7b9a0SKenneth D. Merry #define MPI2_IEEE32_SGE_SET_FLAGS_LENGTH(f, l)      (MPI2_IEEE32_SGE_SET_FLAGS(f) | MPI2_IEEE32_SGE_LENGTH(l))
1073d3c7b9a0SKenneth D. Merry 
1074d3c7b9a0SKenneth D. Merry #define MPI2_IEEE32_pSGE_GET_FLAGS(psg)             MPI2_IEEE32_SGE_GET_FLAGS((psg)->FlagsLength)
1075d3c7b9a0SKenneth D. Merry #define MPI2_IEEE32_pSGE_GET_LENGTH(psg)            MPI2_IEEE32_SGE_LENGTH((psg)->FlagsLength)
1076d3c7b9a0SKenneth D. Merry #define MPI2_IEEE32_pSGE_SET_FLAGS_LENGTH(psg,f,l)  (psg)->FlagsLength = MPI2_IEEE32_SGE_SET_FLAGS_LENGTH(f,l)
1077d3c7b9a0SKenneth D. Merry 
1078d3c7b9a0SKenneth D. Merry /* CAUTION - The following are READ-MODIFY-WRITE! */
1079d3c7b9a0SKenneth D. Merry #define MPI2_IEEE32_pSGE_SET_FLAGS(psg,f)    (psg)->FlagsLength |= MPI2_IEEE32_SGE_SET_FLAGS(f)
1080d3c7b9a0SKenneth D. Merry #define MPI2_IEEE32_pSGE_SET_LENGTH(psg,l)   (psg)->FlagsLength |= MPI2_IEEE32_SGE_LENGTH(l)
1081d3c7b9a0SKenneth D. Merry 
1082d3c7b9a0SKenneth D. Merry /*****************************************************************************
1083d3c7b9a0SKenneth D. Merry *
1084d3c7b9a0SKenneth D. Merry *        Fusion-MPT MPI/IEEE Scatter Gather Unions
1085d3c7b9a0SKenneth D. Merry *
1086d3c7b9a0SKenneth D. Merry *****************************************************************************/
1087d3c7b9a0SKenneth D. Merry 
1088d3c7b9a0SKenneth D. Merry typedef union _MPI2_SIMPLE_SGE_UNION
1089d3c7b9a0SKenneth D. Merry {
1090d3c7b9a0SKenneth D. Merry     MPI2_SGE_SIMPLE_UNION       MpiSimple;
1091d3c7b9a0SKenneth D. Merry     MPI2_IEEE_SGE_SIMPLE_UNION  IeeeSimple;
1092d3c7b9a0SKenneth D. Merry } MPI2_SIMPLE_SGE_UNION, MPI2_POINTER PTR_MPI2_SIMPLE_SGE_UNION,
1093d3c7b9a0SKenneth D. Merry   Mpi2SimpleSgeUntion_t, MPI2_POINTER pMpi2SimpleSgeUntion_t;
1094d3c7b9a0SKenneth D. Merry 
1095d3c7b9a0SKenneth D. Merry typedef union _MPI2_SGE_IO_UNION
1096d3c7b9a0SKenneth D. Merry {
1097d3c7b9a0SKenneth D. Merry     MPI2_SGE_SIMPLE_UNION       MpiSimple;
1098d3c7b9a0SKenneth D. Merry     MPI2_SGE_CHAIN_UNION        MpiChain;
1099d3c7b9a0SKenneth D. Merry     MPI2_IEEE_SGE_SIMPLE_UNION  IeeeSimple;
1100d3c7b9a0SKenneth D. Merry     MPI2_IEEE_SGE_CHAIN_UNION   IeeeChain;
1101d3c7b9a0SKenneth D. Merry } MPI2_SGE_IO_UNION, MPI2_POINTER PTR_MPI2_SGE_IO_UNION,
1102d3c7b9a0SKenneth D. Merry   Mpi2SGEIOUnion_t, MPI2_POINTER pMpi2SGEIOUnion_t;
1103d3c7b9a0SKenneth D. Merry 
1104d3c7b9a0SKenneth D. Merry /****************************************************************************
1105d3c7b9a0SKenneth D. Merry *
1106d3c7b9a0SKenneth D. Merry *  Values for SGLFlags field, used in many request messages with an SGL
1107d3c7b9a0SKenneth D. Merry *
1108d3c7b9a0SKenneth D. Merry ****************************************************************************/
1109d3c7b9a0SKenneth D. Merry 
1110d3c7b9a0SKenneth D. Merry /* values for MPI SGL Data Location Address Space subfield */
1111d3c7b9a0SKenneth D. Merry #define MPI2_SGLFLAGS_ADDRESS_SPACE_MASK            (0x0C)
1112d3c7b9a0SKenneth D. Merry #define MPI2_SGLFLAGS_SYSTEM_ADDRESS_SPACE          (0x00)
1113d3c7b9a0SKenneth D. Merry #define MPI2_SGLFLAGS_IOCDDR_ADDRESS_SPACE          (0x04)
1114d3c7b9a0SKenneth D. Merry #define MPI2_SGLFLAGS_IOCPLB_ADDRESS_SPACE          (0x08)
1115d3c7b9a0SKenneth D. Merry #define MPI2_SGLFLAGS_IOCPLBNTA_ADDRESS_SPACE       (0x0C)
1116d3c7b9a0SKenneth D. Merry /* values for SGL Type subfield */
1117d3c7b9a0SKenneth D. Merry #define MPI2_SGLFLAGS_SGL_TYPE_MASK                 (0x03)
1118d3c7b9a0SKenneth D. Merry #define MPI2_SGLFLAGS_SGL_TYPE_MPI                  (0x00)
1119d3c7b9a0SKenneth D. Merry #define MPI2_SGLFLAGS_SGL_TYPE_IEEE32               (0x01)
1120d3c7b9a0SKenneth D. Merry #define MPI2_SGLFLAGS_SGL_TYPE_IEEE64               (0x02)
1121d3c7b9a0SKenneth D. Merry 
1122d3c7b9a0SKenneth D. Merry #endif
1123