mpi2.h revision f4af3c14113d1b0d98d5a5e717b8aa1f484065b6
1635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*
2635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  Copyright (c) 2000-2009 LSI Corporation.
3635374e7eb110e80d9918b8611198edd56a32975Eric Moore *
4635374e7eb110e80d9918b8611198edd56a32975Eric Moore *
5635374e7eb110e80d9918b8611198edd56a32975Eric Moore *           Name:  mpi2.h
6635374e7eb110e80d9918b8611198edd56a32975Eric Moore *          Title:  MPI Message independent structures and definitions
7635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                  including System Interface Register Set and
8635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                  scatter/gather formats.
9635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  Creation Date:  June 21, 2006
10635374e7eb110e80d9918b8611198edd56a32975Eric Moore *
11f4af3c14113d1b0d98d5a5e717b8aa1f484065b6Kashyap, Desai *  mpi2.h Version:  02.00.14
12635374e7eb110e80d9918b8611198edd56a32975Eric Moore *
13635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  Version History
14635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  ---------------
15635374e7eb110e80d9918b8611198edd56a32975Eric Moore *
16635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  Date      Version   Description
17635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  --------  --------  ------------------------------------------------------
18635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  04-30-07  02.00.00  Corresponds to Fusion-MPT MPI Specification Rev A.
19635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  06-04-07  02.00.01  Bumped MPI2_HEADER_VERSION_UNIT.
20635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  06-26-07  02.00.02  Bumped MPI2_HEADER_VERSION_UNIT.
21635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  08-31-07  02.00.03  Bumped MPI2_HEADER_VERSION_UNIT.
22635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      Moved ReplyPostHostIndex register to offset 0x6C of the
23635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      MPI2_SYSTEM_INTERFACE_REGS and modified the define for
24635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      MPI2_REPLY_POST_HOST_INDEX_OFFSET.
25635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      Added union of request descriptors.
26635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      Added union of reply descriptors.
27635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  10-31-07  02.00.04  Bumped MPI2_HEADER_VERSION_UNIT.
28635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      Added define for MPI2_VERSION_02_00.
29635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      Fixed the size of the FunctionDependent5 field in the
30635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      MPI2_DEFAULT_REPLY structure.
31635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  12-18-07  02.00.05  Bumped MPI2_HEADER_VERSION_UNIT.
32635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      Removed the MPI-defined Fault Codes and extended the
33635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      product specific codes up to 0xEFFF.
34635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      Added a sixth key value for the WriteSequence register
35635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      and changed the flush value to 0x0.
36635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      Added message function codes for Diagnostic Buffer Post
37635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      and Diagnsotic Release.
38635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      New IOCStatus define: MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED
39635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      Moved MPI2_VERSION_UNION from mpi2_ioc.h.
40635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  02-29-08  02.00.06  Bumped MPI2_HEADER_VERSION_UNIT.
41635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  03-03-08  02.00.07  Bumped MPI2_HEADER_VERSION_UNIT.
42635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  05-21-08  02.00.08  Bumped MPI2_HEADER_VERSION_UNIT.
43635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      Added #defines for marking a reply descriptor as unused.
44635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  06-27-08  02.00.09  Bumped MPI2_HEADER_VERSION_UNIT.
45635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  10-02-08  02.00.10  Bumped MPI2_HEADER_VERSION_UNIT.
46635374e7eb110e80d9918b8611198edd56a32975Eric Moore *                      Moved LUN field defines from mpi2_init.h.
47635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  01-19-09  02.00.11  Bumped MPI2_HEADER_VERSION_UNIT.
487b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai *  05-06-09  02.00.12  Bumped MPI2_HEADER_VERSION_UNIT.
497b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai *                      In all request and reply descriptors, replaced VF_ID
507b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai *                      field with MSIxIndex field.
517b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai *                      Removed DevHandle field from
527b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai *                      MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR and made those
537b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai *                      bytes reserved.
547b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai *                      Added RAID Accelerator functionality.
559fec5f9fc2fbe7c6e39db01ae296528d9a20a5b1Kashyap, Desai *  07-30-09  02.00.13  Bumped MPI2_HEADER_VERSION_UNIT.
56f4af3c14113d1b0d98d5a5e717b8aa1f484065b6Kashyap, Desai *  10-28-09  02.00.14  Bumped MPI2_HEADER_VERSION_UNIT.
57f4af3c14113d1b0d98d5a5e717b8aa1f484065b6Kashyap, Desai *                      Added MSI-x index mask and shift for Reply Post Host
58f4af3c14113d1b0d98d5a5e717b8aa1f484065b6Kashyap, Desai *                      Index register.
59f4af3c14113d1b0d98d5a5e717b8aa1f484065b6Kashyap, Desai *                      Added function code for Host Based Discovery Action.
60635374e7eb110e80d9918b8611198edd56a32975Eric Moore *  --------------------------------------------------------------------------
61635374e7eb110e80d9918b8611198edd56a32975Eric Moore */
62635374e7eb110e80d9918b8611198edd56a32975Eric Moore
63635374e7eb110e80d9918b8611198edd56a32975Eric Moore#ifndef MPI2_H
64635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_H
65635374e7eb110e80d9918b8611198edd56a32975Eric Moore
66635374e7eb110e80d9918b8611198edd56a32975Eric Moore
67635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*****************************************************************************
68635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
69635374e7eb110e80d9918b8611198edd56a32975Eric Moore*        MPI Version Definitions
70635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
71635374e7eb110e80d9918b8611198edd56a32975Eric Moore*****************************************************************************/
72635374e7eb110e80d9918b8611198edd56a32975Eric Moore
73635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_VERSION_MAJOR                  (0x02)
74635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_VERSION_MINOR                  (0x00)
75635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_VERSION_MAJOR_MASK             (0xFF00)
76635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_VERSION_MAJOR_SHIFT            (8)
77635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_VERSION_MINOR_MASK             (0x00FF)
78635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_VERSION_MINOR_SHIFT            (0)
79635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_VERSION ((MPI2_VERSION_MAJOR << MPI2_VERSION_MAJOR_SHIFT) |   \
80635374e7eb110e80d9918b8611198edd56a32975Eric Moore                                      MPI2_VERSION_MINOR)
81635374e7eb110e80d9918b8611198edd56a32975Eric Moore
82635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_VERSION_02_00                  (0x0200)
83635374e7eb110e80d9918b8611198edd56a32975Eric Moore
84635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* versioning for this MPI header set */
85f4af3c14113d1b0d98d5a5e717b8aa1f484065b6Kashyap, Desai#define MPI2_HEADER_VERSION_UNIT            (0x0E)
86635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HEADER_VERSION_DEV             (0x00)
87635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HEADER_VERSION_UNIT_MASK       (0xFF00)
88635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HEADER_VERSION_UNIT_SHIFT      (8)
89635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HEADER_VERSION_DEV_MASK        (0x00FF)
90635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HEADER_VERSION_DEV_SHIFT       (0)
91635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HEADER_VERSION ((MPI2_HEADER_VERSION_UNIT << 8) | MPI2_HEADER_VERSION_DEV)
92635374e7eb110e80d9918b8611198edd56a32975Eric Moore
93635374e7eb110e80d9918b8611198edd56a32975Eric Moore
94635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*****************************************************************************
95635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
96635374e7eb110e80d9918b8611198edd56a32975Eric Moore*        IOC State Definitions
97635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
98635374e7eb110e80d9918b8611198edd56a32975Eric Moore*****************************************************************************/
99635374e7eb110e80d9918b8611198edd56a32975Eric Moore
100635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOC_STATE_RESET               (0x00000000)
101635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOC_STATE_READY               (0x10000000)
102635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOC_STATE_OPERATIONAL         (0x20000000)
103635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOC_STATE_FAULT               (0x40000000)
104635374e7eb110e80d9918b8611198edd56a32975Eric Moore
105635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOC_STATE_MASK                (0xF0000000)
106635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOC_STATE_SHIFT               (28)
107635374e7eb110e80d9918b8611198edd56a32975Eric Moore
108635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Fault state range for prodcut specific codes */
109635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FAULT_PRODUCT_SPECIFIC_MIN                 (0x0000)
110635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FAULT_PRODUCT_SPECIFIC_MAX                 (0xEFFF)
111635374e7eb110e80d9918b8611198edd56a32975Eric Moore
112635374e7eb110e80d9918b8611198edd56a32975Eric Moore
113635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*****************************************************************************
114635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
115635374e7eb110e80d9918b8611198edd56a32975Eric Moore*        System Interface Register Definitions
116635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
117635374e7eb110e80d9918b8611198edd56a32975Eric Moore*****************************************************************************/
118635374e7eb110e80d9918b8611198edd56a32975Eric Moore
119635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef volatile struct _MPI2_SYSTEM_INTERFACE_REGS
120635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
121635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         Doorbell;                   /* 0x00 */
122635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         WriteSequence;              /* 0x04 */
123635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         HostDiagnostic;             /* 0x08 */
124635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         Reserved1;                  /* 0x0C */
125635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         DiagRWData;                 /* 0x10 */
126635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         DiagRWAddressLow;           /* 0x14 */
127635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         DiagRWAddressHigh;          /* 0x18 */
128635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         Reserved2[5];               /* 0x1C */
129635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         HostInterruptStatus;        /* 0x30 */
130635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         HostInterruptMask;          /* 0x34 */
131635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         DCRData;                    /* 0x38 */
132635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         DCRAddress;                 /* 0x3C */
133635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         Reserved3[2];               /* 0x40 */
134635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         ReplyFreeHostIndex;         /* 0x48 */
135635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         Reserved4[8];               /* 0x4C */
136635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         ReplyPostHostIndex;         /* 0x6C */
137635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         Reserved5;                  /* 0x70 */
138635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         HCBSize;                    /* 0x74 */
139635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         HCBAddressLow;              /* 0x78 */
140635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         HCBAddressHigh;             /* 0x7C */
141635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         Reserved6[16];              /* 0x80 */
142635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         RequestDescriptorPostLow;   /* 0xC0 */
143635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         RequestDescriptorPostHigh;  /* 0xC4 */
144635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32         Reserved7[14];              /* 0xC8 */
145635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SYSTEM_INTERFACE_REGS, MPI2_POINTER PTR_MPI2_SYSTEM_INTERFACE_REGS,
146635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SystemInterfaceRegs_t, MPI2_POINTER pMpi2SystemInterfaceRegs_t;
147635374e7eb110e80d9918b8611198edd56a32975Eric Moore
148635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*
149635374e7eb110e80d9918b8611198edd56a32975Eric Moore * Defines for working with the Doorbell register.
150635374e7eb110e80d9918b8611198edd56a32975Eric Moore */
151635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DOORBELL_OFFSET                    (0x00000000)
152635374e7eb110e80d9918b8611198edd56a32975Eric Moore
153635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* IOC --> System values */
154635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DOORBELL_USED                      (0x08000000)
155635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DOORBELL_WHO_INIT_MASK             (0x07000000)
156635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DOORBELL_WHO_INIT_SHIFT            (24)
157635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DOORBELL_FAULT_CODE_MASK           (0x0000FFFF)
158635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DOORBELL_DATA_MASK                 (0x0000FFFF)
159635374e7eb110e80d9918b8611198edd56a32975Eric Moore
160635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* System --> IOC values */
161635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DOORBELL_FUNCTION_MASK             (0xFF000000)
162635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DOORBELL_FUNCTION_SHIFT            (24)
163635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DOORBELL_ADD_DWORDS_MASK           (0x00FF0000)
164635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DOORBELL_ADD_DWORDS_SHIFT          (16)
165635374e7eb110e80d9918b8611198edd56a32975Eric Moore
166635374e7eb110e80d9918b8611198edd56a32975Eric Moore
167635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*
168635374e7eb110e80d9918b8611198edd56a32975Eric Moore * Defines for the WriteSequence register
169635374e7eb110e80d9918b8611198edd56a32975Eric Moore */
170635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_WRITE_SEQUENCE_OFFSET              (0x00000004)
171635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_WRSEQ_KEY_VALUE_MASK               (0x0000000F)
172635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_WRSEQ_FLUSH_KEY_VALUE              (0x0)
173635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_WRSEQ_1ST_KEY_VALUE                (0xF)
174635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_WRSEQ_2ND_KEY_VALUE                (0x4)
175635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_WRSEQ_3RD_KEY_VALUE                (0xB)
176635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_WRSEQ_4TH_KEY_VALUE                (0x2)
177635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_WRSEQ_5TH_KEY_VALUE                (0x7)
178635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_WRSEQ_6TH_KEY_VALUE                (0xD)
179635374e7eb110e80d9918b8611198edd56a32975Eric Moore
180635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*
181635374e7eb110e80d9918b8611198edd56a32975Eric Moore * Defines for the HostDiagnostic register
182635374e7eb110e80d9918b8611198edd56a32975Eric Moore */
183635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HOST_DIAGNOSTIC_OFFSET             (0x00000008)
184635374e7eb110e80d9918b8611198edd56a32975Eric Moore
185635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_BOOT_DEVICE_SELECT_MASK       (0x00001800)
186635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_BOOT_DEVICE_SELECT_DEFAULT    (0x00000000)
187635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_BOOT_DEVICE_SELECT_HCDW       (0x00000800)
188635374e7eb110e80d9918b8611198edd56a32975Eric Moore
189635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_CLEAR_FLASH_BAD_SIG           (0x00000400)
190635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_FORCE_HCB_ON_RESET            (0x00000200)
191635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_HCB_MODE                      (0x00000100)
192635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_DIAG_WRITE_ENABLE             (0x00000080)
193635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_FLASH_BAD_SIG                 (0x00000040)
194635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_RESET_HISTORY                 (0x00000020)
195635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_DIAG_RW_ENABLE                (0x00000010)
196635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_RESET_ADAPTER                 (0x00000004)
197635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_HOLD_IOC_RESET                (0x00000002)
198635374e7eb110e80d9918b8611198edd56a32975Eric Moore
199635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*
200635374e7eb110e80d9918b8611198edd56a32975Eric Moore * Offsets for DiagRWData and address
201635374e7eb110e80d9918b8611198edd56a32975Eric Moore */
202635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_RW_DATA_OFFSET                (0x00000010)
203635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_RW_ADDRESS_LOW_OFFSET         (0x00000014)
204635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DIAG_RW_ADDRESS_HIGH_OFFSET        (0x00000018)
205635374e7eb110e80d9918b8611198edd56a32975Eric Moore
206635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*
207635374e7eb110e80d9918b8611198edd56a32975Eric Moore * Defines for the HostInterruptStatus register
208635374e7eb110e80d9918b8611198edd56a32975Eric Moore */
209635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HOST_INTERRUPT_STATUS_OFFSET       (0x00000030)
210635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HIS_SYS2IOC_DB_STATUS              (0x80000000)
211635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HIS_IOP_DOORBELL_STATUS            MPI2_HIS_SYS2IOC_DB_STATUS
212635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HIS_RESET_IRQ_STATUS               (0x40000000)
213635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HIS_REPLY_DESCRIPTOR_INTERRUPT     (0x00000008)
214635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HIS_IOC2SYS_DB_STATUS              (0x00000001)
215635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HIS_DOORBELL_INTERRUPT             MPI2_HIS_IOC2SYS_DB_STATUS
216635374e7eb110e80d9918b8611198edd56a32975Eric Moore
217635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*
218635374e7eb110e80d9918b8611198edd56a32975Eric Moore * Defines for the HostInterruptMask register
219635374e7eb110e80d9918b8611198edd56a32975Eric Moore */
220635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HOST_INTERRUPT_MASK_OFFSET         (0x00000034)
221635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HIM_RESET_IRQ_MASK                 (0x40000000)
222635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HIM_REPLY_INT_MASK                 (0x00000008)
223635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HIM_RIM                            MPI2_HIM_REPLY_INT_MASK
224635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HIM_IOC2SYS_DB_MASK                (0x00000001)
225635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HIM_DIM                            MPI2_HIM_IOC2SYS_DB_MASK
226635374e7eb110e80d9918b8611198edd56a32975Eric Moore
227635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*
228635374e7eb110e80d9918b8611198edd56a32975Eric Moore * Offsets for DCRData and address
229635374e7eb110e80d9918b8611198edd56a32975Eric Moore */
230635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DCR_DATA_OFFSET                    (0x00000038)
231635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_DCR_ADDRESS_OFFSET                 (0x0000003C)
232635374e7eb110e80d9918b8611198edd56a32975Eric Moore
233635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*
234635374e7eb110e80d9918b8611198edd56a32975Eric Moore * Offset for the Reply Free Queue
235635374e7eb110e80d9918b8611198edd56a32975Eric Moore */
236635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_REPLY_FREE_HOST_INDEX_OFFSET       (0x00000048)
237635374e7eb110e80d9918b8611198edd56a32975Eric Moore
238635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*
239f4af3c14113d1b0d98d5a5e717b8aa1f484065b6Kashyap, Desai * Defines for the Reply Descriptor Post Queue
240635374e7eb110e80d9918b8611198edd56a32975Eric Moore */
241635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_REPLY_POST_HOST_INDEX_OFFSET       (0x0000006C)
242f4af3c14113d1b0d98d5a5e717b8aa1f484065b6Kashyap, Desai#define MPI2_REPLY_POST_HOST_INDEX_MASK         (0x00FFFFFF)
243f4af3c14113d1b0d98d5a5e717b8aa1f484065b6Kashyap, Desai#define MPI2_RPHI_MSIX_INDEX_MASK               (0xFF000000)
244f4af3c14113d1b0d98d5a5e717b8aa1f484065b6Kashyap, Desai#define MPI2_RPHI_MSIX_INDEX_SHIFT              (24)
245635374e7eb110e80d9918b8611198edd56a32975Eric Moore
246635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*
247635374e7eb110e80d9918b8611198edd56a32975Eric Moore * Defines for the HCBSize and address
248635374e7eb110e80d9918b8611198edd56a32975Eric Moore */
249635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HCB_SIZE_OFFSET                    (0x00000074)
250635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HCB_SIZE_SIZE_MASK                 (0xFFFFF000)
251635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HCB_SIZE_HCB_ENABLE                (0x00000001)
252635374e7eb110e80d9918b8611198edd56a32975Eric Moore
253635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HCB_ADDRESS_LOW_OFFSET             (0x00000078)
254635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_HCB_ADDRESS_HIGH_OFFSET            (0x0000007C)
255635374e7eb110e80d9918b8611198edd56a32975Eric Moore
256635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*
257635374e7eb110e80d9918b8611198edd56a32975Eric Moore * Offsets for the Request Queue
258635374e7eb110e80d9918b8611198edd56a32975Eric Moore */
259635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_REQUEST_DESCRIPTOR_POST_LOW_OFFSET     (0x000000C0)
260635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_REQUEST_DESCRIPTOR_POST_HIGH_OFFSET    (0x000000C4)
261635374e7eb110e80d9918b8611198edd56a32975Eric Moore
262635374e7eb110e80d9918b8611198edd56a32975Eric Moore
263635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*****************************************************************************
264635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
265635374e7eb110e80d9918b8611198edd56a32975Eric Moore*        Message Descriptors
266635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
267635374e7eb110e80d9918b8611198edd56a32975Eric Moore*****************************************************************************/
268635374e7eb110e80d9918b8611198edd56a32975Eric Moore
269635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Request Descriptors */
270635374e7eb110e80d9918b8611198edd56a32975Eric Moore
271635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Default Request Descriptor */
272635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_DEFAULT_REQUEST_DESCRIPTOR
273635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
274635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              RequestFlags;               /* 0x00 */
2757b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U8              MSIxIndex;                  /* 0x01 */
276635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             SMID;                       /* 0x02 */
277635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             LMID;                       /* 0x04 */
278635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             DescriptorTypeDependent;    /* 0x06 */
279635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_DEFAULT_REQUEST_DESCRIPTOR,
280635374e7eb110e80d9918b8611198edd56a32975Eric Moore  MPI2_POINTER PTR_MPI2_DEFAULT_REQUEST_DESCRIPTOR,
281635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2DefaultRequestDescriptor_t, MPI2_POINTER pMpi2DefaultRequestDescriptor_t;
282635374e7eb110e80d9918b8611198edd56a32975Eric Moore
283635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* defines for the RequestFlags field */
284635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_REQ_DESCRIPT_FLAGS_TYPE_MASK               (0x0E)
285635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO                 (0x00)
286635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_REQ_DESCRIPT_FLAGS_SCSI_TARGET             (0x02)
287635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY           (0x06)
288635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE            (0x08)
2897b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai#define MPI2_REQ_DESCRIPT_FLAGS_RAID_ACCELERATOR        (0x0A)
290635374e7eb110e80d9918b8611198edd56a32975Eric Moore
291635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_REQ_DESCRIPT_FLAGS_IOC_FIFO_MARKER (0x01)
292635374e7eb110e80d9918b8611198edd56a32975Eric Moore
293635374e7eb110e80d9918b8611198edd56a32975Eric Moore
294635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* High Priority Request Descriptor */
295635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR
296635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
297635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              RequestFlags;               /* 0x00 */
2987b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U8              MSIxIndex;                  /* 0x01 */
299635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             SMID;                       /* 0x02 */
300635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             LMID;                       /* 0x04 */
301635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             Reserved1;                  /* 0x06 */
302635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR,
303635374e7eb110e80d9918b8611198edd56a32975Eric Moore  MPI2_POINTER PTR_MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR,
304635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2HighPriorityRequestDescriptor_t,
305635374e7eb110e80d9918b8611198edd56a32975Eric Moore  MPI2_POINTER pMpi2HighPriorityRequestDescriptor_t;
306635374e7eb110e80d9918b8611198edd56a32975Eric Moore
307635374e7eb110e80d9918b8611198edd56a32975Eric Moore
308635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* SCSI IO Request Descriptor */
309635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SCSI_IO_REQUEST_DESCRIPTOR
310635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
311635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              RequestFlags;               /* 0x00 */
3127b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U8              MSIxIndex;                  /* 0x01 */
313635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             SMID;                       /* 0x02 */
314635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             LMID;                       /* 0x04 */
315635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             DevHandle;                  /* 0x06 */
316635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SCSI_IO_REQUEST_DESCRIPTOR,
317635374e7eb110e80d9918b8611198edd56a32975Eric Moore  MPI2_POINTER PTR_MPI2_SCSI_IO_REQUEST_DESCRIPTOR,
318635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SCSIIORequestDescriptor_t, MPI2_POINTER pMpi2SCSIIORequestDescriptor_t;
319635374e7eb110e80d9918b8611198edd56a32975Eric Moore
320635374e7eb110e80d9918b8611198edd56a32975Eric Moore
321635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* SCSI Target Request Descriptor */
322635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR
323635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
324635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              RequestFlags;               /* 0x00 */
3257b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U8              MSIxIndex;                  /* 0x01 */
326635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             SMID;                       /* 0x02 */
327635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             LMID;                       /* 0x04 */
328635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             IoIndex;                    /* 0x06 */
329635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR,
330635374e7eb110e80d9918b8611198edd56a32975Eric Moore  MPI2_POINTER PTR_MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR,
331635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SCSITargetRequestDescriptor_t,
332635374e7eb110e80d9918b8611198edd56a32975Eric Moore  MPI2_POINTER pMpi2SCSITargetRequestDescriptor_t;
333635374e7eb110e80d9918b8611198edd56a32975Eric Moore
3347b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai
3357b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai/* RAID Accelerator Request Descriptor */
3367b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desaitypedef struct _MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR {
3377b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U8              RequestFlags;               /* 0x00 */
3387b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U8              MSIxIndex;                  /* 0x01 */
3397b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U16             SMID;                       /* 0x02 */
3407b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U16             LMID;                       /* 0x04 */
3417b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U16             Reserved;                   /* 0x06 */
3427b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai} MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR,
3437b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai  MPI2_POINTER PTR_MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR,
3447b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai  Mpi2RAIDAcceleratorRequestDescriptor_t,
3457b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai  MPI2_POINTER pMpi2RAIDAcceleratorRequestDescriptor_t;
3467b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai
3477b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai
348635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* union of Request Descriptors */
349635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef union _MPI2_REQUEST_DESCRIPTOR_UNION
350635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
3517b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    MPI2_DEFAULT_REQUEST_DESCRIPTOR             Default;
3527b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    MPI2_HIGH_PRIORITY_REQUEST_DESCRIPTOR       HighPriority;
3537b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    MPI2_SCSI_IO_REQUEST_DESCRIPTOR             SCSIIO;
3547b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    MPI2_SCSI_TARGET_REQUEST_DESCRIPTOR         SCSITarget;
3557b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    MPI2_RAID_ACCEL_REQUEST_DESCRIPTOR          RAIDAccelerator;
3567b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U64                                         Words;
357635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_REQUEST_DESCRIPTOR_UNION, MPI2_POINTER PTR_MPI2_REQUEST_DESCRIPTOR_UNION,
358635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2RequestDescriptorUnion_t, MPI2_POINTER pMpi2RequestDescriptorUnion_t;
359635374e7eb110e80d9918b8611198edd56a32975Eric Moore
360635374e7eb110e80d9918b8611198edd56a32975Eric Moore
361635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Reply Descriptors */
362635374e7eb110e80d9918b8611198edd56a32975Eric Moore
363635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Default Reply Descriptor */
364635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_DEFAULT_REPLY_DESCRIPTOR
365635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
366635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              ReplyFlags;                 /* 0x00 */
3677b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U8              MSIxIndex;                  /* 0x01 */
368635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             DescriptorTypeDependent1;   /* 0x02 */
369635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32             DescriptorTypeDependent2;   /* 0x04 */
370635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_DEFAULT_REPLY_DESCRIPTOR, MPI2_POINTER PTR_MPI2_DEFAULT_REPLY_DESCRIPTOR,
371635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2DefaultReplyDescriptor_t, MPI2_POINTER pMpi2DefaultReplyDescriptor_t;
372635374e7eb110e80d9918b8611198edd56a32975Eric Moore
373635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* defines for the ReplyFlags field */
3747b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai#define MPI2_RPY_DESCRIPT_FLAGS_TYPE_MASK                   (0x0F)
3757b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai#define MPI2_RPY_DESCRIPT_FLAGS_SCSI_IO_SUCCESS             (0x00)
3767b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai#define MPI2_RPY_DESCRIPT_FLAGS_ADDRESS_REPLY               (0x01)
3777b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai#define MPI2_RPY_DESCRIPT_FLAGS_TARGETASSIST_SUCCESS        (0x02)
3787b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai#define MPI2_RPY_DESCRIPT_FLAGS_TARGET_COMMAND_BUFFER       (0x03)
3797b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai#define MPI2_RPY_DESCRIPT_FLAGS_RAID_ACCELERATOR_SUCCESS    (0x05)
3807b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai#define MPI2_RPY_DESCRIPT_FLAGS_UNUSED                      (0x0F)
381635374e7eb110e80d9918b8611198edd56a32975Eric Moore
382635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* values for marking a reply descriptor as unused */
383635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_RPY_DESCRIPT_UNUSED_WORD0_MARK             (0xFFFFFFFF)
384635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_RPY_DESCRIPT_UNUSED_WORD1_MARK             (0xFFFFFFFF)
385635374e7eb110e80d9918b8611198edd56a32975Eric Moore
386635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Address Reply Descriptor */
387635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_ADDRESS_REPLY_DESCRIPTOR
388635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
389635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              ReplyFlags;                 /* 0x00 */
3907b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U8              MSIxIndex;                  /* 0x01 */
391635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             SMID;                       /* 0x02 */
392635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32             ReplyFrameAddress;          /* 0x04 */
393635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_ADDRESS_REPLY_DESCRIPTOR, MPI2_POINTER PTR_MPI2_ADDRESS_REPLY_DESCRIPTOR,
394635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2AddressReplyDescriptor_t, MPI2_POINTER pMpi2AddressReplyDescriptor_t;
395635374e7eb110e80d9918b8611198edd56a32975Eric Moore
396635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_ADDRESS_REPLY_SMID_INVALID                 (0x00)
397635374e7eb110e80d9918b8611198edd56a32975Eric Moore
398635374e7eb110e80d9918b8611198edd56a32975Eric Moore
399635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* SCSI IO Success Reply Descriptor */
400635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR
401635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
402635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              ReplyFlags;                 /* 0x00 */
4037b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U8              MSIxIndex;                  /* 0x01 */
404635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             SMID;                       /* 0x02 */
405635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             TaskTag;                    /* 0x04 */
4067b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U16             Reserved1;                  /* 0x06 */
407635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR,
408635374e7eb110e80d9918b8611198edd56a32975Eric Moore  MPI2_POINTER PTR_MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR,
409635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SCSIIOSuccessReplyDescriptor_t,
410635374e7eb110e80d9918b8611198edd56a32975Eric Moore  MPI2_POINTER pMpi2SCSIIOSuccessReplyDescriptor_t;
411635374e7eb110e80d9918b8611198edd56a32975Eric Moore
412635374e7eb110e80d9918b8611198edd56a32975Eric Moore
413635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* TargetAssist Success Reply Descriptor */
414635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR
415635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
416635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              ReplyFlags;                 /* 0x00 */
4177b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U8              MSIxIndex;                  /* 0x01 */
418635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             SMID;                       /* 0x02 */
419635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              SequenceNumber;             /* 0x04 */
420635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              Reserved1;                  /* 0x05 */
421635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             IoIndex;                    /* 0x06 */
422635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR,
423635374e7eb110e80d9918b8611198edd56a32975Eric Moore  MPI2_POINTER PTR_MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR,
424635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2TargetAssistSuccessReplyDescriptor_t,
425635374e7eb110e80d9918b8611198edd56a32975Eric Moore  MPI2_POINTER pMpi2TargetAssistSuccessReplyDescriptor_t;
426635374e7eb110e80d9918b8611198edd56a32975Eric Moore
427635374e7eb110e80d9918b8611198edd56a32975Eric Moore
428635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Target Command Buffer Reply Descriptor */
429635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR
430635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
431635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              ReplyFlags;                 /* 0x00 */
4327b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U8              MSIxIndex;                  /* 0x01 */
433635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              VP_ID;                      /* 0x02 */
434635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              Flags;                      /* 0x03 */
435635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             InitiatorDevHandle;         /* 0x04 */
436635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             IoIndex;                    /* 0x06 */
437635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR,
438635374e7eb110e80d9918b8611198edd56a32975Eric Moore  MPI2_POINTER PTR_MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR,
439635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2TargetCommandBufferReplyDescriptor_t,
440635374e7eb110e80d9918b8611198edd56a32975Eric Moore  MPI2_POINTER pMpi2TargetCommandBufferReplyDescriptor_t;
441635374e7eb110e80d9918b8611198edd56a32975Eric Moore
442635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* defines for Flags field */
443635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_RPY_DESCRIPT_TCB_FLAGS_PHYNUM_MASK     (0x3F)
444635374e7eb110e80d9918b8611198edd56a32975Eric Moore
445635374e7eb110e80d9918b8611198edd56a32975Eric Moore
4467b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai/* RAID Accelerator Success Reply Descriptor */
4477b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desaitypedef struct _MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR {
4487b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U8              ReplyFlags;                 /* 0x00 */
4497b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U8              MSIxIndex;                  /* 0x01 */
4507b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U16             SMID;                       /* 0x02 */
4517b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U32             Reserved;                   /* 0x04 */
4527b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai} MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR,
4537b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai  MPI2_POINTER PTR_MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR,
4547b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai  Mpi2RAIDAcceleratorSuccessReplyDescriptor_t,
4557b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai  MPI2_POINTER pMpi2RAIDAcceleratorSuccessReplyDescriptor_t;
4567b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai
4577b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai
458635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* union of Reply Descriptors */
459635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef union _MPI2_REPLY_DESCRIPTORS_UNION
460635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
4617b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    MPI2_DEFAULT_REPLY_DESCRIPTOR                   Default;
4627b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    MPI2_ADDRESS_REPLY_DESCRIPTOR                   AddressReply;
4637b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    MPI2_SCSI_IO_SUCCESS_REPLY_DESCRIPTOR           SCSIIOSuccess;
4647b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    MPI2_TARGETASSIST_SUCCESS_REPLY_DESCRIPTOR      TargetAssistSuccess;
4657b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    MPI2_TARGET_COMMAND_BUFFER_REPLY_DESCRIPTOR     TargetCommandBuffer;
4667b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    MPI2_RAID_ACCELERATOR_SUCCESS_REPLY_DESCRIPTOR  RAIDAcceleratorSuccess;
4677b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai    U64                                             Words;
468635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_REPLY_DESCRIPTORS_UNION, MPI2_POINTER PTR_MPI2_REPLY_DESCRIPTORS_UNION,
469635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2ReplyDescriptorsUnion_t, MPI2_POINTER pMpi2ReplyDescriptorsUnion_t;
470635374e7eb110e80d9918b8611198edd56a32975Eric Moore
471635374e7eb110e80d9918b8611198edd56a32975Eric Moore
472635374e7eb110e80d9918b8611198edd56a32975Eric Moore
473635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*****************************************************************************
474635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
475635374e7eb110e80d9918b8611198edd56a32975Eric Moore*        Message Functions
476635374e7eb110e80d9918b8611198edd56a32975Eric Moore*              0x80 -> 0x8F reserved for private message use per product
477635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
478635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
479635374e7eb110e80d9918b8611198edd56a32975Eric Moore*****************************************************************************/
480635374e7eb110e80d9918b8611198edd56a32975Eric Moore
481635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_SCSI_IO_REQUEST               (0x00) /* SCSI IO */
482635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_SCSI_TASK_MGMT                (0x01) /* SCSI Task Management */
483635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_IOC_INIT                      (0x02) /* IOC Init */
484635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_IOC_FACTS                     (0x03) /* IOC Facts */
485635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_CONFIG                        (0x04) /* Configuration */
486635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_PORT_FACTS                    (0x05) /* Port Facts */
487635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_PORT_ENABLE                   (0x06) /* Port Enable */
488635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_EVENT_NOTIFICATION            (0x07) /* Event Notification */
489635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_EVENT_ACK                     (0x08) /* Event Acknowledge */
490635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_FW_DOWNLOAD                   (0x09) /* FW Download */
491635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_TARGET_ASSIST                 (0x0B) /* Target Assist */
492635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_TARGET_STATUS_SEND            (0x0C) /* Target Status Send */
493635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_TARGET_MODE_ABORT             (0x0D) /* Target Mode Abort */
494635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_FW_UPLOAD                     (0x12) /* FW Upload */
495635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_RAID_ACTION                   (0x15) /* RAID Action */
496635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_RAID_SCSI_IO_PASSTHROUGH      (0x16) /* SCSI IO RAID Passthrough */
497635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_TOOLBOX                       (0x17) /* Toolbox */
498635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_SCSI_ENCLOSURE_PROCESSOR      (0x18) /* SCSI Enclosure Processor */
499635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_SMP_PASSTHROUGH               (0x1A) /* SMP Passthrough */
500635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_SAS_IO_UNIT_CONTROL           (0x1B) /* SAS IO Unit Control */
501635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_SATA_PASSTHROUGH              (0x1C) /* SATA Passthrough */
502635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_DIAG_BUFFER_POST              (0x1D) /* Diagnostic Buffer Post */
503635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_DIAG_RELEASE                  (0x1E) /* Diagnostic Release */
504635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_TARGET_CMD_BUF_BASE_POST      (0x24) /* Target Command Buffer Post Base */
505635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_TARGET_CMD_BUF_LIST_POST      (0x25) /* Target Command Buffer Post List */
5067b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai#define MPI2_FUNCTION_RAID_ACCELERATOR              (0x2C) /* RAID Accelerator*/
507f4af3c14113d1b0d98d5a5e717b8aa1f484065b6Kashyap, Desai/* Host Based Discovery Action */
508f4af3c14113d1b0d98d5a5e717b8aa1f484065b6Kashyap, Desai#define MPI2_FUNCTION_HOST_BASED_DISCOVERY_ACTION   (0x2F)
509635374e7eb110e80d9918b8611198edd56a32975Eric Moore
510635374e7eb110e80d9918b8611198edd56a32975Eric Moore
511635374e7eb110e80d9918b8611198edd56a32975Eric Moore
512635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Doorbell functions */
513635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET        (0x40)
514635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_FUNCTION_HANDSHAKE                     (0x42)
515635374e7eb110e80d9918b8611198edd56a32975Eric Moore
516635374e7eb110e80d9918b8611198edd56a32975Eric Moore
517635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*****************************************************************************
518635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
519635374e7eb110e80d9918b8611198edd56a32975Eric Moore*        IOC Status Values
520635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
521635374e7eb110e80d9918b8611198edd56a32975Eric Moore*****************************************************************************/
522635374e7eb110e80d9918b8611198edd56a32975Eric Moore
523635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* mask for IOCStatus status value */
524635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_MASK                     (0x7FFF)
525635374e7eb110e80d9918b8611198edd56a32975Eric Moore
526635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
527635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  Common IOCStatus values for all replies
528635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
529635374e7eb110e80d9918b8611198edd56a32975Eric Moore
530635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SUCCESS                      (0x0000)
531635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_INVALID_FUNCTION             (0x0001)
532635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_BUSY                         (0x0002)
533635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_INVALID_SGL                  (0x0003)
534635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_INTERNAL_ERROR               (0x0004)
535635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_INVALID_VPID                 (0x0005)
536635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_INSUFFICIENT_RESOURCES       (0x0006)
537635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_INVALID_FIELD                (0x0007)
538635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_INVALID_STATE                (0x0008)
539635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_OP_STATE_NOT_SUPPORTED       (0x0009)
540635374e7eb110e80d9918b8611198edd56a32975Eric Moore
541635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
542635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  Config IOCStatus values
543635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
544635374e7eb110e80d9918b8611198edd56a32975Eric Moore
545635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_CONFIG_INVALID_ACTION        (0x0020)
546635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_CONFIG_INVALID_TYPE          (0x0021)
547635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_CONFIG_INVALID_PAGE          (0x0022)
548635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_CONFIG_INVALID_DATA          (0x0023)
549635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_CONFIG_NO_DEFAULTS           (0x0024)
550635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_CONFIG_CANT_COMMIT           (0x0025)
551635374e7eb110e80d9918b8611198edd56a32975Eric Moore
552635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
553635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  SCSI IO Reply
554635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
555635374e7eb110e80d9918b8611198edd56a32975Eric Moore
556635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SCSI_RECOVERED_ERROR         (0x0040)
557635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SCSI_INVALID_DEVHANDLE       (0x0042)
558635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE        (0x0043)
559635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SCSI_DATA_OVERRUN            (0x0044)
560635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SCSI_DATA_UNDERRUN           (0x0045)
561635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SCSI_IO_DATA_ERROR           (0x0046)
562635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR          (0x0047)
563635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SCSI_TASK_TERMINATED         (0x0048)
564635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SCSI_RESIDUAL_MISMATCH       (0x0049)
565635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SCSI_TASK_MGMT_FAILED        (0x004A)
566635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SCSI_IOC_TERMINATED          (0x004B)
567635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SCSI_EXT_TERMINATED          (0x004C)
568635374e7eb110e80d9918b8611198edd56a32975Eric Moore
569635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
570635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  For use by SCSI Initiator and SCSI Target end-to-end data protection
571635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
572635374e7eb110e80d9918b8611198edd56a32975Eric Moore
573635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_EEDP_GUARD_ERROR             (0x004D)
574635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR           (0x004E)
575635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR           (0x004F)
576635374e7eb110e80d9918b8611198edd56a32975Eric Moore
577635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
578635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  SCSI Target values
579635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
580635374e7eb110e80d9918b8611198edd56a32975Eric Moore
581635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_TARGET_INVALID_IO_INDEX      (0x0062)
582635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_TARGET_ABORTED               (0x0063)
583635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_TARGET_NO_CONN_RETRYABLE     (0x0064)
584635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_TARGET_NO_CONNECTION         (0x0065)
585635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_TARGET_XFER_COUNT_MISMATCH   (0x006A)
586635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_TARGET_DATA_OFFSET_ERROR     (0x006D)
587635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_TARGET_TOO_MUCH_WRITE_DATA   (0x006E)
588635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_TARGET_IU_TOO_SHORT          (0x006F)
589635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_TARGET_ACK_NAK_TIMEOUT       (0x0070)
590635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_TARGET_NAK_RECEIVED          (0x0071)
591635374e7eb110e80d9918b8611198edd56a32975Eric Moore
592635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
593635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  Serial Attached SCSI values
594635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
595635374e7eb110e80d9918b8611198edd56a32975Eric Moore
596635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SAS_SMP_REQUEST_FAILED       (0x0090)
597635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_SAS_SMP_DATA_OVERRUN         (0x0091)
598635374e7eb110e80d9918b8611198edd56a32975Eric Moore
599635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
600635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  Diagnostic Buffer Post / Diagnostic Release values
601635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
602635374e7eb110e80d9918b8611198edd56a32975Eric Moore
603635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED          (0x00A0)
604635374e7eb110e80d9918b8611198edd56a32975Eric Moore
6057b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai/****************************************************************************
6067b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai*  RAID Accelerator values
6077b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai****************************************************************************/
6087b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai
6097b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai#define MPI2_IOCSTATUS_RAID_ACCEL_ERROR             (0x00B0)
610635374e7eb110e80d9918b8611198edd56a32975Eric Moore
611635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
612635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  IOCStatus flag to indicate that log info is available
613635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
614635374e7eb110e80d9918b8611198edd56a32975Eric Moore
6157b936b02293b2891d899233d3f4bb45295e8c1f9Kashyap, Desai#define MPI2_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE      (0x8000)
616635374e7eb110e80d9918b8611198edd56a32975Eric Moore
617635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
618635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  IOCLogInfo Types
619635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
620635374e7eb110e80d9918b8611198edd56a32975Eric Moore
621635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCLOGINFO_TYPE_MASK               (0xF0000000)
622635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCLOGINFO_TYPE_SHIFT              (28)
623635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCLOGINFO_TYPE_NONE               (0x0)
624635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCLOGINFO_TYPE_SCSI               (0x1)
625635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCLOGINFO_TYPE_FC                 (0x2)
626635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCLOGINFO_TYPE_SAS                (0x3)
627635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCLOGINFO_TYPE_ISCSI              (0x4)
628635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IOCLOGINFO_LOG_DATA_MASK           (0x0FFFFFFF)
629635374e7eb110e80d9918b8611198edd56a32975Eric Moore
630635374e7eb110e80d9918b8611198edd56a32975Eric Moore
631635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*****************************************************************************
632635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
633635374e7eb110e80d9918b8611198edd56a32975Eric Moore*        Standard Message Structures
634635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
635635374e7eb110e80d9918b8611198edd56a32975Eric Moore*****************************************************************************/
636635374e7eb110e80d9918b8611198edd56a32975Eric Moore
637635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
638635374e7eb110e80d9918b8611198edd56a32975Eric Moore* Request Message Header for all request messages
639635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
640635374e7eb110e80d9918b8611198edd56a32975Eric Moore
641635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_REQUEST_HEADER
642635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
643635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             FunctionDependent1;         /* 0x00 */
644635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              ChainOffset;                /* 0x02 */
645635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              Function;                   /* 0x03 */
646635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             FunctionDependent2;         /* 0x04 */
647635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              FunctionDependent3;         /* 0x06 */
648635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              MsgFlags;                   /* 0x07 */
649635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              VP_ID;                      /* 0x08 */
650635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              VF_ID;                      /* 0x09 */
651635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             Reserved1;                  /* 0x0A */
652635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_REQUEST_HEADER, MPI2_POINTER PTR_MPI2_REQUEST_HEADER,
653635374e7eb110e80d9918b8611198edd56a32975Eric Moore  MPI2RequestHeader_t, MPI2_POINTER pMPI2RequestHeader_t;
654635374e7eb110e80d9918b8611198edd56a32975Eric Moore
655635374e7eb110e80d9918b8611198edd56a32975Eric Moore
656635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
657635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  Default Reply
658635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
659635374e7eb110e80d9918b8611198edd56a32975Eric Moore
660635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_DEFAULT_REPLY
661635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
662635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             FunctionDependent1;         /* 0x00 */
663635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              MsgLength;                  /* 0x02 */
664635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              Function;                   /* 0x03 */
665635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             FunctionDependent2;         /* 0x04 */
666635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              FunctionDependent3;         /* 0x06 */
667635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              MsgFlags;                   /* 0x07 */
668635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              VP_ID;                      /* 0x08 */
669635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8              VF_ID;                      /* 0x09 */
670635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             Reserved1;                  /* 0x0A */
671635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             FunctionDependent5;         /* 0x0C */
672635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16             IOCStatus;                  /* 0x0E */
673635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32             IOCLogInfo;                 /* 0x10 */
674635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_DEFAULT_REPLY, MPI2_POINTER PTR_MPI2_DEFAULT_REPLY,
675635374e7eb110e80d9918b8611198edd56a32975Eric Moore  MPI2DefaultReply_t, MPI2_POINTER pMPI2DefaultReply_t;
676635374e7eb110e80d9918b8611198edd56a32975Eric Moore
677635374e7eb110e80d9918b8611198edd56a32975Eric Moore
678635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* common version structure/union used in messages and configuration pages */
679635374e7eb110e80d9918b8611198edd56a32975Eric Moore
680635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_VERSION_STRUCT
681635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
682635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Dev;                        /* 0x00 */
683635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Unit;                       /* 0x01 */
684635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Minor;                      /* 0x02 */
685635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Major;                      /* 0x03 */
686635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_VERSION_STRUCT;
687635374e7eb110e80d9918b8611198edd56a32975Eric Moore
688635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef union _MPI2_VERSION_UNION
689635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
690635374e7eb110e80d9918b8611198edd56a32975Eric Moore    MPI2_VERSION_STRUCT     Struct;
691635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     Word;
692635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_VERSION_UNION;
693635374e7eb110e80d9918b8611198edd56a32975Eric Moore
694635374e7eb110e80d9918b8611198edd56a32975Eric Moore
695635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* LUN field defines, common to many structures */
696635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_LUN_FIRST_LEVEL_ADDRESSING             (0x0000FFFF)
697635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_LUN_SECOND_LEVEL_ADDRESSING            (0xFFFF0000)
698635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_LUN_THIRD_LEVEL_ADDRESSING             (0x0000FFFF)
699635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_LUN_FOURTH_LEVEL_ADDRESSING            (0xFFFF0000)
700635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_LUN_LEVEL_1_WORD                       (0xFF00)
701635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_LUN_LEVEL_1_DWORD                      (0x0000FF00)
702635374e7eb110e80d9918b8611198edd56a32975Eric Moore
703635374e7eb110e80d9918b8611198edd56a32975Eric Moore
704635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*****************************************************************************
705635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
706635374e7eb110e80d9918b8611198edd56a32975Eric Moore*        Fusion-MPT MPI Scatter Gather Elements
707635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
708635374e7eb110e80d9918b8611198edd56a32975Eric Moore*****************************************************************************/
709635374e7eb110e80d9918b8611198edd56a32975Eric Moore
710635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
711635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  MPI Simple Element structures
712635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
713635374e7eb110e80d9918b8611198edd56a32975Eric Moore
714635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SGE_SIMPLE32
715635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
716635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     FlagsLength;
717635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     Address;
718635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SGE_SIMPLE32, MPI2_POINTER PTR_MPI2_SGE_SIMPLE32,
719635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SGESimple32_t, MPI2_POINTER pMpi2SGESimple32_t;
720635374e7eb110e80d9918b8611198edd56a32975Eric Moore
721635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SGE_SIMPLE64
722635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
723635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     FlagsLength;
724635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U64                     Address;
725635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SGE_SIMPLE64, MPI2_POINTER PTR_MPI2_SGE_SIMPLE64,
726635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SGESimple64_t, MPI2_POINTER pMpi2SGESimple64_t;
727635374e7eb110e80d9918b8611198edd56a32975Eric Moore
728635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SGE_SIMPLE_UNION
729635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
730635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     FlagsLength;
731635374e7eb110e80d9918b8611198edd56a32975Eric Moore    union
732635374e7eb110e80d9918b8611198edd56a32975Eric Moore    {
733635374e7eb110e80d9918b8611198edd56a32975Eric Moore        U32                 Address32;
734635374e7eb110e80d9918b8611198edd56a32975Eric Moore        U64                 Address64;
735635374e7eb110e80d9918b8611198edd56a32975Eric Moore    } u;
736635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SGE_SIMPLE_UNION, MPI2_POINTER PTR_MPI2_SGE_SIMPLE_UNION,
737635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SGESimpleUnion_t, MPI2_POINTER pMpi2SGESimpleUnion_t;
738635374e7eb110e80d9918b8611198edd56a32975Eric Moore
739635374e7eb110e80d9918b8611198edd56a32975Eric Moore
740635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
741635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  MPI Chain Element structures
742635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
743635374e7eb110e80d9918b8611198edd56a32975Eric Moore
744635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SGE_CHAIN32
745635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
746635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16                     Length;
747635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      NextChainOffset;
748635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Flags;
749635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     Address;
750635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SGE_CHAIN32, MPI2_POINTER PTR_MPI2_SGE_CHAIN32,
751635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SGEChain32_t, MPI2_POINTER pMpi2SGEChain32_t;
752635374e7eb110e80d9918b8611198edd56a32975Eric Moore
753635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SGE_CHAIN64
754635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
755635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16                     Length;
756635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      NextChainOffset;
757635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Flags;
758635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U64                     Address;
759635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SGE_CHAIN64, MPI2_POINTER PTR_MPI2_SGE_CHAIN64,
760635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SGEChain64_t, MPI2_POINTER pMpi2SGEChain64_t;
761635374e7eb110e80d9918b8611198edd56a32975Eric Moore
762635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SGE_CHAIN_UNION
763635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
764635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16                     Length;
765635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      NextChainOffset;
766635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Flags;
767635374e7eb110e80d9918b8611198edd56a32975Eric Moore    union
768635374e7eb110e80d9918b8611198edd56a32975Eric Moore    {
769635374e7eb110e80d9918b8611198edd56a32975Eric Moore        U32                 Address32;
770635374e7eb110e80d9918b8611198edd56a32975Eric Moore        U64                 Address64;
771635374e7eb110e80d9918b8611198edd56a32975Eric Moore    } u;
772635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SGE_CHAIN_UNION, MPI2_POINTER PTR_MPI2_SGE_CHAIN_UNION,
773635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SGEChainUnion_t, MPI2_POINTER pMpi2SGEChainUnion_t;
774635374e7eb110e80d9918b8611198edd56a32975Eric Moore
775635374e7eb110e80d9918b8611198edd56a32975Eric Moore
776635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
777635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  MPI Transaction Context Element structures
778635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
779635374e7eb110e80d9918b8611198edd56a32975Eric Moore
780635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SGE_TRANSACTION32
781635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
782635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Reserved;
783635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      ContextSize;
784635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      DetailsLength;
785635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Flags;
786635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     TransactionContext[1];
787635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     TransactionDetails[1];
788635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SGE_TRANSACTION32, MPI2_POINTER PTR_MPI2_SGE_TRANSACTION32,
789635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SGETransaction32_t, MPI2_POINTER pMpi2SGETransaction32_t;
790635374e7eb110e80d9918b8611198edd56a32975Eric Moore
791635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SGE_TRANSACTION64
792635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
793635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Reserved;
794635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      ContextSize;
795635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      DetailsLength;
796635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Flags;
797635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     TransactionContext[2];
798635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     TransactionDetails[1];
799635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SGE_TRANSACTION64, MPI2_POINTER PTR_MPI2_SGE_TRANSACTION64,
800635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SGETransaction64_t, MPI2_POINTER pMpi2SGETransaction64_t;
801635374e7eb110e80d9918b8611198edd56a32975Eric Moore
802635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SGE_TRANSACTION96
803635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
804635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Reserved;
805635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      ContextSize;
806635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      DetailsLength;
807635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Flags;
808635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     TransactionContext[3];
809635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     TransactionDetails[1];
810635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SGE_TRANSACTION96, MPI2_POINTER PTR_MPI2_SGE_TRANSACTION96,
811635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SGETransaction96_t, MPI2_POINTER pMpi2SGETransaction96_t;
812635374e7eb110e80d9918b8611198edd56a32975Eric Moore
813635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SGE_TRANSACTION128
814635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
815635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Reserved;
816635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      ContextSize;
817635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      DetailsLength;
818635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Flags;
819635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     TransactionContext[4];
820635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     TransactionDetails[1];
821635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SGE_TRANSACTION128, MPI2_POINTER PTR_MPI2_SGE_TRANSACTION128,
822635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SGETransaction_t128, MPI2_POINTER pMpi2SGETransaction_t128;
823635374e7eb110e80d9918b8611198edd56a32975Eric Moore
824635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SGE_TRANSACTION_UNION
825635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
826635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Reserved;
827635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      ContextSize;
828635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      DetailsLength;
829635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Flags;
830635374e7eb110e80d9918b8611198edd56a32975Eric Moore    union
831635374e7eb110e80d9918b8611198edd56a32975Eric Moore    {
832635374e7eb110e80d9918b8611198edd56a32975Eric Moore        U32                 TransactionContext32[1];
833635374e7eb110e80d9918b8611198edd56a32975Eric Moore        U32                 TransactionContext64[2];
834635374e7eb110e80d9918b8611198edd56a32975Eric Moore        U32                 TransactionContext96[3];
835635374e7eb110e80d9918b8611198edd56a32975Eric Moore        U32                 TransactionContext128[4];
836635374e7eb110e80d9918b8611198edd56a32975Eric Moore    } u;
837635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     TransactionDetails[1];
838635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SGE_TRANSACTION_UNION, MPI2_POINTER PTR_MPI2_SGE_TRANSACTION_UNION,
839635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SGETransactionUnion_t, MPI2_POINTER pMpi2SGETransactionUnion_t;
840635374e7eb110e80d9918b8611198edd56a32975Eric Moore
841635374e7eb110e80d9918b8611198edd56a32975Eric Moore
842635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
843635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  MPI SGE union for IO SGL's
844635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
845635374e7eb110e80d9918b8611198edd56a32975Eric Moore
846635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_MPI_SGE_IO_UNION
847635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
848635374e7eb110e80d9918b8611198edd56a32975Eric Moore    union
849635374e7eb110e80d9918b8611198edd56a32975Eric Moore    {
850635374e7eb110e80d9918b8611198edd56a32975Eric Moore        MPI2_SGE_SIMPLE_UNION   Simple;
851635374e7eb110e80d9918b8611198edd56a32975Eric Moore        MPI2_SGE_CHAIN_UNION    Chain;
852635374e7eb110e80d9918b8611198edd56a32975Eric Moore    } u;
853635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_MPI_SGE_IO_UNION, MPI2_POINTER PTR_MPI2_MPI_SGE_IO_UNION,
854635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2MpiSGEIOUnion_t, MPI2_POINTER pMpi2MpiSGEIOUnion_t;
855635374e7eb110e80d9918b8611198edd56a32975Eric Moore
856635374e7eb110e80d9918b8611198edd56a32975Eric Moore
857635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
858635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  MPI SGE union for SGL's with Simple and Transaction elements
859635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
860635374e7eb110e80d9918b8611198edd56a32975Eric Moore
861635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_SGE_TRANS_SIMPLE_UNION
862635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
863635374e7eb110e80d9918b8611198edd56a32975Eric Moore    union
864635374e7eb110e80d9918b8611198edd56a32975Eric Moore    {
865635374e7eb110e80d9918b8611198edd56a32975Eric Moore        MPI2_SGE_SIMPLE_UNION       Simple;
866635374e7eb110e80d9918b8611198edd56a32975Eric Moore        MPI2_SGE_TRANSACTION_UNION  Transaction;
867635374e7eb110e80d9918b8611198edd56a32975Eric Moore    } u;
868635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SGE_TRANS_SIMPLE_UNION, MPI2_POINTER PTR_MPI2_SGE_TRANS_SIMPLE_UNION,
869635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SGETransSimpleUnion_t, MPI2_POINTER pMpi2SGETransSimpleUnion_t;
870635374e7eb110e80d9918b8611198edd56a32975Eric Moore
871635374e7eb110e80d9918b8611198edd56a32975Eric Moore
872635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
873635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  All MPI SGE types union
874635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
875635374e7eb110e80d9918b8611198edd56a32975Eric Moore
876635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_MPI_SGE_UNION
877635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
878635374e7eb110e80d9918b8611198edd56a32975Eric Moore    union
879635374e7eb110e80d9918b8611198edd56a32975Eric Moore    {
880635374e7eb110e80d9918b8611198edd56a32975Eric Moore        MPI2_SGE_SIMPLE_UNION       Simple;
881635374e7eb110e80d9918b8611198edd56a32975Eric Moore        MPI2_SGE_CHAIN_UNION        Chain;
882635374e7eb110e80d9918b8611198edd56a32975Eric Moore        MPI2_SGE_TRANSACTION_UNION  Transaction;
883635374e7eb110e80d9918b8611198edd56a32975Eric Moore    } u;
884635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_MPI_SGE_UNION, MPI2_POINTER PTR_MPI2_MPI_SGE_UNION,
885635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2MpiSgeUnion_t, MPI2_POINTER pMpi2MpiSgeUnion_t;
886635374e7eb110e80d9918b8611198edd56a32975Eric Moore
887635374e7eb110e80d9918b8611198edd56a32975Eric Moore
888635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
889635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  MPI SGE field definition and masks
890635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
891635374e7eb110e80d9918b8611198edd56a32975Eric Moore
892635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Flags field bit definitions */
893635374e7eb110e80d9918b8611198edd56a32975Eric Moore
894635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_LAST_ELEMENT             (0x80)
895635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_END_OF_BUFFER            (0x40)
896635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_ELEMENT_TYPE_MASK        (0x30)
897635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_LOCAL_ADDRESS            (0x08)
898635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_DIRECTION                (0x04)
899635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_ADDRESS_SIZE             (0x02)
900635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_END_OF_LIST              (0x01)
901635374e7eb110e80d9918b8611198edd56a32975Eric Moore
902635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_SHIFT                    (24)
903635374e7eb110e80d9918b8611198edd56a32975Eric Moore
904635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_LENGTH_MASK                    (0x00FFFFFF)
905635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_CHAIN_LENGTH_MASK              (0x0000FFFF)
906635374e7eb110e80d9918b8611198edd56a32975Eric Moore
907635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Element Type */
908635374e7eb110e80d9918b8611198edd56a32975Eric Moore
909635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_TRANSACTION_ELEMENT      (0x00)
910635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_SIMPLE_ELEMENT           (0x10)
911635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_CHAIN_ELEMENT            (0x30)
912635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_ELEMENT_MASK             (0x30)
913635374e7eb110e80d9918b8611198edd56a32975Eric Moore
914635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Address location */
915635374e7eb110e80d9918b8611198edd56a32975Eric Moore
916635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_SYSTEM_ADDRESS           (0x00)
917635374e7eb110e80d9918b8611198edd56a32975Eric Moore
918635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Direction */
919635374e7eb110e80d9918b8611198edd56a32975Eric Moore
920635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_IOC_TO_HOST              (0x00)
921635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_HOST_TO_IOC              (0x04)
922635374e7eb110e80d9918b8611198edd56a32975Eric Moore
923635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Address Size */
924635374e7eb110e80d9918b8611198edd56a32975Eric Moore
925635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_32_BIT_ADDRESSING        (0x00)
926635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_64_BIT_ADDRESSING        (0x02)
927635374e7eb110e80d9918b8611198edd56a32975Eric Moore
928635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Context Size */
929635374e7eb110e80d9918b8611198edd56a32975Eric Moore
930635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_32_BIT_CONTEXT           (0x00)
931635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_64_BIT_CONTEXT           (0x02)
932635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_96_BIT_CONTEXT           (0x04)
933635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_FLAGS_128_BIT_CONTEXT          (0x06)
934635374e7eb110e80d9918b8611198edd56a32975Eric Moore
935635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_CHAIN_OFFSET_MASK              (0x00FF0000)
936635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_CHAIN_OFFSET_SHIFT             (16)
937635374e7eb110e80d9918b8611198edd56a32975Eric Moore
938635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
939635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  MPI SGE operation Macros
940635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
941635374e7eb110e80d9918b8611198edd56a32975Eric Moore
942635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* SIMPLE FlagsLength manipulations... */
943635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_SET_FLAGS(f)          ((U32)(f) << MPI2_SGE_FLAGS_SHIFT)
944635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_GET_FLAGS(f)          (((f) & ~MPI2_SGE_LENGTH_MASK) >> MPI2_SGE_FLAGS_SHIFT)
945635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_LENGTH(f)             ((f) & MPI2_SGE_LENGTH_MASK)
946635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_CHAIN_LENGTH(f)       ((f) & MPI2_SGE_CHAIN_LENGTH_MASK)
947635374e7eb110e80d9918b8611198edd56a32975Eric Moore
948635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGE_SET_FLAGS_LENGTH(f,l) (MPI2_SGE_SET_FLAGS(f) | MPI2_SGE_LENGTH(l))
949635374e7eb110e80d9918b8611198edd56a32975Eric Moore
950635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_pSGE_GET_FLAGS(psg)            MPI2_SGE_GET_FLAGS((psg)->FlagsLength)
951635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_pSGE_GET_LENGTH(psg)           MPI2_SGE_LENGTH((psg)->FlagsLength)
952635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_pSGE_SET_FLAGS_LENGTH(psg,f,l) (psg)->FlagsLength = MPI2_SGE_SET_FLAGS_LENGTH(f,l)
953635374e7eb110e80d9918b8611198edd56a32975Eric Moore
954635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* CAUTION - The following are READ-MODIFY-WRITE! */
955635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_pSGE_SET_FLAGS(psg,f)      (psg)->FlagsLength |= MPI2_SGE_SET_FLAGS(f)
956635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_pSGE_SET_LENGTH(psg,l)     (psg)->FlagsLength |= MPI2_SGE_LENGTH(l)
957635374e7eb110e80d9918b8611198edd56a32975Eric Moore
958635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_GET_CHAIN_OFFSET(x)    ((x & MPI2_SGE_CHAIN_OFFSET_MASK) >> MPI2_SGE_CHAIN_OFFSET_SHIFT)
959635374e7eb110e80d9918b8611198edd56a32975Eric Moore
960635374e7eb110e80d9918b8611198edd56a32975Eric Moore
961635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*****************************************************************************
962635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
963635374e7eb110e80d9918b8611198edd56a32975Eric Moore*        Fusion-MPT IEEE Scatter Gather Elements
964635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
965635374e7eb110e80d9918b8611198edd56a32975Eric Moore*****************************************************************************/
966635374e7eb110e80d9918b8611198edd56a32975Eric Moore
967635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
968635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  IEEE Simple Element structures
969635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
970635374e7eb110e80d9918b8611198edd56a32975Eric Moore
971635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_IEEE_SGE_SIMPLE32
972635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
973635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     Address;
974635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     FlagsLength;
975635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_IEEE_SGE_SIMPLE32, MPI2_POINTER PTR_MPI2_IEEE_SGE_SIMPLE32,
976635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2IeeeSgeSimple32_t, MPI2_POINTER pMpi2IeeeSgeSimple32_t;
977635374e7eb110e80d9918b8611198edd56a32975Eric Moore
978635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_IEEE_SGE_SIMPLE64
979635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
980635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U64                     Address;
981635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U32                     Length;
982635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U16                     Reserved1;
983635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Reserved2;
984635374e7eb110e80d9918b8611198edd56a32975Eric Moore    U8                      Flags;
985635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_IEEE_SGE_SIMPLE64, MPI2_POINTER PTR_MPI2_IEEE_SGE_SIMPLE64,
986635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2IeeeSgeSimple64_t, MPI2_POINTER pMpi2IeeeSgeSimple64_t;
987635374e7eb110e80d9918b8611198edd56a32975Eric Moore
988635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef union _MPI2_IEEE_SGE_SIMPLE_UNION
989635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
990635374e7eb110e80d9918b8611198edd56a32975Eric Moore    MPI2_IEEE_SGE_SIMPLE32  Simple32;
991635374e7eb110e80d9918b8611198edd56a32975Eric Moore    MPI2_IEEE_SGE_SIMPLE64  Simple64;
992635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_IEEE_SGE_SIMPLE_UNION, MPI2_POINTER PTR_MPI2_IEEE_SGE_SIMPLE_UNION,
993635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2IeeeSgeSimpleUnion_t, MPI2_POINTER pMpi2IeeeSgeSimpleUnion_t;
994635374e7eb110e80d9918b8611198edd56a32975Eric Moore
995635374e7eb110e80d9918b8611198edd56a32975Eric Moore
996635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
997635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  IEEE Chain Element structures
998635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
999635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1000635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef MPI2_IEEE_SGE_SIMPLE32  MPI2_IEEE_SGE_CHAIN32;
1001635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1002635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef MPI2_IEEE_SGE_SIMPLE64  MPI2_IEEE_SGE_CHAIN64;
1003635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1004635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef union _MPI2_IEEE_SGE_CHAIN_UNION
1005635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
1006635374e7eb110e80d9918b8611198edd56a32975Eric Moore    MPI2_IEEE_SGE_CHAIN32   Chain32;
1007635374e7eb110e80d9918b8611198edd56a32975Eric Moore    MPI2_IEEE_SGE_CHAIN64   Chain64;
1008635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_IEEE_SGE_CHAIN_UNION, MPI2_POINTER PTR_MPI2_IEEE_SGE_CHAIN_UNION,
1009635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2IeeeSgeChainUnion_t, MPI2_POINTER pMpi2IeeeSgeChainUnion_t;
1010635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1011635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1012635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
1013635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  All IEEE SGE types union
1014635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
1015635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1016635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef struct _MPI2_IEEE_SGE_UNION
1017635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
1018635374e7eb110e80d9918b8611198edd56a32975Eric Moore    union
1019635374e7eb110e80d9918b8611198edd56a32975Eric Moore    {
1020635374e7eb110e80d9918b8611198edd56a32975Eric Moore        MPI2_IEEE_SGE_SIMPLE_UNION  Simple;
1021635374e7eb110e80d9918b8611198edd56a32975Eric Moore        MPI2_IEEE_SGE_CHAIN_UNION   Chain;
1022635374e7eb110e80d9918b8611198edd56a32975Eric Moore    } u;
1023635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_IEEE_SGE_UNION, MPI2_POINTER PTR_MPI2_IEEE_SGE_UNION,
1024635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2IeeeSgeUnion_t, MPI2_POINTER pMpi2IeeeSgeUnion_t;
1025635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1026635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1027635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
1028635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  IEEE SGE field definitions and masks
1029635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
1030635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1031635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Flags field bit definitions */
1032635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1033635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE_SGE_FLAGS_ELEMENT_TYPE_MASK   (0x80)
1034635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1035635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE32_SGE_FLAGS_SHIFT             (24)
1036635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1037635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE32_SGE_LENGTH_MASK             (0x00FFFFFF)
1038635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1039635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Element Type */
1040635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1041635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE_SGE_FLAGS_SIMPLE_ELEMENT      (0x00)
1042635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE_SGE_FLAGS_CHAIN_ELEMENT       (0x80)
1043635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1044635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* Data Location Address Space */
1045635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1046635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE_SGE_FLAGS_ADDR_MASK           (0x03)
1047635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR         (0x00)
1048635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE_SGE_FLAGS_IOCDDR_ADDR         (0x01)
1049635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE_SGE_FLAGS_IOCPLB_ADDR         (0x02)
1050635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR      (0x03)
1051635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1052635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1053635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
1054635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  IEEE SGE operation Macros
1055635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
1056635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1057635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* SIMPLE FlagsLength manipulations... */
1058635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE32_SGE_SET_FLAGS(f)     ((U32)(f) << MPI2_IEEE32_SGE_FLAGS_SHIFT)
1059635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE32_SGE_GET_FLAGS(f)     (((f) & ~MPI2_IEEE32_SGE_LENGTH_MASK) >> MPI2_IEEE32_SGE_FLAGS_SHIFT)
1060635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE32_SGE_LENGTH(f)        ((f) & MPI2_IEEE32_SGE_LENGTH_MASK)
1061635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1062635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE32_SGE_SET_FLAGS_LENGTH(f, l)      (MPI2_IEEE32_SGE_SET_FLAGS(f) | MPI2_IEEE32_SGE_LENGTH(l))
1063635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1064635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE32_pSGE_GET_FLAGS(psg)             MPI2_IEEE32_SGE_GET_FLAGS((psg)->FlagsLength)
1065635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE32_pSGE_GET_LENGTH(psg)            MPI2_IEEE32_SGE_LENGTH((psg)->FlagsLength)
1066635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE32_pSGE_SET_FLAGS_LENGTH(psg,f,l)  (psg)->FlagsLength = MPI2_IEEE32_SGE_SET_FLAGS_LENGTH(f,l)
1067635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1068635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* CAUTION - The following are READ-MODIFY-WRITE! */
1069635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE32_pSGE_SET_FLAGS(psg,f)    (psg)->FlagsLength |= MPI2_IEEE32_SGE_SET_FLAGS(f)
1070635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_IEEE32_pSGE_SET_LENGTH(psg,l)   (psg)->FlagsLength |= MPI2_IEEE32_SGE_LENGTH(l)
1071635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1072635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1073635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1074635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1075635374e7eb110e80d9918b8611198edd56a32975Eric Moore/*****************************************************************************
1076635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
1077635374e7eb110e80d9918b8611198edd56a32975Eric Moore*        Fusion-MPT MPI/IEEE Scatter Gather Unions
1078635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
1079635374e7eb110e80d9918b8611198edd56a32975Eric Moore*****************************************************************************/
1080635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1081635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef union _MPI2_SIMPLE_SGE_UNION
1082635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
1083635374e7eb110e80d9918b8611198edd56a32975Eric Moore    MPI2_SGE_SIMPLE_UNION       MpiSimple;
1084635374e7eb110e80d9918b8611198edd56a32975Eric Moore    MPI2_IEEE_SGE_SIMPLE_UNION  IeeeSimple;
1085635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SIMPLE_SGE_UNION, MPI2_POINTER PTR_MPI2_SIMPLE_SGE_UNION,
1086635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SimpleSgeUntion_t, MPI2_POINTER pMpi2SimpleSgeUntion_t;
1087635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1088635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1089635374e7eb110e80d9918b8611198edd56a32975Eric Mooretypedef union _MPI2_SGE_IO_UNION
1090635374e7eb110e80d9918b8611198edd56a32975Eric Moore{
1091635374e7eb110e80d9918b8611198edd56a32975Eric Moore    MPI2_SGE_SIMPLE_UNION       MpiSimple;
1092635374e7eb110e80d9918b8611198edd56a32975Eric Moore    MPI2_SGE_CHAIN_UNION        MpiChain;
1093635374e7eb110e80d9918b8611198edd56a32975Eric Moore    MPI2_IEEE_SGE_SIMPLE_UNION  IeeeSimple;
1094635374e7eb110e80d9918b8611198edd56a32975Eric Moore    MPI2_IEEE_SGE_CHAIN_UNION   IeeeChain;
1095635374e7eb110e80d9918b8611198edd56a32975Eric Moore} MPI2_SGE_IO_UNION, MPI2_POINTER PTR_MPI2_SGE_IO_UNION,
1096635374e7eb110e80d9918b8611198edd56a32975Eric Moore  Mpi2SGEIOUnion_t, MPI2_POINTER pMpi2SGEIOUnion_t;
1097635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1098635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1099635374e7eb110e80d9918b8611198edd56a32975Eric Moore/****************************************************************************
1100635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
1101635374e7eb110e80d9918b8611198edd56a32975Eric Moore*  Values for SGLFlags field, used in many request messages with an SGL
1102635374e7eb110e80d9918b8611198edd56a32975Eric Moore*
1103635374e7eb110e80d9918b8611198edd56a32975Eric Moore****************************************************************************/
1104635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1105635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* values for MPI SGL Data Location Address Space subfield */
1106635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGLFLAGS_ADDRESS_SPACE_MASK            (0x0C)
1107635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGLFLAGS_SYSTEM_ADDRESS_SPACE          (0x00)
1108635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGLFLAGS_IOCDDR_ADDRESS_SPACE          (0x04)
1109635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGLFLAGS_IOCPLB_ADDRESS_SPACE          (0x08)
1110635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGLFLAGS_IOCPLBNTA_ADDRESS_SPACE       (0x0C)
1111635374e7eb110e80d9918b8611198edd56a32975Eric Moore/* values for SGL Type subfield */
1112635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGLFLAGS_SGL_TYPE_MASK                 (0x03)
1113635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGLFLAGS_SGL_TYPE_MPI                  (0x00)
1114635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGLFLAGS_SGL_TYPE_IEEE32               (0x01)
1115635374e7eb110e80d9918b8611198edd56a32975Eric Moore#define MPI2_SGLFLAGS_SGL_TYPE_IEEE64               (0x02)
1116635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1117635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1118635374e7eb110e80d9918b8611198edd56a32975Eric Moore#endif
1119635374e7eb110e80d9918b8611198edd56a32975Eric Moore
1120