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 * 329de3c85cSMatt Jacob * Name: mpi_raid.h 339b631363SMatt Jacob * Title: MPI RAID message and structures 349b631363SMatt Jacob * Creation Date: February 27, 2001 359b631363SMatt Jacob * 3662ae194dSScott Long * mpi_raid.h Version: 01.05.03 379b631363SMatt Jacob * 389b631363SMatt Jacob * Version History 399b631363SMatt Jacob * --------------- 409b631363SMatt Jacob * 419b631363SMatt Jacob * Date Version Description 429b631363SMatt Jacob * -------- -------- ------------------------------------------------------ 439b631363SMatt Jacob * 02-27-01 01.01.01 Original release for this file. 449b631363SMatt Jacob * 03-27-01 01.01.02 Added structure offset comments. 459b631363SMatt Jacob * 08-08-01 01.02.01 Original release for v1.2 work. 469b631363SMatt Jacob * 09-28-01 01.02.02 Major rework for MPI v1.2 Integrated RAID changes. 479b631363SMatt Jacob * 10-04-01 01.02.03 Added ActionData defines for 489b631363SMatt Jacob * MPI_RAID_ACTION_DELETE_VOLUME action. 499b631363SMatt Jacob * 11-01-01 01.02.04 Added define for MPI_RAID_ACTION_ADATA_DO_NOT_SYNC. 507fed69eeSMatt Jacob * 03-14-02 01.02.05 Added define for MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT. 517fed69eeSMatt Jacob * 05-07-02 01.02.06 Added define for MPI_RAID_ACTION_ACTIVATE_VOLUME, 527fed69eeSMatt Jacob * MPI_RAID_ACTION_INACTIVATE_VOLUME, and 537fed69eeSMatt Jacob * MPI_RAID_ACTION_ADATA_INACTIVATE_ALL. 547fed69eeSMatt Jacob * 07-12-02 01.02.07 Added structures for Mailbox request and reply. 557fed69eeSMatt Jacob * 11-15-02 01.02.08 Added missing MsgContext field to MSG_MAILBOX_REQUEST. 567fed69eeSMatt Jacob * 04-01-03 01.02.09 New action data option flag for 577fed69eeSMatt Jacob * MPI_RAID_ACTION_DELETE_VOLUME. 589de3c85cSMatt Jacob * 05-11-04 01.03.01 Original release for MPI v1.3. 599de3c85cSMatt Jacob * 08-19-04 01.05.01 Original release for MPI v1.5. 609de3c85cSMatt Jacob * 01-15-05 01.05.02 Added defines for the two new RAID Actions for 619de3c85cSMatt Jacob * _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE. 6262ae194dSScott Long * 02-28-07 01.05.03 Added new RAID Action, Device FW Update Mode, and 6362ae194dSScott Long * associated defines. 649b631363SMatt Jacob * -------------------------------------------------------------------------- 659b631363SMatt Jacob */ 669b631363SMatt Jacob 679b631363SMatt Jacob #ifndef MPI_RAID_H 689b631363SMatt Jacob #define MPI_RAID_H 699b631363SMatt Jacob 709b631363SMatt Jacob 719b631363SMatt Jacob /****************************************************************************** 729b631363SMatt Jacob * 739b631363SMatt Jacob * R A I D M e s s a g e s 749b631363SMatt Jacob * 759b631363SMatt Jacob *******************************************************************************/ 769b631363SMatt Jacob 779b631363SMatt Jacob 789b631363SMatt Jacob /****************************************************************************/ 799de3c85cSMatt Jacob /* RAID Action Request */ 809b631363SMatt Jacob /****************************************************************************/ 819b631363SMatt Jacob 829b631363SMatt Jacob typedef struct _MSG_RAID_ACTION 839b631363SMatt Jacob { 849b631363SMatt Jacob U8 Action; /* 00h */ 859b631363SMatt Jacob U8 Reserved1; /* 01h */ 869b631363SMatt Jacob U8 ChainOffset; /* 02h */ 879b631363SMatt Jacob U8 Function; /* 03h */ 889b631363SMatt Jacob U8 VolumeID; /* 04h */ 899b631363SMatt Jacob U8 VolumeBus; /* 05h */ 909b631363SMatt Jacob U8 PhysDiskNum; /* 06h */ 919b631363SMatt Jacob U8 MsgFlags; /* 07h */ 929b631363SMatt Jacob U32 MsgContext; /* 08h */ 939b631363SMatt Jacob U32 Reserved2; /* 0Ch */ 949b631363SMatt Jacob U32 ActionDataWord; /* 10h */ 959b631363SMatt Jacob SGE_SIMPLE_UNION ActionDataSGE; /* 14h */ 969b631363SMatt Jacob } MSG_RAID_ACTION_REQUEST, MPI_POINTER PTR_MSG_RAID_ACTION_REQUEST, 979b631363SMatt Jacob MpiRaidActionRequest_t , MPI_POINTER pMpiRaidActionRequest_t; 989b631363SMatt Jacob 999b631363SMatt Jacob 1009b631363SMatt Jacob /* RAID Action request Action values */ 1019b631363SMatt Jacob 1029b631363SMatt Jacob #define MPI_RAID_ACTION_STATUS (0x00) 1039b631363SMatt Jacob #define MPI_RAID_ACTION_INDICATOR_STRUCT (0x01) 1049b631363SMatt Jacob #define MPI_RAID_ACTION_CREATE_VOLUME (0x02) 1059b631363SMatt Jacob #define MPI_RAID_ACTION_DELETE_VOLUME (0x03) 1069b631363SMatt Jacob #define MPI_RAID_ACTION_DISABLE_VOLUME (0x04) 1079b631363SMatt Jacob #define MPI_RAID_ACTION_ENABLE_VOLUME (0x05) 1089b631363SMatt Jacob #define MPI_RAID_ACTION_QUIESCE_PHYS_IO (0x06) 1099b631363SMatt Jacob #define MPI_RAID_ACTION_ENABLE_PHYS_IO (0x07) 1109b631363SMatt Jacob #define MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS (0x08) 1119b631363SMatt Jacob #define MPI_RAID_ACTION_PHYSDISK_OFFLINE (0x0A) 1129b631363SMatt Jacob #define MPI_RAID_ACTION_PHYSDISK_ONLINE (0x0B) 1139b631363SMatt Jacob #define MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS (0x0C) 1149b631363SMatt Jacob #define MPI_RAID_ACTION_CREATE_PHYSDISK (0x0D) 1159b631363SMatt Jacob #define MPI_RAID_ACTION_DELETE_PHYSDISK (0x0E) 1169b631363SMatt Jacob #define MPI_RAID_ACTION_FAIL_PHYSDISK (0x0F) 1179b631363SMatt Jacob #define MPI_RAID_ACTION_REPLACE_PHYSDISK (0x10) 1187fed69eeSMatt Jacob #define MPI_RAID_ACTION_ACTIVATE_VOLUME (0x11) 1197fed69eeSMatt Jacob #define MPI_RAID_ACTION_INACTIVATE_VOLUME (0x12) 120b0a2fdeeSScott Long #define MPI_RAID_ACTION_SET_RESYNC_RATE (0x13) 121b0a2fdeeSScott Long #define MPI_RAID_ACTION_SET_DATA_SCRUB_RATE (0x14) 12262ae194dSScott Long #define MPI_RAID_ACTION_DEVICE_FW_UPDATE_MODE (0x15) 1239b631363SMatt Jacob 1249b631363SMatt Jacob /* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */ 1259b631363SMatt Jacob #define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC (0x00000001) 1267fed69eeSMatt Jacob #define MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT (0x00000002) 1279b631363SMatt Jacob 1289b631363SMatt Jacob /* ActionDataWord defines for use with MPI_RAID_ACTION_DELETE_VOLUME action */ 1299b631363SMatt Jacob #define MPI_RAID_ACTION_ADATA_KEEP_PHYS_DISKS (0x00000000) 1309b631363SMatt Jacob #define MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS (0x00000001) 1319b631363SMatt Jacob 1327fed69eeSMatt Jacob #define MPI_RAID_ACTION_ADATA_KEEP_LBA0 (0x00000000) 1337fed69eeSMatt Jacob #define MPI_RAID_ACTION_ADATA_ZERO_LBA0 (0x00000002) 1347fed69eeSMatt Jacob 1357fed69eeSMatt Jacob /* ActionDataWord defines for use with MPI_RAID_ACTION_ACTIVATE_VOLUME action */ 1367fed69eeSMatt Jacob #define MPI_RAID_ACTION_ADATA_INACTIVATE_ALL (0x00000001) 1377fed69eeSMatt Jacob 1389de3c85cSMatt Jacob /* ActionDataWord defines for use with MPI_RAID_ACTION_SET_RESYNC_RATE action */ 1399de3c85cSMatt Jacob #define MPI_RAID_ACTION_ADATA_RESYNC_RATE_MASK (0x000000FF) 1409de3c85cSMatt Jacob 1419de3c85cSMatt Jacob /* ActionDataWord defines for use with MPI_RAID_ACTION_SET_DATA_SCRUB_RATE action */ 1429de3c85cSMatt Jacob #define MPI_RAID_ACTION_ADATA_DATA_SCRUB_RATE_MASK (0x000000FF) 1439de3c85cSMatt Jacob 14462ae194dSScott Long /* ActionDataWord defines for use with MPI_RAID_ACTION_DEVICE_FW_UPDATE_MODE action */ 14562ae194dSScott Long #define MPI_RAID_ACTION_ADATA_ENABLE_FW_UPDATE (0x00000001) 14662ae194dSScott Long #define MPI_RAID_ACTION_ADATA_MASK_FW_UPDATE_TIMEOUT (0x0000FF00) 14762ae194dSScott Long #define MPI_RAID_ACTION_ADATA_SHIFT_FW_UPDATE_TIMEOUT (8) 1489de3c85cSMatt Jacob 1499b631363SMatt Jacob 1509b631363SMatt Jacob /* RAID Action reply message */ 1519b631363SMatt Jacob 1529b631363SMatt Jacob typedef struct _MSG_RAID_ACTION_REPLY 1539b631363SMatt Jacob { 1549b631363SMatt Jacob U8 Action; /* 00h */ 1559b631363SMatt Jacob U8 Reserved; /* 01h */ 1569b631363SMatt Jacob U8 MsgLength; /* 02h */ 1579b631363SMatt Jacob U8 Function; /* 03h */ 1589b631363SMatt Jacob U8 VolumeID; /* 04h */ 1599b631363SMatt Jacob U8 VolumeBus; /* 05h */ 1609b631363SMatt Jacob U8 PhysDiskNum; /* 06h */ 1619b631363SMatt Jacob U8 MsgFlags; /* 07h */ 1629b631363SMatt Jacob U32 MsgContext; /* 08h */ 1639b631363SMatt Jacob U16 ActionStatus; /* 0Ch */ 1649b631363SMatt Jacob U16 IOCStatus; /* 0Eh */ 1659b631363SMatt Jacob U32 IOCLogInfo; /* 10h */ 1669b631363SMatt Jacob U32 VolumeStatus; /* 14h */ 1679b631363SMatt Jacob U32 ActionData; /* 18h */ 1689b631363SMatt Jacob } MSG_RAID_ACTION_REPLY, MPI_POINTER PTR_MSG_RAID_ACTION_REPLY, 1699b631363SMatt Jacob MpiRaidActionReply_t, MPI_POINTER pMpiRaidActionReply_t; 1709b631363SMatt Jacob 1719b631363SMatt Jacob 1729b631363SMatt Jacob /* RAID Volume reply ActionStatus values */ 1739b631363SMatt Jacob 1749b631363SMatt Jacob #define MPI_RAID_ACTION_ASTATUS_SUCCESS (0x0000) 1759b631363SMatt Jacob #define MPI_RAID_ACTION_ASTATUS_INVALID_ACTION (0x0001) 1769b631363SMatt Jacob #define MPI_RAID_ACTION_ASTATUS_FAILURE (0x0002) 1779b631363SMatt Jacob #define MPI_RAID_ACTION_ASTATUS_IN_PROGRESS (0x0003) 1789b631363SMatt Jacob 1799b631363SMatt Jacob 1809b631363SMatt Jacob /* RAID Volume reply RAID Volume Indicator structure */ 1819b631363SMatt Jacob 1829b631363SMatt Jacob typedef struct _MPI_RAID_VOL_INDICATOR 1839b631363SMatt Jacob { 1849b631363SMatt Jacob U64 TotalBlocks; /* 00h */ 1859b631363SMatt Jacob U64 BlocksRemaining; /* 08h */ 1869b631363SMatt Jacob } MPI_RAID_VOL_INDICATOR, MPI_POINTER PTR_MPI_RAID_VOL_INDICATOR, 1879b631363SMatt Jacob MpiRaidVolIndicator_t, MPI_POINTER pMpiRaidVolIndicator_t; 1889b631363SMatt Jacob 1899b631363SMatt Jacob 1909b631363SMatt Jacob /****************************************************************************/ 1919b631363SMatt Jacob /* SCSI IO RAID Passthrough Request */ 1929b631363SMatt Jacob /****************************************************************************/ 1939b631363SMatt Jacob 1949b631363SMatt Jacob typedef struct _MSG_SCSI_IO_RAID_PT_REQUEST 1959b631363SMatt Jacob { 1969b631363SMatt Jacob U8 PhysDiskNum; /* 00h */ 1979b631363SMatt Jacob U8 Reserved1; /* 01h */ 1989b631363SMatt Jacob U8 ChainOffset; /* 02h */ 1999b631363SMatt Jacob U8 Function; /* 03h */ 2009b631363SMatt Jacob U8 CDBLength; /* 04h */ 2019b631363SMatt Jacob U8 SenseBufferLength; /* 05h */ 2029b631363SMatt Jacob U8 Reserved2; /* 06h */ 2039b631363SMatt Jacob U8 MsgFlags; /* 07h */ 2049b631363SMatt Jacob U32 MsgContext; /* 08h */ 2059b631363SMatt Jacob U8 LUN[8]; /* 0Ch */ 2069b631363SMatt Jacob U32 Control; /* 14h */ 2079b631363SMatt Jacob U8 CDB[16]; /* 18h */ 2089b631363SMatt Jacob U32 DataLength; /* 28h */ 2099b631363SMatt Jacob U32 SenseBufferLowAddr; /* 2Ch */ 2109b631363SMatt Jacob SGE_IO_UNION SGL; /* 30h */ 2119b631363SMatt Jacob } MSG_SCSI_IO_RAID_PT_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REQUEST, 2129b631363SMatt Jacob SCSIIORaidPassthroughRequest_t, MPI_POINTER pSCSIIORaidPassthroughRequest_t; 2139b631363SMatt Jacob 2149b631363SMatt Jacob 2159b631363SMatt Jacob /* SCSI IO RAID Passthrough reply structure */ 2169b631363SMatt Jacob 2179b631363SMatt Jacob typedef struct _MSG_SCSI_IO_RAID_PT_REPLY 2189b631363SMatt Jacob { 2199b631363SMatt Jacob U8 PhysDiskNum; /* 00h */ 2209b631363SMatt Jacob U8 Reserved1; /* 01h */ 2219b631363SMatt Jacob U8 MsgLength; /* 02h */ 2229b631363SMatt Jacob U8 Function; /* 03h */ 2239b631363SMatt Jacob U8 CDBLength; /* 04h */ 2249b631363SMatt Jacob U8 SenseBufferLength; /* 05h */ 2259b631363SMatt Jacob U8 Reserved2; /* 06h */ 2269b631363SMatt Jacob U8 MsgFlags; /* 07h */ 2279b631363SMatt Jacob U32 MsgContext; /* 08h */ 2289b631363SMatt Jacob U8 SCSIStatus; /* 0Ch */ 2299b631363SMatt Jacob U8 SCSIState; /* 0Dh */ 2309b631363SMatt Jacob U16 IOCStatus; /* 0Eh */ 2319b631363SMatt Jacob U32 IOCLogInfo; /* 10h */ 2329b631363SMatt Jacob U32 TransferCount; /* 14h */ 2339b631363SMatt Jacob U32 SenseCount; /* 18h */ 2349b631363SMatt Jacob U32 ResponseInfo; /* 1Ch */ 2359b631363SMatt Jacob } MSG_SCSI_IO_RAID_PT_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REPLY, 2369b631363SMatt Jacob SCSIIORaidPassthroughReply_t, MPI_POINTER pSCSIIORaidPassthroughReply_t; 2379b631363SMatt Jacob 2389b631363SMatt Jacob 2397fed69eeSMatt Jacob /****************************************************************************/ 2407fed69eeSMatt Jacob /* Mailbox reqeust structure */ 2417fed69eeSMatt Jacob /****************************************************************************/ 2427fed69eeSMatt Jacob 2437fed69eeSMatt Jacob typedef struct _MSG_MAILBOX_REQUEST 2447fed69eeSMatt Jacob { 2457fed69eeSMatt Jacob U16 Reserved1; 2467fed69eeSMatt Jacob U8 ChainOffset; 2477fed69eeSMatt Jacob U8 Function; 2487fed69eeSMatt Jacob U16 Reserved2; 2497fed69eeSMatt Jacob U8 Reserved3; 2507fed69eeSMatt Jacob U8 MsgFlags; 2517fed69eeSMatt Jacob U32 MsgContext; 2527fed69eeSMatt Jacob U8 Command[10]; 2537fed69eeSMatt Jacob U16 Reserved4; 2547fed69eeSMatt Jacob SGE_IO_UNION SGL; 2557fed69eeSMatt Jacob } MSG_MAILBOX_REQUEST, MPI_POINTER PTR_MSG_MAILBOX_REQUEST, 2567fed69eeSMatt Jacob MailboxRequest_t, MPI_POINTER pMailboxRequest_t; 2577fed69eeSMatt Jacob 2587fed69eeSMatt Jacob 2597fed69eeSMatt Jacob /* Mailbox reply structure */ 2607fed69eeSMatt Jacob typedef struct _MSG_MAILBOX_REPLY 2617fed69eeSMatt Jacob { 2627fed69eeSMatt Jacob U16 Reserved1; /* 00h */ 2637fed69eeSMatt Jacob U8 MsgLength; /* 02h */ 2647fed69eeSMatt Jacob U8 Function; /* 03h */ 2657fed69eeSMatt Jacob U16 Reserved2; /* 04h */ 2667fed69eeSMatt Jacob U8 Reserved3; /* 06h */ 2677fed69eeSMatt Jacob U8 MsgFlags; /* 07h */ 2687fed69eeSMatt Jacob U32 MsgContext; /* 08h */ 2697fed69eeSMatt Jacob U16 MailboxStatus; /* 0Ch */ 2707fed69eeSMatt Jacob U16 IOCStatus; /* 0Eh */ 2717fed69eeSMatt Jacob U32 IOCLogInfo; /* 10h */ 2727fed69eeSMatt Jacob U32 Reserved4; /* 14h */ 2737fed69eeSMatt Jacob } MSG_MAILBOX_REPLY, MPI_POINTER PTR_MSG_MAILBOX_REPLY, 2747fed69eeSMatt Jacob MailboxReply_t, MPI_POINTER pMailboxReply_t; 2757fed69eeSMatt Jacob 2769b631363SMatt Jacob #endif 2779b631363SMatt Jacob 2789b631363SMatt Jacob 2799b631363SMatt Jacob 280