xref: /onnv-gate/usr/src/uts/common/sys/mpt/mpi_raid.h (revision 7233:ca680b47401f)
10Sstevel@tonic-gate /*
2*7233Syw161884  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
30Sstevel@tonic-gate  * Use is subject to license terms.
40Sstevel@tonic-gate  */
50Sstevel@tonic-gate 
60Sstevel@tonic-gate #ifndef	_SYS_MPI_RAID_H
70Sstevel@tonic-gate #define	_SYS_MPI_RAID_H
80Sstevel@tonic-gate 
90Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
100Sstevel@tonic-gate 
110Sstevel@tonic-gate #ifdef	__cplusplus
120Sstevel@tonic-gate extern "C" {
130Sstevel@tonic-gate #endif
140Sstevel@tonic-gate 
150Sstevel@tonic-gate /*
160Sstevel@tonic-gate  * RAID Volume Request
170Sstevel@tonic-gate  */
180Sstevel@tonic-gate typedef struct msg_raid_action {
190Sstevel@tonic-gate 	uint8_t			Action;
200Sstevel@tonic-gate 	uint8_t			Reserved1;
210Sstevel@tonic-gate 	uint8_t			ChainOffset;
220Sstevel@tonic-gate 	uint8_t			Function;
230Sstevel@tonic-gate 	uint8_t			VolumeID;
240Sstevel@tonic-gate 	uint8_t			VolumeBus;
250Sstevel@tonic-gate 	uint8_t			PhysDiskNum;
260Sstevel@tonic-gate 	uint8_t			MsgFlags;
270Sstevel@tonic-gate 	uint32_t		MsgContext;
280Sstevel@tonic-gate 	uint32_t		Reserved2;
290Sstevel@tonic-gate 	uint32_t		ActionDataWord;
300Sstevel@tonic-gate 	sge_simple_union_t	ActionDataSGE;
310Sstevel@tonic-gate } msg_raid_action_t;
320Sstevel@tonic-gate 
330Sstevel@tonic-gate 
340Sstevel@tonic-gate /* RAID Volume Action values */
350Sstevel@tonic-gate 
360Sstevel@tonic-gate #define	MPI_RAID_ACTION_STATUS				0x00
370Sstevel@tonic-gate #define	MPI_RAID_ACTION_INDICATOR_STRUCT		0x01
380Sstevel@tonic-gate #define	MPI_RAID_ACTION_CREATE_VOLUME			0x02
390Sstevel@tonic-gate #define	MPI_RAID_ACTION_DELETE_VOLUME			0x03
400Sstevel@tonic-gate #define	MPI_RAID_ACTION_DISABLE_VOLUME			0x04
410Sstevel@tonic-gate #define	MPI_RAID_ACTION_ENABLE_VOLUME			0x05
420Sstevel@tonic-gate #define	MPI_RAID_ACTION_QUIESCE_PHYS_IO			0x06
430Sstevel@tonic-gate #define	MPI_RAID_ACTION_ENABLE_PHYS_IO			0x07
440Sstevel@tonic-gate #define	MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS		0x08
450Sstevel@tonic-gate #define	MPI_RAID_ACTION_PHYSDISK_OFFLINE		0x0A
460Sstevel@tonic-gate #define	MPI_RAID_ACTION_PHYSDISK_ONLINE			0x0B
470Sstevel@tonic-gate #define	MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS	0x0C
480Sstevel@tonic-gate #define	MPI_RAID_ACTION_CREATE_PHYSDISK			0x0D
490Sstevel@tonic-gate #define	MPI_RAID_ACTION_DELETE_PHYSDISK			0x0E
500Sstevel@tonic-gate #define	MPI_RAID_ACTION_FAIL_PHYSDISK			0x0F
510Sstevel@tonic-gate #define	MPI_RAID_ACTION_REPLACE_PHYSDISK		0x10
52*7233Syw161884 #define	MPI_RAID_ACTION_ACTIVATE_VOLUME			0x11
53*7233Syw161884 #define	MPI_RAID_ACTION_INACTIVATE_VOLUME		0x12
540Sstevel@tonic-gate 
550Sstevel@tonic-gate #define	MPI_RAID_ACTION_ADATA_DO_NOT_SYNC		0x00000001
560Sstevel@tonic-gate 
570Sstevel@tonic-gate #define	MPI_RAID_ACTION_ADATA_KEEP_PHYS_DISKS		0x00000000
580Sstevel@tonic-gate #define	MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS		0x00000001
590Sstevel@tonic-gate 
600Sstevel@tonic-gate /* RAID Volume reply message */
610Sstevel@tonic-gate 
620Sstevel@tonic-gate typedef struct msg_raid_action_reply {
630Sstevel@tonic-gate 	uint8_t			Action;
640Sstevel@tonic-gate 	uint8_t			Reserved;
650Sstevel@tonic-gate 	uint8_t			MsgLength;
660Sstevel@tonic-gate 	uint8_t			Function;
670Sstevel@tonic-gate 	uint8_t			VolumeID;
680Sstevel@tonic-gate 	uint8_t			VolumeBus;
690Sstevel@tonic-gate 	uint8_t			PhysDiskNum;
700Sstevel@tonic-gate 	uint8_t			MsgFlags;
710Sstevel@tonic-gate 	uint32_t		MsgContext;
720Sstevel@tonic-gate 	uint16_t		ActionStatus;
730Sstevel@tonic-gate 	uint16_t		IOCStatus;
740Sstevel@tonic-gate 	uint32_t		IOCLogInfo;
750Sstevel@tonic-gate 	uint32_t		VolumeStatus;
760Sstevel@tonic-gate 	uint32_t		ActionData;
770Sstevel@tonic-gate } msg_raid_action_reply_t;
780Sstevel@tonic-gate 
790Sstevel@tonic-gate 
800Sstevel@tonic-gate /* RAID Volume reply ActionStatus values */
810Sstevel@tonic-gate 
820Sstevel@tonic-gate #define	MPI_RAID_VOL_ASTATUS_SUCCESS		0x0000
830Sstevel@tonic-gate #define	MPI_RAID_VOL_ASTATUS_INVALID_ACTION	0x0001
840Sstevel@tonic-gate #define	MPI_RAID_VOL_ASTATUS_FAILURE		0x0002
850Sstevel@tonic-gate #define	MPI_RAID_VOL_ASTATUS_IN_PROGRESS	0x0003
860Sstevel@tonic-gate 
870Sstevel@tonic-gate 
880Sstevel@tonic-gate /* RAID Volume reply RAID Volume Indicator structure */
890Sstevel@tonic-gate 
900Sstevel@tonic-gate typedef struct mpi_raid_vol_indicator {
910Sstevel@tonic-gate 	uint64_t		TotalBlocks;
920Sstevel@tonic-gate 	uint64_t		BlocksRemaining;
930Sstevel@tonic-gate } mpi_raid_vol_indicator_t;
940Sstevel@tonic-gate 
950Sstevel@tonic-gate 
960Sstevel@tonic-gate /*
970Sstevel@tonic-gate  * SCSI IO RAID Passthrough Request
980Sstevel@tonic-gate  */
990Sstevel@tonic-gate typedef struct msg_scsi_io_raid_pt_request {
1000Sstevel@tonic-gate 	uint8_t			PhysDiskNum;
1010Sstevel@tonic-gate 	uint8_t			Reserved1;
1020Sstevel@tonic-gate 	uint8_t			ChainOffset;
1030Sstevel@tonic-gate 	uint8_t			Function;
1040Sstevel@tonic-gate 	uint8_t			CDBLength;
1050Sstevel@tonic-gate 	uint8_t			SenseBufferLength;
1060Sstevel@tonic-gate 	uint8_t			Reserved2;
1070Sstevel@tonic-gate 	uint8_t			MsgFlags;
1080Sstevel@tonic-gate 	uint32_t		MsgContext;
1090Sstevel@tonic-gate 	uint8_t			LUN[8];
1100Sstevel@tonic-gate 	uint32_t		Control;
1110Sstevel@tonic-gate 	uint8_t			CDB[16];
1120Sstevel@tonic-gate 	uint32_t		DataLength;
1130Sstevel@tonic-gate 	uint32_t		SenseBufferLowAddr;
1140Sstevel@tonic-gate 	sge_io_union_t		SGL;
1150Sstevel@tonic-gate } msg_scsi_io_raid_pt_request_t;
1160Sstevel@tonic-gate 
1170Sstevel@tonic-gate 
1180Sstevel@tonic-gate /* SCSI IO RAID Passthrough reply structure */
1190Sstevel@tonic-gate 
1200Sstevel@tonic-gate typedef struct msg_scsi_io_raid_pt_reply {
1210Sstevel@tonic-gate 	uint8_t			PhysDiskNum;
1220Sstevel@tonic-gate 	uint8_t			Reserved1;
1230Sstevel@tonic-gate 	uint8_t			MsgLength;
1240Sstevel@tonic-gate 	uint8_t			Function;
1250Sstevel@tonic-gate 	uint8_t			CDBLength;
1260Sstevel@tonic-gate 	uint8_t			SenseBufferLength;
1270Sstevel@tonic-gate 	uint8_t			Reserved2;
1280Sstevel@tonic-gate 	uint8_t			MsgFlags;
1290Sstevel@tonic-gate 	uint32_t		MsgContext;
1300Sstevel@tonic-gate 	uint8_t			SCSIStatus;
1310Sstevel@tonic-gate 	uint8_t			SCSIState;
1320Sstevel@tonic-gate 	uint16_t		IOCStatus;
1330Sstevel@tonic-gate 	uint32_t		IOCLogInfo;
1340Sstevel@tonic-gate 	uint32_t		TransferCount;
1350Sstevel@tonic-gate 	uint32_t		SenseCount;
1360Sstevel@tonic-gate 	uint32_t		ResponseInfo;
1370Sstevel@tonic-gate } msg_scsi_io_raid_pt_reply_t;
1380Sstevel@tonic-gate 
1390Sstevel@tonic-gate #ifdef	__cplusplus
1400Sstevel@tonic-gate }
1410Sstevel@tonic-gate #endif
1420Sstevel@tonic-gate 
1430Sstevel@tonic-gate #endif	/* _SYS_MPI_RAID_H */
144