18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Copyright 2000-2020 Broadcom Inc. All rights reserved. 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * Name: mpi2_init.h 78c2ecf20Sopenharmony_ci * Title: MPI SCSI initiator mode messages and structures 88c2ecf20Sopenharmony_ci * Creation Date: June 23, 2006 98c2ecf20Sopenharmony_ci * 108c2ecf20Sopenharmony_ci * mpi2_init.h Version: 02.00.21 118c2ecf20Sopenharmony_ci * 128c2ecf20Sopenharmony_ci * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 138c2ecf20Sopenharmony_ci * prefix are for use only on MPI v2.5 products, and must not be used 148c2ecf20Sopenharmony_ci * with MPI v2.0 products. Unless otherwise noted, names beginning with 158c2ecf20Sopenharmony_ci * MPI2 or Mpi2 are for use with both MPI v2.0 and MPI v2.5 products. 168c2ecf20Sopenharmony_ci * 178c2ecf20Sopenharmony_ci * Version History 188c2ecf20Sopenharmony_ci * --------------- 198c2ecf20Sopenharmony_ci * 208c2ecf20Sopenharmony_ci * Date Version Description 218c2ecf20Sopenharmony_ci * -------- -------- ------------------------------------------------------ 228c2ecf20Sopenharmony_ci * 04-30-07 02.00.00 Corresponds to Fusion-MPT MPI Specification Rev A. 238c2ecf20Sopenharmony_ci * 10-31-07 02.00.01 Fixed name for pMpi2SCSITaskManagementRequest_t. 248c2ecf20Sopenharmony_ci * 12-18-07 02.00.02 Modified Task Management Target Reset Method defines. 258c2ecf20Sopenharmony_ci * 02-29-08 02.00.03 Added Query Task Set and Query Unit Attention. 268c2ecf20Sopenharmony_ci * 03-03-08 02.00.04 Fixed name of struct _MPI2_SCSI_TASK_MANAGE_REPLY. 278c2ecf20Sopenharmony_ci * 05-21-08 02.00.05 Fixed typo in name of Mpi2SepRequest_t. 288c2ecf20Sopenharmony_ci * 10-02-08 02.00.06 Removed Untagged and No Disconnect values from SCSI IO 298c2ecf20Sopenharmony_ci * Control field Task Attribute flags. 308c2ecf20Sopenharmony_ci * Moved LUN field defines to mpi2.h becasue they are 318c2ecf20Sopenharmony_ci * common to many structures. 328c2ecf20Sopenharmony_ci * 05-06-09 02.00.07 Changed task management type of Query Unit Attention to 338c2ecf20Sopenharmony_ci * Query Asynchronous Event. 348c2ecf20Sopenharmony_ci * Defined two new bits in the SlotStatus field of the SCSI 358c2ecf20Sopenharmony_ci * Enclosure Processor Request and Reply. 368c2ecf20Sopenharmony_ci * 10-28-09 02.00.08 Added defines for decoding the ResponseInfo bytes for 378c2ecf20Sopenharmony_ci * both SCSI IO Error Reply and SCSI Task Management Reply. 388c2ecf20Sopenharmony_ci * Added ResponseInfo field to MPI2_SCSI_TASK_MANAGE_REPLY. 398c2ecf20Sopenharmony_ci * Added MPI2_SCSITASKMGMT_RSP_TM_OVERLAPPED_TAG define. 408c2ecf20Sopenharmony_ci * 02-10-10 02.00.09 Removed unused structure that had "#if 0" around it. 418c2ecf20Sopenharmony_ci * 05-12-10 02.00.10 Added optional vendor-unique region to SCSI IO Request. 428c2ecf20Sopenharmony_ci * 11-10-10 02.00.11 Added MPI2_SCSIIO_NUM_SGLOFFSETS define. 438c2ecf20Sopenharmony_ci * 11-18-11 02.00.12 Incorporating additions for MPI v2.5. 448c2ecf20Sopenharmony_ci * 02-06-12 02.00.13 Added alternate defines for Task Priority / Command 458c2ecf20Sopenharmony_ci * Priority to match SAM-4. 468c2ecf20Sopenharmony_ci * Added EEDPErrorOffset to MPI2_SCSI_IO_REPLY. 478c2ecf20Sopenharmony_ci * 07-10-12 02.00.14 Added MPI2_SCSIIO_CONTROL_SHIFT_DATADIRECTION. 488c2ecf20Sopenharmony_ci * 04-09-13 02.00.15 Added SCSIStatusQualifier field to MPI2_SCSI_IO_REPLY, 498c2ecf20Sopenharmony_ci * replacing the Reserved4 field. 508c2ecf20Sopenharmony_ci * 11-18-14 02.00.16 Updated copyright information. 518c2ecf20Sopenharmony_ci * 03-16-15 02.00.17 Updated for MPI v2.6. 528c2ecf20Sopenharmony_ci * Added MPI26_SCSIIO_IOFLAGS_ESCAPE_PASSTHROUGH. 538c2ecf20Sopenharmony_ci * Added MPI2_SEP_REQ_SLOTSTATUS_DEV_OFF and 548c2ecf20Sopenharmony_ci * MPI2_SEP_REPLY_SLOTSTATUS_DEV_OFF. 558c2ecf20Sopenharmony_ci * 08-26-15 02.00.18 Added SCSITASKMGMT_MSGFLAGS for Target Reset. 568c2ecf20Sopenharmony_ci * 12-18-15 02.00.19 Added EEDPObservedValue added to SCSI IO Reply message. 578c2ecf20Sopenharmony_ci * 01-04-16 02.00.20 Modified EEDP reported values in SCSI IO Reply message. 588c2ecf20Sopenharmony_ci * 01-21-16 02.00.21 Modified MPI26_SCSITASKMGMT_MSGFLAGS_PCIE* defines to 598c2ecf20Sopenharmony_ci * be unique within first 32 characters. 608c2ecf20Sopenharmony_ci * -------------------------------------------------------------------------- 618c2ecf20Sopenharmony_ci */ 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ci#ifndef MPI2_INIT_H 648c2ecf20Sopenharmony_ci#define MPI2_INIT_H 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ci/***************************************************************************** 678c2ecf20Sopenharmony_ci* 688c2ecf20Sopenharmony_ci* SCSI Initiator Messages 698c2ecf20Sopenharmony_ci* 708c2ecf20Sopenharmony_ci*****************************************************************************/ 718c2ecf20Sopenharmony_ci 728c2ecf20Sopenharmony_ci/**************************************************************************** 738c2ecf20Sopenharmony_ci* SCSI IO messages and associated structures 748c2ecf20Sopenharmony_ci****************************************************************************/ 758c2ecf20Sopenharmony_ci 768c2ecf20Sopenharmony_citypedef struct _MPI2_SCSI_IO_CDB_EEDP32 { 778c2ecf20Sopenharmony_ci U8 CDB[20]; /*0x00 */ 788c2ecf20Sopenharmony_ci __be32 PrimaryReferenceTag; /*0x14 */ 798c2ecf20Sopenharmony_ci U16 PrimaryApplicationTag; /*0x18 */ 808c2ecf20Sopenharmony_ci U16 PrimaryApplicationTagMask; /*0x1A */ 818c2ecf20Sopenharmony_ci U32 TransferLength; /*0x1C */ 828c2ecf20Sopenharmony_ci} MPI2_SCSI_IO_CDB_EEDP32, *PTR_MPI2_SCSI_IO_CDB_EEDP32, 838c2ecf20Sopenharmony_ci Mpi2ScsiIoCdbEedp32_t, *pMpi2ScsiIoCdbEedp32_t; 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ci/*MPI v2.0 CDB field */ 868c2ecf20Sopenharmony_citypedef union _MPI2_SCSI_IO_CDB_UNION { 878c2ecf20Sopenharmony_ci U8 CDB32[32]; 888c2ecf20Sopenharmony_ci MPI2_SCSI_IO_CDB_EEDP32 EEDP32; 898c2ecf20Sopenharmony_ci MPI2_SGE_SIMPLE_UNION SGE; 908c2ecf20Sopenharmony_ci} MPI2_SCSI_IO_CDB_UNION, *PTR_MPI2_SCSI_IO_CDB_UNION, 918c2ecf20Sopenharmony_ci Mpi2ScsiIoCdb_t, *pMpi2ScsiIoCdb_t; 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci/*MPI v2.0 SCSI IO Request Message */ 948c2ecf20Sopenharmony_citypedef struct _MPI2_SCSI_IO_REQUEST { 958c2ecf20Sopenharmony_ci U16 DevHandle; /*0x00 */ 968c2ecf20Sopenharmony_ci U8 ChainOffset; /*0x02 */ 978c2ecf20Sopenharmony_ci U8 Function; /*0x03 */ 988c2ecf20Sopenharmony_ci U16 Reserved1; /*0x04 */ 998c2ecf20Sopenharmony_ci U8 Reserved2; /*0x06 */ 1008c2ecf20Sopenharmony_ci U8 MsgFlags; /*0x07 */ 1018c2ecf20Sopenharmony_ci U8 VP_ID; /*0x08 */ 1028c2ecf20Sopenharmony_ci U8 VF_ID; /*0x09 */ 1038c2ecf20Sopenharmony_ci U16 Reserved3; /*0x0A */ 1048c2ecf20Sopenharmony_ci U32 SenseBufferLowAddress; /*0x0C */ 1058c2ecf20Sopenharmony_ci U16 SGLFlags; /*0x10 */ 1068c2ecf20Sopenharmony_ci U8 SenseBufferLength; /*0x12 */ 1078c2ecf20Sopenharmony_ci U8 Reserved4; /*0x13 */ 1088c2ecf20Sopenharmony_ci U8 SGLOffset0; /*0x14 */ 1098c2ecf20Sopenharmony_ci U8 SGLOffset1; /*0x15 */ 1108c2ecf20Sopenharmony_ci U8 SGLOffset2; /*0x16 */ 1118c2ecf20Sopenharmony_ci U8 SGLOffset3; /*0x17 */ 1128c2ecf20Sopenharmony_ci U32 SkipCount; /*0x18 */ 1138c2ecf20Sopenharmony_ci U32 DataLength; /*0x1C */ 1148c2ecf20Sopenharmony_ci U32 BidirectionalDataLength; /*0x20 */ 1158c2ecf20Sopenharmony_ci U16 IoFlags; /*0x24 */ 1168c2ecf20Sopenharmony_ci U16 EEDPFlags; /*0x26 */ 1178c2ecf20Sopenharmony_ci U32 EEDPBlockSize; /*0x28 */ 1188c2ecf20Sopenharmony_ci U32 SecondaryReferenceTag; /*0x2C */ 1198c2ecf20Sopenharmony_ci U16 SecondaryApplicationTag; /*0x30 */ 1208c2ecf20Sopenharmony_ci U16 ApplicationTagTranslationMask; /*0x32 */ 1218c2ecf20Sopenharmony_ci U8 LUN[8]; /*0x34 */ 1228c2ecf20Sopenharmony_ci U32 Control; /*0x3C */ 1238c2ecf20Sopenharmony_ci MPI2_SCSI_IO_CDB_UNION CDB; /*0x40 */ 1248c2ecf20Sopenharmony_ci 1258c2ecf20Sopenharmony_ci#ifdef MPI2_SCSI_IO_VENDOR_UNIQUE_REGION /*typically this is left undefined */ 1268c2ecf20Sopenharmony_ci MPI2_SCSI_IO_VENDOR_UNIQUE VendorRegion; 1278c2ecf20Sopenharmony_ci#endif 1288c2ecf20Sopenharmony_ci 1298c2ecf20Sopenharmony_ci MPI2_SGE_IO_UNION SGL; /*0x60 */ 1308c2ecf20Sopenharmony_ci 1318c2ecf20Sopenharmony_ci} MPI2_SCSI_IO_REQUEST, *PTR_MPI2_SCSI_IO_REQUEST, 1328c2ecf20Sopenharmony_ci Mpi2SCSIIORequest_t, *pMpi2SCSIIORequest_t; 1338c2ecf20Sopenharmony_ci 1348c2ecf20Sopenharmony_ci/*SCSI IO MsgFlags bits */ 1358c2ecf20Sopenharmony_ci 1368c2ecf20Sopenharmony_ci/*MsgFlags for SenseBufferAddressSpace */ 1378c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_MSGFLAGS_MASK_SENSE_ADDR (0x0C) 1388c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_MSGFLAGS_SYSTEM_SENSE_ADDR (0x00) 1398c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_MSGFLAGS_IOCDDR_SENSE_ADDR (0x04) 1408c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_MSGFLAGS_IOCPLB_SENSE_ADDR (0x08) 1418c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_MSGFLAGS_IOCPLBNTA_SENSE_ADDR (0x0C) 1428c2ecf20Sopenharmony_ci#define MPI26_SCSIIO_MSGFLAGS_IOCCTL_SENSE_ADDR (0x08) 1438c2ecf20Sopenharmony_ci 1448c2ecf20Sopenharmony_ci/*SCSI IO SGLFlags bits */ 1458c2ecf20Sopenharmony_ci 1468c2ecf20Sopenharmony_ci/*base values for Data Location Address Space */ 1478c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_ADDR_MASK (0x0C) 1488c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_SYSTEM_ADDR (0x00) 1498c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_IOCDDR_ADDR (0x04) 1508c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_IOCPLB_ADDR (0x08) 1518c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_IOCPLBNTA_ADDR (0x0C) 1528c2ecf20Sopenharmony_ci 1538c2ecf20Sopenharmony_ci/*base values for Type */ 1548c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_TYPE_MASK (0x03) 1558c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_TYPE_MPI (0x00) 1568c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_TYPE_IEEE32 (0x01) 1578c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_TYPE_IEEE64 (0x02) 1588c2ecf20Sopenharmony_ci 1598c2ecf20Sopenharmony_ci/*shift values for each sub-field */ 1608c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_SGL3_SHIFT (12) 1618c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_SGL2_SHIFT (8) 1628c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_SGL1_SHIFT (4) 1638c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_SGLFLAGS_SGL0_SHIFT (0) 1648c2ecf20Sopenharmony_ci 1658c2ecf20Sopenharmony_ci/*number of SGLOffset fields */ 1668c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_NUM_SGLOFFSETS (4) 1678c2ecf20Sopenharmony_ci 1688c2ecf20Sopenharmony_ci/*SCSI IO IoFlags bits */ 1698c2ecf20Sopenharmony_ci 1708c2ecf20Sopenharmony_ci/*Large CDB Address Space */ 1718c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CDB_ADDR_MASK (0x6000) 1728c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CDB_ADDR_SYSTEM (0x0000) 1738c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CDB_ADDR_IOCDDR (0x2000) 1748c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CDB_ADDR_IOCPLB (0x4000) 1758c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CDB_ADDR_IOCPLBNTA (0x6000) 1768c2ecf20Sopenharmony_ci 1778c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_IOFLAGS_LARGE_CDB (0x1000) 1788c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_IOFLAGS_BIDIRECTIONAL (0x0800) 1798c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_IOFLAGS_MULTICAST (0x0400) 1808c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_IOFLAGS_CMD_DETERMINES_DATA_DIR (0x0200) 1818c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_IOFLAGS_CDBLENGTH_MASK (0x01FF) 1828c2ecf20Sopenharmony_ci 1838c2ecf20Sopenharmony_ci/*SCSI IO EEDPFlags bits */ 1848c2ecf20Sopenharmony_ci 1858c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_INC_PRI_REFTAG (0x8000) 1868c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_INC_SEC_REFTAG (0x4000) 1878c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_INC_PRI_APPTAG (0x2000) 1888c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_INC_SEC_APPTAG (0x1000) 1898c2ecf20Sopenharmony_ci 1908c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_CHECK_REFTAG (0x0400) 1918c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_CHECK_APPTAG (0x0200) 1928c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD (0x0100) 1938c2ecf20Sopenharmony_ci 1948c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_PASSTHRU_REFTAG (0x0008) 1958c2ecf20Sopenharmony_ci 1968c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_MASK_OP (0x0007) 1978c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_NOOP_OP (0x0000) 1988c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_CHECK_OP (0x0001) 1998c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_STRIP_OP (0x0002) 2008c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_CHECK_REMOVE_OP (0x0003) 2018c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_INSERT_OP (0x0004) 2028c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_REPLACE_OP (0x0006) 2038c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_EEDPFLAGS_CHECK_REGEN_OP (0x0007) 2048c2ecf20Sopenharmony_ci 2058c2ecf20Sopenharmony_ci/*SCSI IO LUN fields: use MPI2_LUN_ from mpi2.h */ 2068c2ecf20Sopenharmony_ci 2078c2ecf20Sopenharmony_ci/*SCSI IO Control bits */ 2088c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_ADDCDBLEN_MASK (0xFC000000) 2098c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_ADDCDBLEN_SHIFT (26) 2108c2ecf20Sopenharmony_ci 2118c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_DATADIRECTION_MASK (0x03000000) 2128c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_SHIFT_DATADIRECTION (24) 2138c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_NODATATRANSFER (0x00000000) 2148c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_WRITE (0x01000000) 2158c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_READ (0x02000000) 2168c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_BIDIRECTIONAL (0x03000000) 2178c2ecf20Sopenharmony_ci 2188c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_TASKPRI_MASK (0x00007800) 2198c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_TASKPRI_SHIFT (11) 2208c2ecf20Sopenharmony_ci/*alternate name for the previous field; called Command Priority in SAM-4 */ 2218c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_CMDPRI_MASK (0x00007800) 2228c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_CMDPRI_SHIFT (11) 2238c2ecf20Sopenharmony_ci 2248c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_TASKATTRIBUTE_MASK (0x00000700) 2258c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_SIMPLEQ (0x00000000) 2268c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_HEADOFQ (0x00000100) 2278c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_ORDEREDQ (0x00000200) 2288c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_ACAQ (0x00000400) 2298c2ecf20Sopenharmony_ci 2308c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_TLR_MASK (0x000000C0) 2318c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_NO_TLR (0x00000000) 2328c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_TLR_ON (0x00000040) 2338c2ecf20Sopenharmony_ci#define MPI2_SCSIIO_CONTROL_TLR_OFF (0x00000080) 2348c2ecf20Sopenharmony_ci 2358c2ecf20Sopenharmony_ci/*MPI v2.5 CDB field */ 2368c2ecf20Sopenharmony_citypedef union _MPI25_SCSI_IO_CDB_UNION { 2378c2ecf20Sopenharmony_ci U8 CDB32[32]; 2388c2ecf20Sopenharmony_ci MPI2_SCSI_IO_CDB_EEDP32 EEDP32; 2398c2ecf20Sopenharmony_ci MPI2_IEEE_SGE_SIMPLE64 SGE; 2408c2ecf20Sopenharmony_ci} MPI25_SCSI_IO_CDB_UNION, *PTR_MPI25_SCSI_IO_CDB_UNION, 2418c2ecf20Sopenharmony_ci Mpi25ScsiIoCdb_t, *pMpi25ScsiIoCdb_t; 2428c2ecf20Sopenharmony_ci 2438c2ecf20Sopenharmony_ci/*MPI v2.5/2.6 SCSI IO Request Message */ 2448c2ecf20Sopenharmony_citypedef struct _MPI25_SCSI_IO_REQUEST { 2458c2ecf20Sopenharmony_ci U16 DevHandle; /*0x00 */ 2468c2ecf20Sopenharmony_ci U8 ChainOffset; /*0x02 */ 2478c2ecf20Sopenharmony_ci U8 Function; /*0x03 */ 2488c2ecf20Sopenharmony_ci U16 Reserved1; /*0x04 */ 2498c2ecf20Sopenharmony_ci U8 Reserved2; /*0x06 */ 2508c2ecf20Sopenharmony_ci U8 MsgFlags; /*0x07 */ 2518c2ecf20Sopenharmony_ci U8 VP_ID; /*0x08 */ 2528c2ecf20Sopenharmony_ci U8 VF_ID; /*0x09 */ 2538c2ecf20Sopenharmony_ci U16 Reserved3; /*0x0A */ 2548c2ecf20Sopenharmony_ci U32 SenseBufferLowAddress; /*0x0C */ 2558c2ecf20Sopenharmony_ci U8 DMAFlags; /*0x10 */ 2568c2ecf20Sopenharmony_ci U8 Reserved5; /*0x11 */ 2578c2ecf20Sopenharmony_ci U8 SenseBufferLength; /*0x12 */ 2588c2ecf20Sopenharmony_ci U8 Reserved4; /*0x13 */ 2598c2ecf20Sopenharmony_ci U8 SGLOffset0; /*0x14 */ 2608c2ecf20Sopenharmony_ci U8 SGLOffset1; /*0x15 */ 2618c2ecf20Sopenharmony_ci U8 SGLOffset2; /*0x16 */ 2628c2ecf20Sopenharmony_ci U8 SGLOffset3; /*0x17 */ 2638c2ecf20Sopenharmony_ci U32 SkipCount; /*0x18 */ 2648c2ecf20Sopenharmony_ci U32 DataLength; /*0x1C */ 2658c2ecf20Sopenharmony_ci U32 BidirectionalDataLength; /*0x20 */ 2668c2ecf20Sopenharmony_ci U16 IoFlags; /*0x24 */ 2678c2ecf20Sopenharmony_ci U16 EEDPFlags; /*0x26 */ 2688c2ecf20Sopenharmony_ci U16 EEDPBlockSize; /*0x28 */ 2698c2ecf20Sopenharmony_ci U16 Reserved6; /*0x2A */ 2708c2ecf20Sopenharmony_ci U32 SecondaryReferenceTag; /*0x2C */ 2718c2ecf20Sopenharmony_ci U16 SecondaryApplicationTag; /*0x30 */ 2728c2ecf20Sopenharmony_ci U16 ApplicationTagTranslationMask; /*0x32 */ 2738c2ecf20Sopenharmony_ci U8 LUN[8]; /*0x34 */ 2748c2ecf20Sopenharmony_ci U32 Control; /*0x3C */ 2758c2ecf20Sopenharmony_ci MPI25_SCSI_IO_CDB_UNION CDB; /*0x40 */ 2768c2ecf20Sopenharmony_ci 2778c2ecf20Sopenharmony_ci#ifdef MPI25_SCSI_IO_VENDOR_UNIQUE_REGION /*typically this is left undefined */ 2788c2ecf20Sopenharmony_ci MPI25_SCSI_IO_VENDOR_UNIQUE VendorRegion; 2798c2ecf20Sopenharmony_ci#endif 2808c2ecf20Sopenharmony_ci 2818c2ecf20Sopenharmony_ci MPI25_SGE_IO_UNION SGL; /*0x60 */ 2828c2ecf20Sopenharmony_ci 2838c2ecf20Sopenharmony_ci} MPI25_SCSI_IO_REQUEST, *PTR_MPI25_SCSI_IO_REQUEST, 2848c2ecf20Sopenharmony_ci Mpi25SCSIIORequest_t, *pMpi25SCSIIORequest_t; 2858c2ecf20Sopenharmony_ci 2868c2ecf20Sopenharmony_ci/*use MPI2_SCSIIO_MSGFLAGS_ defines for the MsgFlags field */ 2878c2ecf20Sopenharmony_ci 2888c2ecf20Sopenharmony_ci/*Defines for the DMAFlags field 2898c2ecf20Sopenharmony_ci * Each setting affects 4 SGLS, from SGL0 to SGL3. 2908c2ecf20Sopenharmony_ci * D = Data 2918c2ecf20Sopenharmony_ci * C = Cache DIF 2928c2ecf20Sopenharmony_ci * I = Interleaved 2938c2ecf20Sopenharmony_ci * H = Host DIF 2948c2ecf20Sopenharmony_ci */ 2958c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_MASK (0x0F) 2968c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_D_D_D (0x00) 2978c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_D_D_C (0x01) 2988c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_D_D_I (0x02) 2998c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_D_C_C (0x03) 3008c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_D_C_I (0x04) 3018c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_D_I_I (0x05) 3028c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_C_C_C (0x06) 3038c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_C_C_I (0x07) 3048c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_C_I_I (0x08) 3058c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_I_I_I (0x09) 3068c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_H_D_D (0x0A) 3078c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_H_D_C (0x0B) 3088c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_H_D_I (0x0C) 3098c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_H_C_C (0x0D) 3108c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_H_C_I (0x0E) 3118c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_DMAFLAGS_OP_D_H_I_I (0x0F) 3128c2ecf20Sopenharmony_ci 3138c2ecf20Sopenharmony_ci/*number of SGLOffset fields */ 3148c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_NUM_SGLOFFSETS (4) 3158c2ecf20Sopenharmony_ci 3168c2ecf20Sopenharmony_ci/*defines for the IoFlags field */ 3178c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_IOFLAGS_IO_PATH_MASK (0xC000) 3188c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_IOFLAGS_NORMAL_PATH (0x0000) 3198c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_IOFLAGS_FAST_PATH (0x4000) 3208c2ecf20Sopenharmony_ci 3218c2ecf20Sopenharmony_ci#define MPI26_SCSIIO_IOFLAGS_ESCAPE_PASSTHROUGH (0x2000) 3228c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_IOFLAGS_LARGE_CDB (0x1000) 3238c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_IOFLAGS_BIDIRECTIONAL (0x0800) 3248c2ecf20Sopenharmony_ci#define MPI26_SCSIIO_IOFLAGS_PORT_REQUEST (0x0400) 3258c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_IOFLAGS_CDBLENGTH_MASK (0x01FF) 3268c2ecf20Sopenharmony_ci 3278c2ecf20Sopenharmony_ci/*MPI v2.5 defines for the EEDPFlags bits */ 3288c2ecf20Sopenharmony_ci/*use MPI2_SCSIIO_EEDPFLAGS_ defines for the other EEDPFlags bits */ 3298c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_ESCAPE_MODE_MASK (0x00C0) 3308c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_COMPATIBLE_MODE (0x0000) 3318c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_DO_NOT_DISABLE_MODE (0x0040) 3328c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_APPTAG_DISABLE_MODE (0x0080) 3338c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_APPTAG_REFTAG_DISABLE_MODE (0x00C0) 3348c2ecf20Sopenharmony_ci 3358c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_HOST_GUARD_METHOD_MASK (0x0030) 3368c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_T10_CRC_HOST_GUARD (0x0000) 3378c2ecf20Sopenharmony_ci#define MPI25_SCSIIO_EEDPFLAGS_IP_CHKSUM_HOST_GUARD (0x0010) 3388c2ecf20Sopenharmony_ci 3398c2ecf20Sopenharmony_ci/*use MPI2_LUN_ defines from mpi2.h for the LUN field */ 3408c2ecf20Sopenharmony_ci 3418c2ecf20Sopenharmony_ci/*use MPI2_SCSIIO_CONTROL_ defines for the Control field */ 3428c2ecf20Sopenharmony_ci 3438c2ecf20Sopenharmony_ci/*NOTE: The SCSI IO Reply is nearly the same for MPI 2.0 and MPI 2.5, so 3448c2ecf20Sopenharmony_ci * MPI2_SCSI_IO_REPLY is used for both. 3458c2ecf20Sopenharmony_ci */ 3468c2ecf20Sopenharmony_ci 3478c2ecf20Sopenharmony_ci/*SCSI IO Error Reply Message */ 3488c2ecf20Sopenharmony_citypedef struct _MPI2_SCSI_IO_REPLY { 3498c2ecf20Sopenharmony_ci U16 DevHandle; /*0x00 */ 3508c2ecf20Sopenharmony_ci U8 MsgLength; /*0x02 */ 3518c2ecf20Sopenharmony_ci U8 Function; /*0x03 */ 3528c2ecf20Sopenharmony_ci U16 Reserved1; /*0x04 */ 3538c2ecf20Sopenharmony_ci U8 Reserved2; /*0x06 */ 3548c2ecf20Sopenharmony_ci U8 MsgFlags; /*0x07 */ 3558c2ecf20Sopenharmony_ci U8 VP_ID; /*0x08 */ 3568c2ecf20Sopenharmony_ci U8 VF_ID; /*0x09 */ 3578c2ecf20Sopenharmony_ci U16 Reserved3; /*0x0A */ 3588c2ecf20Sopenharmony_ci U8 SCSIStatus; /*0x0C */ 3598c2ecf20Sopenharmony_ci U8 SCSIState; /*0x0D */ 3608c2ecf20Sopenharmony_ci U16 IOCStatus; /*0x0E */ 3618c2ecf20Sopenharmony_ci U32 IOCLogInfo; /*0x10 */ 3628c2ecf20Sopenharmony_ci U32 TransferCount; /*0x14 */ 3638c2ecf20Sopenharmony_ci U32 SenseCount; /*0x18 */ 3648c2ecf20Sopenharmony_ci U32 ResponseInfo; /*0x1C */ 3658c2ecf20Sopenharmony_ci U16 TaskTag; /*0x20 */ 3668c2ecf20Sopenharmony_ci U16 SCSIStatusQualifier; /* 0x22 */ 3678c2ecf20Sopenharmony_ci U32 BidirectionalTransferCount; /*0x24 */ 3688c2ecf20Sopenharmony_ci /* MPI 2.5+ only; Reserved in MPI 2.0 */ 3698c2ecf20Sopenharmony_ci U32 EEDPErrorOffset; /* 0x28 */ 3708c2ecf20Sopenharmony_ci /* MPI 2.5+ only; Reserved in MPI 2.0 */ 3718c2ecf20Sopenharmony_ci U16 EEDPObservedAppTag; /* 0x2C */ 3728c2ecf20Sopenharmony_ci /* MPI 2.5+ only; Reserved in MPI 2.0 */ 3738c2ecf20Sopenharmony_ci U16 EEDPObservedGuard; /* 0x2E */ 3748c2ecf20Sopenharmony_ci /* MPI 2.5+ only; Reserved in MPI 2.0 */ 3758c2ecf20Sopenharmony_ci U32 EEDPObservedRefTag; /* 0x30 */ 3768c2ecf20Sopenharmony_ci} MPI2_SCSI_IO_REPLY, *PTR_MPI2_SCSI_IO_REPLY, 3778c2ecf20Sopenharmony_ci Mpi2SCSIIOReply_t, *pMpi2SCSIIOReply_t; 3788c2ecf20Sopenharmony_ci 3798c2ecf20Sopenharmony_ci/*SCSI IO Reply MsgFlags bits */ 3808c2ecf20Sopenharmony_ci#define MPI26_SCSIIO_REPLY_MSGFLAGS_REFTAG_OBSERVED_VALID (0x01) 3818c2ecf20Sopenharmony_ci#define MPI26_SCSIIO_REPLY_MSGFLAGS_GUARD_OBSERVED_VALID (0x02) 3828c2ecf20Sopenharmony_ci#define MPI26_SCSIIO_REPLY_MSGFLAGS_APPTAG_OBSERVED_VALID (0x04) 3838c2ecf20Sopenharmony_ci 3848c2ecf20Sopenharmony_ci/*SCSI IO Reply SCSIStatus values (SAM-4 status codes) */ 3858c2ecf20Sopenharmony_ci 3868c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATUS_GOOD (0x00) 3878c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATUS_CHECK_CONDITION (0x02) 3888c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATUS_CONDITION_MET (0x04) 3898c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATUS_BUSY (0x08) 3908c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATUS_INTERMEDIATE (0x10) 3918c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATUS_INTERMEDIATE_CONDMET (0x14) 3928c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATUS_RESERVATION_CONFLICT (0x18) 3938c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATUS_COMMAND_TERMINATED (0x22) /*obsolete */ 3948c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATUS_TASK_SET_FULL (0x28) 3958c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATUS_ACA_ACTIVE (0x30) 3968c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATUS_TASK_ABORTED (0x40) 3978c2ecf20Sopenharmony_ci 3988c2ecf20Sopenharmony_ci/*SCSI IO Reply SCSIState flags */ 3998c2ecf20Sopenharmony_ci 4008c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATE_RESPONSE_INFO_VALID (0x10) 4018c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATE_TERMINATED (0x08) 4028c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATE_NO_SCSI_STATUS (0x04) 4038c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATE_AUTOSENSE_FAILED (0x02) 4048c2ecf20Sopenharmony_ci#define MPI2_SCSI_STATE_AUTOSENSE_VALID (0x01) 4058c2ecf20Sopenharmony_ci 4068c2ecf20Sopenharmony_ci/*masks and shifts for the ResponseInfo field */ 4078c2ecf20Sopenharmony_ci 4088c2ecf20Sopenharmony_ci#define MPI2_SCSI_RI_MASK_REASONCODE (0x000000FF) 4098c2ecf20Sopenharmony_ci#define MPI2_SCSI_RI_SHIFT_REASONCODE (0) 4108c2ecf20Sopenharmony_ci 4118c2ecf20Sopenharmony_ci#define MPI2_SCSI_TASKTAG_UNKNOWN (0xFFFF) 4128c2ecf20Sopenharmony_ci 4138c2ecf20Sopenharmony_ci/**************************************************************************** 4148c2ecf20Sopenharmony_ci* SCSI Task Management messages 4158c2ecf20Sopenharmony_ci****************************************************************************/ 4168c2ecf20Sopenharmony_ci 4178c2ecf20Sopenharmony_ci/*SCSI Task Management Request Message */ 4188c2ecf20Sopenharmony_citypedef struct _MPI2_SCSI_TASK_MANAGE_REQUEST { 4198c2ecf20Sopenharmony_ci U16 DevHandle; /*0x00 */ 4208c2ecf20Sopenharmony_ci U8 ChainOffset; /*0x02 */ 4218c2ecf20Sopenharmony_ci U8 Function; /*0x03 */ 4228c2ecf20Sopenharmony_ci U8 Reserved1; /*0x04 */ 4238c2ecf20Sopenharmony_ci U8 TaskType; /*0x05 */ 4248c2ecf20Sopenharmony_ci U8 Reserved2; /*0x06 */ 4258c2ecf20Sopenharmony_ci U8 MsgFlags; /*0x07 */ 4268c2ecf20Sopenharmony_ci U8 VP_ID; /*0x08 */ 4278c2ecf20Sopenharmony_ci U8 VF_ID; /*0x09 */ 4288c2ecf20Sopenharmony_ci U16 Reserved3; /*0x0A */ 4298c2ecf20Sopenharmony_ci U8 LUN[8]; /*0x0C */ 4308c2ecf20Sopenharmony_ci U32 Reserved4[7]; /*0x14 */ 4318c2ecf20Sopenharmony_ci U16 TaskMID; /*0x30 */ 4328c2ecf20Sopenharmony_ci U16 Reserved5; /*0x32 */ 4338c2ecf20Sopenharmony_ci} MPI2_SCSI_TASK_MANAGE_REQUEST, 4348c2ecf20Sopenharmony_ci *PTR_MPI2_SCSI_TASK_MANAGE_REQUEST, 4358c2ecf20Sopenharmony_ci Mpi2SCSITaskManagementRequest_t, 4368c2ecf20Sopenharmony_ci *pMpi2SCSITaskManagementRequest_t; 4378c2ecf20Sopenharmony_ci 4388c2ecf20Sopenharmony_ci/*TaskType values */ 4398c2ecf20Sopenharmony_ci 4408c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK (0x01) 4418c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET (0x02) 4428c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET (0x03) 4438c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05) 4448c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06) 4458c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07) 4468c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_CLR_ACA (0x08) 4478c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_QRY_TASK_SET (0x09) 4488c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_QRY_ASYNC_EVENT (0x0A) 4498c2ecf20Sopenharmony_ci 4508c2ecf20Sopenharmony_ci/*obsolete TaskType name */ 4518c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_TASKTYPE_QRY_UNIT_ATTENTION \ 4528c2ecf20Sopenharmony_ci (MPI2_SCSITASKMGMT_TASKTYPE_QRY_ASYNC_EVENT) 4538c2ecf20Sopenharmony_ci 4548c2ecf20Sopenharmony_ci/*MsgFlags bits */ 4558c2ecf20Sopenharmony_ci 4568c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_MSGFLAGS_MASK_TARGET_RESET (0x18) 4578c2ecf20Sopenharmony_ci#define MPI26_SCSITASKMGMT_MSGFLAGS_HOT_RESET_PCIE (0x00) 4588c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET (0x00) 4598c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_MSGFLAGS_NEXUS_RESET_SRST (0x08) 4608c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_MSGFLAGS_SAS_HARD_LINK_RESET (0x10) 4618c2ecf20Sopenharmony_ci 4628c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_MSGFLAGS_DO_NOT_SEND_TASK_IU (0x01) 4638c2ecf20Sopenharmony_ci#define MPI26_SCSITASKMGMT_MSGFLAGS_PROTOCOL_LVL_RST_PCIE (0x18) 4648c2ecf20Sopenharmony_ci 4658c2ecf20Sopenharmony_ci/*SCSI Task Management Reply Message */ 4668c2ecf20Sopenharmony_citypedef struct _MPI2_SCSI_TASK_MANAGE_REPLY { 4678c2ecf20Sopenharmony_ci U16 DevHandle; /*0x00 */ 4688c2ecf20Sopenharmony_ci U8 MsgLength; /*0x02 */ 4698c2ecf20Sopenharmony_ci U8 Function; /*0x03 */ 4708c2ecf20Sopenharmony_ci U8 ResponseCode; /*0x04 */ 4718c2ecf20Sopenharmony_ci U8 TaskType; /*0x05 */ 4728c2ecf20Sopenharmony_ci U8 Reserved1; /*0x06 */ 4738c2ecf20Sopenharmony_ci U8 MsgFlags; /*0x07 */ 4748c2ecf20Sopenharmony_ci U8 VP_ID; /*0x08 */ 4758c2ecf20Sopenharmony_ci U8 VF_ID; /*0x09 */ 4768c2ecf20Sopenharmony_ci U16 Reserved2; /*0x0A */ 4778c2ecf20Sopenharmony_ci U16 Reserved3; /*0x0C */ 4788c2ecf20Sopenharmony_ci U16 IOCStatus; /*0x0E */ 4798c2ecf20Sopenharmony_ci U32 IOCLogInfo; /*0x10 */ 4808c2ecf20Sopenharmony_ci U32 TerminationCount; /*0x14 */ 4818c2ecf20Sopenharmony_ci U32 ResponseInfo; /*0x18 */ 4828c2ecf20Sopenharmony_ci} MPI2_SCSI_TASK_MANAGE_REPLY, 4838c2ecf20Sopenharmony_ci *PTR_MPI2_SCSI_TASK_MANAGE_REPLY, 4848c2ecf20Sopenharmony_ci Mpi2SCSITaskManagementReply_t, *pMpi2SCSIManagementReply_t; 4858c2ecf20Sopenharmony_ci 4868c2ecf20Sopenharmony_ci/*ResponseCode values */ 4878c2ecf20Sopenharmony_ci 4888c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_TM_COMPLETE (0x00) 4898c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_INVALID_FRAME (0x02) 4908c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED (0x04) 4918c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_TM_FAILED (0x05) 4928c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED (0x08) 4938c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_TM_INVALID_LUN (0x09) 4948c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_TM_OVERLAPPED_TAG (0x0A) 4958c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC (0x80) 4968c2ecf20Sopenharmony_ci 4978c2ecf20Sopenharmony_ci/*masks and shifts for the ResponseInfo field */ 4988c2ecf20Sopenharmony_ci 4998c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_MASK_REASONCODE (0x000000FF) 5008c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_SHIFT_REASONCODE (0) 5018c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_MASK_ARI2 (0x0000FF00) 5028c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_SHIFT_ARI2 (8) 5038c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_MASK_ARI1 (0x00FF0000) 5048c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_SHIFT_ARI1 (16) 5058c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_MASK_ARI0 (0xFF000000) 5068c2ecf20Sopenharmony_ci#define MPI2_SCSITASKMGMT_RI_SHIFT_ARI0 (24) 5078c2ecf20Sopenharmony_ci 5088c2ecf20Sopenharmony_ci/**************************************************************************** 5098c2ecf20Sopenharmony_ci* SCSI Enclosure Processor messages 5108c2ecf20Sopenharmony_ci****************************************************************************/ 5118c2ecf20Sopenharmony_ci 5128c2ecf20Sopenharmony_ci/*SCSI Enclosure Processor Request Message */ 5138c2ecf20Sopenharmony_citypedef struct _MPI2_SEP_REQUEST { 5148c2ecf20Sopenharmony_ci U16 DevHandle; /*0x00 */ 5158c2ecf20Sopenharmony_ci U8 ChainOffset; /*0x02 */ 5168c2ecf20Sopenharmony_ci U8 Function; /*0x03 */ 5178c2ecf20Sopenharmony_ci U8 Action; /*0x04 */ 5188c2ecf20Sopenharmony_ci U8 Flags; /*0x05 */ 5198c2ecf20Sopenharmony_ci U8 Reserved1; /*0x06 */ 5208c2ecf20Sopenharmony_ci U8 MsgFlags; /*0x07 */ 5218c2ecf20Sopenharmony_ci U8 VP_ID; /*0x08 */ 5228c2ecf20Sopenharmony_ci U8 VF_ID; /*0x09 */ 5238c2ecf20Sopenharmony_ci U16 Reserved2; /*0x0A */ 5248c2ecf20Sopenharmony_ci U32 SlotStatus; /*0x0C */ 5258c2ecf20Sopenharmony_ci U32 Reserved3; /*0x10 */ 5268c2ecf20Sopenharmony_ci U32 Reserved4; /*0x14 */ 5278c2ecf20Sopenharmony_ci U32 Reserved5; /*0x18 */ 5288c2ecf20Sopenharmony_ci U16 Slot; /*0x1C */ 5298c2ecf20Sopenharmony_ci U16 EnclosureHandle; /*0x1E */ 5308c2ecf20Sopenharmony_ci} MPI2_SEP_REQUEST, *PTR_MPI2_SEP_REQUEST, 5318c2ecf20Sopenharmony_ci Mpi2SepRequest_t, *pMpi2SepRequest_t; 5328c2ecf20Sopenharmony_ci 5338c2ecf20Sopenharmony_ci/*Action defines */ 5348c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_ACTION_WRITE_STATUS (0x00) 5358c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_ACTION_READ_STATUS (0x01) 5368c2ecf20Sopenharmony_ci 5378c2ecf20Sopenharmony_ci/*Flags defines */ 5388c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_FLAGS_DEVHANDLE_ADDRESS (0x00) 5398c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS (0x01) 5408c2ecf20Sopenharmony_ci 5418c2ecf20Sopenharmony_ci/*SlotStatus defines */ 5428c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_DEV_OFF (0x00080000) 5438c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE (0x00040000) 5448c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000) 5458c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED (0x00000200) 5468c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_HOT_SPARE (0x00000100) 5478c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_UNCONFIGURED (0x00000080) 5488c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT (0x00000040) 5498c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010) 5508c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008) 5518c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_DEV_REBUILDING (0x00000004) 5528c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_DEV_FAULTY (0x00000002) 5538c2ecf20Sopenharmony_ci#define MPI2_SEP_REQ_SLOTSTATUS_NO_ERROR (0x00000001) 5548c2ecf20Sopenharmony_ci 5558c2ecf20Sopenharmony_ci/*SCSI Enclosure Processor Reply Message */ 5568c2ecf20Sopenharmony_citypedef struct _MPI2_SEP_REPLY { 5578c2ecf20Sopenharmony_ci U16 DevHandle; /*0x00 */ 5588c2ecf20Sopenharmony_ci U8 MsgLength; /*0x02 */ 5598c2ecf20Sopenharmony_ci U8 Function; /*0x03 */ 5608c2ecf20Sopenharmony_ci U8 Action; /*0x04 */ 5618c2ecf20Sopenharmony_ci U8 Flags; /*0x05 */ 5628c2ecf20Sopenharmony_ci U8 Reserved1; /*0x06 */ 5638c2ecf20Sopenharmony_ci U8 MsgFlags; /*0x07 */ 5648c2ecf20Sopenharmony_ci U8 VP_ID; /*0x08 */ 5658c2ecf20Sopenharmony_ci U8 VF_ID; /*0x09 */ 5668c2ecf20Sopenharmony_ci U16 Reserved2; /*0x0A */ 5678c2ecf20Sopenharmony_ci U16 Reserved3; /*0x0C */ 5688c2ecf20Sopenharmony_ci U16 IOCStatus; /*0x0E */ 5698c2ecf20Sopenharmony_ci U32 IOCLogInfo; /*0x10 */ 5708c2ecf20Sopenharmony_ci U32 SlotStatus; /*0x14 */ 5718c2ecf20Sopenharmony_ci U32 Reserved4; /*0x18 */ 5728c2ecf20Sopenharmony_ci U16 Slot; /*0x1C */ 5738c2ecf20Sopenharmony_ci U16 EnclosureHandle; /*0x1E */ 5748c2ecf20Sopenharmony_ci} MPI2_SEP_REPLY, *PTR_MPI2_SEP_REPLY, 5758c2ecf20Sopenharmony_ci Mpi2SepReply_t, *pMpi2SepReply_t; 5768c2ecf20Sopenharmony_ci 5778c2ecf20Sopenharmony_ci/*SlotStatus defines */ 5788c2ecf20Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_DEV_OFF (0x00080000) 5798c2ecf20Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_REMOVE_READY (0x00040000) 5808c2ecf20Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST (0x00020000) 5818c2ecf20Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED (0x00000200) 5828c2ecf20Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_HOT_SPARE (0x00000100) 5838c2ecf20Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_UNCONFIGURED (0x00000080) 5848c2ecf20Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT (0x00000040) 5858c2ecf20Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_IN_CRITICAL_ARRAY (0x00000010) 5868c2ecf20Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_IN_FAILED_ARRAY (0x00000008) 5878c2ecf20Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING (0x00000004) 5888c2ecf20Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_DEV_FAULTY (0x00000002) 5898c2ecf20Sopenharmony_ci#define MPI2_SEP_REPLY_SLOTSTATUS_NO_ERROR (0x00000001) 5908c2ecf20Sopenharmony_ci 5918c2ecf20Sopenharmony_ci#endif 592