162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright 2000-2020 Broadcom Inc. All rights reserved.
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci *          Name:  mpi2_init.h
762306a36Sopenharmony_ci *         Title:  MPI SCSI initiator mode messages and structures
862306a36Sopenharmony_ci * Creation Date:  June 23, 2006
962306a36Sopenharmony_ci *
1062306a36Sopenharmony_ci * mpi2_init.h Version:  02.00.21
1162306a36Sopenharmony_ci *
1262306a36Sopenharmony_ci * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
1362306a36Sopenharmony_ci *       prefix are for use only on MPI v2.5 products, and must not be used
1462306a36Sopenharmony_ci *       with MPI v2.0 products. Unless otherwise noted, names beginning with
1562306a36Sopenharmony_ci *       MPI2 or Mpi2 are for use with both MPI v2.0 and MPI v2.5 products.
1662306a36Sopenharmony_ci *
1762306a36Sopenharmony_ci * Version History
1862306a36Sopenharmony_ci * ---------------
1962306a36Sopenharmony_ci *
2062306a36Sopenharmony_ci * Date      Version   Description
2162306a36Sopenharmony_ci * --------  --------  ------------------------------------------------------
2262306a36Sopenharmony_ci * 04-30-07  02.00.00  Corresponds to Fusion-MPT MPI Specification Rev A.
2362306a36Sopenharmony_ci * 10-31-07  02.00.01  Fixed name for pMpi2SCSITaskManagementRequest_t.
2462306a36Sopenharmony_ci * 12-18-07  02.00.02  Modified Task Management Target Reset Method defines.
2562306a36Sopenharmony_ci * 02-29-08  02.00.03  Added Query Task Set and Query Unit Attention.
2662306a36Sopenharmony_ci * 03-03-08  02.00.04  Fixed name of struct _MPI2_SCSI_TASK_MANAGE_REPLY.
2762306a36Sopenharmony_ci * 05-21-08  02.00.05  Fixed typo in name of Mpi2SepRequest_t.
2862306a36Sopenharmony_ci * 10-02-08  02.00.06  Removed Untagged and No Disconnect values from SCSI IO
2962306a36Sopenharmony_ci *                     Control field Task Attribute flags.
3062306a36Sopenharmony_ci *                     Moved LUN field defines to mpi2.h becasue they are
3162306a36Sopenharmony_ci *                     common to many structures.
3262306a36Sopenharmony_ci * 05-06-09  02.00.07  Changed task management type of Query Unit Attention to
3362306a36Sopenharmony_ci *                     Query Asynchronous Event.
3462306a36Sopenharmony_ci *                     Defined two new bits in the SlotStatus field of the SCSI
3562306a36Sopenharmony_ci *                     Enclosure Processor Request and Reply.
3662306a36Sopenharmony_ci * 10-28-09  02.00.08  Added defines for decoding the ResponseInfo bytes for
3762306a36Sopenharmony_ci *                     both SCSI IO Error Reply and SCSI Task Management Reply.
3862306a36Sopenharmony_ci *                     Added ResponseInfo field to MPI2_SCSI_TASK_MANAGE_REPLY.
3962306a36Sopenharmony_ci *                     Added MPI2_SCSITASKMGMT_RSP_TM_OVERLAPPED_TAG define.
4062306a36Sopenharmony_ci * 02-10-10  02.00.09  Removed unused structure that had "#if 0" around it.
4162306a36Sopenharmony_ci * 05-12-10  02.00.10  Added optional vendor-unique region to SCSI IO Request.
4262306a36Sopenharmony_ci * 11-10-10  02.00.11  Added MPI2_SCSIIO_NUM_SGLOFFSETS define.
4362306a36Sopenharmony_ci * 11-18-11  02.00.12  Incorporating additions for MPI v2.5.
4462306a36Sopenharmony_ci * 02-06-12  02.00.13  Added alternate defines for Task Priority / Command
4562306a36Sopenharmony_ci *                     Priority to match SAM-4.
4662306a36Sopenharmony_ci *                     Added EEDPErrorOffset to MPI2_SCSI_IO_REPLY.
4762306a36Sopenharmony_ci * 07-10-12  02.00.14  Added MPI2_SCSIIO_CONTROL_SHIFT_DATADIRECTION.
4862306a36Sopenharmony_ci * 04-09-13  02.00.15  Added SCSIStatusQualifier field to MPI2_SCSI_IO_REPLY,
4962306a36Sopenharmony_ci *                     replacing the Reserved4 field.
5062306a36Sopenharmony_ci * 11-18-14  02.00.16  Updated copyright information.
5162306a36Sopenharmony_ci * 03-16-15  02.00.17  Updated for MPI v2.6.
5262306a36Sopenharmony_ci *                     Added MPI26_SCSIIO_IOFLAGS_ESCAPE_PASSTHROUGH.
5362306a36Sopenharmony_ci *                     Added MPI2_SEP_REQ_SLOTSTATUS_DEV_OFF and
5462306a36Sopenharmony_ci *                     MPI2_SEP_REPLY_SLOTSTATUS_DEV_OFF.
5562306a36Sopenharmony_ci * 08-26-15  02.00.18  Added SCSITASKMGMT_MSGFLAGS for Target Reset.
5662306a36Sopenharmony_ci * 12-18-15  02.00.19  Added EEDPObservedValue added to SCSI IO Reply message.
5762306a36Sopenharmony_ci * 01-04-16  02.00.20  Modified EEDP reported values in SCSI IO Reply message.
5862306a36Sopenharmony_ci * 01-21-16  02.00.21  Modified MPI26_SCSITASKMGMT_MSGFLAGS_PCIE* defines to
5962306a36Sopenharmony_ci *                     be unique within first 32 characters.
6062306a36Sopenharmony_ci * --------------------------------------------------------------------------
6162306a36Sopenharmony_ci */
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci#ifndef MPI2_INIT_H
6462306a36Sopenharmony_ci#define MPI2_INIT_H
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci/*****************************************************************************
6762306a36Sopenharmony_ci*
6862306a36Sopenharmony_ci*              SCSI Initiator Messages
6962306a36Sopenharmony_ci*
7062306a36Sopenharmony_ci*****************************************************************************/
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci/****************************************************************************
7362306a36Sopenharmony_ci* SCSI IO messages and associated structures
7462306a36Sopenharmony_ci****************************************************************************/
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_citypedef struct _MPI2_SCSI_IO_CDB_EEDP32 {
7762306a36Sopenharmony_ci	U8 CDB[20];		/*0x00 */
7862306a36Sopenharmony_ci	__be32 PrimaryReferenceTag;	/*0x14 */
7962306a36Sopenharmony_ci	U16 PrimaryApplicationTag;	/*0x18 */
8062306a36Sopenharmony_ci	U16 PrimaryApplicationTagMask;	/*0x1A */
8162306a36Sopenharmony_ci	U32 TransferLength;	/*0x1C */
8262306a36Sopenharmony_ci} MPI2_SCSI_IO_CDB_EEDP32, *PTR_MPI2_SCSI_IO_CDB_EEDP32,
8362306a36Sopenharmony_ci	Mpi2ScsiIoCdbEedp32_t, *pMpi2ScsiIoCdbEedp32_t;
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci/*MPI v2.0 CDB field */
8662306a36Sopenharmony_citypedef union _MPI2_SCSI_IO_CDB_UNION {
8762306a36Sopenharmony_ci	U8 CDB32[32];
8862306a36Sopenharmony_ci	MPI2_SCSI_IO_CDB_EEDP32 EEDP32;
8962306a36Sopenharmony_ci	MPI2_SGE_SIMPLE_UNION SGE;
9062306a36Sopenharmony_ci} MPI2_SCSI_IO_CDB_UNION, *PTR_MPI2_SCSI_IO_CDB_UNION,
9162306a36Sopenharmony_ci	Mpi2ScsiIoCdb_t, *pMpi2ScsiIoCdb_t;
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci/*MPI v2.0 SCSI IO Request Message */
9462306a36Sopenharmony_citypedef struct _MPI2_SCSI_IO_REQUEST {
9562306a36Sopenharmony_ci	U16 DevHandle;		/*0x00 */
9662306a36Sopenharmony_ci	U8 ChainOffset;		/*0x02 */
9762306a36Sopenharmony_ci	U8 Function;		/*0x03 */
9862306a36Sopenharmony_ci	U16 Reserved1;		/*0x04 */
9962306a36Sopenharmony_ci	U8 Reserved2;		/*0x06 */
10062306a36Sopenharmony_ci	U8 MsgFlags;		/*0x07 */
10162306a36Sopenharmony_ci	U8 VP_ID;		/*0x08 */
10262306a36Sopenharmony_ci	U8 VF_ID;		/*0x09 */
10362306a36Sopenharmony_ci	U16 Reserved3;		/*0x0A */
10462306a36Sopenharmony_ci	U32 SenseBufferLowAddress;	/*0x0C */
10562306a36Sopenharmony_ci	U16 SGLFlags;		/*0x10 */
10662306a36Sopenharmony_ci	U8 SenseBufferLength;	/*0x12 */
10762306a36Sopenharmony_ci	U8 Reserved4;		/*0x13 */
10862306a36Sopenharmony_ci	U8 SGLOffset0;		/*0x14 */
10962306a36Sopenharmony_ci	U8 SGLOffset1;		/*0x15 */
11062306a36Sopenharmony_ci	U8 SGLOffset2;		/*0x16 */
11162306a36Sopenharmony_ci	U8 SGLOffset3;		/*0x17 */
11262306a36Sopenharmony_ci	U32 SkipCount;		/*0x18 */
11362306a36Sopenharmony_ci	U32 DataLength;		/*0x1C */
11462306a36Sopenharmony_ci	U32 BidirectionalDataLength;	/*0x20 */
11562306a36Sopenharmony_ci	U16 IoFlags;		/*0x24 */
11662306a36Sopenharmony_ci	U16 EEDPFlags;		/*0x26 */
11762306a36Sopenharmony_ci	U32 EEDPBlockSize;	/*0x28 */
11862306a36Sopenharmony_ci	U32 SecondaryReferenceTag;	/*0x2C */
11962306a36Sopenharmony_ci	U16 SecondaryApplicationTag;	/*0x30 */
12062306a36Sopenharmony_ci	U16 ApplicationTagTranslationMask;	/*0x32 */
12162306a36Sopenharmony_ci	U8 LUN[8];		/*0x34 */
12262306a36Sopenharmony_ci	U32 Control;		/*0x3C */
12362306a36Sopenharmony_ci	MPI2_SCSI_IO_CDB_UNION CDB;	/*0x40 */
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ci#ifdef MPI2_SCSI_IO_VENDOR_UNIQUE_REGION /*typically this is left undefined */
12662306a36Sopenharmony_ci	MPI2_SCSI_IO_VENDOR_UNIQUE VendorRegion;
12762306a36Sopenharmony_ci#endif
12862306a36Sopenharmony_ci
12962306a36Sopenharmony_ci	MPI2_SGE_IO_UNION SGL;	/*0x60 */
13062306a36Sopenharmony_ci
13162306a36Sopenharmony_ci} MPI2_SCSI_IO_REQUEST, *PTR_MPI2_SCSI_IO_REQUEST,
13262306a36Sopenharmony_ci	Mpi2SCSIIORequest_t, *pMpi2SCSIIORequest_t;
13362306a36Sopenharmony_ci
13462306a36Sopenharmony_ci/*SCSI IO MsgFlags bits */
13562306a36Sopenharmony_ci
13662306a36Sopenharmony_ci/*MsgFlags for SenseBufferAddressSpace */
13762306a36Sopenharmony_ci#define MPI2_SCSIIO_MSGFLAGS_MASK_SENSE_ADDR        (0x0C)
13862306a36Sopenharmony_ci#define MPI2_SCSIIO_MSGFLAGS_SYSTEM_SENSE_ADDR      (0x00)
13962306a36Sopenharmony_ci#define MPI2_SCSIIO_MSGFLAGS_IOCDDR_SENSE_ADDR      (0x04)
14062306a36Sopenharmony_ci#define MPI2_SCSIIO_MSGFLAGS_IOCPLB_SENSE_ADDR      (0x08)
14162306a36Sopenharmony_ci#define MPI2_SCSIIO_MSGFLAGS_IOCPLBNTA_SENSE_ADDR   (0x0C)
14262306a36Sopenharmony_ci#define MPI26_SCSIIO_MSGFLAGS_IOCCTL_SENSE_ADDR     (0x08)
14362306a36Sopenharmony_ci
14462306a36Sopenharmony_ci/*SCSI IO SGLFlags bits */
14562306a36Sopenharmony_ci
14662306a36Sopenharmony_ci/*base values for Data Location Address Space */
14762306a36Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_ADDR_MASK              (0x0C)
14862306a36Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_SYSTEM_ADDR            (0x00)
14962306a36Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_IOCDDR_ADDR            (0x04)
15062306a36Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_IOCPLB_ADDR            (0x08)
15162306a36Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_IOCPLBNTA_ADDR         (0x0C)
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci/*base values for Type */
15462306a36Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_TYPE_MASK              (0x03)
15562306a36Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_TYPE_MPI               (0x00)
15662306a36Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_TYPE_IEEE32            (0x01)
15762306a36Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_TYPE_IEEE64            (0x02)
15862306a36Sopenharmony_ci
15962306a36Sopenharmony_ci/*shift values for each sub-field */
16062306a36Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_SGL3_SHIFT             (12)
16162306a36Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_SGL2_SHIFT             (8)
16262306a36Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_SGL1_SHIFT             (4)
16362306a36Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_SGL0_SHIFT             (0)
16462306a36Sopenharmony_ci
16562306a36Sopenharmony_ci/*number of SGLOffset fields */
16662306a36Sopenharmony_ci#define MPI2_SCSIIO_NUM_SGLOFFSETS                  (4)
16762306a36Sopenharmony_ci
16862306a36Sopenharmony_ci/*SCSI IO IoFlags bits */
16962306a36Sopenharmony_ci
17062306a36Sopenharmony_ci/*Large CDB Address Space */
17162306a36Sopenharmony_ci#define MPI2_SCSIIO_CDB_ADDR_MASK                   (0x6000)
17262306a36Sopenharmony_ci#define MPI2_SCSIIO_CDB_ADDR_SYSTEM                 (0x0000)
17362306a36Sopenharmony_ci#define MPI2_SCSIIO_CDB_ADDR_IOCDDR                 (0x2000)
17462306a36Sopenharmony_ci#define MPI2_SCSIIO_CDB_ADDR_IOCPLB                 (0x4000)
17562306a36Sopenharmony_ci#define MPI2_SCSIIO_CDB_ADDR_IOCPLBNTA              (0x6000)
17662306a36Sopenharmony_ci
17762306a36Sopenharmony_ci#define MPI2_SCSIIO_IOFLAGS_LARGE_CDB               (0x1000)
17862306a36Sopenharmony_ci#define MPI2_SCSIIO_IOFLAGS_BIDIRECTIONAL           (0x0800)
17962306a36Sopenharmony_ci#define MPI2_SCSIIO_IOFLAGS_MULTICAST               (0x0400)
18062306a36Sopenharmony_ci#define MPI2_SCSIIO_IOFLAGS_CMD_DETERMINES_DATA_DIR (0x0200)
18162306a36Sopenharmony_ci#define MPI2_SCSIIO_IOFLAGS_CDBLENGTH_MASK          (0x01FF)
18262306a36Sopenharmony_ci
18362306a36Sopenharmony_ci/*SCSI IO EEDPFlags bits */
18462306a36Sopenharmony_ci
18562306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_INC_PRI_REFTAG        (0x8000)
18662306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_INC_SEC_REFTAG        (0x4000)
18762306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_INC_PRI_APPTAG        (0x2000)
18862306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_INC_SEC_APPTAG        (0x1000)
18962306a36Sopenharmony_ci
19062306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_CHECK_REFTAG          (0x0400)
19162306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_CHECK_APPTAG          (0x0200)
19262306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD           (0x0100)
19362306a36Sopenharmony_ci
19462306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_PASSTHRU_REFTAG       (0x0008)
19562306a36Sopenharmony_ci
19662306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_MASK_OP               (0x0007)
19762306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_NOOP_OP               (0x0000)
19862306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_CHECK_OP              (0x0001)
19962306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_STRIP_OP              (0x0002)
20062306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_CHECK_REMOVE_OP       (0x0003)
20162306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_INSERT_OP             (0x0004)
20262306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_REPLACE_OP            (0x0006)
20362306a36Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_CHECK_REGEN_OP        (0x0007)
20462306a36Sopenharmony_ci
20562306a36Sopenharmony_ci/*SCSI IO LUN fields: use MPI2_LUN_ from mpi2.h */
20662306a36Sopenharmony_ci
20762306a36Sopenharmony_ci/*SCSI IO Control bits */
20862306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_ADDCDBLEN_MASK      (0xFC000000)
20962306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_ADDCDBLEN_SHIFT     (26)
21062306a36Sopenharmony_ci
21162306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_DATADIRECTION_MASK  (0x03000000)
21262306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_SHIFT_DATADIRECTION (24)
21362306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_NODATATRANSFER      (0x00000000)
21462306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_WRITE               (0x01000000)
21562306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_READ                (0x02000000)
21662306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_BIDIRECTIONAL       (0x03000000)
21762306a36Sopenharmony_ci
21862306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_TASKPRI_MASK        (0x00007800)
21962306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_TASKPRI_SHIFT       (11)
22062306a36Sopenharmony_ci/*alternate name for the previous field; called Command Priority in SAM-4 */
22162306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_CMDPRI_MASK         (0x00007800)
22262306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_CMDPRI_SHIFT        (11)
22362306a36Sopenharmony_ci
22462306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_TASKATTRIBUTE_MASK  (0x00000700)
22562306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_SIMPLEQ             (0x00000000)
22662306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_HEADOFQ             (0x00000100)
22762306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_ORDEREDQ            (0x00000200)
22862306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_ACAQ                (0x00000400)
22962306a36Sopenharmony_ci
23062306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_TLR_MASK            (0x000000C0)
23162306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_NO_TLR              (0x00000000)
23262306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_TLR_ON              (0x00000040)
23362306a36Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_TLR_OFF             (0x00000080)
23462306a36Sopenharmony_ci
23562306a36Sopenharmony_ci/*MPI v2.5 CDB field */
23662306a36Sopenharmony_citypedef union _MPI25_SCSI_IO_CDB_UNION {
23762306a36Sopenharmony_ci	U8 CDB32[32];
23862306a36Sopenharmony_ci	MPI2_SCSI_IO_CDB_EEDP32 EEDP32;
23962306a36Sopenharmony_ci	MPI2_IEEE_SGE_SIMPLE64 SGE;
24062306a36Sopenharmony_ci} MPI25_SCSI_IO_CDB_UNION, *PTR_MPI25_SCSI_IO_CDB_UNION,
24162306a36Sopenharmony_ci	Mpi25ScsiIoCdb_t, *pMpi25ScsiIoCdb_t;
24262306a36Sopenharmony_ci
24362306a36Sopenharmony_ci/*MPI v2.5/2.6 SCSI IO Request Message */
24462306a36Sopenharmony_citypedef struct _MPI25_SCSI_IO_REQUEST {
24562306a36Sopenharmony_ci	U16 DevHandle;		/*0x00 */
24662306a36Sopenharmony_ci	U8 ChainOffset;		/*0x02 */
24762306a36Sopenharmony_ci	U8 Function;		/*0x03 */
24862306a36Sopenharmony_ci	U16 Reserved1;		/*0x04 */
24962306a36Sopenharmony_ci	U8 Reserved2;		/*0x06 */
25062306a36Sopenharmony_ci	U8 MsgFlags;		/*0x07 */
25162306a36Sopenharmony_ci	U8 VP_ID;		/*0x08 */
25262306a36Sopenharmony_ci	U8 VF_ID;		/*0x09 */
25362306a36Sopenharmony_ci	U16 Reserved3;		/*0x0A */
25462306a36Sopenharmony_ci	U32 SenseBufferLowAddress;	/*0x0C */
25562306a36Sopenharmony_ci	U8 DMAFlags;		/*0x10 */
25662306a36Sopenharmony_ci	U8 Reserved5;		/*0x11 */
25762306a36Sopenharmony_ci	U8 SenseBufferLength;	/*0x12 */
25862306a36Sopenharmony_ci	U8 Reserved4;		/*0x13 */
25962306a36Sopenharmony_ci	U8 SGLOffset0;		/*0x14 */
26062306a36Sopenharmony_ci	U8 SGLOffset1;		/*0x15 */
26162306a36Sopenharmony_ci	U8 SGLOffset2;		/*0x16 */
26262306a36Sopenharmony_ci	U8 SGLOffset3;		/*0x17 */
26362306a36Sopenharmony_ci	U32 SkipCount;		/*0x18 */
26462306a36Sopenharmony_ci	U32 DataLength;		/*0x1C */
26562306a36Sopenharmony_ci	U32 BidirectionalDataLength;	/*0x20 */
26662306a36Sopenharmony_ci	U16 IoFlags;		/*0x24 */
26762306a36Sopenharmony_ci	U16 EEDPFlags;		/*0x26 */
26862306a36Sopenharmony_ci	U16 EEDPBlockSize;	/*0x28 */
26962306a36Sopenharmony_ci	U16 Reserved6;		/*0x2A */
27062306a36Sopenharmony_ci	U32 SecondaryReferenceTag;	/*0x2C */
27162306a36Sopenharmony_ci	U16 SecondaryApplicationTag;	/*0x30 */
27262306a36Sopenharmony_ci	U16 ApplicationTagTranslationMask;	/*0x32 */
27362306a36Sopenharmony_ci	U8 LUN[8];		/*0x34 */
27462306a36Sopenharmony_ci	U32 Control;		/*0x3C */
27562306a36Sopenharmony_ci	MPI25_SCSI_IO_CDB_UNION CDB;	/*0x40 */
27662306a36Sopenharmony_ci
27762306a36Sopenharmony_ci#ifdef MPI25_SCSI_IO_VENDOR_UNIQUE_REGION /*typically this is left undefined */
27862306a36Sopenharmony_ci	MPI25_SCSI_IO_VENDOR_UNIQUE VendorRegion;
27962306a36Sopenharmony_ci#endif
28062306a36Sopenharmony_ci
28162306a36Sopenharmony_ci	MPI25_SGE_IO_UNION SGL;	/*0x60 */
28262306a36Sopenharmony_ci
28362306a36Sopenharmony_ci} MPI25_SCSI_IO_REQUEST, *PTR_MPI25_SCSI_IO_REQUEST,
28462306a36Sopenharmony_ci	Mpi25SCSIIORequest_t, *pMpi25SCSIIORequest_t;
28562306a36Sopenharmony_ci
28662306a36Sopenharmony_ci/*use MPI2_SCSIIO_MSGFLAGS_ defines for the MsgFlags field */
28762306a36Sopenharmony_ci
28862306a36Sopenharmony_ci/*Defines for the DMAFlags field
28962306a36Sopenharmony_ci * Each setting affects 4 SGLS, from SGL0 to SGL3.
29062306a36Sopenharmony_ci *     D = Data
29162306a36Sopenharmony_ci *     C = Cache DIF
29262306a36Sopenharmony_ci *     I = Interleaved
29362306a36Sopenharmony_ci *     H = Host DIF
29462306a36Sopenharmony_ci */
29562306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_MASK               (0x0F)
29662306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_D_D_D            (0x00)
29762306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_D_D_C            (0x01)
29862306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_D_D_I            (0x02)
29962306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_D_C_C            (0x03)
30062306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_D_C_I            (0x04)
30162306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_D_I_I            (0x05)
30262306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_C_C_C            (0x06)
30362306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_C_C_I            (0x07)
30462306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_C_I_I            (0x08)
30562306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_I_I_I            (0x09)
30662306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_H_D_D            (0x0A)
30762306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_H_D_C            (0x0B)
30862306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_H_D_I            (0x0C)
30962306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_H_C_C            (0x0D)
31062306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_H_C_I            (0x0E)
31162306a36Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_H_I_I            (0x0F)
31262306a36Sopenharmony_ci
31362306a36Sopenharmony_ci/*number of SGLOffset fields */
31462306a36Sopenharmony_ci#define MPI25_SCSIIO_NUM_SGLOFFSETS                 (4)
31562306a36Sopenharmony_ci
31662306a36Sopenharmony_ci/*defines for the IoFlags field */
31762306a36Sopenharmony_ci#define MPI25_SCSIIO_IOFLAGS_IO_PATH_MASK               (0xC000)
31862306a36Sopenharmony_ci#define MPI25_SCSIIO_IOFLAGS_NORMAL_PATH                (0x0000)
31962306a36Sopenharmony_ci#define MPI25_SCSIIO_IOFLAGS_FAST_PATH                  (0x4000)
32062306a36Sopenharmony_ci
32162306a36Sopenharmony_ci#define MPI26_SCSIIO_IOFLAGS_ESCAPE_PASSTHROUGH         (0x2000)
32262306a36Sopenharmony_ci#define MPI25_SCSIIO_IOFLAGS_LARGE_CDB                  (0x1000)
32362306a36Sopenharmony_ci#define MPI25_SCSIIO_IOFLAGS_BIDIRECTIONAL              (0x0800)
32462306a36Sopenharmony_ci#define MPI26_SCSIIO_IOFLAGS_PORT_REQUEST               (0x0400)
32562306a36Sopenharmony_ci#define MPI25_SCSIIO_IOFLAGS_CDBLENGTH_MASK             (0x01FF)
32662306a36Sopenharmony_ci
32762306a36Sopenharmony_ci/*MPI v2.5 defines for the EEDPFlags bits */
32862306a36Sopenharmony_ci/*use MPI2_SCSIIO_EEDPFLAGS_ defines for the other EEDPFlags bits */
32962306a36Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_ESCAPE_MODE_MASK             (0x00C0)
33062306a36Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_COMPATIBLE_MODE              (0x0000)
33162306a36Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_DO_NOT_DISABLE_MODE          (0x0040)
33262306a36Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_APPTAG_DISABLE_MODE          (0x0080)
33362306a36Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_APPTAG_REFTAG_DISABLE_MODE   (0x00C0)
33462306a36Sopenharmony_ci
33562306a36Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_HOST_GUARD_METHOD_MASK       (0x0030)
33662306a36Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_T10_CRC_HOST_GUARD           (0x0000)
33762306a36Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_IP_CHKSUM_HOST_GUARD         (0x0010)
33862306a36Sopenharmony_ci
33962306a36Sopenharmony_ci/*use MPI2_LUN_ defines from mpi2.h for the LUN field */
34062306a36Sopenharmony_ci
34162306a36Sopenharmony_ci/*use MPI2_SCSIIO_CONTROL_ defines for the Control field */
34262306a36Sopenharmony_ci
34362306a36Sopenharmony_ci/*NOTE: The SCSI IO Reply is nearly the same for MPI 2.0 and MPI 2.5, so
34462306a36Sopenharmony_ci *      MPI2_SCSI_IO_REPLY is used for both.
34562306a36Sopenharmony_ci */
34662306a36Sopenharmony_ci
34762306a36Sopenharmony_ci/*SCSI IO Error Reply Message */
34862306a36Sopenharmony_citypedef struct _MPI2_SCSI_IO_REPLY {
34962306a36Sopenharmony_ci	U16 DevHandle;		/*0x00 */
35062306a36Sopenharmony_ci	U8 MsgLength;		/*0x02 */
35162306a36Sopenharmony_ci	U8 Function;		/*0x03 */
35262306a36Sopenharmony_ci	U16 Reserved1;		/*0x04 */
35362306a36Sopenharmony_ci	U8 Reserved2;		/*0x06 */
35462306a36Sopenharmony_ci	U8 MsgFlags;		/*0x07 */
35562306a36Sopenharmony_ci	U8 VP_ID;		/*0x08 */
35662306a36Sopenharmony_ci	U8 VF_ID;		/*0x09 */
35762306a36Sopenharmony_ci	U16 Reserved3;		/*0x0A */
35862306a36Sopenharmony_ci	U8 SCSIStatus;		/*0x0C */
35962306a36Sopenharmony_ci	U8 SCSIState;		/*0x0D */
36062306a36Sopenharmony_ci	U16 IOCStatus;		/*0x0E */
36162306a36Sopenharmony_ci	U32 IOCLogInfo;		/*0x10 */
36262306a36Sopenharmony_ci	U32 TransferCount;	/*0x14 */
36362306a36Sopenharmony_ci	U32 SenseCount;		/*0x18 */
36462306a36Sopenharmony_ci	U32 ResponseInfo;	/*0x1C */
36562306a36Sopenharmony_ci	U16 TaskTag;		/*0x20 */
36662306a36Sopenharmony_ci	U16 SCSIStatusQualifier; /* 0x22 */
36762306a36Sopenharmony_ci	U32 BidirectionalTransferCount;	/*0x24 */
36862306a36Sopenharmony_ci /* MPI 2.5+ only; Reserved in MPI 2.0 */
36962306a36Sopenharmony_ci	U32 EEDPErrorOffset;	/* 0x28 */
37062306a36Sopenharmony_ci /* MPI 2.5+ only; Reserved in MPI 2.0 */
37162306a36Sopenharmony_ci	U16 EEDPObservedAppTag;	/* 0x2C */
37262306a36Sopenharmony_ci /* MPI 2.5+ only; Reserved in MPI 2.0 */
37362306a36Sopenharmony_ci	U16 EEDPObservedGuard;	/* 0x2E */
37462306a36Sopenharmony_ci /* MPI 2.5+ only; Reserved in MPI 2.0 */
37562306a36Sopenharmony_ci	U32 EEDPObservedRefTag;	/* 0x30 */
37662306a36Sopenharmony_ci} MPI2_SCSI_IO_REPLY, *PTR_MPI2_SCSI_IO_REPLY,
37762306a36Sopenharmony_ci	Mpi2SCSIIOReply_t, *pMpi2SCSIIOReply_t;
37862306a36Sopenharmony_ci
37962306a36Sopenharmony_ci/*SCSI IO Reply MsgFlags bits */
38062306a36Sopenharmony_ci#define MPI26_SCSIIO_REPLY_MSGFLAGS_REFTAG_OBSERVED_VALID     (0x01)
38162306a36Sopenharmony_ci#define MPI26_SCSIIO_REPLY_MSGFLAGS_GUARD_OBSERVED_VALID      (0x02)
38262306a36Sopenharmony_ci#define MPI26_SCSIIO_REPLY_MSGFLAGS_APPTAG_OBSERVED_VALID     (0x04)
38362306a36Sopenharmony_ci
38462306a36Sopenharmony_ci/*SCSI IO Reply SCSIStatus values (SAM-4 status codes) */
38562306a36Sopenharmony_ci
38662306a36Sopenharmony_ci#define MPI2_SCSI_STATUS_GOOD                   (0x00)
38762306a36Sopenharmony_ci#define MPI2_SCSI_STATUS_CHECK_CONDITION        (0x02)
38862306a36Sopenharmony_ci#define MPI2_SCSI_STATUS_CONDITION_MET          (0x04)
38962306a36Sopenharmony_ci#define MPI2_SCSI_STATUS_BUSY                   (0x08)
39062306a36Sopenharmony_ci#define MPI2_SCSI_STATUS_INTERMEDIATE           (0x10)
39162306a36Sopenharmony_ci#define MPI2_SCSI_STATUS_INTERMEDIATE_CONDMET   (0x14)
39262306a36Sopenharmony_ci#define MPI2_SCSI_STATUS_RESERVATION_CONFLICT   (0x18)
39362306a36Sopenharmony_ci#define MPI2_SCSI_STATUS_COMMAND_TERMINATED     (0x22)	/*obsolete */
39462306a36Sopenharmony_ci#define MPI2_SCSI_STATUS_TASK_SET_FULL          (0x28)
39562306a36Sopenharmony_ci#define MPI2_SCSI_STATUS_ACA_ACTIVE             (0x30)
39662306a36Sopenharmony_ci#define MPI2_SCSI_STATUS_TASK_ABORTED           (0x40)
39762306a36Sopenharmony_ci
39862306a36Sopenharmony_ci/*SCSI IO Reply SCSIState flags */
39962306a36Sopenharmony_ci
40062306a36Sopenharmony_ci#define MPI2_SCSI_STATE_RESPONSE_INFO_VALID     (0x10)
40162306a36Sopenharmony_ci#define MPI2_SCSI_STATE_TERMINATED              (0x08)
40262306a36Sopenharmony_ci#define MPI2_SCSI_STATE_NO_SCSI_STATUS          (0x04)
40362306a36Sopenharmony_ci#define MPI2_SCSI_STATE_AUTOSENSE_FAILED        (0x02)
40462306a36Sopenharmony_ci#define MPI2_SCSI_STATE_AUTOSENSE_VALID         (0x01)
40562306a36Sopenharmony_ci
40662306a36Sopenharmony_ci/*masks and shifts for the ResponseInfo field */
40762306a36Sopenharmony_ci
40862306a36Sopenharmony_ci#define MPI2_SCSI_RI_MASK_REASONCODE            (0x000000FF)
40962306a36Sopenharmony_ci#define MPI2_SCSI_RI_SHIFT_REASONCODE           (0)
41062306a36Sopenharmony_ci
41162306a36Sopenharmony_ci#define MPI2_SCSI_TASKTAG_UNKNOWN               (0xFFFF)
41262306a36Sopenharmony_ci
41362306a36Sopenharmony_ci/****************************************************************************
41462306a36Sopenharmony_ci* SCSI Task Management messages
41562306a36Sopenharmony_ci****************************************************************************/
41662306a36Sopenharmony_ci
41762306a36Sopenharmony_ci/*SCSI Task Management Request Message */
41862306a36Sopenharmony_citypedef struct _MPI2_SCSI_TASK_MANAGE_REQUEST {
41962306a36Sopenharmony_ci	U16 DevHandle;		/*0x00 */
42062306a36Sopenharmony_ci	U8 ChainOffset;		/*0x02 */
42162306a36Sopenharmony_ci	U8 Function;		/*0x03 */
42262306a36Sopenharmony_ci	U8 Reserved1;		/*0x04 */
42362306a36Sopenharmony_ci	U8 TaskType;		/*0x05 */
42462306a36Sopenharmony_ci	U8 Reserved2;		/*0x06 */
42562306a36Sopenharmony_ci	U8 MsgFlags;		/*0x07 */
42662306a36Sopenharmony_ci	U8 VP_ID;		/*0x08 */
42762306a36Sopenharmony_ci	U8 VF_ID;		/*0x09 */
42862306a36Sopenharmony_ci	U16 Reserved3;		/*0x0A */
42962306a36Sopenharmony_ci	U8 LUN[8];		/*0x0C */
43062306a36Sopenharmony_ci	U32 Reserved4[7];	/*0x14 */
43162306a36Sopenharmony_ci	U16 TaskMID;		/*0x30 */
43262306a36Sopenharmony_ci	U16 Reserved5;		/*0x32 */
43362306a36Sopenharmony_ci} MPI2_SCSI_TASK_MANAGE_REQUEST,
43462306a36Sopenharmony_ci	*PTR_MPI2_SCSI_TASK_MANAGE_REQUEST,
43562306a36Sopenharmony_ci	Mpi2SCSITaskManagementRequest_t,
43662306a36Sopenharmony_ci	*pMpi2SCSITaskManagementRequest_t;
43762306a36Sopenharmony_ci
43862306a36Sopenharmony_ci/*TaskType values */
43962306a36Sopenharmony_ci
44062306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK           (0x01)
44162306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET        (0x02)
44262306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET         (0x03)
44362306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET   (0x05)
44462306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET       (0x06)
44562306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK           (0x07)
44662306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_CLR_ACA              (0x08)
44762306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_QRY_TASK_SET         (0x09)
44862306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_QRY_ASYNC_EVENT      (0x0A)
44962306a36Sopenharmony_ci
45062306a36Sopenharmony_ci/*obsolete TaskType name */
45162306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_QRY_UNIT_ATTENTION \
45262306a36Sopenharmony_ci		(MPI2_SCSITASKMGMT_TASKTYPE_QRY_ASYNC_EVENT)
45362306a36Sopenharmony_ci
45462306a36Sopenharmony_ci/*MsgFlags bits */
45562306a36Sopenharmony_ci
45662306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_MSGFLAGS_MASK_TARGET_RESET    (0x18)
45762306a36Sopenharmony_ci#define MPI26_SCSITASKMGMT_MSGFLAGS_HOT_RESET_PCIE        (0x00)
45862306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET           (0x00)
45962306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_MSGFLAGS_NEXUS_RESET_SRST     (0x08)
46062306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_MSGFLAGS_SAS_HARD_LINK_RESET  (0x10)
46162306a36Sopenharmony_ci
46262306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_MSGFLAGS_DO_NOT_SEND_TASK_IU  (0x01)
46362306a36Sopenharmony_ci#define MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE (0x18)
46462306a36Sopenharmony_ci
46562306a36Sopenharmony_ci/*SCSI Task Management Reply Message */
46662306a36Sopenharmony_citypedef struct _MPI2_SCSI_TASK_MANAGE_REPLY {
46762306a36Sopenharmony_ci	U16 DevHandle;		/*0x00 */
46862306a36Sopenharmony_ci	U8 MsgLength;		/*0x02 */
46962306a36Sopenharmony_ci	U8 Function;		/*0x03 */
47062306a36Sopenharmony_ci	U8 ResponseCode;	/*0x04 */
47162306a36Sopenharmony_ci	U8 TaskType;		/*0x05 */
47262306a36Sopenharmony_ci	U8 Reserved1;		/*0x06 */
47362306a36Sopenharmony_ci	U8 MsgFlags;		/*0x07 */
47462306a36Sopenharmony_ci	U8 VP_ID;		/*0x08 */
47562306a36Sopenharmony_ci	U8 VF_ID;		/*0x09 */
47662306a36Sopenharmony_ci	U16 Reserved2;		/*0x0A */
47762306a36Sopenharmony_ci	U16 Reserved3;		/*0x0C */
47862306a36Sopenharmony_ci	U16 IOCStatus;		/*0x0E */
47962306a36Sopenharmony_ci	U32 IOCLogInfo;		/*0x10 */
48062306a36Sopenharmony_ci	U32 TerminationCount;	/*0x14 */
48162306a36Sopenharmony_ci	U32 ResponseInfo;	/*0x18 */
48262306a36Sopenharmony_ci} MPI2_SCSI_TASK_MANAGE_REPLY,
48362306a36Sopenharmony_ci	*PTR_MPI2_SCSI_TASK_MANAGE_REPLY,
48462306a36Sopenharmony_ci	Mpi2SCSITaskManagementReply_t, *pMpi2SCSIManagementReply_t;
48562306a36Sopenharmony_ci
48662306a36Sopenharmony_ci/*ResponseCode values */
48762306a36Sopenharmony_ci
48862306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_TM_COMPLETE               (0x00)
48962306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_INVALID_FRAME             (0x02)
49062306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED          (0x04)
49162306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_TM_FAILED                 (0x05)
49262306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED              (0x08)
49362306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_TM_INVALID_LUN            (0x09)
49462306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_TM_OVERLAPPED_TAG         (0x0A)
49562306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC          (0x80)
49662306a36Sopenharmony_ci
49762306a36Sopenharmony_ci/*masks and shifts for the ResponseInfo field */
49862306a36Sopenharmony_ci
49962306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_MASK_REASONCODE            (0x000000FF)
50062306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_SHIFT_REASONCODE           (0)
50162306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_MASK_ARI2                  (0x0000FF00)
50262306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_SHIFT_ARI2                 (8)
50362306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_MASK_ARI1                  (0x00FF0000)
50462306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_SHIFT_ARI1                 (16)
50562306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_MASK_ARI0                  (0xFF000000)
50662306a36Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_SHIFT_ARI0                 (24)
50762306a36Sopenharmony_ci
50862306a36Sopenharmony_ci/****************************************************************************
50962306a36Sopenharmony_ci* SCSI Enclosure Processor messages
51062306a36Sopenharmony_ci****************************************************************************/
51162306a36Sopenharmony_ci
51262306a36Sopenharmony_ci/*SCSI Enclosure Processor Request Message */
51362306a36Sopenharmony_citypedef struct _MPI2_SEP_REQUEST {
51462306a36Sopenharmony_ci	U16 DevHandle;		/*0x00 */
51562306a36Sopenharmony_ci	U8 ChainOffset;		/*0x02 */
51662306a36Sopenharmony_ci	U8 Function;		/*0x03 */
51762306a36Sopenharmony_ci	U8 Action;		/*0x04 */
51862306a36Sopenharmony_ci	U8 Flags;		/*0x05 */
51962306a36Sopenharmony_ci	U8 Reserved1;		/*0x06 */
52062306a36Sopenharmony_ci	U8 MsgFlags;		/*0x07 */
52162306a36Sopenharmony_ci	U8 VP_ID;		/*0x08 */
52262306a36Sopenharmony_ci	U8 VF_ID;		/*0x09 */
52362306a36Sopenharmony_ci	U16 Reserved2;		/*0x0A */
52462306a36Sopenharmony_ci	U32 SlotStatus;		/*0x0C */
52562306a36Sopenharmony_ci	U32 Reserved3;		/*0x10 */
52662306a36Sopenharmony_ci	U32 Reserved4;		/*0x14 */
52762306a36Sopenharmony_ci	U32 Reserved5;		/*0x18 */
52862306a36Sopenharmony_ci	U16 Slot;		/*0x1C */
52962306a36Sopenharmony_ci	U16 EnclosureHandle;	/*0x1E */
53062306a36Sopenharmony_ci} MPI2_SEP_REQUEST, *PTR_MPI2_SEP_REQUEST,
53162306a36Sopenharmony_ci	Mpi2SepRequest_t, *pMpi2SepRequest_t;
53262306a36Sopenharmony_ci
53362306a36Sopenharmony_ci/*Action defines */
53462306a36Sopenharmony_ci#define MPI2_SEP_REQ_ACTION_WRITE_STATUS                (0x00)
53562306a36Sopenharmony_ci#define MPI2_SEP_REQ_ACTION_READ_STATUS                 (0x01)
53662306a36Sopenharmony_ci
53762306a36Sopenharmony_ci/*Flags defines */
53862306a36Sopenharmony_ci#define MPI2_SEP_REQ_FLAGS_DEVHANDLE_ADDRESS            (0x00)
53962306a36Sopenharmony_ci#define MPI2_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS       (0x01)
54062306a36Sopenharmony_ci
54162306a36Sopenharmony_ci/*SlotStatus defines */
54262306a36Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_DEV_OFF                 (0x00080000)
54362306a36Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE          (0x00040000)
54462306a36Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST        (0x00020000)
54562306a36Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED         (0x00000200)
54662306a36Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_HOT_SPARE               (0x00000100)
54762306a36Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_UNCONFIGURED            (0x00000080)
54862306a36Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT         (0x00000040)
54962306a36Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_IN_CRITICAL_ARRAY       (0x00000010)
55062306a36Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_IN_FAILED_ARRAY         (0x00000008)
55162306a36Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_DEV_REBUILDING          (0x00000004)
55262306a36Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_DEV_FAULTY              (0x00000002)
55362306a36Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_NO_ERROR                (0x00000001)
55462306a36Sopenharmony_ci
55562306a36Sopenharmony_ci/*SCSI Enclosure Processor Reply Message */
55662306a36Sopenharmony_citypedef struct _MPI2_SEP_REPLY {
55762306a36Sopenharmony_ci	U16 DevHandle;		/*0x00 */
55862306a36Sopenharmony_ci	U8 MsgLength;		/*0x02 */
55962306a36Sopenharmony_ci	U8 Function;		/*0x03 */
56062306a36Sopenharmony_ci	U8 Action;		/*0x04 */
56162306a36Sopenharmony_ci	U8 Flags;		/*0x05 */
56262306a36Sopenharmony_ci	U8 Reserved1;		/*0x06 */
56362306a36Sopenharmony_ci	U8 MsgFlags;		/*0x07 */
56462306a36Sopenharmony_ci	U8 VP_ID;		/*0x08 */
56562306a36Sopenharmony_ci	U8 VF_ID;		/*0x09 */
56662306a36Sopenharmony_ci	U16 Reserved2;		/*0x0A */
56762306a36Sopenharmony_ci	U16 Reserved3;		/*0x0C */
56862306a36Sopenharmony_ci	U16 IOCStatus;		/*0x0E */
56962306a36Sopenharmony_ci	U32 IOCLogInfo;		/*0x10 */
57062306a36Sopenharmony_ci	U32 SlotStatus;		/*0x14 */
57162306a36Sopenharmony_ci	U32 Reserved4;		/*0x18 */
57262306a36Sopenharmony_ci	U16 Slot;		/*0x1C */
57362306a36Sopenharmony_ci	U16 EnclosureHandle;	/*0x1E */
57462306a36Sopenharmony_ci} MPI2_SEP_REPLY, *PTR_MPI2_SEP_REPLY,
57562306a36Sopenharmony_ci	Mpi2SepReply_t, *pMpi2SepReply_t;
57662306a36Sopenharmony_ci
57762306a36Sopenharmony_ci/*SlotStatus defines */
57862306a36Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_DEV_OFF               (0x00080000)
57962306a36Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_REMOVE_READY          (0x00040000)
58062306a36Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST      (0x00020000)
58162306a36Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED       (0x00000200)
58262306a36Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_HOT_SPARE             (0x00000100)
58362306a36Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_UNCONFIGURED          (0x00000080)
58462306a36Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT       (0x00000040)
58562306a36Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_IN_CRITICAL_ARRAY     (0x00000010)
58662306a36Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_IN_FAILED_ARRAY       (0x00000008)
58762306a36Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING        (0x00000004)
58862306a36Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_DEV_FAULTY            (0x00000002)
58962306a36Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_NO_ERROR              (0x00000001)
59062306a36Sopenharmony_ci
59162306a36Sopenharmony_ci#endif
592