OMAPDSS: VENC: fix NULL pointer dereference in DSS2 VENC sysfs debug attr on OMAP4
[zen-stable.git] / drivers / message / fusion / lsi / mpi_raid.h
blobadd60cc85be136148f7f2649e198026cf415d336
1 /*
2 * Copyright (c) 2001-2008 LSI Corporation.
5 * Name: mpi_raid.h
6 * Title: MPI RAID message and structures
7 * Creation Date: February 27, 2001
9 * mpi_raid.h Version: 01.05.05
11 * Version History
12 * ---------------
14 * Date Version Description
15 * -------- -------- ------------------------------------------------------
16 * 02-27-01 01.01.01 Original release for this file.
17 * 03-27-01 01.01.02 Added structure offset comments.
18 * 08-08-01 01.02.01 Original release for v1.2 work.
19 * 09-28-01 01.02.02 Major rework for MPI v1.2 Integrated RAID changes.
20 * 10-04-01 01.02.03 Added ActionData defines for
21 * MPI_RAID_ACTION_DELETE_VOLUME action.
22 * 11-01-01 01.02.04 Added define for MPI_RAID_ACTION_ADATA_DO_NOT_SYNC.
23 * 03-14-02 01.02.05 Added define for MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT.
24 * 05-07-02 01.02.06 Added define for MPI_RAID_ACTION_ACTIVATE_VOLUME,
25 * MPI_RAID_ACTION_INACTIVATE_VOLUME, and
26 * MPI_RAID_ACTION_ADATA_INACTIVATE_ALL.
27 * 07-12-02 01.02.07 Added structures for Mailbox request and reply.
28 * 11-15-02 01.02.08 Added missing MsgContext field to MSG_MAILBOX_REQUEST.
29 * 04-01-03 01.02.09 New action data option flag for
30 * MPI_RAID_ACTION_DELETE_VOLUME.
31 * 05-11-04 01.03.01 Original release for MPI v1.3.
32 * 08-19-04 01.05.01 Original release for MPI v1.5.
33 * 01-15-05 01.05.02 Added defines for the two new RAID Actions for
34 * _SET_RESYNC_RATE and _SET_DATA_SCRUB_RATE.
35 * 02-28-07 01.05.03 Added new RAID Action, Device FW Update Mode, and
36 * associated defines.
37 * 08-07-07 01.05.04 Added Disable Full Rebuild bit to the ActionDataWord
38 * for the RAID Action MPI_RAID_ACTION_DISABLE_VOLUME.
39 * 01-15-08 01.05.05 Added define for MPI_RAID_ACTION_SET_VOLUME_NAME.
40 * --------------------------------------------------------------------------
43 #ifndef MPI_RAID_H
44 #define MPI_RAID_H
47 /******************************************************************************
49 * R A I D M e s s a g e s
51 *******************************************************************************/
54 /****************************************************************************/
55 /* RAID Action Request */
56 /****************************************************************************/
58 typedef struct _MSG_RAID_ACTION
60 U8 Action; /* 00h */
61 U8 Reserved1; /* 01h */
62 U8 ChainOffset; /* 02h */
63 U8 Function; /* 03h */
64 U8 VolumeID; /* 04h */
65 U8 VolumeBus; /* 05h */
66 U8 PhysDiskNum; /* 06h */
67 U8 MsgFlags; /* 07h */
68 U32 MsgContext; /* 08h */
69 U32 Reserved2; /* 0Ch */
70 U32 ActionDataWord; /* 10h */
71 SGE_SIMPLE_UNION ActionDataSGE; /* 14h */
72 } MSG_RAID_ACTION_REQUEST, MPI_POINTER PTR_MSG_RAID_ACTION_REQUEST,
73 MpiRaidActionRequest_t , MPI_POINTER pMpiRaidActionRequest_t;
76 /* RAID Action request Action values */
78 #define MPI_RAID_ACTION_STATUS (0x00)
79 #define MPI_RAID_ACTION_INDICATOR_STRUCT (0x01)
80 #define MPI_RAID_ACTION_CREATE_VOLUME (0x02)
81 #define MPI_RAID_ACTION_DELETE_VOLUME (0x03)
82 #define MPI_RAID_ACTION_DISABLE_VOLUME (0x04)
83 #define MPI_RAID_ACTION_ENABLE_VOLUME (0x05)
84 #define MPI_RAID_ACTION_QUIESCE_PHYS_IO (0x06)
85 #define MPI_RAID_ACTION_ENABLE_PHYS_IO (0x07)
86 #define MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS (0x08)
87 #define MPI_RAID_ACTION_PHYSDISK_OFFLINE (0x0A)
88 #define MPI_RAID_ACTION_PHYSDISK_ONLINE (0x0B)
89 #define MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS (0x0C)
90 #define MPI_RAID_ACTION_CREATE_PHYSDISK (0x0D)
91 #define MPI_RAID_ACTION_DELETE_PHYSDISK (0x0E)
92 #define MPI_RAID_ACTION_FAIL_PHYSDISK (0x0F)
93 #define MPI_RAID_ACTION_REPLACE_PHYSDISK (0x10)
94 #define MPI_RAID_ACTION_ACTIVATE_VOLUME (0x11)
95 #define MPI_RAID_ACTION_INACTIVATE_VOLUME (0x12)
96 #define MPI_RAID_ACTION_SET_RESYNC_RATE (0x13)
97 #define MPI_RAID_ACTION_SET_DATA_SCRUB_RATE (0x14)
98 #define MPI_RAID_ACTION_DEVICE_FW_UPDATE_MODE (0x15)
99 #define MPI_RAID_ACTION_SET_VOLUME_NAME (0x16)
101 /* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */
102 #define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC (0x00000001)
103 #define MPI_RAID_ACTION_ADATA_LOW_LEVEL_INIT (0x00000002)
105 /* ActionDataWord defines for use with MPI_RAID_ACTION_DELETE_VOLUME action */
106 #define MPI_RAID_ACTION_ADATA_KEEP_PHYS_DISKS (0x00000000)
107 #define MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS (0x00000001)
109 #define MPI_RAID_ACTION_ADATA_KEEP_LBA0 (0x00000000)
110 #define MPI_RAID_ACTION_ADATA_ZERO_LBA0 (0x00000002)
112 /* ActionDataWord defines for use with MPI_RAID_ACTION_DISABLE_VOLUME action */
113 #define MPI_RAID_ACTION_ADATA_DISABLE_FULL_REBUILD (0x00000001)
115 /* ActionDataWord defines for use with MPI_RAID_ACTION_ACTIVATE_VOLUME action */
116 #define MPI_RAID_ACTION_ADATA_INACTIVATE_ALL (0x00000001)
118 /* ActionDataWord defines for use with MPI_RAID_ACTION_SET_RESYNC_RATE action */
119 #define MPI_RAID_ACTION_ADATA_RESYNC_RATE_MASK (0x000000FF)
121 /* ActionDataWord defines for use with MPI_RAID_ACTION_SET_DATA_SCRUB_RATE action */
122 #define MPI_RAID_ACTION_ADATA_DATA_SCRUB_RATE_MASK (0x000000FF)
124 /* ActionDataWord defines for use with MPI_RAID_ACTION_DEVICE_FW_UPDATE_MODE action */
125 #define MPI_RAID_ACTION_ADATA_ENABLE_FW_UPDATE (0x00000001)
126 #define MPI_RAID_ACTION_ADATA_MASK_FW_UPDATE_TIMEOUT (0x0000FF00)
127 #define MPI_RAID_ACTION_ADATA_SHIFT_FW_UPDATE_TIMEOUT (8)
130 /* RAID Action reply message */
132 typedef struct _MSG_RAID_ACTION_REPLY
134 U8 Action; /* 00h */
135 U8 Reserved; /* 01h */
136 U8 MsgLength; /* 02h */
137 U8 Function; /* 03h */
138 U8 VolumeID; /* 04h */
139 U8 VolumeBus; /* 05h */
140 U8 PhysDiskNum; /* 06h */
141 U8 MsgFlags; /* 07h */
142 U32 MsgContext; /* 08h */
143 U16 ActionStatus; /* 0Ch */
144 U16 IOCStatus; /* 0Eh */
145 U32 IOCLogInfo; /* 10h */
146 U32 VolumeStatus; /* 14h */
147 U32 ActionData; /* 18h */
148 } MSG_RAID_ACTION_REPLY, MPI_POINTER PTR_MSG_RAID_ACTION_REPLY,
149 MpiRaidActionReply_t, MPI_POINTER pMpiRaidActionReply_t;
152 /* RAID Volume reply ActionStatus values */
154 #define MPI_RAID_ACTION_ASTATUS_SUCCESS (0x0000)
155 #define MPI_RAID_ACTION_ASTATUS_INVALID_ACTION (0x0001)
156 #define MPI_RAID_ACTION_ASTATUS_FAILURE (0x0002)
157 #define MPI_RAID_ACTION_ASTATUS_IN_PROGRESS (0x0003)
160 /* RAID Volume reply RAID Volume Indicator structure */
162 typedef struct _MPI_RAID_VOL_INDICATOR
164 U64 TotalBlocks; /* 00h */
165 U64 BlocksRemaining; /* 08h */
166 } MPI_RAID_VOL_INDICATOR, MPI_POINTER PTR_MPI_RAID_VOL_INDICATOR,
167 MpiRaidVolIndicator_t, MPI_POINTER pMpiRaidVolIndicator_t;
170 /****************************************************************************/
171 /* SCSI IO RAID Passthrough Request */
172 /****************************************************************************/
174 typedef struct _MSG_SCSI_IO_RAID_PT_REQUEST
176 U8 PhysDiskNum; /* 00h */
177 U8 Reserved1; /* 01h */
178 U8 ChainOffset; /* 02h */
179 U8 Function; /* 03h */
180 U8 CDBLength; /* 04h */
181 U8 SenseBufferLength; /* 05h */
182 U8 Reserved2; /* 06h */
183 U8 MsgFlags; /* 07h */
184 U32 MsgContext; /* 08h */
185 U8 LUN[8]; /* 0Ch */
186 U32 Control; /* 14h */
187 U8 CDB[16]; /* 18h */
188 U32 DataLength; /* 28h */
189 U32 SenseBufferLowAddr; /* 2Ch */
190 SGE_IO_UNION SGL; /* 30h */
191 } MSG_SCSI_IO_RAID_PT_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REQUEST,
192 SCSIIORaidPassthroughRequest_t, MPI_POINTER pSCSIIORaidPassthroughRequest_t;
195 /* SCSI IO RAID Passthrough reply structure */
197 typedef struct _MSG_SCSI_IO_RAID_PT_REPLY
199 U8 PhysDiskNum; /* 00h */
200 U8 Reserved1; /* 01h */
201 U8 MsgLength; /* 02h */
202 U8 Function; /* 03h */
203 U8 CDBLength; /* 04h */
204 U8 SenseBufferLength; /* 05h */
205 U8 Reserved2; /* 06h */
206 U8 MsgFlags; /* 07h */
207 U32 MsgContext; /* 08h */
208 U8 SCSIStatus; /* 0Ch */
209 U8 SCSIState; /* 0Dh */
210 U16 IOCStatus; /* 0Eh */
211 U32 IOCLogInfo; /* 10h */
212 U32 TransferCount; /* 14h */
213 U32 SenseCount; /* 18h */
214 U32 ResponseInfo; /* 1Ch */
215 } MSG_SCSI_IO_RAID_PT_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REPLY,
216 SCSIIORaidPassthroughReply_t, MPI_POINTER pSCSIIORaidPassthroughReply_t;
219 /****************************************************************************/
220 /* Mailbox reqeust structure */
221 /****************************************************************************/
223 typedef struct _MSG_MAILBOX_REQUEST
225 U16 Reserved1;
226 U8 ChainOffset;
227 U8 Function;
228 U16 Reserved2;
229 U8 Reserved3;
230 U8 MsgFlags;
231 U32 MsgContext;
232 U8 Command[10];
233 U16 Reserved4;
234 SGE_IO_UNION SGL;
235 } MSG_MAILBOX_REQUEST, MPI_POINTER PTR_MSG_MAILBOX_REQUEST,
236 MailboxRequest_t, MPI_POINTER pMailboxRequest_t;
239 /* Mailbox reply structure */
240 typedef struct _MSG_MAILBOX_REPLY
242 U16 Reserved1; /* 00h */
243 U8 MsgLength; /* 02h */
244 U8 Function; /* 03h */
245 U16 Reserved2; /* 04h */
246 U8 Reserved3; /* 06h */
247 U8 MsgFlags; /* 07h */
248 U32 MsgContext; /* 08h */
249 U16 MailboxStatus; /* 0Ch */
250 U16 IOCStatus; /* 0Eh */
251 U32 IOCLogInfo; /* 10h */
252 U32 Reserved4; /* 14h */
253 } MSG_MAILBOX_REPLY, MPI_POINTER PTR_MSG_MAILBOX_REPLY,
254 MailboxReply_t, MPI_POINTER pMailboxReply_t;
256 #endif