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