xref: /freebsd/sys/dev/mpt/mpilib/mpi_raid.h (revision b0a2fdee0dd7d2a6141da0b764f718ad26864a8b)
19b631363SMatt Jacob /* $FreeBSD$ */
2098ca2bdSWarner Losh /*-
3b0a2fdeeSScott Long  * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors.
4b0a2fdeeSScott Long  * All rights reserved.
5d3ecac66SMatt Jacob  *
6d3ecac66SMatt Jacob  * Redistribution and use in source and binary forms, with or without
7b0a2fdeeSScott Long  * modification, are permitted provided that the following conditions are
8b0a2fdeeSScott Long  * met:
9d3ecac66SMatt Jacob  * 1. Redistributions of source code must retain the above copyright
10b0a2fdeeSScott Long  *    notice, this list of conditions and the following disclaimer.
11b0a2fdeeSScott Long  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
12b0a2fdeeSScott Long  *    substantially similar to the "NO WARRANTY" disclaimer below
13b0a2fdeeSScott Long  *    ("Disclaimer") and any redistribution must be conditioned upon including
14b0a2fdeeSScott Long  *    a substantially similar Disclaimer requirement for further binary
15b0a2fdeeSScott Long  *    redistribution.
16b0a2fdeeSScott Long  * 3. Neither the name of the LSI Logic Corporation nor the names of its
17b0a2fdeeSScott Long  *    contributors may be used to endorse or promote products derived from
18b0a2fdeeSScott Long  *    this software without specific prior written permission.
19d3ecac66SMatt Jacob  *
20b0a2fdeeSScott Long  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21b0a2fdeeSScott Long  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22d3ecac66SMatt Jacob  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23b0a2fdeeSScott Long  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24b0a2fdeeSScott Long  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25b0a2fdeeSScott Long  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26b0a2fdeeSScott Long  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27b0a2fdeeSScott Long  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28b0a2fdeeSScott Long  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29b0a2fdeeSScott Long  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE COPYRIGHT
30b0a2fdeeSScott Long  * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
319b631363SMatt Jacob  *
329b631363SMatt Jacob  *
339b631363SMatt Jacob  *           Name:  MPI_RAID.H
349b631363SMatt Jacob  *          Title:  MPI RAID message and structures
359b631363SMatt Jacob  *  Creation Date:  February 27, 2001
369b631363SMatt Jacob  *
377fed69eeSMatt Jacob  *    MPI_RAID.H Version:  01.02.09
389b631363SMatt Jacob  *
399b631363SMatt Jacob  *  Version History
409b631363SMatt Jacob  *  ---------------
419b631363SMatt Jacob  *
429b631363SMatt Jacob  *  Date      Version   Description
439b631363SMatt Jacob  *  --------  --------  ------------------------------------------------------
449b631363SMatt Jacob  *  02-27-01  01.01.01  Original release for this file.
459b631363SMatt Jacob  *  03-27-01  01.01.02  Added structure offset comments.
469b631363SMatt Jacob  *  08-08-01  01.02.01  Original release for v1.2 work.
479b631363SMatt Jacob  *  09-28-01  01.02.02  Major rework for MPI v1.2 Integrated RAID changes.
489b631363SMatt Jacob  *  10-04-01  01.02.03  Added ActionData defines for
499b631363SMatt Jacob  *                      MPI_RAID_ACTION_DELETE_VOLUME action.
509b631363SMatt Jacob  *  11-01-01  01.02.04  Added define for MPI_RAID_ACTION_ADATA_DO_NOT_SYNC.
517fed69eeSMatt Jacob  *  03-14-02  01.02.05  Added define for MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT.
527fed69eeSMatt Jacob  *  05-07-02  01.02.06  Added define for MPI_RAID_ACTION_ACTIVATE_VOLUME,
537fed69eeSMatt Jacob  *                      MPI_RAID_ACTION_INACTIVATE_VOLUME, and
547fed69eeSMatt Jacob  *                      MPI_RAID_ACTION_ADATA_INACTIVATE_ALL.
557fed69eeSMatt Jacob  *  07-12-02  01.02.07  Added structures for Mailbox request and reply.
567fed69eeSMatt Jacob  *  11-15-02  01.02.08  Added missing MsgContext field to MSG_MAILBOX_REQUEST.
577fed69eeSMatt Jacob  *  04-01-03  01.02.09  New action data option flag for
587fed69eeSMatt Jacob  *                      MPI_RAID_ACTION_DELETE_VOLUME.
599b631363SMatt Jacob  *  --------------------------------------------------------------------------
609b631363SMatt Jacob  */
619b631363SMatt Jacob 
629b631363SMatt Jacob #ifndef MPI_RAID_H
639b631363SMatt Jacob #define MPI_RAID_H
649b631363SMatt Jacob 
659b631363SMatt Jacob 
669b631363SMatt Jacob /******************************************************************************
679b631363SMatt Jacob *
689b631363SMatt Jacob *        R A I D    M e s s a g e s
699b631363SMatt Jacob *
709b631363SMatt Jacob *******************************************************************************/
719b631363SMatt Jacob 
729b631363SMatt Jacob 
739b631363SMatt Jacob /****************************************************************************/
749b631363SMatt Jacob /* RAID Volume Request                                                      */
759b631363SMatt Jacob /****************************************************************************/
769b631363SMatt Jacob 
779b631363SMatt Jacob typedef struct _MSG_RAID_ACTION
789b631363SMatt Jacob {
799b631363SMatt Jacob     U8                      Action;             /* 00h */
809b631363SMatt Jacob     U8                      Reserved1;          /* 01h */
819b631363SMatt Jacob     U8                      ChainOffset;        /* 02h */
829b631363SMatt Jacob     U8                      Function;           /* 03h */
839b631363SMatt Jacob     U8                      VolumeID;           /* 04h */
849b631363SMatt Jacob     U8                      VolumeBus;          /* 05h */
859b631363SMatt Jacob     U8                      PhysDiskNum;        /* 06h */
869b631363SMatt Jacob     U8                      MsgFlags;           /* 07h */
879b631363SMatt Jacob     U32                     MsgContext;         /* 08h */
889b631363SMatt Jacob     U32                     Reserved2;          /* 0Ch */
899b631363SMatt Jacob     U32                     ActionDataWord;     /* 10h */
909b631363SMatt Jacob     SGE_SIMPLE_UNION        ActionDataSGE;      /* 14h */
919b631363SMatt Jacob } MSG_RAID_ACTION_REQUEST, MPI_POINTER PTR_MSG_RAID_ACTION_REQUEST,
929b631363SMatt Jacob   MpiRaidActionRequest_t , MPI_POINTER pMpiRaidActionRequest_t;
939b631363SMatt Jacob 
949b631363SMatt Jacob 
959b631363SMatt Jacob /* RAID Action request Action values */
969b631363SMatt Jacob 
979b631363SMatt Jacob #define MPI_RAID_ACTION_STATUS                      (0x00)
989b631363SMatt Jacob #define MPI_RAID_ACTION_INDICATOR_STRUCT            (0x01)
999b631363SMatt Jacob #define MPI_RAID_ACTION_CREATE_VOLUME               (0x02)
1009b631363SMatt Jacob #define MPI_RAID_ACTION_DELETE_VOLUME               (0x03)
1019b631363SMatt Jacob #define MPI_RAID_ACTION_DISABLE_VOLUME              (0x04)
1029b631363SMatt Jacob #define MPI_RAID_ACTION_ENABLE_VOLUME               (0x05)
1039b631363SMatt Jacob #define MPI_RAID_ACTION_QUIESCE_PHYS_IO             (0x06)
1049b631363SMatt Jacob #define MPI_RAID_ACTION_ENABLE_PHYS_IO              (0x07)
1059b631363SMatt Jacob #define MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS      (0x08)
1069b631363SMatt Jacob #define MPI_RAID_ACTION_PHYSDISK_OFFLINE            (0x0A)
1079b631363SMatt Jacob #define MPI_RAID_ACTION_PHYSDISK_ONLINE             (0x0B)
1089b631363SMatt Jacob #define MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS    (0x0C)
1099b631363SMatt Jacob #define MPI_RAID_ACTION_CREATE_PHYSDISK             (0x0D)
1109b631363SMatt Jacob #define MPI_RAID_ACTION_DELETE_PHYSDISK             (0x0E)
1119b631363SMatt Jacob #define MPI_RAID_ACTION_FAIL_PHYSDISK               (0x0F)
1129b631363SMatt Jacob #define MPI_RAID_ACTION_REPLACE_PHYSDISK            (0x10)
1137fed69eeSMatt Jacob #define MPI_RAID_ACTION_ACTIVATE_VOLUME             (0x11)
1147fed69eeSMatt Jacob #define MPI_RAID_ACTION_INACTIVATE_VOLUME           (0x12)
115b0a2fdeeSScott Long #define MPI_RAID_ACTION_SET_RESYNC_RATE             (0x13)
116b0a2fdeeSScott Long #define MPI_RAID_ACTION_SET_DATA_SCRUB_RATE         (0x14)
1179b631363SMatt Jacob 
1189b631363SMatt Jacob /* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */
1199b631363SMatt Jacob #define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC           (0x00000001)
1207fed69eeSMatt Jacob #define MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT        (0x00000002)
1219b631363SMatt Jacob 
1229b631363SMatt Jacob /* ActionDataWord defines for use with MPI_RAID_ACTION_DELETE_VOLUME action */
1239b631363SMatt Jacob #define MPI_RAID_ACTION_ADATA_KEEP_PHYS_DISKS       (0x00000000)
1249b631363SMatt Jacob #define MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS        (0x00000001)
1259b631363SMatt Jacob 
1267fed69eeSMatt Jacob #define MPI_RAID_ACTION_ADATA_KEEP_LBA0             (0x00000000)
1277fed69eeSMatt Jacob #define MPI_RAID_ACTION_ADATA_ZERO_LBA0             (0x00000002)
1287fed69eeSMatt Jacob 
1297fed69eeSMatt Jacob /* ActionDataWord defines for use with MPI_RAID_ACTION_ACTIVATE_VOLUME action */
1307fed69eeSMatt Jacob #define MPI_RAID_ACTION_ADATA_INACTIVATE_ALL        (0x00000001)
1317fed69eeSMatt Jacob 
1329b631363SMatt Jacob 
1339b631363SMatt Jacob /* RAID Action reply message */
1349b631363SMatt Jacob 
1359b631363SMatt Jacob typedef struct _MSG_RAID_ACTION_REPLY
1369b631363SMatt Jacob {
1379b631363SMatt Jacob     U8                      Action;             /* 00h */
1389b631363SMatt Jacob     U8                      Reserved;           /* 01h */
1399b631363SMatt Jacob     U8                      MsgLength;          /* 02h */
1409b631363SMatt Jacob     U8                      Function;           /* 03h */
1419b631363SMatt Jacob     U8                      VolumeID;           /* 04h */
1429b631363SMatt Jacob     U8                      VolumeBus;          /* 05h */
1439b631363SMatt Jacob     U8                      PhysDiskNum;        /* 06h */
1449b631363SMatt Jacob     U8                      MsgFlags;           /* 07h */
1459b631363SMatt Jacob     U32                     MsgContext;         /* 08h */
1469b631363SMatt Jacob     U16                     ActionStatus;       /* 0Ch */
1479b631363SMatt Jacob     U16                     IOCStatus;          /* 0Eh */
1489b631363SMatt Jacob     U32                     IOCLogInfo;         /* 10h */
1499b631363SMatt Jacob     U32                     VolumeStatus;       /* 14h */
1509b631363SMatt Jacob     U32                     ActionData;         /* 18h */
1519b631363SMatt Jacob } MSG_RAID_ACTION_REPLY, MPI_POINTER PTR_MSG_RAID_ACTION_REPLY,
1529b631363SMatt Jacob   MpiRaidActionReply_t, MPI_POINTER pMpiRaidActionReply_t;
1539b631363SMatt Jacob 
1549b631363SMatt Jacob 
1559b631363SMatt Jacob /* RAID Volume reply ActionStatus values */
1569b631363SMatt Jacob 
1579b631363SMatt Jacob #define MPI_RAID_ACTION_ASTATUS_SUCCESS             (0x0000)
1589b631363SMatt Jacob #define MPI_RAID_ACTION_ASTATUS_INVALID_ACTION      (0x0001)
1599b631363SMatt Jacob #define MPI_RAID_ACTION_ASTATUS_FAILURE             (0x0002)
1609b631363SMatt Jacob #define MPI_RAID_ACTION_ASTATUS_IN_PROGRESS         (0x0003)
1619b631363SMatt Jacob 
1629b631363SMatt Jacob 
1639b631363SMatt Jacob /* RAID Volume reply RAID Volume Indicator structure */
1649b631363SMatt Jacob 
1659b631363SMatt Jacob typedef struct _MPI_RAID_VOL_INDICATOR
1669b631363SMatt Jacob {
1679b631363SMatt Jacob     U64                     TotalBlocks;        /* 00h */
1689b631363SMatt Jacob     U64                     BlocksRemaining;    /* 08h */
1699b631363SMatt Jacob } MPI_RAID_VOL_INDICATOR, MPI_POINTER PTR_MPI_RAID_VOL_INDICATOR,
1709b631363SMatt Jacob   MpiRaidVolIndicator_t, MPI_POINTER pMpiRaidVolIndicator_t;
1719b631363SMatt Jacob 
1729b631363SMatt Jacob 
1739b631363SMatt Jacob /****************************************************************************/
1749b631363SMatt Jacob /* SCSI IO RAID Passthrough Request                                         */
1759b631363SMatt Jacob /****************************************************************************/
1769b631363SMatt Jacob 
1779b631363SMatt Jacob typedef struct _MSG_SCSI_IO_RAID_PT_REQUEST
1789b631363SMatt Jacob {
1799b631363SMatt Jacob     U8                      PhysDiskNum;        /* 00h */
1809b631363SMatt Jacob     U8                      Reserved1;          /* 01h */
1819b631363SMatt Jacob     U8                      ChainOffset;        /* 02h */
1829b631363SMatt Jacob     U8                      Function;           /* 03h */
1839b631363SMatt Jacob     U8                      CDBLength;          /* 04h */
1849b631363SMatt Jacob     U8                      SenseBufferLength;  /* 05h */
1859b631363SMatt Jacob     U8                      Reserved2;          /* 06h */
1869b631363SMatt Jacob     U8                      MsgFlags;           /* 07h */
1879b631363SMatt Jacob     U32                     MsgContext;         /* 08h */
1889b631363SMatt Jacob     U8                      LUN[8];             /* 0Ch */
1899b631363SMatt Jacob     U32                     Control;            /* 14h */
1909b631363SMatt Jacob     U8                      CDB[16];            /* 18h */
1919b631363SMatt Jacob     U32                     DataLength;         /* 28h */
1929b631363SMatt Jacob     U32                     SenseBufferLowAddr; /* 2Ch */
1939b631363SMatt Jacob     SGE_IO_UNION            SGL;                /* 30h */
1949b631363SMatt Jacob } MSG_SCSI_IO_RAID_PT_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REQUEST,
1959b631363SMatt Jacob   SCSIIORaidPassthroughRequest_t, MPI_POINTER pSCSIIORaidPassthroughRequest_t;
1969b631363SMatt Jacob 
1979b631363SMatt Jacob 
1989b631363SMatt Jacob /* SCSI IO RAID Passthrough reply structure */
1999b631363SMatt Jacob 
2009b631363SMatt Jacob typedef struct _MSG_SCSI_IO_RAID_PT_REPLY
2019b631363SMatt Jacob {
2029b631363SMatt Jacob     U8                      PhysDiskNum;        /* 00h */
2039b631363SMatt Jacob     U8                      Reserved1;          /* 01h */
2049b631363SMatt Jacob     U8                      MsgLength;          /* 02h */
2059b631363SMatt Jacob     U8                      Function;           /* 03h */
2069b631363SMatt Jacob     U8                      CDBLength;          /* 04h */
2079b631363SMatt Jacob     U8                      SenseBufferLength;  /* 05h */
2089b631363SMatt Jacob     U8                      Reserved2;          /* 06h */
2099b631363SMatt Jacob     U8                      MsgFlags;           /* 07h */
2109b631363SMatt Jacob     U32                     MsgContext;         /* 08h */
2119b631363SMatt Jacob     U8                      SCSIStatus;         /* 0Ch */
2129b631363SMatt Jacob     U8                      SCSIState;          /* 0Dh */
2139b631363SMatt Jacob     U16                     IOCStatus;          /* 0Eh */
2149b631363SMatt Jacob     U32                     IOCLogInfo;         /* 10h */
2159b631363SMatt Jacob     U32                     TransferCount;      /* 14h */
2169b631363SMatt Jacob     U32                     SenseCount;         /* 18h */
2179b631363SMatt Jacob     U32                     ResponseInfo;       /* 1Ch */
2189b631363SMatt Jacob } MSG_SCSI_IO_RAID_PT_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REPLY,
2199b631363SMatt Jacob   SCSIIORaidPassthroughReply_t, MPI_POINTER pSCSIIORaidPassthroughReply_t;
2209b631363SMatt Jacob 
2219b631363SMatt Jacob 
2227fed69eeSMatt Jacob /****************************************************************************/
2237fed69eeSMatt Jacob /* Mailbox reqeust structure */
2247fed69eeSMatt Jacob /****************************************************************************/
2257fed69eeSMatt Jacob 
2267fed69eeSMatt Jacob typedef struct _MSG_MAILBOX_REQUEST
2277fed69eeSMatt Jacob {
2287fed69eeSMatt Jacob     U16                     Reserved1;
2297fed69eeSMatt Jacob     U8                      ChainOffset;
2307fed69eeSMatt Jacob     U8                      Function;
2317fed69eeSMatt Jacob     U16                     Reserved2;
2327fed69eeSMatt Jacob     U8                      Reserved3;
2337fed69eeSMatt Jacob     U8                      MsgFlags;
2347fed69eeSMatt Jacob     U32                     MsgContext;
2357fed69eeSMatt Jacob     U8                      Command[10];
2367fed69eeSMatt Jacob     U16                     Reserved4;
2377fed69eeSMatt Jacob     SGE_IO_UNION            SGL;
2387fed69eeSMatt Jacob } MSG_MAILBOX_REQUEST, MPI_POINTER PTR_MSG_MAILBOX_REQUEST,
2397fed69eeSMatt Jacob   MailboxRequest_t, MPI_POINTER pMailboxRequest_t;
2407fed69eeSMatt Jacob 
2417fed69eeSMatt Jacob 
2427fed69eeSMatt Jacob /* Mailbox reply structure */
2437fed69eeSMatt Jacob typedef struct _MSG_MAILBOX_REPLY
2447fed69eeSMatt Jacob {
2457fed69eeSMatt Jacob     U16                     Reserved1;          /* 00h */
2467fed69eeSMatt Jacob     U8                      MsgLength;          /* 02h */
2477fed69eeSMatt Jacob     U8                      Function;           /* 03h */
2487fed69eeSMatt Jacob     U16                     Reserved2;          /* 04h */
2497fed69eeSMatt Jacob     U8                      Reserved3;          /* 06h */
2507fed69eeSMatt Jacob     U8                      MsgFlags;           /* 07h */
2517fed69eeSMatt Jacob     U32                     MsgContext;         /* 08h */
2527fed69eeSMatt Jacob     U16                     MailboxStatus;      /* 0Ch */
2537fed69eeSMatt Jacob     U16                     IOCStatus;          /* 0Eh */
2547fed69eeSMatt Jacob     U32                     IOCLogInfo;         /* 10h */
2557fed69eeSMatt Jacob     U32                     Reserved4;          /* 14h */
2567fed69eeSMatt Jacob } MSG_MAILBOX_REPLY, MPI_POINTER PTR_MSG_MAILBOX_REPLY,
2577fed69eeSMatt Jacob   MailboxReply_t, MPI_POINTER pMailboxReply_t;
2587fed69eeSMatt Jacob 
2599b631363SMatt Jacob #endif
2609b631363SMatt Jacob 
2619b631363SMatt Jacob 
2629b631363SMatt Jacob 
263