1/*
2 *  Copyright (c) 2001 LSI Logic Corporation.
3 *
4 *
5 *           Name:  MPI_RAID.H
6 *          Title:  MPI RAID message and structures
7 *  Creation Date:  February 27, 2001
8 *
9 *    MPI Version:  01.02.04
10 *
11 *  Version History
12 *  ---------------
13 *
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 *  --------------------------------------------------------------------------
24 */
25
26#ifndef MPI_RAID_H
27#define MPI_RAID_H
28
29
30/******************************************************************************
31*
32*        R A I D    M e s s a g e s
33*
34*******************************************************************************/
35
36
37/****************************************************************************/
38/* RAID Volume Request                                                      */
39/****************************************************************************/
40
41typedef struct _MSG_RAID_ACTION
42{
43    U8                      Action;             /* 00h */
44    U8                      Reserved1;          /* 01h */
45    U8                      ChainOffset;        /* 02h */
46    U8                      Function;           /* 03h */
47    U8                      VolumeID;           /* 04h */
48    U8                      VolumeBus;          /* 05h */
49    U8                      PhysDiskNum;        /* 06h */
50    U8                      MsgFlags;           /* 07h */
51    U32                     MsgContext;         /* 08h */
52    U32                     Reserved2;          /* 0Ch */
53    U32                     ActionDataWord;     /* 10h */
54    SGE_SIMPLE_UNION        ActionDataSGE;      /* 14h */
55} MSG_RAID_ACTION_REQUEST, MPI_POINTER PTR_MSG_RAID_ACTION_REQUEST,
56  MpiRaidActionRequest_t , MPI_POINTER pMpiRaidActionRequest_t;
57
58
59/* RAID Action request Action values */
60
61#define MPI_RAID_ACTION_STATUS                      (0x00)
62#define MPI_RAID_ACTION_INDICATOR_STRUCT            (0x01)
63#define MPI_RAID_ACTION_CREATE_VOLUME               (0x02)
64#define MPI_RAID_ACTION_DELETE_VOLUME               (0x03)
65#define MPI_RAID_ACTION_DISABLE_VOLUME              (0x04)
66#define MPI_RAID_ACTION_ENABLE_VOLUME               (0x05)
67#define MPI_RAID_ACTION_QUIESCE_PHYS_IO             (0x06)
68#define MPI_RAID_ACTION_ENABLE_PHYS_IO              (0x07)
69#define MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS      (0x08)
70#define MPI_RAID_ACTION_PHYSDISK_OFFLINE            (0x0A)
71#define MPI_RAID_ACTION_PHYSDISK_ONLINE             (0x0B)
72#define MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS    (0x0C)
73#define MPI_RAID_ACTION_CREATE_PHYSDISK             (0x0D)
74#define MPI_RAID_ACTION_DELETE_PHYSDISK             (0x0E)
75#define MPI_RAID_ACTION_FAIL_PHYSDISK               (0x0F)
76#define MPI_RAID_ACTION_REPLACE_PHYSDISK            (0x10)
77
78/* ActionDataWord defines for use with MPI_RAID_ACTION_CREATE_VOLUME action */
79#define MPI_RAID_ACTION_ADATA_DO_NOT_SYNC           (0x00000001)
80
81/* ActionDataWord defines for use with MPI_RAID_ACTION_DELETE_VOLUME action */
82#define MPI_RAID_ACTION_ADATA_KEEP_PHYS_DISKS       (0x00000000)
83#define MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS        (0x00000001)
84
85
86/* RAID Action reply message */
87
88typedef struct _MSG_RAID_ACTION_REPLY
89{
90    U8                      Action;             /* 00h */
91    U8                      Reserved;           /* 01h */
92    U8                      MsgLength;          /* 02h */
93    U8                      Function;           /* 03h */
94    U8                      VolumeID;           /* 04h */
95    U8                      VolumeBus;          /* 05h */
96    U8                      PhysDiskNum;        /* 06h */
97    U8                      MsgFlags;           /* 07h */
98    U32                     MsgContext;         /* 08h */
99    U16                     ActionStatus;       /* 0Ch */
100    U16                     IOCStatus;          /* 0Eh */
101    U32                     IOCLogInfo;         /* 10h */
102    U32                     VolumeStatus;       /* 14h */
103    U32                     ActionData;         /* 18h */
104} MSG_RAID_ACTION_REPLY, MPI_POINTER PTR_MSG_RAID_ACTION_REPLY,
105  MpiRaidActionReply_t, MPI_POINTER pMpiRaidActionReply_t;
106
107
108/* RAID Volume reply ActionStatus values */
109
110#define MPI_RAID_ACTION_ASTATUS_SUCCESS             (0x0000)
111#define MPI_RAID_ACTION_ASTATUS_INVALID_ACTION      (0x0001)
112#define MPI_RAID_ACTION_ASTATUS_FAILURE             (0x0002)
113#define MPI_RAID_ACTION_ASTATUS_IN_PROGRESS         (0x0003)
114
115
116/* RAID Volume reply RAID Volume Indicator structure */
117
118typedef struct _MPI_RAID_VOL_INDICATOR
119{
120    U64                     TotalBlocks;        /* 00h */
121    U64                     BlocksRemaining;    /* 08h */
122} MPI_RAID_VOL_INDICATOR, MPI_POINTER PTR_MPI_RAID_VOL_INDICATOR,
123  MpiRaidVolIndicator_t, MPI_POINTER pMpiRaidVolIndicator_t;
124
125
126/****************************************************************************/
127/* SCSI IO RAID Passthrough Request                                         */
128/****************************************************************************/
129
130typedef struct _MSG_SCSI_IO_RAID_PT_REQUEST
131{
132    U8                      PhysDiskNum;        /* 00h */
133    U8                      Reserved1;          /* 01h */
134    U8                      ChainOffset;        /* 02h */
135    U8                      Function;           /* 03h */
136    U8                      CDBLength;          /* 04h */
137    U8                      SenseBufferLength;  /* 05h */
138    U8                      Reserved2;          /* 06h */
139    U8                      MsgFlags;           /* 07h */
140    U32                     MsgContext;         /* 08h */
141    U8                      LUN[8];             /* 0Ch */
142    U32                     Control;            /* 14h */
143    U8                      CDB[16];            /* 18h */
144    U32                     DataLength;         /* 28h */
145    U32                     SenseBufferLowAddr; /* 2Ch */
146    SGE_IO_UNION            SGL;                /* 30h */
147} MSG_SCSI_IO_RAID_PT_REQUEST, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REQUEST,
148  SCSIIORaidPassthroughRequest_t, MPI_POINTER pSCSIIORaidPassthroughRequest_t;
149
150
151/* SCSI IO RAID Passthrough reply structure */
152
153typedef struct _MSG_SCSI_IO_RAID_PT_REPLY
154{
155    U8                      PhysDiskNum;        /* 00h */
156    U8                      Reserved1;          /* 01h */
157    U8                      MsgLength;          /* 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 */
164    U8                      SCSIStatus;         /* 0Ch */
165    U8                      SCSIState;          /* 0Dh */
166    U16                     IOCStatus;          /* 0Eh */
167    U32                     IOCLogInfo;         /* 10h */
168    U32                     TransferCount;      /* 14h */
169    U32                     SenseCount;         /* 18h */
170    U32                     ResponseInfo;       /* 1Ch */
171} MSG_SCSI_IO_RAID_PT_REPLY, MPI_POINTER PTR_MSG_SCSI_IO_RAID_PT_REPLY,
172  SCSIIORaidPassthroughReply_t, MPI_POINTER pSCSIIORaidPassthroughReply_t;
173
174
175#endif
176
177
178
179