xref: /illumos-gate/usr/src/uts/common/sys/mpt/mpi_raid.h (revision dd72704bd9e794056c558153663c739e2012d721)
1 /*
2  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #ifndef	_SYS_MPI_RAID_H
7 #define	_SYS_MPI_RAID_H
8 
9 #ifdef	__cplusplus
10 extern "C" {
11 #endif
12 
13 /*
14  * RAID Volume Request
15  */
16 typedef struct msg_raid_action {
17 	uint8_t			Action;
18 	uint8_t			Reserved1;
19 	uint8_t			ChainOffset;
20 	uint8_t			Function;
21 	uint8_t			VolumeID;
22 	uint8_t			VolumeBus;
23 	uint8_t			PhysDiskNum;
24 	uint8_t			MsgFlags;
25 	uint32_t		MsgContext;
26 	uint32_t		Reserved2;
27 	uint32_t		ActionDataWord;
28 	sge_simple_union_t	ActionDataSGE;
29 } msg_raid_action_t;
30 
31 
32 /* RAID Volume Action values */
33 
34 #define	MPI_RAID_ACTION_STATUS				0x00
35 #define	MPI_RAID_ACTION_INDICATOR_STRUCT		0x01
36 #define	MPI_RAID_ACTION_CREATE_VOLUME			0x02
37 #define	MPI_RAID_ACTION_DELETE_VOLUME			0x03
38 #define	MPI_RAID_ACTION_DISABLE_VOLUME			0x04
39 #define	MPI_RAID_ACTION_ENABLE_VOLUME			0x05
40 #define	MPI_RAID_ACTION_QUIESCE_PHYS_IO			0x06
41 #define	MPI_RAID_ACTION_ENABLE_PHYS_IO			0x07
42 #define	MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS		0x08
43 #define	MPI_RAID_ACTION_PHYSDISK_OFFLINE		0x0A
44 #define	MPI_RAID_ACTION_PHYSDISK_ONLINE			0x0B
45 #define	MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS	0x0C
46 #define	MPI_RAID_ACTION_CREATE_PHYSDISK			0x0D
47 #define	MPI_RAID_ACTION_DELETE_PHYSDISK			0x0E
48 #define	MPI_RAID_ACTION_FAIL_PHYSDISK			0x0F
49 #define	MPI_RAID_ACTION_REPLACE_PHYSDISK		0x10
50 #define	MPI_RAID_ACTION_ACTIVATE_VOLUME			0x11
51 #define	MPI_RAID_ACTION_INACTIVATE_VOLUME		0x12
52 
53 #define	MPI_RAID_ACTION_ADATA_DO_NOT_SYNC		0x00000001
54 
55 #define	MPI_RAID_ACTION_ADATA_KEEP_PHYS_DISKS		0x00000000
56 #define	MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS		0x00000001
57 
58 /* RAID Volume reply message */
59 
60 typedef struct msg_raid_action_reply {
61 	uint8_t			Action;
62 	uint8_t			Reserved;
63 	uint8_t			MsgLength;
64 	uint8_t			Function;
65 	uint8_t			VolumeID;
66 	uint8_t			VolumeBus;
67 	uint8_t			PhysDiskNum;
68 	uint8_t			MsgFlags;
69 	uint32_t		MsgContext;
70 	uint16_t		ActionStatus;
71 	uint16_t		IOCStatus;
72 	uint32_t		IOCLogInfo;
73 	uint32_t		VolumeStatus;
74 	uint32_t		ActionData;
75 } msg_raid_action_reply_t;
76 
77 
78 /* RAID Volume reply ActionStatus values */
79 
80 #define	MPI_RAID_VOL_ASTATUS_SUCCESS		0x0000
81 #define	MPI_RAID_VOL_ASTATUS_INVALID_ACTION	0x0001
82 #define	MPI_RAID_VOL_ASTATUS_FAILURE		0x0002
83 #define	MPI_RAID_VOL_ASTATUS_IN_PROGRESS	0x0003
84 
85 
86 /* RAID Volume reply RAID Volume Indicator structure */
87 
88 typedef struct mpi_raid_vol_indicator {
89 	uint64_t		TotalBlocks;
90 	uint64_t		BlocksRemaining;
91 } mpi_raid_vol_indicator_t;
92 
93 
94 /*
95  * SCSI IO RAID Passthrough Request
96  */
97 typedef struct msg_scsi_io_raid_pt_request {
98 	uint8_t			PhysDiskNum;
99 	uint8_t			Reserved1;
100 	uint8_t			ChainOffset;
101 	uint8_t			Function;
102 	uint8_t			CDBLength;
103 	uint8_t			SenseBufferLength;
104 	uint8_t			Reserved2;
105 	uint8_t			MsgFlags;
106 	uint32_t		MsgContext;
107 	uint8_t			LUN[8];
108 	uint32_t		Control;
109 	uint8_t			CDB[16];
110 	uint32_t		DataLength;
111 	uint32_t		SenseBufferLowAddr;
112 	sge_io_union_t		SGL;
113 } msg_scsi_io_raid_pt_request_t;
114 
115 
116 /* SCSI IO RAID Passthrough reply structure */
117 
118 typedef struct msg_scsi_io_raid_pt_reply {
119 	uint8_t			PhysDiskNum;
120 	uint8_t			Reserved1;
121 	uint8_t			MsgLength;
122 	uint8_t			Function;
123 	uint8_t			CDBLength;
124 	uint8_t			SenseBufferLength;
125 	uint8_t			Reserved2;
126 	uint8_t			MsgFlags;
127 	uint32_t		MsgContext;
128 	uint8_t			SCSIStatus;
129 	uint8_t			SCSIState;
130 	uint16_t		IOCStatus;
131 	uint32_t		IOCLogInfo;
132 	uint32_t		TransferCount;
133 	uint32_t		SenseCount;
134 	uint32_t		ResponseInfo;
135 } msg_scsi_io_raid_pt_reply_t;
136 
137 #ifdef	__cplusplus
138 }
139 #endif
140 
141 #endif	/* _SYS_MPI_RAID_H */
142