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 * 339de3c85cSMatt Jacob * Name: mpi_raid.h 349b631363SMatt Jacob * Title: MPI RAID message and structures 359b631363SMatt Jacob * Creation Date: February 27, 2001 369b631363SMatt Jacob * 379de3c85cSMatt Jacob * mpi_raid.h Version: 01.05.02 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. 599de3c85cSMatt Jacob * 05-11-04 01.03.01 Original release for MPI v1.3. 609de3c85cSMatt Jacob * 08-19-04 01.05.01 Original release for MPI v1.5. 619de3c85cSMatt Jacob * 01-15-05 01.05.02 Added defines for the two new RAID Actions for 629de3c85cSMatt Jacob * _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE. 639b631363SMatt Jacob * -------------------------------------------------------------------------- 649b631363SMatt Jacob */ 659b631363SMatt Jacob 669b631363SMatt Jacob #ifndef MPI_RAID_H 679b631363SMatt Jacob #define MPI_RAID_H 689b631363SMatt Jacob 699b631363SMatt Jacob 709b631363SMatt Jacob /****************************************************************************** 719b631363SMatt Jacob * 729b631363SMatt Jacob * R A I D M e s s a g e s 739b631363SMatt Jacob * 749b631363SMatt Jacob *******************************************************************************/ 759b631363SMatt Jacob 769b631363SMatt Jacob 779b631363SMatt Jacob /****************************************************************************/ 789de3c85cSMatt Jacob /* RAID Action Request */ 799b631363SMatt Jacob /****************************************************************************/ 809b631363SMatt Jacob 819b631363SMatt Jacob typedef struct _MSG_RAID_ACTION 829b631363SMatt Jacob { 839b631363SMatt Jacob U8 Action; /* 00h */ 849b631363SMatt Jacob U8 Reserved1; /* 01h */ 859b631363SMatt Jacob U8 ChainOffset; /* 02h */ 869b631363SMatt Jacob U8 Function; /* 03h */ 879b631363SMatt Jacob U8 VolumeID; /* 04h */ 889b631363SMatt Jacob U8 VolumeBus; /* 05h */ 899b631363SMatt Jacob U8 PhysDiskNum; /* 06h */ 909b631363SMatt Jacob U8 MsgFlags; /* 07h */ 919b631363SMatt Jacob U32 MsgContext; /* 08h */ 929b631363SMatt Jacob U32 Reserved2; /* 0Ch */ 939b631363SMatt Jacob U32 ActionDataWord; /* 10h */ 949b631363SMatt Jacob SGE_SIMPLE_UNION ActionDataSGE; /* 14h */ 959b631363SMatt Jacob } MSG_RAID_ACTION_REQUEST, MPI_POINTER PTR_MSG_RAID_ACTION_REQUEST, 969b631363SMatt Jacob MpiRaidActionRequest_t , MPI_POINTER pMpiRaidActionRequest_t; 979b631363SMatt Jacob 989b631363SMatt Jacob 999b631363SMatt Jacob /* RAID Action request Action values */ 1009b631363SMatt Jacob 1019b631363SMatt Jacob #define MPI_RAID_ACTION_STATUS (0x00) 1029b631363SMatt Jacob #define MPI_RAID_ACTION_INDICATOR_STRUCT (0x01) 1039b631363SMatt Jacob #define MPI_RAID_ACTION_CREATE_VOLUME (0x02) 1049b631363SMatt Jacob #define MPI_RAID_ACTION_DELETE_VOLUME (0x03) 1059b631363SMatt Jacob #define MPI_RAID_ACTION_DISABLE_VOLUME (0x04) 1069b631363SMatt Jacob #define MPI_RAID_ACTION_ENABLE_VOLUME (0x05) 1079b631363SMatt Jacob #define MPI_RAID_ACTION_QUIESCE_PHYS_IO (0x06) 1089b631363SMatt Jacob #define MPI_RAID_ACTION_ENABLE_PHYS_IO (0x07) 1099b631363SMatt Jacob #define MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS (0x08) 1109b631363SMatt Jacob #define MPI_RAID_ACTION_PHYSDISK_OFFLINE (0x0A) 1119b631363SMatt Jacob #define MPI_RAID_ACTION_PHYSDISK_ONLINE (0x0B) 1129b631363SMatt Jacob #define MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS (0x0C) 1139b631363SMatt Jacob #define MPI_RAID_ACTION_CREATE_PHYSDISK (0x0D) 1149b631363SMatt Jacob #define MPI_RAID_ACTION_DELETE_PHYSDISK (0x0E) 1159b631363SMatt Jacob #define MPI_RAID_ACTION_FAIL_PHYSDISK (0x0F) 1169b631363SMatt Jacob #define MPI_RAID_ACTION_REPLACE_PHYSDISK (0x10) 1177fed69eeSMatt Jacob #define MPI_RAID_ACTION_ACTIVATE_VOLUME (0x11) 1187fed69eeSMatt Jacob #define MPI_RAID_ACTION_INACTIVATE_VOLUME (0x12) 119b0a2fdeeSScott Long #define MPI_RAID_ACTION_SET_RESYNC_RATE (0x13) 120b0a2fdeeSScott Long #define MPI_RAID_ACTION_SET_DATA_SCRUB_RATE (0x14) 1219b631363SMatt Jacob 1229b631363SMatt Jacob /* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */ 1239b631363SMatt Jacob #define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC (0x00000001) 1247fed69eeSMatt Jacob #define MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT (0x00000002) 1259b631363SMatt Jacob 1269b631363SMatt Jacob /* ActionDataWord defines for use with MPI_RAID_ACTION_DELETE_VOLUME action */ 1279b631363SMatt Jacob #define MPI_RAID_ACTION_ADATA_KEEP_PHYS_DISKS (0x00000000) 1289b631363SMatt Jacob #define MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS (0x00000001) 1299b631363SMatt Jacob 1307fed69eeSMatt Jacob #define MPI_RAID_ACTION_ADATA_KEEP_LBA0 (0x00000000) 1317fed69eeSMatt Jacob #define MPI_RAID_ACTION_ADATA_ZERO_LBA0 (0x00000002) 1327fed69eeSMatt Jacob 1337fed69eeSMatt Jacob /* ActionDataWord defines for use with MPI_RAID_ACTION_ACTIVATE_VOLUME action */ 1347fed69eeSMatt Jacob #define MPI_RAID_ACTION_ADATA_INACTIVATE_ALL (0x00000001) 1357fed69eeSMatt Jacob 1369de3c85cSMatt Jacob /* ActionDataWord defines for use with MPI_RAID_ACTION_SET_RESYNC_RATE action */ 1379de3c85cSMatt Jacob #define MPI_RAID_ACTION_ADATA_RESYNC_RATE_MASK (0x000000FF) 1389de3c85cSMatt Jacob 1399de3c85cSMatt Jacob /* ActionDataWord defines for use with MPI_RAID_ACTION_SET_DATA_SCRUB_RATE action */ 1409de3c85cSMatt Jacob #define MPI_RAID_ACTION_ADATA_DATA_SCRUB_RATE_MASK (0x000000FF) 1419de3c85cSMatt Jacob 1429de3c85cSMatt Jacob 1439b631363SMatt Jacob 1449b631363SMatt Jacob /* RAID Action reply message */ 1459b631363SMatt Jacob 1469b631363SMatt Jacob typedef struct _MSG_RAID_ACTION_REPLY 1479b631363SMatt Jacob { 1489b631363SMatt Jacob U8 Action; /* 00h */ 1499b631363SMatt Jacob U8 Reserved; /* 01h */ 1509b631363SMatt Jacob U8 MsgLength; /* 02h */ 1519b631363SMatt Jacob U8 Function; /* 03h */ 1529b631363SMatt Jacob U8 VolumeID; /* 04h */ 1539b631363SMatt Jacob U8 VolumeBus; /* 05h */ 1549b631363SMatt Jacob U8 PhysDiskNum; /* 06h */ 1559b631363SMatt Jacob U8 MsgFlags; /* 07h */ 1569b631363SMatt Jacob U32 MsgContext; /* 08h */ 1579b631363SMatt Jacob U16 ActionStatus; /* 0Ch */ 1589b631363SMatt Jacob U16 IOCStatus; /* 0Eh */ 1599b631363SMatt Jacob U32 IOCLogInfo; /* 10h */ 1609b631363SMatt Jacob U32 VolumeStatus; /* 14h */ 1619b631363SMatt Jacob U32 ActionData; /* 18h */ 1629b631363SMatt Jacob } MSG_RAID_ACTION_REPLY, MPI_POINTER PTR_MSG_RAID_ACTION_REPLY, 1639b631363SMatt Jacob MpiRaidActionReply_t, MPI_POINTER pMpiRaidActionReply_t; 1649b631363SMatt Jacob 1659b631363SMatt Jacob 1669b631363SMatt Jacob /* RAID Volume reply ActionStatus values */ 1679b631363SMatt Jacob 1689b631363SMatt Jacob #define MPI_RAID_ACTION_ASTATUS_SUCCESS (0x0000) 1699b631363SMatt Jacob #define MPI_RAID_ACTION_ASTATUS_INVALID_ACTION (0x0001) 1709b631363SMatt Jacob #define MPI_RAID_ACTION_ASTATUS_FAILURE (0x0002) 1719b631363SMatt Jacob #define MPI_RAID_ACTION_ASTATUS_IN_PROGRESS (0x0003) 1729b631363SMatt Jacob 1739b631363SMatt Jacob 1749b631363SMatt Jacob /* RAID Volume reply RAID Volume Indicator structure */ 1759b631363SMatt Jacob 1769b631363SMatt Jacob typedef struct _MPI_RAID_VOL_INDICATOR 1779b631363SMatt Jacob { 1789b631363SMatt Jacob U64 TotalBlocks; /* 00h */ 1799b631363SMatt Jacob U64 BlocksRemaining; /* 08h */ 1809b631363SMatt Jacob } MPI_RAID_VOL_INDICATOR, MPI_POINTER PTR_MPI_RAID_VOL_INDICATOR, 1819b631363SMatt Jacob MpiRaidVolIndicator_t, MPI_POINTER pMpiRaidVolIndicator_t; 1829b631363SMatt Jacob 1839b631363SMatt Jacob 1849b631363SMatt Jacob /****************************************************************************/ 1859b631363SMatt Jacob /* SCSI IO RAID Passthrough Request */ 1869b631363SMatt Jacob /****************************************************************************/ 1879b631363SMatt Jacob 1889b631363SMatt Jacob typedef struct _MSG_SCSI_IO_RAID_PT_REQUEST 1899b631363SMatt Jacob { 1909b631363SMatt Jacob U8 PhysDiskNum; /* 00h */ 1919b631363SMatt Jacob U8 Reserved1; /* 01h */ 1929b631363SMatt Jacob U8 ChainOffset; /* 02h */ 1939b631363SMatt Jacob U8 Function; /* 03h */ 1949b631363SMatt Jacob U8 CDBLength; /* 04h */ 1959b631363SMatt Jacob U8 SenseBufferLength; /* 05h */ 1969b631363SMatt Jacob U8 Reserved2; /* 06h */ 1979b631363SMatt Jacob U8 MsgFlags; /* 07h */ 1989b631363SMatt Jacob U32 MsgContext; /* 08h */ 1999b631363SMatt Jacob U8 LUN[8]; /* 0Ch */ 2009b631363SMatt Jacob U32 Control; /* 14h */ 2019b631363SMatt Jacob U8 CDB[16]; /* 18h */ 2029b631363SMatt Jacob U32 DataLength; /* 28h */ 2039b631363SMatt Jacob U32 SenseBufferLowAddr; /* 2Ch */ 2049b631363SMatt Jacob SGE_IO_UNION SGL; /* 30h */ 2059b631363SMatt Jacob } MSG_SCSI_IO_RAID_PT_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REQUEST, 2069b631363SMatt Jacob SCSIIORaidPassthroughRequest_t, MPI_POINTER pSCSIIORaidPassthroughRequest_t; 2079b631363SMatt Jacob 2089b631363SMatt Jacob 2099b631363SMatt Jacob /* SCSI IO RAID Passthrough reply structure */ 2109b631363SMatt Jacob 2119b631363SMatt Jacob typedef struct _MSG_SCSI_IO_RAID_PT_REPLY 2129b631363SMatt Jacob { 2139b631363SMatt Jacob U8 PhysDiskNum; /* 00h */ 2149b631363SMatt Jacob U8 Reserved1; /* 01h */ 2159b631363SMatt Jacob U8 MsgLength; /* 02h */ 2169b631363SMatt Jacob U8 Function; /* 03h */ 2179b631363SMatt Jacob U8 CDBLength; /* 04h */ 2189b631363SMatt Jacob U8 SenseBufferLength; /* 05h */ 2199b631363SMatt Jacob U8 Reserved2; /* 06h */ 2209b631363SMatt Jacob U8 MsgFlags; /* 07h */ 2219b631363SMatt Jacob U32 MsgContext; /* 08h */ 2229b631363SMatt Jacob U8 SCSIStatus; /* 0Ch */ 2239b631363SMatt Jacob U8 SCSIState; /* 0Dh */ 2249b631363SMatt Jacob U16 IOCStatus; /* 0Eh */ 2259b631363SMatt Jacob U32 IOCLogInfo; /* 10h */ 2269b631363SMatt Jacob U32 TransferCount; /* 14h */ 2279b631363SMatt Jacob U32 SenseCount; /* 18h */ 2289b631363SMatt Jacob U32 ResponseInfo; /* 1Ch */ 2299b631363SMatt Jacob } MSG_SCSI_IO_RAID_PT_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REPLY, 2309b631363SMatt Jacob SCSIIORaidPassthroughReply_t, MPI_POINTER pSCSIIORaidPassthroughReply_t; 2319b631363SMatt Jacob 2329b631363SMatt Jacob 2337fed69eeSMatt Jacob /****************************************************************************/ 2347fed69eeSMatt Jacob /* Mailbox reqeust structure */ 2357fed69eeSMatt Jacob /****************************************************************************/ 2367fed69eeSMatt Jacob 2377fed69eeSMatt Jacob typedef struct _MSG_MAILBOX_REQUEST 2387fed69eeSMatt Jacob { 2397fed69eeSMatt Jacob U16 Reserved1; 2407fed69eeSMatt Jacob U8 ChainOffset; 2417fed69eeSMatt Jacob U8 Function; 2427fed69eeSMatt Jacob U16 Reserved2; 2437fed69eeSMatt Jacob U8 Reserved3; 2447fed69eeSMatt Jacob U8 MsgFlags; 2457fed69eeSMatt Jacob U32 MsgContext; 2467fed69eeSMatt Jacob U8 Command[10]; 2477fed69eeSMatt Jacob U16 Reserved4; 2487fed69eeSMatt Jacob SGE_IO_UNION SGL; 2497fed69eeSMatt Jacob } MSG_MAILBOX_REQUEST, MPI_POINTER PTR_MSG_MAILBOX_REQUEST, 2507fed69eeSMatt Jacob MailboxRequest_t, MPI_POINTER pMailboxRequest_t; 2517fed69eeSMatt Jacob 2527fed69eeSMatt Jacob 2537fed69eeSMatt Jacob /* Mailbox reply structure */ 2547fed69eeSMatt Jacob typedef struct _MSG_MAILBOX_REPLY 2557fed69eeSMatt Jacob { 2567fed69eeSMatt Jacob U16 Reserved1; /* 00h */ 2577fed69eeSMatt Jacob U8 MsgLength; /* 02h */ 2587fed69eeSMatt Jacob U8 Function; /* 03h */ 2597fed69eeSMatt Jacob U16 Reserved2; /* 04h */ 2607fed69eeSMatt Jacob U8 Reserved3; /* 06h */ 2617fed69eeSMatt Jacob U8 MsgFlags; /* 07h */ 2627fed69eeSMatt Jacob U32 MsgContext; /* 08h */ 2637fed69eeSMatt Jacob U16 MailboxStatus; /* 0Ch */ 2647fed69eeSMatt Jacob U16 IOCStatus; /* 0Eh */ 2657fed69eeSMatt Jacob U32 IOCLogInfo; /* 10h */ 2667fed69eeSMatt Jacob U32 Reserved4; /* 14h */ 2677fed69eeSMatt Jacob } MSG_MAILBOX_REPLY, MPI_POINTER PTR_MSG_MAILBOX_REPLY, 2687fed69eeSMatt Jacob MailboxReply_t, MPI_POINTER pMailboxReply_t; 2697fed69eeSMatt Jacob 2709b631363SMatt Jacob #endif 2719b631363SMatt Jacob 2729b631363SMatt Jacob 2739b631363SMatt Jacob 274