xref: /linux/drivers/message/fusion/lsi/mpi_init.h (revision b2441318)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
21da177e4SLinus Torvalds /*
3fd7a2533SKashyap, Desai  *  Copyright (c) 2000-2008 LSI Corporation.
41da177e4SLinus Torvalds  *
51da177e4SLinus Torvalds  *
61da177e4SLinus Torvalds  *           Name:  mpi_init.h
71da177e4SLinus Torvalds  *          Title:  MPI initiator mode messages and structures
81da177e4SLinus Torvalds  *  Creation Date:  June 8, 2000
91da177e4SLinus Torvalds  *
10d16291b1SEric Moore  *    mpi_init.h Version:  01.05.09
111da177e4SLinus Torvalds  *
121da177e4SLinus Torvalds  *  Version History
131da177e4SLinus Torvalds  *  ---------------
141da177e4SLinus Torvalds  *
151da177e4SLinus Torvalds  *  Date      Version   Description
161da177e4SLinus Torvalds  *  --------  --------  ------------------------------------------------------
171da177e4SLinus Torvalds  *  05-08-00  00.10.01  Original release for 0.10 spec dated 4/26/2000.
181da177e4SLinus Torvalds  *  05-24-00  00.10.02  Added SenseBufferLength to _MSG_SCSI_IO_REPLY.
191da177e4SLinus Torvalds  *  06-06-00  01.00.01  Update version number for 1.0 release.
201da177e4SLinus Torvalds  *  06-08-00  01.00.02  Added MPI_SCSI_RSP_INFO_ definitions.
211da177e4SLinus Torvalds  *  11-02-00  01.01.01  Original release for post 1.0 work.
221da177e4SLinus Torvalds  *  12-04-00  01.01.02  Added MPI_SCSIIO_CONTROL_NO_DISCONNECT.
231da177e4SLinus Torvalds  *  02-20-01  01.01.03  Started using MPI_POINTER.
241da177e4SLinus Torvalds  *  03-27-01  01.01.04  Added structure offset comments.
251da177e4SLinus Torvalds  *  04-10-01  01.01.05  Added new MsgFlag for MSG_SCSI_TASK_MGMT.
261da177e4SLinus Torvalds  *  08-08-01  01.02.01  Original release for v1.2 work.
271da177e4SLinus Torvalds  *  08-29-01  01.02.02  Added MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET.
281da177e4SLinus Torvalds  *                      Added MPI_SCSI_STATE_QUEUE_TAG_REJECTED for
291da177e4SLinus Torvalds  *                      MSG_SCSI_IO_REPLY.
301da177e4SLinus Torvalds  *  09-28-01  01.02.03  Added structures and defines for SCSI Enclosure
311da177e4SLinus Torvalds  *                      Processor messages.
321da177e4SLinus Torvalds  *  10-04-01  01.02.04  Added defines for SEP request Action field.
331da177e4SLinus Torvalds  *  05-31-02  01.02.05  Added MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR define
341da177e4SLinus Torvalds  *                      for SCSI IO requests.
351da177e4SLinus Torvalds  *  11-15-02  01.02.06  Added special extended SCSI Status defines for FCP.
361da177e4SLinus Torvalds  *  06-26-03  01.02.07  Added MPI_SCSI_STATUS_FCPEXT_UNASSIGNED define.
37c1a71d1cSMoore, Eric Dean   *  05-11-04  01.03.01  Original release for MPI v1.3.
38c1a71d1cSMoore, Eric Dean   *  08-19-04  01.05.01  Added MsgFlags defines for EEDP to SCSI IO request.
39c1a71d1cSMoore, Eric Dean   *                      Added new word to MSG_SCSI_IO_REPLY to add TaskTag field
40c1a71d1cSMoore, Eric Dean   *                      and a reserved U16.
41c1a71d1cSMoore, Eric Dean   *                      Added new MSG_SCSI_IO32_REQUEST structure.
42c1a71d1cSMoore, Eric Dean   *                      Added a TaskType of Clear Task Set to SCSI
43c1a71d1cSMoore, Eric Dean   *                      Task Management request.
44c1a71d1cSMoore, Eric Dean   *  12-07-04  01.05.02  Added support for Task Management Query Task.
45c1a71d1cSMoore, Eric Dean   *  01-15-05  01.05.03  Modified SCSI Enclosure Processor Request to support
46c1a71d1cSMoore, Eric Dean   *                      WWID addressing.
47c1a71d1cSMoore, Eric Dean   *  03-11-05  01.05.04  Removed EEDP flags from SCSI IO Request.
48c1a71d1cSMoore, Eric Dean   *                      Removed SCSI IO 32 Request.
49c1a71d1cSMoore, Eric Dean   *                      Modified SCSI Enclosure Processor Request and Reply to
50c1a71d1cSMoore, Eric Dean   *                      support Enclosure/Slot addressing rather than WWID
51c1a71d1cSMoore, Eric Dean   *                      addressing.
52ccf3b7bdSChristoph Hellwig  *  06-24-05  01.05.05  Added SCSI IO 32 structures and defines.
53ccf3b7bdSChristoph Hellwig  *                      Added four new defines for SEP SlotStatus.
544b915a73SMoore, Eric  *  08-03-05  01.05.06  Fixed some MPI_SCSIIO32_MSGFLGS_ defines to make them
554b915a73SMoore, Eric  *                      unique in the first 32 characters.
562076eb6aSEric Moore  *  03-27-06  01.05.07  Added Task Management type of Clear ACA.
57eae225ebSEric Moore  *  10-11-06  01.05.08  Shortened define for Task Management type of Clear ACA.
58d16291b1SEric Moore  *  02-28-07  01.05.09  Defined two new MsgFlags bits for SCSI Task Management
59d16291b1SEric Moore  *                      Request: Do Not Send Task IU and Soft Reset Option.
601da177e4SLinus Torvalds  *  --------------------------------------------------------------------------
611da177e4SLinus Torvalds  */
621da177e4SLinus Torvalds 
631da177e4SLinus Torvalds #ifndef MPI_INIT_H
641da177e4SLinus Torvalds #define MPI_INIT_H
651da177e4SLinus Torvalds 
661da177e4SLinus Torvalds 
671da177e4SLinus Torvalds /*****************************************************************************
681da177e4SLinus Torvalds *
691da177e4SLinus Torvalds *               S C S I    I n i t i a t o r    M e s s a g e s
701da177e4SLinus Torvalds *
711da177e4SLinus Torvalds *****************************************************************************/
721da177e4SLinus Torvalds 
731da177e4SLinus Torvalds /****************************************************************************/
741da177e4SLinus Torvalds /*  SCSI IO messages and associated structures                              */
751da177e4SLinus Torvalds /****************************************************************************/
761da177e4SLinus Torvalds 
771da177e4SLinus Torvalds typedef struct _MSG_SCSI_IO_REQUEST
781da177e4SLinus Torvalds {
791da177e4SLinus Torvalds     U8                      TargetID;           /* 00h */
801da177e4SLinus Torvalds     U8                      Bus;                /* 01h */
811da177e4SLinus Torvalds     U8                      ChainOffset;        /* 02h */
821da177e4SLinus Torvalds     U8                      Function;           /* 03h */
831da177e4SLinus Torvalds     U8                      CDBLength;          /* 04h */
841da177e4SLinus Torvalds     U8                      SenseBufferLength;  /* 05h */
851da177e4SLinus Torvalds     U8                      Reserved;           /* 06h */
861da177e4SLinus Torvalds     U8                      MsgFlags;           /* 07h */
871da177e4SLinus Torvalds     U32                     MsgContext;         /* 08h */
881da177e4SLinus Torvalds     U8                      LUN[8];             /* 0Ch */
891da177e4SLinus Torvalds     U32                     Control;            /* 14h */
901da177e4SLinus Torvalds     U8                      CDB[16];            /* 18h */
911da177e4SLinus Torvalds     U32                     DataLength;         /* 28h */
921da177e4SLinus Torvalds     U32                     SenseBufferLowAddr; /* 2Ch */
931da177e4SLinus Torvalds     SGE_IO_UNION            SGL;                /* 30h */
941da177e4SLinus Torvalds } MSG_SCSI_IO_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_REQUEST,
951da177e4SLinus Torvalds   SCSIIORequest_t, MPI_POINTER pSCSIIORequest_t;
961da177e4SLinus Torvalds 
971da177e4SLinus Torvalds 
981da177e4SLinus Torvalds /* SCSI IO MsgFlags bits */
991da177e4SLinus Torvalds 
1001da177e4SLinus Torvalds #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH              (0x01)
1011da177e4SLinus Torvalds #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_32           (0x00)
1021da177e4SLinus Torvalds #define MPI_SCSIIO_MSGFLGS_SENSE_WIDTH_64           (0x01)
103c1a71d1cSMoore, Eric Dean  
1041da177e4SLinus Torvalds #define MPI_SCSIIO_MSGFLGS_SENSE_LOCATION           (0x02)
1051da177e4SLinus Torvalds #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_HOST           (0x00)
1061da177e4SLinus Torvalds #define MPI_SCSIIO_MSGFLGS_SENSE_LOC_IOC            (0x02)
1071da177e4SLinus Torvalds 
108c1a71d1cSMoore, Eric Dean  #define MPI_SCSIIO_MSGFLGS_CMD_DETERMINES_DATA_DIR  (0x04)
1091da177e4SLinus Torvalds 
1101da177e4SLinus Torvalds /* SCSI IO LUN fields */
1111da177e4SLinus Torvalds 
1121da177e4SLinus Torvalds #define MPI_SCSIIO_LUN_FIRST_LEVEL_ADDRESSING   (0x0000FFFF)
1131da177e4SLinus Torvalds #define MPI_SCSIIO_LUN_SECOND_LEVEL_ADDRESSING  (0xFFFF0000)
1141da177e4SLinus Torvalds #define MPI_SCSIIO_LUN_THIRD_LEVEL_ADDRESSING   (0x0000FFFF)
1151da177e4SLinus Torvalds #define MPI_SCSIIO_LUN_FOURTH_LEVEL_ADDRESSING  (0xFFFF0000)
1161da177e4SLinus Torvalds #define MPI_SCSIIO_LUN_LEVEL_1_WORD             (0xFF00)
1171da177e4SLinus Torvalds #define MPI_SCSIIO_LUN_LEVEL_1_DWORD            (0x0000FF00)
1181da177e4SLinus Torvalds 
1191da177e4SLinus Torvalds /* SCSI IO Control bits */
1201da177e4SLinus Torvalds 
1211da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_DATADIRECTION_MASK   (0x03000000)
1221da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_NODATATRANSFER       (0x00000000)
1231da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_WRITE                (0x01000000)
1241da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_READ                 (0x02000000)
1251da177e4SLinus Torvalds 
1261da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_ADDCDBLEN_MASK       (0x3C000000)
1271da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_ADDCDBLEN_SHIFT      (26)
1281da177e4SLinus Torvalds 
1291da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_TASKATTRIBUTE_MASK   (0x00000700)
1301da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_SIMPLEQ              (0x00000000)
1311da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_HEADOFQ              (0x00000100)
1321da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_ORDEREDQ             (0x00000200)
1331da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_ACAQ                 (0x00000400)
1341da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_UNTAGGED             (0x00000500)
1351da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_NO_DISCONNECT        (0x00000700)
1361da177e4SLinus Torvalds 
1371da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_TASKMANAGE_MASK      (0x00FF0000)
1381da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_OBSOLETE             (0x00800000)
1391da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_CLEAR_ACA_RSV        (0x00400000)
1401da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_TARGET_RESET         (0x00200000)
1411da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_LUN_RESET_RSV        (0x00100000)
1421da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_RESERVED             (0x00080000)
1431da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_CLR_TASK_SET_RSV     (0x00040000)
1441da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_ABORT_TASK_SET       (0x00020000)
1451da177e4SLinus Torvalds #define MPI_SCSIIO_CONTROL_RESERVED2            (0x00010000)
1461da177e4SLinus Torvalds 
1471da177e4SLinus Torvalds 
1481da177e4SLinus Torvalds /* SCSI IO reply structure */
1491da177e4SLinus Torvalds typedef struct _MSG_SCSI_IO_REPLY
1501da177e4SLinus Torvalds {
1511da177e4SLinus Torvalds     U8                      TargetID;           /* 00h */
1521da177e4SLinus Torvalds     U8                      Bus;                /* 01h */
1531da177e4SLinus Torvalds     U8                      MsgLength;          /* 02h */
1541da177e4SLinus Torvalds     U8                      Function;           /* 03h */
1551da177e4SLinus Torvalds     U8                      CDBLength;          /* 04h */
1561da177e4SLinus Torvalds     U8                      SenseBufferLength;  /* 05h */
1571da177e4SLinus Torvalds     U8                      Reserved;           /* 06h */
1581da177e4SLinus Torvalds     U8                      MsgFlags;           /* 07h */
1591da177e4SLinus Torvalds     U32                     MsgContext;         /* 08h */
1601da177e4SLinus Torvalds     U8                      SCSIStatus;         /* 0Ch */
1611da177e4SLinus Torvalds     U8                      SCSIState;          /* 0Dh */
1621da177e4SLinus Torvalds     U16                     IOCStatus;          /* 0Eh */
1631da177e4SLinus Torvalds     U32                     IOCLogInfo;         /* 10h */
1641da177e4SLinus Torvalds     U32                     TransferCount;      /* 14h */
1651da177e4SLinus Torvalds     U32                     SenseCount;         /* 18h */
1661da177e4SLinus Torvalds     U32                     ResponseInfo;       /* 1Ch */
167c1a71d1cSMoore, Eric Dean      U16                     TaskTag;            /* 20h */
168c1a71d1cSMoore, Eric Dean      U16                     Reserved1;          /* 22h */
1691da177e4SLinus Torvalds } MSG_SCSI_IO_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_REPLY,
1701da177e4SLinus Torvalds   SCSIIOReply_t, MPI_POINTER pSCSIIOReply_t;
1711da177e4SLinus Torvalds 
1721da177e4SLinus Torvalds 
1731da177e4SLinus Torvalds /* SCSI IO Reply SCSIStatus values (SAM-2 status codes) */
1741da177e4SLinus Torvalds 
1751da177e4SLinus Torvalds #define MPI_SCSI_STATUS_SUCCESS                 (0x00)
1761da177e4SLinus Torvalds #define MPI_SCSI_STATUS_CHECK_CONDITION         (0x02)
1771da177e4SLinus Torvalds #define MPI_SCSI_STATUS_CONDITION_MET           (0x04)
1781da177e4SLinus Torvalds #define MPI_SCSI_STATUS_BUSY                    (0x08)
1791da177e4SLinus Torvalds #define MPI_SCSI_STATUS_INTERMEDIATE            (0x10)
1801da177e4SLinus Torvalds #define MPI_SCSI_STATUS_INTERMEDIATE_CONDMET    (0x14)
1811da177e4SLinus Torvalds #define MPI_SCSI_STATUS_RESERVATION_CONFLICT    (0x18)
1821da177e4SLinus Torvalds #define MPI_SCSI_STATUS_COMMAND_TERMINATED      (0x22)
1831da177e4SLinus Torvalds #define MPI_SCSI_STATUS_TASK_SET_FULL           (0x28)
1841da177e4SLinus Torvalds #define MPI_SCSI_STATUS_ACA_ACTIVE              (0x30)
1851da177e4SLinus Torvalds 
1861da177e4SLinus Torvalds #define MPI_SCSI_STATUS_FCPEXT_DEVICE_LOGGED_OUT    (0x80)
1871da177e4SLinus Torvalds #define MPI_SCSI_STATUS_FCPEXT_NO_LINK              (0x81)
1881da177e4SLinus Torvalds #define MPI_SCSI_STATUS_FCPEXT_UNASSIGNED           (0x82)
1891da177e4SLinus Torvalds 
1901da177e4SLinus Torvalds 
1911da177e4SLinus Torvalds /* SCSI IO Reply SCSIState values */
1921da177e4SLinus Torvalds 
1931da177e4SLinus Torvalds #define MPI_SCSI_STATE_AUTOSENSE_VALID          (0x01)
1941da177e4SLinus Torvalds #define MPI_SCSI_STATE_AUTOSENSE_FAILED         (0x02)
1951da177e4SLinus Torvalds #define MPI_SCSI_STATE_NO_SCSI_STATUS           (0x04)
1961da177e4SLinus Torvalds #define MPI_SCSI_STATE_TERMINATED               (0x08)
1971da177e4SLinus Torvalds #define MPI_SCSI_STATE_RESPONSE_INFO_VALID      (0x10)
1981da177e4SLinus Torvalds #define MPI_SCSI_STATE_QUEUE_TAG_REJECTED       (0x20)
1991da177e4SLinus Torvalds 
2001da177e4SLinus Torvalds /* SCSI IO Reply ResponseInfo values */
2011da177e4SLinus Torvalds /* (FCP-1 RSP_CODE values and SPI-3 Packetized Failure codes) */
2021da177e4SLinus Torvalds 
2031da177e4SLinus Torvalds #define MPI_SCSI_RSP_INFO_FUNCTION_COMPLETE     (0x00000000)
2041da177e4SLinus Torvalds #define MPI_SCSI_RSP_INFO_FCP_BURST_LEN_ERROR   (0x01000000)
2051da177e4SLinus Torvalds #define MPI_SCSI_RSP_INFO_CMND_FIELDS_INVALID   (0x02000000)
2061da177e4SLinus Torvalds #define MPI_SCSI_RSP_INFO_FCP_DATA_RO_ERROR     (0x03000000)
2071da177e4SLinus Torvalds #define MPI_SCSI_RSP_INFO_TASK_MGMT_UNSUPPORTED (0x04000000)
2081da177e4SLinus Torvalds #define MPI_SCSI_RSP_INFO_TASK_MGMT_FAILED      (0x05000000)
2091da177e4SLinus Torvalds #define MPI_SCSI_RSP_INFO_SPI_LQ_INVALID_TYPE   (0x06000000)
2101da177e4SLinus Torvalds 
211c1a71d1cSMoore, Eric Dean  #define MPI_SCSI_TASKTAG_UNKNOWN                (0xFFFF)
2121da177e4SLinus Torvalds 
2131da177e4SLinus Torvalds 
2141da177e4SLinus Torvalds /****************************************************************************/
215ccf3b7bdSChristoph Hellwig /*  SCSI IO 32 messages and associated structures                           */
216ccf3b7bdSChristoph Hellwig /****************************************************************************/
217ccf3b7bdSChristoph Hellwig 
218ccf3b7bdSChristoph Hellwig typedef struct
219ccf3b7bdSChristoph Hellwig {
220ccf3b7bdSChristoph Hellwig     U8                      CDB[20];                    /* 00h */
221ccf3b7bdSChristoph Hellwig     U32                     PrimaryReferenceTag;        /* 14h */
222ccf3b7bdSChristoph Hellwig     U16                     PrimaryApplicationTag;      /* 18h */
223ccf3b7bdSChristoph Hellwig     U16                     PrimaryApplicationTagMask;  /* 1Ah */
224ccf3b7bdSChristoph Hellwig     U32                     TransferLength;             /* 1Ch */
225ccf3b7bdSChristoph Hellwig } MPI_SCSI_IO32_CDB_EEDP32, MPI_POINTER PTR_MPI_SCSI_IO32_CDB_EEDP32,
226ccf3b7bdSChristoph Hellwig   MpiScsiIo32CdbEedp32_t, MPI_POINTER pMpiScsiIo32CdbEedp32_t;
227ccf3b7bdSChristoph Hellwig 
228ccf3b7bdSChristoph Hellwig typedef struct
229ccf3b7bdSChristoph Hellwig {
230ccf3b7bdSChristoph Hellwig     U8                      CDB[16];                    /* 00h */
231ccf3b7bdSChristoph Hellwig     U32                     DataLength;                 /* 10h */
232ccf3b7bdSChristoph Hellwig     U32                     PrimaryReferenceTag;        /* 14h */
233ccf3b7bdSChristoph Hellwig     U16                     PrimaryApplicationTag;      /* 18h */
234ccf3b7bdSChristoph Hellwig     U16                     PrimaryApplicationTagMask;  /* 1Ah */
235ccf3b7bdSChristoph Hellwig     U32                     TransferLength;             /* 1Ch */
236ccf3b7bdSChristoph Hellwig } MPI_SCSI_IO32_CDB_EEDP16, MPI_POINTER PTR_MPI_SCSI_IO32_CDB_EEDP16,
237ccf3b7bdSChristoph Hellwig   MpiScsiIo32CdbEedp16_t, MPI_POINTER pMpiScsiIo32CdbEedp16_t;
238ccf3b7bdSChristoph Hellwig 
239ccf3b7bdSChristoph Hellwig typedef union
240ccf3b7bdSChristoph Hellwig {
241ccf3b7bdSChristoph Hellwig     U8                       CDB32[32];
242ccf3b7bdSChristoph Hellwig     MPI_SCSI_IO32_CDB_EEDP32 EEDP32;
243ccf3b7bdSChristoph Hellwig     MPI_SCSI_IO32_CDB_EEDP16 EEDP16;
244ccf3b7bdSChristoph Hellwig     SGE_SIMPLE_UNION         SGE;
245ccf3b7bdSChristoph Hellwig } MPI_SCSI_IO32_CDB_UNION, MPI_POINTER PTR_MPI_SCSI_IO32_CDB_UNION,
246ccf3b7bdSChristoph Hellwig   MpiScsiIo32Cdb_t, MPI_POINTER pMpiScsiIo32Cdb_t;
247ccf3b7bdSChristoph Hellwig 
248ccf3b7bdSChristoph Hellwig typedef struct
249ccf3b7bdSChristoph Hellwig {
250ccf3b7bdSChristoph Hellwig     U8                      TargetID;           /* 00h */
251ccf3b7bdSChristoph Hellwig     U8                      Bus;                /* 01h */
252ccf3b7bdSChristoph Hellwig     U16                     Reserved1;          /* 02h */
253ccf3b7bdSChristoph Hellwig     U32                     Reserved2;          /* 04h */
254ccf3b7bdSChristoph Hellwig } MPI_SCSI_IO32_BUS_TARGET_ID_FORM, MPI_POINTER PTR_MPI_SCSI_IO32_BUS_TARGET_ID_FORM,
255ccf3b7bdSChristoph Hellwig   MpiScsiIo32BusTargetIdForm_t, MPI_POINTER pMpiScsiIo32BusTargetIdForm_t;
256ccf3b7bdSChristoph Hellwig 
257ccf3b7bdSChristoph Hellwig typedef union
258ccf3b7bdSChristoph Hellwig {
259ccf3b7bdSChristoph Hellwig     MPI_SCSI_IO32_BUS_TARGET_ID_FORM    SCSIID;
260ccf3b7bdSChristoph Hellwig     U64                                 WWID;
261ccf3b7bdSChristoph Hellwig } MPI_SCSI_IO32_ADDRESS, MPI_POINTER PTR_MPI_SCSI_IO32_ADDRESS,
262ccf3b7bdSChristoph Hellwig   MpiScsiIo32Address_t, MPI_POINTER pMpiScsiIo32Address_t;
263ccf3b7bdSChristoph Hellwig 
264ccf3b7bdSChristoph Hellwig typedef struct _MSG_SCSI_IO32_REQUEST
265ccf3b7bdSChristoph Hellwig {
266ccf3b7bdSChristoph Hellwig     U8                          Port;                           /* 00h */
267ccf3b7bdSChristoph Hellwig     U8                          Reserved1;                      /* 01h */
268ccf3b7bdSChristoph Hellwig     U8                          ChainOffset;                    /* 02h */
269ccf3b7bdSChristoph Hellwig     U8                          Function;                       /* 03h */
270ccf3b7bdSChristoph Hellwig     U8                          CDBLength;                      /* 04h */
271ccf3b7bdSChristoph Hellwig     U8                          SenseBufferLength;              /* 05h */
272ccf3b7bdSChristoph Hellwig     U8                          Flags;                          /* 06h */
273ccf3b7bdSChristoph Hellwig     U8                          MsgFlags;                       /* 07h */
274ccf3b7bdSChristoph Hellwig     U32                         MsgContext;                     /* 08h */
275ccf3b7bdSChristoph Hellwig     U8                          LUN[8];                         /* 0Ch */
276ccf3b7bdSChristoph Hellwig     U32                         Control;                        /* 14h */
277ccf3b7bdSChristoph Hellwig     MPI_SCSI_IO32_CDB_UNION     CDB;                            /* 18h */
278ccf3b7bdSChristoph Hellwig     U32                         DataLength;                     /* 38h */
279ccf3b7bdSChristoph Hellwig     U32                         BidirectionalDataLength;        /* 3Ch */
280ccf3b7bdSChristoph Hellwig     U32                         SecondaryReferenceTag;          /* 40h */
281ccf3b7bdSChristoph Hellwig     U16                         SecondaryApplicationTag;        /* 44h */
282ccf3b7bdSChristoph Hellwig     U16                         Reserved2;                      /* 46h */
283ccf3b7bdSChristoph Hellwig     U16                         EEDPFlags;                      /* 48h */
284ccf3b7bdSChristoph Hellwig     U16                         ApplicationTagTranslationMask;  /* 4Ah */
285ccf3b7bdSChristoph Hellwig     U32                         EEDPBlockSize;                  /* 4Ch */
286ccf3b7bdSChristoph Hellwig     MPI_SCSI_IO32_ADDRESS       DeviceAddress;                  /* 50h */
287ccf3b7bdSChristoph Hellwig     U8                          SGLOffset0;                     /* 58h */
288ccf3b7bdSChristoph Hellwig     U8                          SGLOffset1;                     /* 59h */
289ccf3b7bdSChristoph Hellwig     U8                          SGLOffset2;                     /* 5Ah */
290ccf3b7bdSChristoph Hellwig     U8                          SGLOffset3;                     /* 5Bh */
291ccf3b7bdSChristoph Hellwig     U32                         Reserved3;                      /* 5Ch */
292ccf3b7bdSChristoph Hellwig     U32                         Reserved4;                      /* 60h */
293ccf3b7bdSChristoph Hellwig     U32                         SenseBufferLowAddr;             /* 64h */
294ccf3b7bdSChristoph Hellwig     SGE_IO_UNION                SGL;                            /* 68h */
295ccf3b7bdSChristoph Hellwig } MSG_SCSI_IO32_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO32_REQUEST,
296ccf3b7bdSChristoph Hellwig   SCSIIO32Request_t, MPI_POINTER pSCSIIO32Request_t;
297ccf3b7bdSChristoph Hellwig 
298ccf3b7bdSChristoph Hellwig /* SCSI IO 32 MsgFlags bits */
299ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_MSGFLGS_SENSE_WIDTH                (0x01)
3004b915a73SMoore, Eric #define MPI_SCSIIO32_MSGFLGS_32_SENSE_WIDTH             (0x00)
3014b915a73SMoore, Eric #define MPI_SCSIIO32_MSGFLGS_64_SENSE_WIDTH             (0x01)
302ccf3b7bdSChristoph Hellwig 
303ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_MSGFLGS_SENSE_LOCATION             (0x02)
304ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_MSGFLGS_SENSE_LOC_HOST             (0x00)
305ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_MSGFLGS_SENSE_LOC_IOC              (0x02)
306ccf3b7bdSChristoph Hellwig 
307ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_MSGFLGS_CMD_DETERMINES_DATA_DIR    (0x04)
308ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_MSGFLGS_SGL_OFFSETS_CHAINS         (0x08)
309ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_MSGFLGS_MULTICAST                  (0x10)
310ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_MSGFLGS_BIDIRECTIONAL              (0x20)
311ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_MSGFLGS_LARGE_CDB                  (0x40)
312ccf3b7bdSChristoph Hellwig 
313ccf3b7bdSChristoph Hellwig /* SCSI IO 32 Flags bits */
314ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_FLAGS_FORM_MASK                    (0x03)
315ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_FLAGS_FORM_SCSIID                  (0x00)
316ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_FLAGS_FORM_WWID                    (0x01)
317ccf3b7bdSChristoph Hellwig 
318ccf3b7bdSChristoph Hellwig /* SCSI IO 32 LUN fields */
319ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_LUN_FIRST_LEVEL_ADDRESSING     (0x0000FFFF)
320ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_LUN_SECOND_LEVEL_ADDRESSING    (0xFFFF0000)
321ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_LUN_THIRD_LEVEL_ADDRESSING     (0x0000FFFF)
322ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_LUN_FOURTH_LEVEL_ADDRESSING    (0xFFFF0000)
323ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_LUN_LEVEL_1_WORD               (0xFF00)
324ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_LUN_LEVEL_1_DWORD              (0x0000FF00)
325ccf3b7bdSChristoph Hellwig 
326ccf3b7bdSChristoph Hellwig /* SCSI IO 32 Control bits */
327ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_DATADIRECTION_MASK     (0x03000000)
328ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_NODATATRANSFER         (0x00000000)
329ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_WRITE                  (0x01000000)
330ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_READ                   (0x02000000)
331ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_BIDIRECTIONAL          (0x03000000)
332ccf3b7bdSChristoph Hellwig 
333ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_ADDCDBLEN_MASK         (0xFC000000)
334ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_ADDCDBLEN_SHIFT        (26)
335ccf3b7bdSChristoph Hellwig 
336ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_TASKATTRIBUTE_MASK     (0x00000700)
337ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_SIMPLEQ                (0x00000000)
338ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_HEADOFQ                (0x00000100)
339ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_ORDEREDQ               (0x00000200)
340ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_ACAQ                   (0x00000400)
341ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_UNTAGGED               (0x00000500)
342ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_NO_DISCONNECT          (0x00000700)
343ccf3b7bdSChristoph Hellwig 
344ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_TASKMANAGE_MASK        (0x00FF0000)
345ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_OBSOLETE               (0x00800000)
346ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_CLEAR_ACA_RSV          (0x00400000)
347ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_TARGET_RESET           (0x00200000)
348ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_LUN_RESET_RSV          (0x00100000)
349ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_RESERVED               (0x00080000)
350ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_CLR_TASK_SET_RSV       (0x00040000)
351ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_ABORT_TASK_SET         (0x00020000)
352ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_CONTROL_RESERVED2              (0x00010000)
353ccf3b7bdSChristoph Hellwig 
354ccf3b7bdSChristoph Hellwig /* SCSI IO 32 EEDPFlags */
355ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_MASK_OP              (0x0007)
356ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_NOOP_OP              (0x0000)
357ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_CHK_OP               (0x0001)
358ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_STRIP_OP             (0x0002)
359ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_CHKRM_OP             (0x0003)
360ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_INSERT_OP            (0x0004)
361ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_REPLACE_OP           (0x0006)
362ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_CHKREGEN_OP          (0x0007)
363ccf3b7bdSChristoph Hellwig 
364ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_PASS_REF_TAG         (0x0008)
365ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_8_9THS_MODE          (0x0010)
366ccf3b7bdSChristoph Hellwig 
367ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_MASK         (0x0700)
368ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_GUARD        (0x0100)
369ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_REFTAG       (0x0200)
370ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_LBATAG       (0x0400)
371ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_T10_CHK_SHIFT        (8)
372ccf3b7bdSChristoph Hellwig 
373ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_INC_SEC_APPTAG       (0x1000)
374ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_INC_PRI_APPTAG       (0x2000)
375ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_INC_SEC_REFTAG       (0x4000)
376ccf3b7bdSChristoph Hellwig #define MPI_SCSIIO32_EEDPFLAGS_INC_PRI_REFTAG       (0x8000)
377ccf3b7bdSChristoph Hellwig 
378ccf3b7bdSChristoph Hellwig 
379ccf3b7bdSChristoph Hellwig /* SCSIIO32 IO reply structure */
380ccf3b7bdSChristoph Hellwig typedef struct _MSG_SCSIIO32_IO_REPLY
381ccf3b7bdSChristoph Hellwig {
382ccf3b7bdSChristoph Hellwig     U8                      Port;                       /* 00h */
383ccf3b7bdSChristoph Hellwig     U8                      Reserved1;                  /* 01h */
384ccf3b7bdSChristoph Hellwig     U8                      MsgLength;                  /* 02h */
385ccf3b7bdSChristoph Hellwig     U8                      Function;                   /* 03h */
386ccf3b7bdSChristoph Hellwig     U8                      CDBLength;                  /* 04h */
387ccf3b7bdSChristoph Hellwig     U8                      SenseBufferLength;          /* 05h */
388ccf3b7bdSChristoph Hellwig     U8                      Flags;                      /* 06h */
389ccf3b7bdSChristoph Hellwig     U8                      MsgFlags;                   /* 07h */
390ccf3b7bdSChristoph Hellwig     U32                     MsgContext;                 /* 08h */
391ccf3b7bdSChristoph Hellwig     U8                      SCSIStatus;                 /* 0Ch */
392ccf3b7bdSChristoph Hellwig     U8                      SCSIState;                  /* 0Dh */
393ccf3b7bdSChristoph Hellwig     U16                     IOCStatus;                  /* 0Eh */
394ccf3b7bdSChristoph Hellwig     U32                     IOCLogInfo;                 /* 10h */
395ccf3b7bdSChristoph Hellwig     U32                     TransferCount;              /* 14h */
396ccf3b7bdSChristoph Hellwig     U32                     SenseCount;                 /* 18h */
397ccf3b7bdSChristoph Hellwig     U32                     ResponseInfo;               /* 1Ch */
398ccf3b7bdSChristoph Hellwig     U16                     TaskTag;                    /* 20h */
399ccf3b7bdSChristoph Hellwig     U16                     Reserved2;                  /* 22h */
400ccf3b7bdSChristoph Hellwig     U32                     BidirectionalTransferCount; /* 24h */
401ccf3b7bdSChristoph Hellwig } MSG_SCSIIO32_IO_REPLY, MPI_POINTER PTR_MSG_SCSIIO32_IO_REPLY,
402ccf3b7bdSChristoph Hellwig   SCSIIO32Reply_t, MPI_POINTER pSCSIIO32Reply_t;
403ccf3b7bdSChristoph Hellwig 
404ccf3b7bdSChristoph Hellwig 
405ccf3b7bdSChristoph Hellwig /****************************************************************************/
4061da177e4SLinus Torvalds /*  SCSI Task Management messages                                           */
4071da177e4SLinus Torvalds /****************************************************************************/
4081da177e4SLinus Torvalds 
4091da177e4SLinus Torvalds typedef struct _MSG_SCSI_TASK_MGMT
4101da177e4SLinus Torvalds {
4111da177e4SLinus Torvalds     U8                      TargetID;           /* 00h */
4121da177e4SLinus Torvalds     U8                      Bus;                /* 01h */
4131da177e4SLinus Torvalds     U8                      ChainOffset;        /* 02h */
4141da177e4SLinus Torvalds     U8                      Function;           /* 03h */
4151da177e4SLinus Torvalds     U8                      Reserved;           /* 04h */
4161da177e4SLinus Torvalds     U8                      TaskType;           /* 05h */
4171da177e4SLinus Torvalds     U8                      Reserved1;          /* 06h */
4181da177e4SLinus Torvalds     U8                      MsgFlags;           /* 07h */
4191da177e4SLinus Torvalds     U32                     MsgContext;         /* 08h */
4201da177e4SLinus Torvalds     U8                      LUN[8];             /* 0Ch */
4211da177e4SLinus Torvalds     U32                     Reserved2[7];       /* 14h */
4221da177e4SLinus Torvalds     U32                     TaskMsgContext;     /* 30h */
4231da177e4SLinus Torvalds } MSG_SCSI_TASK_MGMT, MPI_POINTER PTR_SCSI_TASK_MGMT,
4241da177e4SLinus Torvalds   SCSITaskMgmt_t, MPI_POINTER pSCSITaskMgmt_t;
4251da177e4SLinus Torvalds 
4261da177e4SLinus Torvalds /* TaskType values */
4271da177e4SLinus Torvalds 
4281da177e4SLinus Torvalds #define MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK            (0x01)
4291da177e4SLinus Torvalds #define MPI_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET         (0x02)
4301da177e4SLinus Torvalds #define MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET          (0x03)
4311da177e4SLinus Torvalds #define MPI_SCSITASKMGMT_TASKTYPE_RESET_BUS             (0x04)
4321da177e4SLinus Torvalds #define MPI_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET    (0x05)
4331da177e4SLinus Torvalds #define MPI_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET        (0x06)
434c1a71d1cSMoore, Eric Dean  #define MPI_SCSITASKMGMT_TASKTYPE_QUERY_TASK            (0x07)
435eae225ebSEric Moore #define MPI_SCSITASKMGMT_TASKTYPE_CLR_ACA               (0x08)
4361da177e4SLinus Torvalds 
4371da177e4SLinus Torvalds /* MsgFlags bits */
438d16291b1SEric Moore #define MPI_SCSITASKMGMT_MSGFLAGS_DO_NOT_SEND_TASK_IU   (0x01)
439d16291b1SEric Moore 
4401da177e4SLinus Torvalds #define MPI_SCSITASKMGMT_MSGFLAGS_TARGET_RESET_OPTION   (0x00)
4411da177e4SLinus Torvalds #define MPI_SCSITASKMGMT_MSGFLAGS_LIP_RESET_OPTION      (0x02)
4421da177e4SLinus Torvalds #define MPI_SCSITASKMGMT_MSGFLAGS_LIPRESET_RESET_OPTION (0x04)
4431da177e4SLinus Torvalds 
444d16291b1SEric Moore #define MPI_SCSITASKMGMT_MSGFLAGS_SOFT_RESET_OPTION     (0x08)
445d16291b1SEric Moore 
4461da177e4SLinus Torvalds /* SCSI Task Management Reply */
4471da177e4SLinus Torvalds typedef struct _MSG_SCSI_TASK_MGMT_REPLY
4481da177e4SLinus Torvalds {
4491da177e4SLinus Torvalds     U8                      TargetID;           /* 00h */
4501da177e4SLinus Torvalds     U8                      Bus;                /* 01h */
4511da177e4SLinus Torvalds     U8                      MsgLength;          /* 02h */
4521da177e4SLinus Torvalds     U8                      Function;           /* 03h */
453c1a71d1cSMoore, Eric Dean      U8                      ResponseCode;       /* 04h */
4541da177e4SLinus Torvalds     U8                      TaskType;           /* 05h */
4551da177e4SLinus Torvalds     U8                      Reserved1;          /* 06h */
4561da177e4SLinus Torvalds     U8                      MsgFlags;           /* 07h */
4571da177e4SLinus Torvalds     U32                     MsgContext;         /* 08h */
4581da177e4SLinus Torvalds     U8                      Reserved2[2];       /* 0Ch */
4591da177e4SLinus Torvalds     U16                     IOCStatus;          /* 0Eh */
4601da177e4SLinus Torvalds     U32                     IOCLogInfo;         /* 10h */
4611da177e4SLinus Torvalds     U32                     TerminationCount;   /* 14h */
4621da177e4SLinus Torvalds } MSG_SCSI_TASK_MGMT_REPLY, MPI_POINTER PTR_MSG_SCSI_TASK_MGMT_REPLY,
4631da177e4SLinus Torvalds   SCSITaskMgmtReply_t, MPI_POINTER pSCSITaskMgmtReply_t;
4641da177e4SLinus Torvalds 
465c1a71d1cSMoore, Eric Dean  /* ResponseCode values */
466c1a71d1cSMoore, Eric Dean  #define MPI_SCSITASKMGMT_RSP_TM_COMPLETE                (0x00)
467c1a71d1cSMoore, Eric Dean  #define MPI_SCSITASKMGMT_RSP_INVALID_FRAME              (0x02)
468c1a71d1cSMoore, Eric Dean  #define MPI_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED           (0x04)
469c1a71d1cSMoore, Eric Dean  #define MPI_SCSITASKMGMT_RSP_TM_FAILED                  (0x05)
470c1a71d1cSMoore, Eric Dean  #define MPI_SCSITASKMGMT_RSP_TM_SUCCEEDED               (0x08)
471c1a71d1cSMoore, Eric Dean  #define MPI_SCSITASKMGMT_RSP_TM_INVALID_LUN             (0x09)
472c1a71d1cSMoore, Eric Dean  #define MPI_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC           (0x80)
473c1a71d1cSMoore, Eric Dean  
4741da177e4SLinus Torvalds 
4751da177e4SLinus Torvalds /****************************************************************************/
4761da177e4SLinus Torvalds /*  SCSI Enclosure Processor messages                                       */
4771da177e4SLinus Torvalds /****************************************************************************/
4781da177e4SLinus Torvalds 
4791da177e4SLinus Torvalds typedef struct _MSG_SEP_REQUEST
4801da177e4SLinus Torvalds {
4811da177e4SLinus Torvalds     U8                      TargetID;           /* 00h */
4821da177e4SLinus Torvalds     U8                      Bus;                /* 01h */
4831da177e4SLinus Torvalds     U8                      ChainOffset;        /* 02h */
4841da177e4SLinus Torvalds     U8                      Function;           /* 03h */
4851da177e4SLinus Torvalds     U8                      Action;             /* 04h */
486c1a71d1cSMoore, Eric Dean      U8                      Flags;              /* 05h */
487c1a71d1cSMoore, Eric Dean      U8                      Reserved1;          /* 06h */
4881da177e4SLinus Torvalds     U8                      MsgFlags;           /* 07h */
4891da177e4SLinus Torvalds     U32                     MsgContext;         /* 08h */
4901da177e4SLinus Torvalds     U32                     SlotStatus;         /* 0Ch */
491c1a71d1cSMoore, Eric Dean      U32                     Reserved2;          /* 10h */
492c1a71d1cSMoore, Eric Dean      U32                     Reserved3;          /* 14h */
493c1a71d1cSMoore, Eric Dean      U32                     Reserved4;          /* 18h */
494c1a71d1cSMoore, Eric Dean      U16                     Slot;               /* 1Ch */
495c1a71d1cSMoore, Eric Dean      U16                     EnclosureHandle;    /* 1Eh */
4961da177e4SLinus Torvalds } MSG_SEP_REQUEST, MPI_POINTER PTR_MSG_SEP_REQUEST,
4971da177e4SLinus Torvalds   SEPRequest_t, MPI_POINTER pSEPRequest_t;
4981da177e4SLinus Torvalds 
4991da177e4SLinus Torvalds /* Action defines */
5001da177e4SLinus Torvalds #define MPI_SEP_REQ_ACTION_WRITE_STATUS                 (0x00)
5011da177e4SLinus Torvalds #define MPI_SEP_REQ_ACTION_READ_STATUS                  (0x01)
5021da177e4SLinus Torvalds 
503c1a71d1cSMoore, Eric Dean  /* Flags defines */
504c1a71d1cSMoore, Eric Dean  #define MPI_SEP_REQ_FLAGS_ENCLOSURE_SLOT_ADDRESS        (0x01)
505c1a71d1cSMoore, Eric Dean  #define MPI_SEP_REQ_FLAGS_BUS_TARGETID_ADDRESS          (0x00)
506c1a71d1cSMoore, Eric Dean  
5071da177e4SLinus Torvalds /* SlotStatus bits for MSG_SEP_REQUEST */
5081da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_NO_ERROR                 (0x00000001)
5091da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_DEV_FAULTY               (0x00000002)
5101da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_DEV_REBUILDING           (0x00000004)
5111da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_IN_FAILED_ARRAY          (0x00000008)
5121da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_IN_CRITICAL_ARRAY        (0x00000010)
5131da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_PARITY_CHECK             (0x00000020)
5141da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_PREDICTED_FAULT          (0x00000040)
5151da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_UNCONFIGURED             (0x00000080)
5161da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_HOT_SPARE                (0x00000100)
5171da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_REBUILD_STOPPED          (0x00000200)
518ccf3b7bdSChristoph Hellwig #define MPI_SEP_REQ_SLOTSTATUS_REQ_CONSISTENCY_CHECK    (0x00001000)
519ccf3b7bdSChristoph Hellwig #define MPI_SEP_REQ_SLOTSTATUS_DISABLE                  (0x00002000)
520ccf3b7bdSChristoph Hellwig #define MPI_SEP_REQ_SLOTSTATUS_REQ_RESERVED_DEVICE      (0x00004000)
5211da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_IDENTIFY_REQUEST         (0x00020000)
5221da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_REQUEST_REMOVE           (0x00040000)
5231da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_REQUEST_INSERT           (0x00080000)
5241da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_DO_NOT_MOVE              (0x00400000)
525ccf3b7bdSChristoph Hellwig #define MPI_SEP_REQ_SLOTSTATUS_ACTIVE                   (0x00800000)
5261da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_B_ENABLE_BYPASS          (0x04000000)
5271da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_A_ENABLE_BYPASS          (0x08000000)
5281da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_DEV_OFF                  (0x10000000)
5291da177e4SLinus Torvalds #define MPI_SEP_REQ_SLOTSTATUS_SWAP_RESET               (0x80000000)
5301da177e4SLinus Torvalds 
5311da177e4SLinus Torvalds 
5321da177e4SLinus Torvalds typedef struct _MSG_SEP_REPLY
5331da177e4SLinus Torvalds {
5341da177e4SLinus Torvalds     U8                      TargetID;           /* 00h */
5351da177e4SLinus Torvalds     U8                      Bus;                /* 01h */
5361da177e4SLinus Torvalds     U8                      MsgLength;          /* 02h */
5371da177e4SLinus Torvalds     U8                      Function;           /* 03h */
5381da177e4SLinus Torvalds     U8                      Action;             /* 04h */
5391da177e4SLinus Torvalds     U8                      Reserved1;          /* 05h */
5401da177e4SLinus Torvalds     U8                      Reserved2;          /* 06h */
5411da177e4SLinus Torvalds     U8                      MsgFlags;           /* 07h */
5421da177e4SLinus Torvalds     U32                     MsgContext;         /* 08h */
5431da177e4SLinus Torvalds     U16                     Reserved3;          /* 0Ch */
5441da177e4SLinus Torvalds     U16                     IOCStatus;          /* 0Eh */
5451da177e4SLinus Torvalds     U32                     IOCLogInfo;         /* 10h */
5461da177e4SLinus Torvalds     U32                     SlotStatus;         /* 14h */
547c1a71d1cSMoore, Eric Dean      U32                     Reserved4;          /* 18h */
548c1a71d1cSMoore, Eric Dean      U16                     Slot;               /* 1Ch */
549c1a71d1cSMoore, Eric Dean      U16                     EnclosureHandle;    /* 1Eh */
5501da177e4SLinus Torvalds } MSG_SEP_REPLY, MPI_POINTER PTR_MSG_SEP_REPLY,
5511da177e4SLinus Torvalds   SEPReply_t, MPI_POINTER pSEPReply_t;
5521da177e4SLinus Torvalds 
5531da177e4SLinus Torvalds /* SlotStatus bits for MSG_SEP_REPLY */
5541da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_NO_ERROR               (0x00000001)
5551da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_DEV_FAULTY             (0x00000002)
5561da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_DEV_REBUILDING         (0x00000004)
5571da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_IN_FAILED_ARRAY        (0x00000008)
5581da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_IN_CRITICAL_ARRAY      (0x00000010)
5591da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_PARITY_CHECK           (0x00000020)
5601da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_PREDICTED_FAULT        (0x00000040)
5611da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_UNCONFIGURED           (0x00000080)
5621da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_HOT_SPARE              (0x00000100)
5631da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_REBUILD_STOPPED        (0x00000200)
564ccf3b7bdSChristoph Hellwig #define MPI_SEP_REPLY_SLOTSTATUS_CONSISTENCY_CHECK      (0x00001000)
565ccf3b7bdSChristoph Hellwig #define MPI_SEP_REPLY_SLOTSTATUS_DISABLE                (0x00002000)
566ccf3b7bdSChristoph Hellwig #define MPI_SEP_REPLY_SLOTSTATUS_RESERVED_DEVICE        (0x00004000)
5671da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_REPORT                 (0x00010000)
5681da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_IDENTIFY_REQUEST       (0x00020000)
5691da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_REMOVE_READY           (0x00040000)
5701da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_INSERT_READY           (0x00080000)
5711da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_DO_NOT_REMOVE          (0x00400000)
572ccf3b7bdSChristoph Hellwig #define MPI_SEP_REPLY_SLOTSTATUS_ACTIVE                 (0x00800000)
5731da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_B_BYPASS_ENABLED       (0x01000000)
5741da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_A_BYPASS_ENABLED       (0x02000000)
5751da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_B_ENABLE_BYPASS        (0x04000000)
5761da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_A_ENABLE_BYPASS        (0x08000000)
5771da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_DEV_OFF                (0x10000000)
5781da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_FAULT_SENSED           (0x40000000)
5791da177e4SLinus Torvalds #define MPI_SEP_REPLY_SLOTSTATUS_SWAPPED                (0x80000000)
5801da177e4SLinus Torvalds 
5811da177e4SLinus Torvalds #endif
582