1 /* $FreeBSD: src/sys/dev/mpt/mpilib/mpi_raid.h,v 1.1.2.2 2002/09/01 23:08:06 mjacob Exp $ */
3 * Copyright (c) 2000, 2001 by LSI Logic Corporation
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice immediately at the beginning of the file, without modification,
10 * this list of conditions, and the following disclaimer.
11 * 2. The name of the author may not be used to endorse or promote products
12 * derived from this software without specific prior written permission.
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
18 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 * Title: MPI RAID message and structures
29 * Creation Date: February 27, 2001
31 * MPI Version: 01.02.04
36 * Date Version Description
37 * -------- -------- ------------------------------------------------------
38 * 02-27-01 01.01.01 Original release for this file.
39 * 03-27-01 01.01.02 Added structure offset comments.
40 * 08-08-01 01.02.01 Original release for v1.2 work.
41 * 09-28-01 01.02.02 Major rework for MPI v1.2 Integrated RAID changes.
42 * 10-04-01 01.02.03 Added ActionData defines for
43 * MPI_RAID_ACTION_DELETE_VOLUME action.
44 * 11-01-01 01.02.04 Added define for MPI_RAID_ACTION_ADATA_DO_NOT_SYNC.
45 * --------------------------------------------------------------------------
52 /******************************************************************************
54 * R A I D M e s s a g e s
56 *******************************************************************************/
59 /****************************************************************************/
60 /* RAID Volume Request */
61 /****************************************************************************/
63 typedef struct _MSG_RAID_ACTION
66 U8 Reserved1; /* 01h */
67 U8 ChainOffset; /* 02h */
68 U8 Function; /* 03h */
69 U8 VolumeID; /* 04h */
70 U8 VolumeBus; /* 05h */
71 U8 PhysDiskNum; /* 06h */
72 U8 MsgFlags; /* 07h */
73 U32 MsgContext; /* 08h */
74 U32 Reserved2; /* 0Ch */
75 U32 ActionDataWord; /* 10h */
76 SGE_SIMPLE_UNION ActionDataSGE; /* 14h */
77 } MSG_RAID_ACTION_REQUEST, MPI_POINTER PTR_MSG_RAID_ACTION_REQUEST,
78 MpiRaidActionRequest_t , MPI_POINTER pMpiRaidActionRequest_t;
81 /* RAID Action request Action values */
83 #define MPI_RAID_ACTION_STATUS (0x00)
84 #define MPI_RAID_ACTION_INDICATOR_STRUCT (0x01)
85 #define MPI_RAID_ACTION_CREATE_VOLUME (0x02)
86 #define MPI_RAID_ACTION_DELETE_VOLUME (0x03)
87 #define MPI_RAID_ACTION_DISABLE_VOLUME (0x04)
88 #define MPI_RAID_ACTION_ENABLE_VOLUME (0x05)
89 #define MPI_RAID_ACTION_QUIESCE_PHYS_IO (0x06)
90 #define MPI_RAID_ACTION_ENABLE_PHYS_IO (0x07)
91 #define MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS (0x08)
92 #define MPI_RAID_ACTION_PHYSDISK_OFFLINE (0x0A)
93 #define MPI_RAID_ACTION_PHYSDISK_ONLINE (0x0B)
94 #define MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS (0x0C)
95 #define MPI_RAID_ACTION_CREATE_PHYSDISK (0x0D)
96 #define MPI_RAID_ACTION_DELETE_PHYSDISK (0x0E)
97 #define MPI_RAID_ACTION_FAIL_PHYSDISK (0x0F)
98 #define MPI_RAID_ACTION_REPLACE_PHYSDISK (0x10)
100 /* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */
101 #define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC (0x00000001)
103 /* ActionDataWord defines for use with MPI_RAID_ACTION_DELETE_VOLUME action */
104 #define MPI_RAID_ACTION_ADATA_KEEP_PHYS_DISKS (0x00000000)
105 #define MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS (0x00000001)
108 /* RAID Action reply message */
110 typedef struct _MSG_RAID_ACTION_REPLY
113 U8 Reserved; /* 01h */
114 U8 MsgLength; /* 02h */
115 U8 Function; /* 03h */
116 U8 VolumeID; /* 04h */
117 U8 VolumeBus; /* 05h */
118 U8 PhysDiskNum; /* 06h */
119 U8 MsgFlags; /* 07h */
120 U32 MsgContext; /* 08h */
121 U16 ActionStatus; /* 0Ch */
122 U16 IOCStatus; /* 0Eh */
123 U32 IOCLogInfo; /* 10h */
124 U32 VolumeStatus; /* 14h */
125 U32 ActionData; /* 18h */
126 } MSG_RAID_ACTION_REPLY, MPI_POINTER PTR_MSG_RAID_ACTION_REPLY,
127 MpiRaidActionReply_t, MPI_POINTER pMpiRaidActionReply_t;
130 /* RAID Volume reply ActionStatus values */
132 #define MPI_RAID_ACTION_ASTATUS_SUCCESS (0x0000)
133 #define MPI_RAID_ACTION_ASTATUS_INVALID_ACTION (0x0001)
134 #define MPI_RAID_ACTION_ASTATUS_FAILURE (0x0002)
135 #define MPI_RAID_ACTION_ASTATUS_IN_PROGRESS (0x0003)
138 /* RAID Volume reply RAID Volume Indicator structure */
140 typedef struct _MPI_RAID_VOL_INDICATOR
142 U64 TotalBlocks; /* 00h */
143 U64 BlocksRemaining; /* 08h */
144 } MPI_RAID_VOL_INDICATOR, MPI_POINTER PTR_MPI_RAID_VOL_INDICATOR,
145 MpiRaidVolIndicator_t, MPI_POINTER pMpiRaidVolIndicator_t;
148 /****************************************************************************/
149 /* SCSI IO RAID Passthrough Request */
150 /****************************************************************************/
152 typedef struct _MSG_SCSI_IO_RAID_PT_REQUEST
154 U8 PhysDiskNum; /* 00h */
155 U8 Reserved1; /* 01h */
156 U8 ChainOffset; /* 02h */
157 U8 Function; /* 03h */
158 U8 CDBLength; /* 04h */
159 U8 SenseBufferLength; /* 05h */
160 U8 Reserved2; /* 06h */
161 U8 MsgFlags; /* 07h */
162 U32 MsgContext; /* 08h */
164 U32 Control; /* 14h */
165 U8 CDB[16]; /* 18h */
166 U32 DataLength; /* 28h */
167 U32 SenseBufferLowAddr; /* 2Ch */
168 SGE_IO_UNION SGL; /* 30h */
169 } MSG_SCSI_IO_RAID_PT_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REQUEST,
170 SCSIIORaidPassthroughRequest_t, MPI_POINTER pSCSIIORaidPassthroughRequest_t;
173 /* SCSI IO RAID Passthrough reply structure */
175 typedef struct _MSG_SCSI_IO_RAID_PT_REPLY
177 U8 PhysDiskNum; /* 00h */
178 U8 Reserved1; /* 01h */
179 U8 MsgLength; /* 02h */
180 U8 Function; /* 03h */
181 U8 CDBLength; /* 04h */
182 U8 SenseBufferLength; /* 05h */
183 U8 Reserved2; /* 06h */
184 U8 MsgFlags; /* 07h */
185 U32 MsgContext; /* 08h */
186 U8 SCSIStatus; /* 0Ch */
187 U8 SCSIState; /* 0Dh */
188 U16 IOCStatus; /* 0Eh */
189 U32 IOCLogInfo; /* 10h */
190 U32 TransferCount; /* 14h */
191 U32 SenseCount; /* 18h */
192 U32 ResponseInfo; /* 1Ch */
193 } MSG_SCSI_IO_RAID_PT_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REPLY,
194 SCSIIORaidPassthroughReply_t, MPI_POINTER pSCSIIORaidPassthroughReply_t;