Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Copyright 2000-2020 Broadcom Inc. All rights reserved.
0004  *
0005  *
0006  *          Name:  mpi2_raid.h
0007  *         Title:  MPI Integrated RAID messages and structures
0008  * Creation Date:  April 26, 2007
0009  *
0010  *   mpi2_raid.h Version:  02.00.11
0011  *
0012  * Version History
0013  * ---------------
0014  *
0015  * Date      Version   Description
0016  * --------  --------  ------------------------------------------------------
0017  * 04-30-07  02.00.00  Corresponds to Fusion-MPT MPI Specification Rev A.
0018  * 08-31-07  02.00.01  Modifications to RAID Action request and reply,
0019  *                     including the Actions and ActionData.
0020  * 02-29-08  02.00.02  Added MPI2_RAID_ACTION_ADATA_DISABL_FULL_REBUILD.
0021  * 05-21-08  02.00.03  Added MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS so that
0022  *                     the PhysDisk array in MPI2_RAID_VOLUME_CREATION_STRUCT
0023  *                     can be sized by the build environment.
0024  * 07-30-09  02.00.04  Added proper define for the Use Default Settings bit of
0025  *                     VolumeCreationFlags and marked the old one as obsolete.
0026  * 05-12-10  02.00.05  Added MPI2_RAID_VOL_FLAGS_OP_MDC define.
0027  * 08-24-10  02.00.06  Added MPI2_RAID_ACTION_COMPATIBILITY_CHECK along with
0028  *                     related structures and defines.
0029  *                     Added product-specific range to RAID Action values.
0030  * 11-18-11  02.00.07  Incorporating additions for MPI v2.5.
0031  * 02-06-12  02.00.08  Added MPI2_RAID_ACTION_PHYSDISK_HIDDEN.
0032  * 07-26-12  02.00.09  Added ElapsedSeconds field to MPI2_RAID_VOL_INDICATOR.
0033  *                     Added MPI2_RAID_VOL_FLAGS_ELAPSED_SECONDS_VALID define.
0034  * 04-17-13  02.00.10  Added MPI25_RAID_ACTION_ADATA_ALLOW_PI.
0035  * 11-18-14  02.00.11  Updated copyright information.
0036  * --------------------------------------------------------------------------
0037  */
0038 
0039 #ifndef MPI2_RAID_H
0040 #define MPI2_RAID_H
0041 
0042 /*****************************************************************************
0043 *
0044 *              Integrated RAID Messages
0045 *
0046 *****************************************************************************/
0047 
0048 /****************************************************************************
0049 * RAID Action messages
0050 ****************************************************************************/
0051 
0052 /* ActionDataWord defines for use with MPI2_RAID_ACTION_CREATE_VOLUME action */
0053 #define MPI25_RAID_ACTION_ADATA_ALLOW_PI            (0x80000000)
0054 
0055 /*ActionDataWord defines for use with MPI2_RAID_ACTION_DELETE_VOLUME action */
0056 #define MPI2_RAID_ACTION_ADATA_KEEP_LBA0            (0x00000000)
0057 #define MPI2_RAID_ACTION_ADATA_ZERO_LBA0            (0x00000001)
0058 
0059 /*use MPI2_RAIDVOL0_SETTING_ defines from mpi2_cnfg.h for
0060  *MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE action */
0061 
0062 /*ActionDataWord defines for use with
0063  *MPI2_RAID_ACTION_DISABLE_ALL_VOLUMES action */
0064 #define MPI2_RAID_ACTION_ADATA_DISABL_FULL_REBUILD  (0x00000001)
0065 
0066 /*ActionDataWord for MPI2_RAID_ACTION_SET_RAID_FUNCTION_RATE Action */
0067 typedef struct _MPI2_RAID_ACTION_RATE_DATA {
0068     U8 RateToChange;    /*0x00 */
0069     U8 RateOrMode;      /*0x01 */
0070     U16 DataScrubDuration;  /*0x02 */
0071 } MPI2_RAID_ACTION_RATE_DATA, *PTR_MPI2_RAID_ACTION_RATE_DATA,
0072     Mpi2RaidActionRateData_t, *pMpi2RaidActionRateData_t;
0073 
0074 #define MPI2_RAID_ACTION_SET_RATE_RESYNC            (0x00)
0075 #define MPI2_RAID_ACTION_SET_RATE_DATA_SCRUB        (0x01)
0076 #define MPI2_RAID_ACTION_SET_RATE_POWERSAVE_MODE    (0x02)
0077 
0078 /*ActionDataWord for MPI2_RAID_ACTION_START_RAID_FUNCTION Action */
0079 typedef struct _MPI2_RAID_ACTION_START_RAID_FUNCTION {
0080     U8 RAIDFunction;    /*0x00 */
0081     U8 Flags;       /*0x01 */
0082     U16 Reserved1;      /*0x02 */
0083 } MPI2_RAID_ACTION_START_RAID_FUNCTION,
0084     *PTR_MPI2_RAID_ACTION_START_RAID_FUNCTION,
0085     Mpi2RaidActionStartRaidFunction_t,
0086     *pMpi2RaidActionStartRaidFunction_t;
0087 
0088 /*defines for the RAIDFunction field */
0089 #define MPI2_RAID_ACTION_START_BACKGROUND_INIT      (0x00)
0090 #define MPI2_RAID_ACTION_START_ONLINE_CAP_EXPANSION (0x01)
0091 #define MPI2_RAID_ACTION_START_CONSISTENCY_CHECK    (0x02)
0092 
0093 /*defines for the Flags field */
0094 #define MPI2_RAID_ACTION_START_NEW                  (0x00)
0095 #define MPI2_RAID_ACTION_START_RESUME               (0x01)
0096 
0097 /*ActionDataWord for MPI2_RAID_ACTION_STOP_RAID_FUNCTION Action */
0098 typedef struct _MPI2_RAID_ACTION_STOP_RAID_FUNCTION {
0099     U8 RAIDFunction;    /*0x00 */
0100     U8 Flags;       /*0x01 */
0101     U16 Reserved1;      /*0x02 */
0102 } MPI2_RAID_ACTION_STOP_RAID_FUNCTION,
0103     *PTR_MPI2_RAID_ACTION_STOP_RAID_FUNCTION,
0104     Mpi2RaidActionStopRaidFunction_t,
0105     *pMpi2RaidActionStopRaidFunction_t;
0106 
0107 /*defines for the RAIDFunction field */
0108 #define MPI2_RAID_ACTION_STOP_BACKGROUND_INIT       (0x00)
0109 #define MPI2_RAID_ACTION_STOP_ONLINE_CAP_EXPANSION  (0x01)
0110 #define MPI2_RAID_ACTION_STOP_CONSISTENCY_CHECK     (0x02)
0111 
0112 /*defines for the Flags field */
0113 #define MPI2_RAID_ACTION_STOP_ABORT                 (0x00)
0114 #define MPI2_RAID_ACTION_STOP_PAUSE                 (0x01)
0115 
0116 /*ActionDataWord for MPI2_RAID_ACTION_CREATE_HOT_SPARE Action */
0117 typedef struct _MPI2_RAID_ACTION_HOT_SPARE {
0118     U8 HotSparePool;    /*0x00 */
0119     U8 Reserved1;       /*0x01 */
0120     U16 DevHandle;      /*0x02 */
0121 } MPI2_RAID_ACTION_HOT_SPARE, *PTR_MPI2_RAID_ACTION_HOT_SPARE,
0122     Mpi2RaidActionHotSpare_t, *pMpi2RaidActionHotSpare_t;
0123 
0124 /*ActionDataWord for MPI2_RAID_ACTION_DEVICE_FW_UPDATE_MODE Action */
0125 typedef struct _MPI2_RAID_ACTION_FW_UPDATE_MODE {
0126     U8 Flags;       /*0x00 */
0127     U8 DeviceFirmwareUpdateModeTimeout; /*0x01 */
0128     U16 Reserved1;      /*0x02 */
0129 } MPI2_RAID_ACTION_FW_UPDATE_MODE,
0130     *PTR_MPI2_RAID_ACTION_FW_UPDATE_MODE,
0131     Mpi2RaidActionFwUpdateMode_t,
0132     *pMpi2RaidActionFwUpdateMode_t;
0133 
0134 /*ActionDataWord defines for use with
0135  *MPI2_RAID_ACTION_DEVICE_FW_UPDATE_MODE action */
0136 #define MPI2_RAID_ACTION_ADATA_DISABLE_FW_UPDATE        (0x00)
0137 #define MPI2_RAID_ACTION_ADATA_ENABLE_FW_UPDATE         (0x01)
0138 
0139 typedef union _MPI2_RAID_ACTION_DATA {
0140     U32 Word;
0141     MPI2_RAID_ACTION_RATE_DATA Rates;
0142     MPI2_RAID_ACTION_START_RAID_FUNCTION StartRaidFunction;
0143     MPI2_RAID_ACTION_STOP_RAID_FUNCTION StopRaidFunction;
0144     MPI2_RAID_ACTION_HOT_SPARE HotSpare;
0145     MPI2_RAID_ACTION_FW_UPDATE_MODE FwUpdateMode;
0146 } MPI2_RAID_ACTION_DATA, *PTR_MPI2_RAID_ACTION_DATA,
0147     Mpi2RaidActionData_t, *pMpi2RaidActionData_t;
0148 
0149 /*RAID Action Request Message */
0150 typedef struct _MPI2_RAID_ACTION_REQUEST {
0151     U8 Action;      /*0x00 */
0152     U8 Reserved1;       /*0x01 */
0153     U8 ChainOffset;     /*0x02 */
0154     U8 Function;        /*0x03 */
0155     U16 VolDevHandle;   /*0x04 */
0156     U8 PhysDiskNum;     /*0x06 */
0157     U8 MsgFlags;        /*0x07 */
0158     U8 VP_ID;       /*0x08 */
0159     U8 VF_ID;       /*0x09 */
0160     U16 Reserved2;      /*0x0A */
0161     U32 Reserved3;      /*0x0C */
0162     MPI2_RAID_ACTION_DATA ActionDataWord;   /*0x10 */
0163     MPI2_SGE_SIMPLE_UNION ActionDataSGE;    /*0x14 */
0164 } MPI2_RAID_ACTION_REQUEST, *PTR_MPI2_RAID_ACTION_REQUEST,
0165     Mpi2RaidActionRequest_t, *pMpi2RaidActionRequest_t;
0166 
0167 /*RAID Action request Action values */
0168 
0169 #define MPI2_RAID_ACTION_INDICATOR_STRUCT           (0x01)
0170 #define MPI2_RAID_ACTION_CREATE_VOLUME              (0x02)
0171 #define MPI2_RAID_ACTION_DELETE_VOLUME              (0x03)
0172 #define MPI2_RAID_ACTION_DISABLE_ALL_VOLUMES        (0x04)
0173 #define MPI2_RAID_ACTION_ENABLE_ALL_VOLUMES         (0x05)
0174 #define MPI2_RAID_ACTION_PHYSDISK_OFFLINE           (0x0A)
0175 #define MPI2_RAID_ACTION_PHYSDISK_ONLINE            (0x0B)
0176 #define MPI2_RAID_ACTION_FAIL_PHYSDISK              (0x0F)
0177 #define MPI2_RAID_ACTION_ACTIVATE_VOLUME            (0x11)
0178 #define MPI2_RAID_ACTION_DEVICE_FW_UPDATE_MODE      (0x15)
0179 #define MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE     (0x17)
0180 #define MPI2_RAID_ACTION_SET_VOLUME_NAME            (0x18)
0181 #define MPI2_RAID_ACTION_SET_RAID_FUNCTION_RATE     (0x19)
0182 #define MPI2_RAID_ACTION_ENABLE_FAILED_VOLUME       (0x1C)
0183 #define MPI2_RAID_ACTION_CREATE_HOT_SPARE           (0x1D)
0184 #define MPI2_RAID_ACTION_DELETE_HOT_SPARE           (0x1E)
0185 #define MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED  (0x20)
0186 #define MPI2_RAID_ACTION_START_RAID_FUNCTION        (0x21)
0187 #define MPI2_RAID_ACTION_STOP_RAID_FUNCTION         (0x22)
0188 #define MPI2_RAID_ACTION_COMPATIBILITY_CHECK        (0x23)
0189 #define MPI2_RAID_ACTION_PHYSDISK_HIDDEN            (0x24)
0190 #define MPI2_RAID_ACTION_MIN_PRODUCT_SPECIFIC       (0x80)
0191 #define MPI2_RAID_ACTION_MAX_PRODUCT_SPECIFIC       (0xFF)
0192 
0193 /*RAID Volume Creation Structure */
0194 
0195 /*
0196  *The following define can be customized for the targeted product.
0197  */
0198 #ifndef MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS
0199 #define MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS        (1)
0200 #endif
0201 
0202 typedef struct _MPI2_RAID_VOLUME_PHYSDISK {
0203     U8 RAIDSetNum;      /*0x00 */
0204     U8 PhysDiskMap;     /*0x01 */
0205     U16 PhysDiskDevHandle;  /*0x02 */
0206 } MPI2_RAID_VOLUME_PHYSDISK, *PTR_MPI2_RAID_VOLUME_PHYSDISK,
0207     Mpi2RaidVolumePhysDisk_t, *pMpi2RaidVolumePhysDisk_t;
0208 
0209 /*defines for the PhysDiskMap field */
0210 #define MPI2_RAIDACTION_PHYSDISK_PRIMARY            (0x01)
0211 #define MPI2_RAIDACTION_PHYSDISK_SECONDARY          (0x02)
0212 
0213 typedef struct _MPI2_RAID_VOLUME_CREATION_STRUCT {
0214     U8 NumPhysDisks;    /*0x00 */
0215     U8 VolumeType;      /*0x01 */
0216     U16 Reserved1;      /*0x02 */
0217     U32 VolumeCreationFlags;    /*0x04 */
0218     U32 VolumeSettings; /*0x08 */
0219     U8 Reserved2;       /*0x0C */
0220     U8 ResyncRate;      /*0x0D */
0221     U16 DataScrubDuration;  /*0x0E */
0222     U64 VolumeMaxLBA;   /*0x10 */
0223     U32 StripeSize;     /*0x18 */
0224     U8 Name[16];        /*0x1C */
0225     MPI2_RAID_VOLUME_PHYSDISK
0226         PhysDisk[MPI2_RAID_VOL_CREATION_NUM_PHYSDISKS]; /*0x2C */
0227 } MPI2_RAID_VOLUME_CREATION_STRUCT,
0228     *PTR_MPI2_RAID_VOLUME_CREATION_STRUCT,
0229     Mpi2RaidVolumeCreationStruct_t,
0230     *pMpi2RaidVolumeCreationStruct_t;
0231 
0232 /*use MPI2_RAID_VOL_TYPE_ defines from mpi2_cnfg.h for VolumeType */
0233 
0234 /*defines for the VolumeCreationFlags field */
0235 #define MPI2_RAID_VOL_CREATION_DEFAULT_SETTINGS     (0x80000000)
0236 #define MPI2_RAID_VOL_CREATION_BACKGROUND_INIT      (0x00000004)
0237 #define MPI2_RAID_VOL_CREATION_LOW_LEVEL_INIT       (0x00000002)
0238 #define MPI2_RAID_VOL_CREATION_MIGRATE_DATA         (0x00000001)
0239 /*The following is an obsolete define.
0240  *It must be shifted left 24 bits in order to set the proper bit.
0241  */
0242 #define MPI2_RAID_VOL_CREATION_USE_DEFAULT_SETTINGS (0x80)
0243 
0244 /*RAID Online Capacity Expansion Structure */
0245 
0246 typedef struct _MPI2_RAID_ONLINE_CAPACITY_EXPANSION {
0247     U32 Flags;      /*0x00 */
0248     U16 DevHandle0;     /*0x04 */
0249     U16 Reserved1;      /*0x06 */
0250     U16 DevHandle1;     /*0x08 */
0251     U16 Reserved2;      /*0x0A */
0252 } MPI2_RAID_ONLINE_CAPACITY_EXPANSION,
0253     *PTR_MPI2_RAID_ONLINE_CAPACITY_EXPANSION,
0254     Mpi2RaidOnlineCapacityExpansion_t,
0255     *pMpi2RaidOnlineCapacityExpansion_t;
0256 
0257 /*RAID Compatibility Input Structure */
0258 
0259 typedef struct _MPI2_RAID_COMPATIBILITY_INPUT_STRUCT {
0260     U16 SourceDevHandle;    /*0x00 */
0261     U16 CandidateDevHandle; /*0x02 */
0262     U32 Flags;      /*0x04 */
0263     U32 Reserved1;      /*0x08 */
0264     U32 Reserved2;      /*0x0C */
0265 } MPI2_RAID_COMPATIBILITY_INPUT_STRUCT,
0266     *PTR_MPI2_RAID_COMPATIBILITY_INPUT_STRUCT,
0267     Mpi2RaidCompatibilityInputStruct_t,
0268     *pMpi2RaidCompatibilityInputStruct_t;
0269 
0270 /*defines for RAID Compatibility Structure Flags field */
0271 #define MPI2_RAID_COMPAT_SOURCE_IS_VOLUME_FLAG      (0x00000002)
0272 #define MPI2_RAID_COMPAT_REPORT_SOURCE_INFO_FLAG    (0x00000001)
0273 
0274 /*RAID Volume Indicator Structure */
0275 
0276 typedef struct _MPI2_RAID_VOL_INDICATOR {
0277     U64 TotalBlocks;    /*0x00 */
0278     U64 BlocksRemaining;    /*0x08 */
0279     U32 Flags;      /*0x10 */
0280     U32 ElapsedSeconds; /* 0x14 */
0281 } MPI2_RAID_VOL_INDICATOR, *PTR_MPI2_RAID_VOL_INDICATOR,
0282     Mpi2RaidVolIndicator_t, *pMpi2RaidVolIndicator_t;
0283 
0284 /*defines for RAID Volume Indicator Flags field */
0285 #define MPI2_RAID_VOL_FLAGS_ELAPSED_SECONDS_VALID   (0x80000000)
0286 #define MPI2_RAID_VOL_FLAGS_OP_MASK                 (0x0000000F)
0287 #define MPI2_RAID_VOL_FLAGS_OP_BACKGROUND_INIT      (0x00000000)
0288 #define MPI2_RAID_VOL_FLAGS_OP_ONLINE_CAP_EXPANSION (0x00000001)
0289 #define MPI2_RAID_VOL_FLAGS_OP_CONSISTENCY_CHECK    (0x00000002)
0290 #define MPI2_RAID_VOL_FLAGS_OP_RESYNC               (0x00000003)
0291 #define MPI2_RAID_VOL_FLAGS_OP_MDC                  (0x00000004)
0292 
0293 /*RAID Compatibility Result Structure */
0294 
0295 typedef struct _MPI2_RAID_COMPATIBILITY_RESULT_STRUCT {
0296     U8 State;       /*0x00 */
0297     U8 Reserved1;       /*0x01 */
0298     U16 Reserved2;      /*0x02 */
0299     U32 GenericAttributes;  /*0x04 */
0300     U32 OEMSpecificAttributes;  /*0x08 */
0301     U32 Reserved3;      /*0x0C */
0302     U32 Reserved4;      /*0x10 */
0303 } MPI2_RAID_COMPATIBILITY_RESULT_STRUCT,
0304     *PTR_MPI2_RAID_COMPATIBILITY_RESULT_STRUCT,
0305     Mpi2RaidCompatibilityResultStruct_t,
0306     *pMpi2RaidCompatibilityResultStruct_t;
0307 
0308 /*defines for RAID Compatibility Result Structure State field */
0309 #define MPI2_RAID_COMPAT_STATE_COMPATIBLE           (0x00)
0310 #define MPI2_RAID_COMPAT_STATE_NOT_COMPATIBLE       (0x01)
0311 
0312 /*defines for RAID Compatibility Result Structure GenericAttributes field */
0313 #define MPI2_RAID_COMPAT_GENATTRIB_4K_SECTOR            (0x00000010)
0314 
0315 #define MPI2_RAID_COMPAT_GENATTRIB_MEDIA_MASK           (0x0000000C)
0316 #define MPI2_RAID_COMPAT_GENATTRIB_SOLID_STATE_DRIVE    (0x00000008)
0317 #define MPI2_RAID_COMPAT_GENATTRIB_HARD_DISK_DRIVE      (0x00000004)
0318 
0319 #define MPI2_RAID_COMPAT_GENATTRIB_PROTOCOL_MASK        (0x00000003)
0320 #define MPI2_RAID_COMPAT_GENATTRIB_SAS_PROTOCOL         (0x00000002)
0321 #define MPI2_RAID_COMPAT_GENATTRIB_SATA_PROTOCOL        (0x00000001)
0322 
0323 /*RAID Action Reply ActionData union */
0324 typedef union _MPI2_RAID_ACTION_REPLY_DATA {
0325     U32 Word[6];
0326     MPI2_RAID_VOL_INDICATOR RaidVolumeIndicator;
0327     U16 VolDevHandle;
0328     U8 VolumeState;
0329     U8 PhysDiskNum;
0330     MPI2_RAID_COMPATIBILITY_RESULT_STRUCT RaidCompatibilityResult;
0331 } MPI2_RAID_ACTION_REPLY_DATA, *PTR_MPI2_RAID_ACTION_REPLY_DATA,
0332     Mpi2RaidActionReplyData_t, *pMpi2RaidActionReplyData_t;
0333 
0334 /*use MPI2_RAIDVOL0_SETTING_ defines from mpi2_cnfg.h for
0335  *MPI2_RAID_ACTION_CHANGE_VOL_WRITE_CACHE action */
0336 
0337 /*RAID Action Reply Message */
0338 typedef struct _MPI2_RAID_ACTION_REPLY {
0339     U8 Action;      /*0x00 */
0340     U8 Reserved1;       /*0x01 */
0341     U8 MsgLength;       /*0x02 */
0342     U8 Function;        /*0x03 */
0343     U16 VolDevHandle;   /*0x04 */
0344     U8 PhysDiskNum;     /*0x06 */
0345     U8 MsgFlags;        /*0x07 */
0346     U8 VP_ID;       /*0x08 */
0347     U8 VF_ID;       /*0x09 */
0348     U16 Reserved2;      /*0x0A */
0349     U16 Reserved3;      /*0x0C */
0350     U16 IOCStatus;      /*0x0E */
0351     U32 IOCLogInfo;     /*0x10 */
0352     MPI2_RAID_ACTION_REPLY_DATA ActionData; /*0x14 */
0353 } MPI2_RAID_ACTION_REPLY, *PTR_MPI2_RAID_ACTION_REPLY,
0354     Mpi2RaidActionReply_t, *pMpi2RaidActionReply_t;
0355 
0356 #endif