xref: /illumos-gate/usr/src/uts/common/sys/mpt/mpi_raid.h (revision 2d6eb4a5)
17c478bd9Sstevel@tonic-gate /*
2*b449fa8aSyw  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
37c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
47c478bd9Sstevel@tonic-gate  */
57c478bd9Sstevel@tonic-gate 
67c478bd9Sstevel@tonic-gate #ifndef	_SYS_MPI_RAID_H
77c478bd9Sstevel@tonic-gate #define	_SYS_MPI_RAID_H
87c478bd9Sstevel@tonic-gate 
97c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
107c478bd9Sstevel@tonic-gate extern "C" {
117c478bd9Sstevel@tonic-gate #endif
127c478bd9Sstevel@tonic-gate 
137c478bd9Sstevel@tonic-gate /*
147c478bd9Sstevel@tonic-gate  * RAID Volume Request
157c478bd9Sstevel@tonic-gate  */
167c478bd9Sstevel@tonic-gate typedef struct msg_raid_action {
177c478bd9Sstevel@tonic-gate 	uint8_t			Action;
187c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1;
197c478bd9Sstevel@tonic-gate 	uint8_t			ChainOffset;
207c478bd9Sstevel@tonic-gate 	uint8_t			Function;
217c478bd9Sstevel@tonic-gate 	uint8_t			VolumeID;
227c478bd9Sstevel@tonic-gate 	uint8_t			VolumeBus;
237c478bd9Sstevel@tonic-gate 	uint8_t			PhysDiskNum;
247c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
257c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
267c478bd9Sstevel@tonic-gate 	uint32_t		Reserved2;
277c478bd9Sstevel@tonic-gate 	uint32_t		ActionDataWord;
287c478bd9Sstevel@tonic-gate 	sge_simple_union_t	ActionDataSGE;
297c478bd9Sstevel@tonic-gate } msg_raid_action_t;
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate /* RAID Volume Action values */
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_STATUS				0x00
357c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_INDICATOR_STRUCT		0x01
367c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_CREATE_VOLUME			0x02
377c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_DELETE_VOLUME			0x03
387c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_DISABLE_VOLUME			0x04
397c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_ENABLE_VOLUME			0x05
407c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_QUIESCE_PHYS_IO			0x06
417c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_ENABLE_PHYS_IO			0x07
427c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_CHANGE_VOLUME_SETTINGS		0x08
437c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_PHYSDISK_OFFLINE		0x0A
447c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_PHYSDISK_ONLINE			0x0B
457c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_CHANGE_PHYSDISK_SETTINGS	0x0C
467c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_CREATE_PHYSDISK			0x0D
477c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_DELETE_PHYSDISK			0x0E
487c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_FAIL_PHYSDISK			0x0F
497c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_REPLACE_PHYSDISK		0x10
50*b449fa8aSyw #define	MPI_RAID_ACTION_ACTIVATE_VOLUME			0x11
51*b449fa8aSyw #define	MPI_RAID_ACTION_INACTIVATE_VOLUME		0x12
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_ADATA_DO_NOT_SYNC		0x00000001
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_ADATA_KEEP_PHYS_DISKS		0x00000000
567c478bd9Sstevel@tonic-gate #define	MPI_RAID_ACTION_ADATA_DEL_PHYS_DISKS		0x00000001
577c478bd9Sstevel@tonic-gate 
587c478bd9Sstevel@tonic-gate /* RAID Volume reply message */
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate typedef struct msg_raid_action_reply {
617c478bd9Sstevel@tonic-gate 	uint8_t			Action;
627c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
637c478bd9Sstevel@tonic-gate 	uint8_t			MsgLength;
647c478bd9Sstevel@tonic-gate 	uint8_t			Function;
657c478bd9Sstevel@tonic-gate 	uint8_t			VolumeID;
667c478bd9Sstevel@tonic-gate 	uint8_t			VolumeBus;
677c478bd9Sstevel@tonic-gate 	uint8_t			PhysDiskNum;
687c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
697c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
707c478bd9Sstevel@tonic-gate 	uint16_t		ActionStatus;
717c478bd9Sstevel@tonic-gate 	uint16_t		IOCStatus;
727c478bd9Sstevel@tonic-gate 	uint32_t		IOCLogInfo;
737c478bd9Sstevel@tonic-gate 	uint32_t		VolumeStatus;
747c478bd9Sstevel@tonic-gate 	uint32_t		ActionData;
757c478bd9Sstevel@tonic-gate } msg_raid_action_reply_t;
767c478bd9Sstevel@tonic-gate 
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate /* RAID Volume reply ActionStatus values */
797c478bd9Sstevel@tonic-gate 
807c478bd9Sstevel@tonic-gate #define	MPI_RAID_VOL_ASTATUS_SUCCESS		0x0000
817c478bd9Sstevel@tonic-gate #define	MPI_RAID_VOL_ASTATUS_INVALID_ACTION	0x0001
827c478bd9Sstevel@tonic-gate #define	MPI_RAID_VOL_ASTATUS_FAILURE		0x0002
837c478bd9Sstevel@tonic-gate #define	MPI_RAID_VOL_ASTATUS_IN_PROGRESS	0x0003
847c478bd9Sstevel@tonic-gate 
857c478bd9Sstevel@tonic-gate 
867c478bd9Sstevel@tonic-gate /* RAID Volume reply RAID Volume Indicator structure */
877c478bd9Sstevel@tonic-gate 
887c478bd9Sstevel@tonic-gate typedef struct mpi_raid_vol_indicator {
897c478bd9Sstevel@tonic-gate 	uint64_t		TotalBlocks;
907c478bd9Sstevel@tonic-gate 	uint64_t		BlocksRemaining;
917c478bd9Sstevel@tonic-gate } mpi_raid_vol_indicator_t;
927c478bd9Sstevel@tonic-gate 
937c478bd9Sstevel@tonic-gate 
947c478bd9Sstevel@tonic-gate /*
957c478bd9Sstevel@tonic-gate  * SCSI IO RAID Passthrough Request
967c478bd9Sstevel@tonic-gate  */
977c478bd9Sstevel@tonic-gate typedef struct msg_scsi_io_raid_pt_request {
987c478bd9Sstevel@tonic-gate 	uint8_t			PhysDiskNum;
997c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1;
1007c478bd9Sstevel@tonic-gate 	uint8_t			ChainOffset;
1017c478bd9Sstevel@tonic-gate 	uint8_t			Function;
1027c478bd9Sstevel@tonic-gate 	uint8_t			CDBLength;
1037c478bd9Sstevel@tonic-gate 	uint8_t			SenseBufferLength;
1047c478bd9Sstevel@tonic-gate 	uint8_t			Reserved2;
1057c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
1067c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
1077c478bd9Sstevel@tonic-gate 	uint8_t			LUN[8];
1087c478bd9Sstevel@tonic-gate 	uint32_t		Control;
1097c478bd9Sstevel@tonic-gate 	uint8_t			CDB[16];
1107c478bd9Sstevel@tonic-gate 	uint32_t		DataLength;
1117c478bd9Sstevel@tonic-gate 	uint32_t		SenseBufferLowAddr;
1127c478bd9Sstevel@tonic-gate 	sge_io_union_t		SGL;
1137c478bd9Sstevel@tonic-gate } msg_scsi_io_raid_pt_request_t;
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate 
1167c478bd9Sstevel@tonic-gate /* SCSI IO RAID Passthrough reply structure */
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate typedef struct msg_scsi_io_raid_pt_reply {
1197c478bd9Sstevel@tonic-gate 	uint8_t			PhysDiskNum;
1207c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1;
1217c478bd9Sstevel@tonic-gate 	uint8_t			MsgLength;
1227c478bd9Sstevel@tonic-gate 	uint8_t			Function;
1237c478bd9Sstevel@tonic-gate 	uint8_t			CDBLength;
1247c478bd9Sstevel@tonic-gate 	uint8_t			SenseBufferLength;
1257c478bd9Sstevel@tonic-gate 	uint8_t			Reserved2;
1267c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
1277c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
1287c478bd9Sstevel@tonic-gate 	uint8_t			SCSIStatus;
1297c478bd9Sstevel@tonic-gate 	uint8_t			SCSIState;
1307c478bd9Sstevel@tonic-gate 	uint16_t		IOCStatus;
1317c478bd9Sstevel@tonic-gate 	uint32_t		IOCLogInfo;
1327c478bd9Sstevel@tonic-gate 	uint32_t		TransferCount;
1337c478bd9Sstevel@tonic-gate 	uint32_t		SenseCount;
1347c478bd9Sstevel@tonic-gate 	uint32_t		ResponseInfo;
1357c478bd9Sstevel@tonic-gate } msg_scsi_io_raid_pt_reply_t;
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1387c478bd9Sstevel@tonic-gate }
1397c478bd9Sstevel@tonic-gate #endif
1407c478bd9Sstevel@tonic-gate 
1417c478bd9Sstevel@tonic-gate #endif	/* _SYS_MPI_RAID_H */
142