xref: /titanic_41/usr/src/uts/common/sys/mpt/mpi_raid.h (revision 4496171313bed39e96f21bc2f9faf2868e267ae3)
1 /*
2  * Copyright 2002 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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
10 
11 #ifdef	__cplusplus
12 extern "C" {
13 #endif
14 
15 /*
16  * RAID Volume Request
17  */
18 typedef struct msg_raid_action {
19 	uint8_t			Action;
20 	uint8_t			Reserved1;
21 	uint8_t			ChainOffset;
22 	uint8_t			Function;
23 	uint8_t			VolumeID;
24 	uint8_t			VolumeBus;
25 	uint8_t			PhysDiskNum;
26 	uint8_t			MsgFlags;
27 	uint32_t		MsgContext;
28 	uint32_t		Reserved2;
29 	uint32_t		ActionDataWord;
30 	sge_simple_union_t	ActionDataSGE;
31 } msg_raid_action_t;
32 
33 
34 /* RAID Volume Action values */
35 
36 #define	MPI_RAID_ACTION_STATUS				0x00
37 #define	MPI_RAID_ACTION_INDICATOR_STRUCT		0x01
38 #define	MPI_RAID_ACTION_CREATE_VOLUME			0x02
39 #define	MPI_RAID_ACTION_DELETE_VOLUME			0x03
40 #define	MPI_RAID_ACTION_DISABLE_VOLUME			0x04
41 #define	MPI_RAID_ACTION_ENABLE_VOLUME			0x05
42 #define	MPI_RAID_ACTION_QUIESCE_PHYS_IO			0x06
43 #define	MPI_RAID_ACTION_ENABLE_PHYS_IO			0x07
44 #define	MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS		0x08
45 #define	MPI_RAID_ACTION_PHYSDISK_OFFLINE		0x0A
46 #define	MPI_RAID_ACTION_PHYSDISK_ONLINE			0x0B
47 #define	MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS	0x0C
48 #define	MPI_RAID_ACTION_CREATE_PHYSDISK			0x0D
49 #define	MPI_RAID_ACTION_DELETE_PHYSDISK			0x0E
50 #define	MPI_RAID_ACTION_FAIL_PHYSDISK			0x0F
51 #define	MPI_RAID_ACTION_REPLACE_PHYSDISK		0x10
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