162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci *  Copyright (c) 2001-2008 LSI Corporation.
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci *           Name:  mpi_raid.h
762306a36Sopenharmony_ci *          Title:  MPI RAID message and structures
862306a36Sopenharmony_ci *  Creation Date:  February 27, 2001
962306a36Sopenharmony_ci *
1062306a36Sopenharmony_ci *    mpi_raid.h Version:  01.05.05
1162306a36Sopenharmony_ci *
1262306a36Sopenharmony_ci *  Version History
1362306a36Sopenharmony_ci *  ---------------
1462306a36Sopenharmony_ci *
1562306a36Sopenharmony_ci *  Date      Version   Description
1662306a36Sopenharmony_ci *  --------  --------  ------------------------------------------------------
1762306a36Sopenharmony_ci *  02-27-01  01.01.01  Original release for this file.
1862306a36Sopenharmony_ci *  03-27-01  01.01.02  Added structure offset comments.
1962306a36Sopenharmony_ci *  08-08-01  01.02.01  Original release for v1.2 work.
2062306a36Sopenharmony_ci *  09-28-01  01.02.02  Major rework for MPI v1.2 Integrated RAID changes.
2162306a36Sopenharmony_ci *  10-04-01  01.02.03  Added ActionData defines for
2262306a36Sopenharmony_ci *                      MPI_RAID_ACTION_DELETE_VOLUME action.
2362306a36Sopenharmony_ci *  11-01-01  01.02.04  Added define for MPI_RAID_ACTION_ADATA_DO_NOT_SYNC.
2462306a36Sopenharmony_ci *  03-14-02  01.02.05  Added define for MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT.
2562306a36Sopenharmony_ci *  05-07-02  01.02.06  Added define for MPI_RAID_ACTION_ACTIVATE_VOLUME,
2662306a36Sopenharmony_ci *                      MPI_RAID_ACTION_INACTIVATE_VOLUME, and
2762306a36Sopenharmony_ci *                      MPI_RAID_ACTION_ADATA_INACTIVATE_ALL.
2862306a36Sopenharmony_ci *  07-12-02  01.02.07  Added structures for Mailbox request and reply.
2962306a36Sopenharmony_ci *  11-15-02  01.02.08  Added missing MsgContext field to MSG_MAILBOX_REQUEST.
3062306a36Sopenharmony_ci *  04-01-03  01.02.09  New action data option flag for
3162306a36Sopenharmony_ci *                      MPI_RAID_ACTION_DELETE_VOLUME.
3262306a36Sopenharmony_ci *  05-11-04  01.03.01  Original release for MPI v1.3.
3362306a36Sopenharmony_ci *  08-19-04  01.05.01  Original release for MPI v1.5.
3462306a36Sopenharmony_ci *  01-15-05  01.05.02  Added defines for the two new RAID Actions for
3562306a36Sopenharmony_ci *                      _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE.
3662306a36Sopenharmony_ci *  02-28-07  01.05.03  Added new RAID Action, Device FW Update Mode, and
3762306a36Sopenharmony_ci *                      associated defines.
3862306a36Sopenharmony_ci *  08-07-07  01.05.04  Added Disable Full Rebuild bit to the ActionDataWord
3962306a36Sopenharmony_ci *                      for the RAID Action MPI_RAID_ACTION_DISABLE_VOLUME.
4062306a36Sopenharmony_ci *  01-15-08  01.05.05  Added define for MPI_RAID_ACTION_SET_VOLUME_NAME.
4162306a36Sopenharmony_ci *  --------------------------------------------------------------------------
4262306a36Sopenharmony_ci */
4362306a36Sopenharmony_ci
4462306a36Sopenharmony_ci#ifndef MPI_RAID_H
4562306a36Sopenharmony_ci#define MPI_RAID_H
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci
4862306a36Sopenharmony_ci/******************************************************************************
4962306a36Sopenharmony_ci*
5062306a36Sopenharmony_ci*        R A I D    M e s s a g e s
5162306a36Sopenharmony_ci*
5262306a36Sopenharmony_ci*******************************************************************************/
5362306a36Sopenharmony_ci
5462306a36Sopenharmony_ci
5562306a36Sopenharmony_ci/****************************************************************************/
5662306a36Sopenharmony_ci/* RAID Action Request                                                      */
5762306a36Sopenharmony_ci/****************************************************************************/
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_citypedef struct _MSG_RAID_ACTION
6062306a36Sopenharmony_ci{
6162306a36Sopenharmony_ci    U8                      Action;             /* 00h */
6262306a36Sopenharmony_ci    U8                      Reserved1;          /* 01h */
6362306a36Sopenharmony_ci    U8                      ChainOffset;        /* 02h */
6462306a36Sopenharmony_ci    U8                      Function;           /* 03h */
6562306a36Sopenharmony_ci    U8                      VolumeID;           /* 04h */
6662306a36Sopenharmony_ci    U8                      VolumeBus;          /* 05h */
6762306a36Sopenharmony_ci    U8                      PhysDiskNum;        /* 06h */
6862306a36Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
6962306a36Sopenharmony_ci    U32                     MsgContext;         /* 08h */
7062306a36Sopenharmony_ci    U32                     Reserved2;          /* 0Ch */
7162306a36Sopenharmony_ci    U32                     ActionDataWord;     /* 10h */
7262306a36Sopenharmony_ci    SGE_SIMPLE_UNION        ActionDataSGE;      /* 14h */
7362306a36Sopenharmony_ci} MSG_RAID_ACTION_REQUEST, MPI_POINTER PTR_MSG_RAID_ACTION_REQUEST,
7462306a36Sopenharmony_ci  MpiRaidActionRequest_t , MPI_POINTER pMpiRaidActionRequest_t;
7562306a36Sopenharmony_ci
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci/* RAID Action request Action values */
7862306a36Sopenharmony_ci
7962306a36Sopenharmony_ci#define MPI_RAID_ACTION_STATUS                      (0x00)
8062306a36Sopenharmony_ci#define MPI_RAID_ACTION_INDICATOR_STRUCT            (0x01)
8162306a36Sopenharmony_ci#define MPI_RAID_ACTION_CREATE_VOLUME               (0x02)
8262306a36Sopenharmony_ci#define MPI_RAID_ACTION_DELETE_VOLUME               (0x03)
8362306a36Sopenharmony_ci#define MPI_RAID_ACTION_DISABLE_VOLUME              (0x04)
8462306a36Sopenharmony_ci#define MPI_RAID_ACTION_ENABLE_VOLUME               (0x05)
8562306a36Sopenharmony_ci#define MPI_RAID_ACTION_QUIESCE_PHYS_IO             (0x06)
8662306a36Sopenharmony_ci#define MPI_RAID_ACTION_ENABLE_PHYS_IO              (0x07)
8762306a36Sopenharmony_ci#define MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS      (0x08)
8862306a36Sopenharmony_ci#define MPI_RAID_ACTION_PHYSDISK_OFFLINE            (0x0A)
8962306a36Sopenharmony_ci#define MPI_RAID_ACTION_PHYSDISK_ONLINE             (0x0B)
9062306a36Sopenharmony_ci#define MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS    (0x0C)
9162306a36Sopenharmony_ci#define MPI_RAID_ACTION_CREATE_PHYSDISK             (0x0D)
9262306a36Sopenharmony_ci#define MPI_RAID_ACTION_DELETE_PHYSDISK             (0x0E)
9362306a36Sopenharmony_ci#define MPI_RAID_ACTION_FAIL_PHYSDISK               (0x0F)
9462306a36Sopenharmony_ci#define MPI_RAID_ACTION_REPLACE_PHYSDISK            (0x10)
9562306a36Sopenharmony_ci#define MPI_RAID_ACTION_ACTIVATE_VOLUME             (0x11)
9662306a36Sopenharmony_ci#define MPI_RAID_ACTION_INACTIVATE_VOLUME           (0x12)
9762306a36Sopenharmony_ci#define MPI_RAID_ACTION_SET_RESYNC_RATE             (0x13)
9862306a36Sopenharmony_ci#define MPI_RAID_ACTION_SET_DATA_SCRUB_RATE         (0x14)
9962306a36Sopenharmony_ci#define MPI_RAID_ACTION_DEVICE_FW_UPDATE_MODE       (0x15)
10062306a36Sopenharmony_ci#define MPI_RAID_ACTION_SET_VOLUME_NAME             (0x16)
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci/* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */
10362306a36Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC           (0x00000001)
10462306a36Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT        (0x00000002)
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci/* ActionDataWord defines for use with MPI_RAID_ACTION_DELETE_VOLUME action */
10762306a36Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_KEEP_PHYS_DISKS       (0x00000000)
10862306a36Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS        (0x00000001)
10962306a36Sopenharmony_ci
11062306a36Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_KEEP_LBA0             (0x00000000)
11162306a36Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_ZERO_LBA0             (0x00000002)
11262306a36Sopenharmony_ci
11362306a36Sopenharmony_ci/* ActionDataWord defines for use with MPI_RAID_ACTION_DISABLE_VOLUME action */
11462306a36Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_DISABLE_FULL_REBUILD  (0x00000001)
11562306a36Sopenharmony_ci
11662306a36Sopenharmony_ci/* ActionDataWord defines for use with MPI_RAID_ACTION_ACTIVATE_VOLUME action */
11762306a36Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_INACTIVATE_ALL        (0x00000001)
11862306a36Sopenharmony_ci
11962306a36Sopenharmony_ci/* ActionDataWord defines for use with MPI_RAID_ACTION_SET_RESYNC_RATE action */
12062306a36Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_RESYNC_RATE_MASK      (0x000000FF)
12162306a36Sopenharmony_ci
12262306a36Sopenharmony_ci/* ActionDataWord defines for use with MPI_RAID_ACTION_SET_DATA_SCRUB_RATE action */
12362306a36Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_DATA_SCRUB_RATE_MASK  (0x000000FF)
12462306a36Sopenharmony_ci
12562306a36Sopenharmony_ci/* ActionDataWord defines for use with MPI_RAID_ACTION_DEVICE_FW_UPDATE_MODE action */
12662306a36Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_ENABLE_FW_UPDATE          (0x00000001)
12762306a36Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_MASK_FW_UPDATE_TIMEOUT    (0x0000FF00)
12862306a36Sopenharmony_ci#define MPI_RAID_ACTION_ADATA_SHIFT_FW_UPDATE_TIMEOUT   (8)
12962306a36Sopenharmony_ci
13062306a36Sopenharmony_ci
13162306a36Sopenharmony_ci/* RAID Action reply message */
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_citypedef struct _MSG_RAID_ACTION_REPLY
13462306a36Sopenharmony_ci{
13562306a36Sopenharmony_ci    U8                      Action;             /* 00h */
13662306a36Sopenharmony_ci    U8                      Reserved;           /* 01h */
13762306a36Sopenharmony_ci    U8                      MsgLength;          /* 02h */
13862306a36Sopenharmony_ci    U8                      Function;           /* 03h */
13962306a36Sopenharmony_ci    U8                      VolumeID;           /* 04h */
14062306a36Sopenharmony_ci    U8                      VolumeBus;          /* 05h */
14162306a36Sopenharmony_ci    U8                      PhysDiskNum;        /* 06h */
14262306a36Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
14362306a36Sopenharmony_ci    U32                     MsgContext;         /* 08h */
14462306a36Sopenharmony_ci    U16                     ActionStatus;       /* 0Ch */
14562306a36Sopenharmony_ci    U16                     IOCStatus;          /* 0Eh */
14662306a36Sopenharmony_ci    U32                     IOCLogInfo;         /* 10h */
14762306a36Sopenharmony_ci    U32                     VolumeStatus;       /* 14h */
14862306a36Sopenharmony_ci    U32                     ActionData;         /* 18h */
14962306a36Sopenharmony_ci} MSG_RAID_ACTION_REPLY, MPI_POINTER PTR_MSG_RAID_ACTION_REPLY,
15062306a36Sopenharmony_ci  MpiRaidActionReply_t, MPI_POINTER pMpiRaidActionReply_t;
15162306a36Sopenharmony_ci
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci/* RAID Volume reply ActionStatus values */
15462306a36Sopenharmony_ci
15562306a36Sopenharmony_ci#define MPI_RAID_ACTION_ASTATUS_SUCCESS             (0x0000)
15662306a36Sopenharmony_ci#define MPI_RAID_ACTION_ASTATUS_INVALID_ACTION      (0x0001)
15762306a36Sopenharmony_ci#define MPI_RAID_ACTION_ASTATUS_FAILURE             (0x0002)
15862306a36Sopenharmony_ci#define MPI_RAID_ACTION_ASTATUS_IN_PROGRESS         (0x0003)
15962306a36Sopenharmony_ci
16062306a36Sopenharmony_ci
16162306a36Sopenharmony_ci/* RAID Volume reply RAID Volume Indicator structure */
16262306a36Sopenharmony_ci
16362306a36Sopenharmony_citypedef struct _MPI_RAID_VOL_INDICATOR
16462306a36Sopenharmony_ci{
16562306a36Sopenharmony_ci    U64                     TotalBlocks;        /* 00h */
16662306a36Sopenharmony_ci    U64                     BlocksRemaining;    /* 08h */
16762306a36Sopenharmony_ci} MPI_RAID_VOL_INDICATOR, MPI_POINTER PTR_MPI_RAID_VOL_INDICATOR,
16862306a36Sopenharmony_ci  MpiRaidVolIndicator_t, MPI_POINTER pMpiRaidVolIndicator_t;
16962306a36Sopenharmony_ci
17062306a36Sopenharmony_ci
17162306a36Sopenharmony_ci/****************************************************************************/
17262306a36Sopenharmony_ci/* SCSI IO RAID Passthrough Request                                         */
17362306a36Sopenharmony_ci/****************************************************************************/
17462306a36Sopenharmony_ci
17562306a36Sopenharmony_citypedef struct _MSG_SCSI_IO_RAID_PT_REQUEST
17662306a36Sopenharmony_ci{
17762306a36Sopenharmony_ci    U8                      PhysDiskNum;        /* 00h */
17862306a36Sopenharmony_ci    U8                      Reserved1;          /* 01h */
17962306a36Sopenharmony_ci    U8                      ChainOffset;        /* 02h */
18062306a36Sopenharmony_ci    U8                      Function;           /* 03h */
18162306a36Sopenharmony_ci    U8                      CDBLength;          /* 04h */
18262306a36Sopenharmony_ci    U8                      SenseBufferLength;  /* 05h */
18362306a36Sopenharmony_ci    U8                      Reserved2;          /* 06h */
18462306a36Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
18562306a36Sopenharmony_ci    U32                     MsgContext;         /* 08h */
18662306a36Sopenharmony_ci    U8                      LUN[8];             /* 0Ch */
18762306a36Sopenharmony_ci    U32                     Control;            /* 14h */
18862306a36Sopenharmony_ci    U8                      CDB[16];            /* 18h */
18962306a36Sopenharmony_ci    U32                     DataLength;         /* 28h */
19062306a36Sopenharmony_ci    U32                     SenseBufferLowAddr; /* 2Ch */
19162306a36Sopenharmony_ci    SGE_IO_UNION            SGL;                /* 30h */
19262306a36Sopenharmony_ci} MSG_SCSI_IO_RAID_PT_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REQUEST,
19362306a36Sopenharmony_ci  SCSIIORaidPassthroughRequest_t, MPI_POINTER pSCSIIORaidPassthroughRequest_t;
19462306a36Sopenharmony_ci
19562306a36Sopenharmony_ci
19662306a36Sopenharmony_ci/* SCSI IO RAID Passthrough reply structure */
19762306a36Sopenharmony_ci
19862306a36Sopenharmony_citypedef struct _MSG_SCSI_IO_RAID_PT_REPLY
19962306a36Sopenharmony_ci{
20062306a36Sopenharmony_ci    U8                      PhysDiskNum;        /* 00h */
20162306a36Sopenharmony_ci    U8                      Reserved1;          /* 01h */
20262306a36Sopenharmony_ci    U8                      MsgLength;          /* 02h */
20362306a36Sopenharmony_ci    U8                      Function;           /* 03h */
20462306a36Sopenharmony_ci    U8                      CDBLength;          /* 04h */
20562306a36Sopenharmony_ci    U8                      SenseBufferLength;  /* 05h */
20662306a36Sopenharmony_ci    U8                      Reserved2;          /* 06h */
20762306a36Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
20862306a36Sopenharmony_ci    U32                     MsgContext;         /* 08h */
20962306a36Sopenharmony_ci    U8                      SCSIStatus;         /* 0Ch */
21062306a36Sopenharmony_ci    U8                      SCSIState;          /* 0Dh */
21162306a36Sopenharmony_ci    U16                     IOCStatus;          /* 0Eh */
21262306a36Sopenharmony_ci    U32                     IOCLogInfo;         /* 10h */
21362306a36Sopenharmony_ci    U32                     TransferCount;      /* 14h */
21462306a36Sopenharmony_ci    U32                     SenseCount;         /* 18h */
21562306a36Sopenharmony_ci    U32                     ResponseInfo;       /* 1Ch */
21662306a36Sopenharmony_ci} MSG_SCSI_IO_RAID_PT_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REPLY,
21762306a36Sopenharmony_ci  SCSIIORaidPassthroughReply_t, MPI_POINTER pSCSIIORaidPassthroughReply_t;
21862306a36Sopenharmony_ci
21962306a36Sopenharmony_ci
22062306a36Sopenharmony_ci/****************************************************************************/
22162306a36Sopenharmony_ci/* Mailbox reqeust structure */
22262306a36Sopenharmony_ci/****************************************************************************/
22362306a36Sopenharmony_ci
22462306a36Sopenharmony_citypedef struct _MSG_MAILBOX_REQUEST
22562306a36Sopenharmony_ci{
22662306a36Sopenharmony_ci    U16                     Reserved1;
22762306a36Sopenharmony_ci    U8                      ChainOffset;
22862306a36Sopenharmony_ci    U8                      Function;
22962306a36Sopenharmony_ci    U16                     Reserved2;
23062306a36Sopenharmony_ci    U8                      Reserved3;
23162306a36Sopenharmony_ci    U8                      MsgFlags;
23262306a36Sopenharmony_ci    U32                     MsgContext;
23362306a36Sopenharmony_ci    U8                      Command[10];
23462306a36Sopenharmony_ci    U16                     Reserved4;
23562306a36Sopenharmony_ci    SGE_IO_UNION            SGL;
23662306a36Sopenharmony_ci} MSG_MAILBOX_REQUEST, MPI_POINTER PTR_MSG_MAILBOX_REQUEST,
23762306a36Sopenharmony_ci  MailboxRequest_t, MPI_POINTER pMailboxRequest_t;
23862306a36Sopenharmony_ci
23962306a36Sopenharmony_ci
24062306a36Sopenharmony_ci/* Mailbox reply structure */
24162306a36Sopenharmony_citypedef struct _MSG_MAILBOX_REPLY
24262306a36Sopenharmony_ci{
24362306a36Sopenharmony_ci    U16                     Reserved1;          /* 00h */
24462306a36Sopenharmony_ci    U8                      MsgLength;          /* 02h */
24562306a36Sopenharmony_ci    U8                      Function;           /* 03h */
24662306a36Sopenharmony_ci    U16                     Reserved2;          /* 04h */
24762306a36Sopenharmony_ci    U8                      Reserved3;          /* 06h */
24862306a36Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
24962306a36Sopenharmony_ci    U32                     MsgContext;         /* 08h */
25062306a36Sopenharmony_ci    U16                     MailboxStatus;      /* 0Ch */
25162306a36Sopenharmony_ci    U16                     IOCStatus;          /* 0Eh */
25262306a36Sopenharmony_ci    U32                     IOCLogInfo;         /* 10h */
25362306a36Sopenharmony_ci    U32                     Reserved4;          /* 14h */
25462306a36Sopenharmony_ci} MSG_MAILBOX_REPLY, MPI_POINTER PTR_MSG_MAILBOX_REPLY,
25562306a36Sopenharmony_ci  MailboxReply_t, MPI_POINTER pMailboxReply_t;
25662306a36Sopenharmony_ci
25762306a36Sopenharmony_ci#endif
25862306a36Sopenharmony_ci
25962306a36Sopenharmony_ci
26062306a36Sopenharmony_ci
261