18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  Copyright (c) 2001-2008 LSI Corporation.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci *           Name:  mpi_raid.h
78c2ecf20Sopenharmony_ci *          Title:  MPI RAID message and structures
88c2ecf20Sopenharmony_ci *  Creation Date:  February 27, 2001
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci *    mpi_raid.h Version:  01.05.05
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci *  Version History
138c2ecf20Sopenharmony_ci *  ---------------
148c2ecf20Sopenharmony_ci *
158c2ecf20Sopenharmony_ci *  Date      Version   Description
168c2ecf20Sopenharmony_ci *  --------  --------  ------------------------------------------------------
178c2ecf20Sopenharmony_ci *  02-27-01  01.01.01  Original release for this file.
188c2ecf20Sopenharmony_ci *  03-27-01  01.01.02  Added structure offset comments.
198c2ecf20Sopenharmony_ci *  08-08-01  01.02.01  Original release for v1.2 work.
208c2ecf20Sopenharmony_ci *  09-28-01  01.02.02  Major rework for MPI v1.2 Integrated RAID changes.
218c2ecf20Sopenharmony_ci *  10-04-01  01.02.03  Added ActionData defines for
228c2ecf20Sopenharmony_ci *                      MPI_RAID_ACTION_DELETE_VOLUME action.
238c2ecf20Sopenharmony_ci *  11-01-01  01.02.04  Added define for MPI_RAID_ACTION_ADATA_DO_NOT_SYNC.
248c2ecf20Sopenharmony_ci *  03-14-02  01.02.05  Added define for MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT.
258c2ecf20Sopenharmony_ci *  05-07-02  01.02.06  Added define for MPI_RAID_ACTION_ACTIVATE_VOLUME,
268c2ecf20Sopenharmony_ci *                      MPI_RAID_ACTION_INACTIVATE_VOLUME, and
278c2ecf20Sopenharmony_ci *                      MPI_RAID_ACTION_ADATA_INACTIVATE_ALL.
288c2ecf20Sopenharmony_ci *  07-12-02  01.02.07  Added structures for Mailbox request and reply.
298c2ecf20Sopenharmony_ci *  11-15-02  01.02.08  Added missing MsgContext field to MSG_MAILBOX_REQUEST.
308c2ecf20Sopenharmony_ci *  04-01-03  01.02.09  New action data option flag for
318c2ecf20Sopenharmony_ci *                      MPI_RAID_ACTION_DELETE_VOLUME.
328c2ecf20Sopenharmony_ci *  05-11-04  01.03.01  Original release for MPI v1.3.
338c2ecf20Sopenharmony_ci *  08-19-04  01.05.01  Original release for MPI v1.5.
348c2ecf20Sopenharmony_ci *  01-15-05  01.05.02  Added defines for the two new RAID Actions for
358c2ecf20Sopenharmony_ci *                      _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE.
368c2ecf20Sopenharmony_ci *  02-28-07  01.05.03  Added new RAID Action, Device FW Update Mode, and
378c2ecf20Sopenharmony_ci *                      associated defines.
388c2ecf20Sopenharmony_ci *  08-07-07  01.05.04  Added Disable Full Rebuild bit to the ActionDataWord
398c2ecf20Sopenharmony_ci *                      for the RAID Action MPI_RAID_ACTION_DISABLE_VOLUME.
408c2ecf20Sopenharmony_ci *  01-15-08  01.05.05  Added define for MPI_RAID_ACTION_SET_VOLUME_NAME.
418c2ecf20Sopenharmony_ci *  --------------------------------------------------------------------------
428c2ecf20Sopenharmony_ci */
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#ifndef MPI_RAID_H
458c2ecf20Sopenharmony_ci#define MPI_RAID_H
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci/******************************************************************************
498c2ecf20Sopenharmony_ci*
508c2ecf20Sopenharmony_ci*        R A I D    M e s s a g e s
518c2ecf20Sopenharmony_ci*
528c2ecf20Sopenharmony_ci*******************************************************************************/
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci/****************************************************************************/
568c2ecf20Sopenharmony_ci/* RAID Action Request                                                      */
578c2ecf20Sopenharmony_ci/****************************************************************************/
588c2ecf20Sopenharmony_ci
598c2ecf20Sopenharmony_citypedef struct _MSG_RAID_ACTION
608c2ecf20Sopenharmony_ci{
618c2ecf20Sopenharmony_ci    U8                      Action;             /* 00h */
628c2ecf20Sopenharmony_ci    U8                      Reserved1;          /* 01h */
638c2ecf20Sopenharmony_ci    U8                      ChainOffset;        /* 02h */
648c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
658c2ecf20Sopenharmony_ci    U8                      VolumeID;           /* 04h */
668c2ecf20Sopenharmony_ci    U8                      VolumeBus;          /* 05h */
678c2ecf20Sopenharmony_ci    U8                      PhysDiskNum;        /* 06h */
688c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
698c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
708c2ecf20Sopenharmony_ci    U32                     Reserved2;          /* 0Ch */
718c2ecf20Sopenharmony_ci    U32                     ActionDataWord;     /* 10h */
728c2ecf20Sopenharmony_ci    SGE_SIMPLE_UNION        ActionDataSGE;      /* 14h */
738c2ecf20Sopenharmony_ci} MSG_RAID_ACTION_REQUEST, MPI_POINTER PTR_MSG_RAID_ACTION_REQUEST,
748c2ecf20Sopenharmony_ci  MpiRaidActionRequest_t , MPI_POINTER pMpiRaidActionRequest_t;
758c2ecf20Sopenharmony_ci
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ci/* RAID Action request Action values */
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_STATUS                      (0x00)
808c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_INDICATOR_STRUCT            (0x01)
818c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_CREATE_VOLUME               (0x02)
828c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_DELETE_VOLUME               (0x03)
838c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_DISABLE_VOLUME              (0x04)
848c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ENABLE_VOLUME               (0x05)
858c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_QUIESCE_PHYS_IO             (0x06)
868c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ENABLE_PHYS_IO              (0x07)
878c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS      (0x08)
888c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_PHYSDISK_OFFLINE            (0x0A)
898c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_PHYSDISK_ONLINE             (0x0B)
908c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS    (0x0C)
918c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_CREATE_PHYSDISK             (0x0D)
928c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_DELETE_PHYSDISK             (0x0E)
938c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_FAIL_PHYSDISK               (0x0F)
948c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_REPLACE_PHYSDISK            (0x10)
958c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ACTIVATE_VOLUME             (0x11)
968c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_INACTIVATE_VOLUME           (0x12)
978c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_SET_RESYNC_RATE             (0x13)
988c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_SET_DATA_SCRUB_RATE         (0x14)
998c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_DEVICE_FW_UPDATE_MODE       (0x15)
1008c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_SET_VOLUME_NAME             (0x16)
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci/* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */
1038c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC           (0x00000001)
1048c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT        (0x00000002)
1058c2ecf20Sopenharmony_ci
1068c2ecf20Sopenharmony_ci/* ActionDataWord defines for use with MPI_RAID_ACTION_DELETE_VOLUME action */
1078c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_KEEP_PHYS_DISKS       (0x00000000)
1088c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS        (0x00000001)
1098c2ecf20Sopenharmony_ci
1108c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_KEEP_LBA0             (0x00000000)
1118c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_ZERO_LBA0             (0x00000002)
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci/* ActionDataWord defines for use with MPI_RAID_ACTION_DISABLE_VOLUME action */
1148c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_DISABLE_FULL_REBUILD  (0x00000001)
1158c2ecf20Sopenharmony_ci
1168c2ecf20Sopenharmony_ci/* ActionDataWord defines for use with MPI_RAID_ACTION_ACTIVATE_VOLUME action */
1178c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_INACTIVATE_ALL        (0x00000001)
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci/* ActionDataWord defines for use with MPI_RAID_ACTION_SET_RESYNC_RATE action */
1208c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_RESYNC_RATE_MASK      (0x000000FF)
1218c2ecf20Sopenharmony_ci
1228c2ecf20Sopenharmony_ci/* ActionDataWord defines for use with MPI_RAID_ACTION_SET_DATA_SCRUB_RATE action */
1238c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_DATA_SCRUB_RATE_MASK  (0x000000FF)
1248c2ecf20Sopenharmony_ci
1258c2ecf20Sopenharmony_ci/* ActionDataWord defines for use with MPI_RAID_ACTION_DEVICE_FW_UPDATE_MODE action */
1268c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_ENABLE_FW_UPDATE          (0x00000001)
1278c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_MASK_FW_UPDATE_TIMEOUT    (0x0000FF00)
1288c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_SHIFT_FW_UPDATE_TIMEOUT   (8)
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci/* RAID Action reply message */
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_citypedef struct _MSG_RAID_ACTION_REPLY
1348c2ecf20Sopenharmony_ci{
1358c2ecf20Sopenharmony_ci    U8                      Action;             /* 00h */
1368c2ecf20Sopenharmony_ci    U8                      Reserved;           /* 01h */
1378c2ecf20Sopenharmony_ci    U8                      MsgLength;          /* 02h */
1388c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
1398c2ecf20Sopenharmony_ci    U8                      VolumeID;           /* 04h */
1408c2ecf20Sopenharmony_ci    U8                      VolumeBus;          /* 05h */
1418c2ecf20Sopenharmony_ci    U8                      PhysDiskNum;        /* 06h */
1428c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
1438c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
1448c2ecf20Sopenharmony_ci    U16                     ActionStatus;       /* 0Ch */
1458c2ecf20Sopenharmony_ci    U16                     IOCStatus;          /* 0Eh */
1468c2ecf20Sopenharmony_ci    U32                     IOCLogInfo;         /* 10h */
1478c2ecf20Sopenharmony_ci    U32                     VolumeStatus;       /* 14h */
1488c2ecf20Sopenharmony_ci    U32                     ActionData;         /* 18h */
1498c2ecf20Sopenharmony_ci} MSG_RAID_ACTION_REPLY, MPI_POINTER PTR_MSG_RAID_ACTION_REPLY,
1508c2ecf20Sopenharmony_ci  MpiRaidActionReply_t, MPI_POINTER pMpiRaidActionReply_t;
1518c2ecf20Sopenharmony_ci
1528c2ecf20Sopenharmony_ci
1538c2ecf20Sopenharmony_ci/* RAID Volume reply ActionStatus values */
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ASTATUS_SUCCESS             (0x0000)
1568c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ASTATUS_INVALID_ACTION      (0x0001)
1578c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ASTATUS_FAILURE             (0x0002)
1588c2ecf20Sopenharmony_ci#define MPI_RAID_ACTION_ASTATUS_IN_PROGRESS         (0x0003)
1598c2ecf20Sopenharmony_ci
1608c2ecf20Sopenharmony_ci
1618c2ecf20Sopenharmony_ci/* RAID Volume reply RAID Volume Indicator structure */
1628c2ecf20Sopenharmony_ci
1638c2ecf20Sopenharmony_citypedef struct _MPI_RAID_VOL_INDICATOR
1648c2ecf20Sopenharmony_ci{
1658c2ecf20Sopenharmony_ci    U64                     TotalBlocks;        /* 00h */
1668c2ecf20Sopenharmony_ci    U64                     BlocksRemaining;    /* 08h */
1678c2ecf20Sopenharmony_ci} MPI_RAID_VOL_INDICATOR, MPI_POINTER PTR_MPI_RAID_VOL_INDICATOR,
1688c2ecf20Sopenharmony_ci  MpiRaidVolIndicator_t, MPI_POINTER pMpiRaidVolIndicator_t;
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ci
1718c2ecf20Sopenharmony_ci/****************************************************************************/
1728c2ecf20Sopenharmony_ci/* SCSI IO RAID Passthrough Request                                         */
1738c2ecf20Sopenharmony_ci/****************************************************************************/
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_citypedef struct _MSG_SCSI_IO_RAID_PT_REQUEST
1768c2ecf20Sopenharmony_ci{
1778c2ecf20Sopenharmony_ci    U8                      PhysDiskNum;        /* 00h */
1788c2ecf20Sopenharmony_ci    U8                      Reserved1;          /* 01h */
1798c2ecf20Sopenharmony_ci    U8                      ChainOffset;        /* 02h */
1808c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
1818c2ecf20Sopenharmony_ci    U8                      CDBLength;          /* 04h */
1828c2ecf20Sopenharmony_ci    U8                      SenseBufferLength;  /* 05h */
1838c2ecf20Sopenharmony_ci    U8                      Reserved2;          /* 06h */
1848c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
1858c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
1868c2ecf20Sopenharmony_ci    U8                      LUN[8];             /* 0Ch */
1878c2ecf20Sopenharmony_ci    U32                     Control;            /* 14h */
1888c2ecf20Sopenharmony_ci    U8                      CDB[16];            /* 18h */
1898c2ecf20Sopenharmony_ci    U32                     DataLength;         /* 28h */
1908c2ecf20Sopenharmony_ci    U32                     SenseBufferLowAddr; /* 2Ch */
1918c2ecf20Sopenharmony_ci    SGE_IO_UNION            SGL;                /* 30h */
1928c2ecf20Sopenharmony_ci} MSG_SCSI_IO_RAID_PT_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REQUEST,
1938c2ecf20Sopenharmony_ci  SCSIIORaidPassthroughRequest_t, MPI_POINTER pSCSIIORaidPassthroughRequest_t;
1948c2ecf20Sopenharmony_ci
1958c2ecf20Sopenharmony_ci
1968c2ecf20Sopenharmony_ci/* SCSI IO RAID Passthrough reply structure */
1978c2ecf20Sopenharmony_ci
1988c2ecf20Sopenharmony_citypedef struct _MSG_SCSI_IO_RAID_PT_REPLY
1998c2ecf20Sopenharmony_ci{
2008c2ecf20Sopenharmony_ci    U8                      PhysDiskNum;        /* 00h */
2018c2ecf20Sopenharmony_ci    U8                      Reserved1;          /* 01h */
2028c2ecf20Sopenharmony_ci    U8                      MsgLength;          /* 02h */
2038c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
2048c2ecf20Sopenharmony_ci    U8                      CDBLength;          /* 04h */
2058c2ecf20Sopenharmony_ci    U8                      SenseBufferLength;  /* 05h */
2068c2ecf20Sopenharmony_ci    U8                      Reserved2;          /* 06h */
2078c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
2088c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
2098c2ecf20Sopenharmony_ci    U8                      SCSIStatus;         /* 0Ch */
2108c2ecf20Sopenharmony_ci    U8                      SCSIState;          /* 0Dh */
2118c2ecf20Sopenharmony_ci    U16                     IOCStatus;          /* 0Eh */
2128c2ecf20Sopenharmony_ci    U32                     IOCLogInfo;         /* 10h */
2138c2ecf20Sopenharmony_ci    U32                     TransferCount;      /* 14h */
2148c2ecf20Sopenharmony_ci    U32                     SenseCount;         /* 18h */
2158c2ecf20Sopenharmony_ci    U32                     ResponseInfo;       /* 1Ch */
2168c2ecf20Sopenharmony_ci} MSG_SCSI_IO_RAID_PT_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REPLY,
2178c2ecf20Sopenharmony_ci  SCSIIORaidPassthroughReply_t, MPI_POINTER pSCSIIORaidPassthroughReply_t;
2188c2ecf20Sopenharmony_ci
2198c2ecf20Sopenharmony_ci
2208c2ecf20Sopenharmony_ci/****************************************************************************/
2218c2ecf20Sopenharmony_ci/* Mailbox reqeust structure */
2228c2ecf20Sopenharmony_ci/****************************************************************************/
2238c2ecf20Sopenharmony_ci
2248c2ecf20Sopenharmony_citypedef struct _MSG_MAILBOX_REQUEST
2258c2ecf20Sopenharmony_ci{
2268c2ecf20Sopenharmony_ci    U16                     Reserved1;
2278c2ecf20Sopenharmony_ci    U8                      ChainOffset;
2288c2ecf20Sopenharmony_ci    U8                      Function;
2298c2ecf20Sopenharmony_ci    U16                     Reserved2;
2308c2ecf20Sopenharmony_ci    U8                      Reserved3;
2318c2ecf20Sopenharmony_ci    U8                      MsgFlags;
2328c2ecf20Sopenharmony_ci    U32                     MsgContext;
2338c2ecf20Sopenharmony_ci    U8                      Command[10];
2348c2ecf20Sopenharmony_ci    U16                     Reserved4;
2358c2ecf20Sopenharmony_ci    SGE_IO_UNION            SGL;
2368c2ecf20Sopenharmony_ci} MSG_MAILBOX_REQUEST, MPI_POINTER PTR_MSG_MAILBOX_REQUEST,
2378c2ecf20Sopenharmony_ci  MailboxRequest_t, MPI_POINTER pMailboxRequest_t;
2388c2ecf20Sopenharmony_ci
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_ci/* Mailbox reply structure */
2418c2ecf20Sopenharmony_citypedef struct _MSG_MAILBOX_REPLY
2428c2ecf20Sopenharmony_ci{
2438c2ecf20Sopenharmony_ci    U16                     Reserved1;          /* 00h */
2448c2ecf20Sopenharmony_ci    U8                      MsgLength;          /* 02h */
2458c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
2468c2ecf20Sopenharmony_ci    U16                     Reserved2;          /* 04h */
2478c2ecf20Sopenharmony_ci    U8                      Reserved3;          /* 06h */
2488c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
2498c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
2508c2ecf20Sopenharmony_ci    U16                     MailboxStatus;      /* 0Ch */
2518c2ecf20Sopenharmony_ci    U16                     IOCStatus;          /* 0Eh */
2528c2ecf20Sopenharmony_ci    U32                     IOCLogInfo;         /* 10h */
2538c2ecf20Sopenharmony_ci    U32                     Reserved4;          /* 14h */
2548c2ecf20Sopenharmony_ci} MSG_MAILBOX_REPLY, MPI_POINTER PTR_MSG_MAILBOX_REPLY,
2558c2ecf20Sopenharmony_ci  MailboxReply_t, MPI_POINTER pMailboxReply_t;
2568c2ecf20Sopenharmony_ci
2578c2ecf20Sopenharmony_ci#endif
2588c2ecf20Sopenharmony_ci
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ci
261