xref: /illumos-gate/usr/src/uts/common/sys/mpt/mpi_ioc.h (revision 2d6eb4a5)
17c478bd9Sstevel@tonic-gate /*
2*9c8b6a95Sjw  * 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_IOC_H
77c478bd9Sstevel@tonic-gate #define	_SYS_MPI_IOC_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  * IOCInit message
157c478bd9Sstevel@tonic-gate  */
167c478bd9Sstevel@tonic-gate typedef struct msg_ioc_init {
177c478bd9Sstevel@tonic-gate 	uint8_t			WhoInit;
187c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
197c478bd9Sstevel@tonic-gate 	uint8_t			ChainOffset;
207c478bd9Sstevel@tonic-gate 	uint8_t			Function;
217c478bd9Sstevel@tonic-gate 	uint8_t			Flags;
227c478bd9Sstevel@tonic-gate 	uint8_t			MaxDevices;
237c478bd9Sstevel@tonic-gate 	uint8_t			MaxBuses;
247c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
257c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
267c478bd9Sstevel@tonic-gate 	uint16_t		ReplyFrameSize;
277c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1[2];
287c478bd9Sstevel@tonic-gate 	uint32_t		HostMfaHighAddr;
297c478bd9Sstevel@tonic-gate 	uint32_t		SenseBufferHighAddr;
307c478bd9Sstevel@tonic-gate 	/* following used in new mpi implementations */
317c478bd9Sstevel@tonic-gate 	uint32_t		ReplyFifoHostSignalingAddr;
327c478bd9Sstevel@tonic-gate 	sge_simple_union_t	HostPageBufferSGE;
337c478bd9Sstevel@tonic-gate 	uint16_t		MsgVersion;
347c478bd9Sstevel@tonic-gate 	uint16_t		HeaderVersion;
357c478bd9Sstevel@tonic-gate } msg_ioc_init_t;
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate typedef struct msg_ioc_init_reply {
387c478bd9Sstevel@tonic-gate 	uint8_t			WhoInit;
397c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
407c478bd9Sstevel@tonic-gate 	uint8_t			MsgLength;
417c478bd9Sstevel@tonic-gate 	uint8_t			Function;
427c478bd9Sstevel@tonic-gate 	uint8_t			Flags;
437c478bd9Sstevel@tonic-gate 	uint8_t			MaxDevices;
447c478bd9Sstevel@tonic-gate 	uint8_t			MaxBuses;
457c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
467c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
477c478bd9Sstevel@tonic-gate 	uint16_t		Reserved2;
487c478bd9Sstevel@tonic-gate 	uint16_t		IOCStatus;
497c478bd9Sstevel@tonic-gate 	uint32_t		IOCLogInfo;
507c478bd9Sstevel@tonic-gate } msg_ioc_init_reply_t;
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate /*
537c478bd9Sstevel@tonic-gate  *  WhoInit values
547c478bd9Sstevel@tonic-gate  */
557c478bd9Sstevel@tonic-gate #define	MPI_WHOINIT_NO_ONE			0x00
567c478bd9Sstevel@tonic-gate #define	MPI_WHOINIT_SYSTEM_BIOS			0x01
577c478bd9Sstevel@tonic-gate #define	MPI_WHOINIT_ROM_BIOS			0x02
587c478bd9Sstevel@tonic-gate #define	MPI_WHOINIT_PCI_PEER			0x03
597c478bd9Sstevel@tonic-gate #define	MPI_WHOINIT_HOST_DRIVER			0x04
607c478bd9Sstevel@tonic-gate #define	MPI_WHOINIT_MANUFACTURER		0x05
617c478bd9Sstevel@tonic-gate 
627c478bd9Sstevel@tonic-gate /*
637c478bd9Sstevel@tonic-gate  * Flags values
647c478bd9Sstevel@tonic-gate  */
657c478bd9Sstevel@tonic-gate #define	MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE		0x01
667c478bd9Sstevel@tonic-gate #define	MPI_IOCINIT_FLAGS_REPLY_FIFO_HOST_SIGNAL	0x02
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate #define	MPI_IOCINIT_MSGVERSION_MAJOR_MASK	(0xFF00)
697c478bd9Sstevel@tonic-gate #define	MPI_IOCINIT_MSGVERSION_MAJOR_SHIFT	(8)
707c478bd9Sstevel@tonic-gate #define	MPI_IOCINIT_MSGVERSION_MINOR_MASK	(0x00FF)
717c478bd9Sstevel@tonic-gate #define	MPI_IOCINIT_MSGVERSION_MINOR_SHIFT	(0)
727c478bd9Sstevel@tonic-gate 
737c478bd9Sstevel@tonic-gate #define	MPI_IOCINIT_HEADERVERSION_UNIT_MASK	(0xFF00)
747c478bd9Sstevel@tonic-gate #define	MPI_IOCINIT_HEADERVERSION_UNIT_SHIFT	(8)
757c478bd9Sstevel@tonic-gate #define	MPI_IOCINIT_HEADERVERSION_DEV_MASK	(0x00FF)
767c478bd9Sstevel@tonic-gate #define	MPI_IOCINIT_HEADERVERSION_DEV_SHIFT	(0)
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate /*
807c478bd9Sstevel@tonic-gate  * IOC Facts message
817c478bd9Sstevel@tonic-gate  */
827c478bd9Sstevel@tonic-gate typedef struct msg_ioc_facts {
837c478bd9Sstevel@tonic-gate 	uint8_t			Reserved[2];
847c478bd9Sstevel@tonic-gate 	uint8_t			ChainOffset;
857c478bd9Sstevel@tonic-gate 	uint8_t			Function;
867c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1[3];
877c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
887c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
897c478bd9Sstevel@tonic-gate } msg_ioc_facts_t;
907c478bd9Sstevel@tonic-gate 
917c478bd9Sstevel@tonic-gate /*
927c478bd9Sstevel@tonic-gate  * FW version
937c478bd9Sstevel@tonic-gate  */
947c478bd9Sstevel@tonic-gate typedef struct mpi_fw_version_struct {
957c478bd9Sstevel@tonic-gate 	uint8_t			Dev;
967c478bd9Sstevel@tonic-gate 	uint8_t			Unit;
977c478bd9Sstevel@tonic-gate 	uint8_t			Minor;
987c478bd9Sstevel@tonic-gate 	uint8_t			Major;
997c478bd9Sstevel@tonic-gate } mpi_fw_version_struct_t;
1007c478bd9Sstevel@tonic-gate 
1017c478bd9Sstevel@tonic-gate typedef union mpi_fw_version {
1027c478bd9Sstevel@tonic-gate 	mpi_fw_version_struct_t	Struct;
1037c478bd9Sstevel@tonic-gate 	uint32_t		Word;
1047c478bd9Sstevel@tonic-gate } mpi_fw_version_t;
1057c478bd9Sstevel@tonic-gate 
1067c478bd9Sstevel@tonic-gate /*
1077c478bd9Sstevel@tonic-gate  * IOC Facts Reply
1087c478bd9Sstevel@tonic-gate  */
1097c478bd9Sstevel@tonic-gate typedef struct msg_ioc_facts_reply {
1107c478bd9Sstevel@tonic-gate 	uint16_t		MsgVersion;
1117c478bd9Sstevel@tonic-gate 	uint8_t			MsgLength;
1127c478bd9Sstevel@tonic-gate 	uint8_t			Function;
1137c478bd9Sstevel@tonic-gate 	uint16_t		HeaderVersion;
1147c478bd9Sstevel@tonic-gate 	uint8_t			IOCNumber;
1157c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
1167c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
1177c478bd9Sstevel@tonic-gate 	uint16_t		IOCExceptions;
1187c478bd9Sstevel@tonic-gate 	uint16_t		IOCStatus;
1197c478bd9Sstevel@tonic-gate 	uint32_t		IOCLogInfo;
1207c478bd9Sstevel@tonic-gate 	uint8_t			MaxChainDepth;
1217c478bd9Sstevel@tonic-gate 	uint8_t			WhoInit;
1227c478bd9Sstevel@tonic-gate 	uint8_t			BlockSize;
1237c478bd9Sstevel@tonic-gate 	uint8_t			Flags;
1247c478bd9Sstevel@tonic-gate 	uint16_t		ReplyQueueDepth;
1257c478bd9Sstevel@tonic-gate 	uint16_t		RequestFrameSize;
1267c478bd9Sstevel@tonic-gate 	uint16_t		Reserved_0101_FWVersion; /* obsolete */
1277c478bd9Sstevel@tonic-gate 	uint16_t		ProductID;
1287c478bd9Sstevel@tonic-gate 	uint32_t		CurrentHostMfaHighAddr;
1297c478bd9Sstevel@tonic-gate 	uint16_t		GlobalCredits;
1307c478bd9Sstevel@tonic-gate 	uint8_t			NumberOfPorts;
1317c478bd9Sstevel@tonic-gate 	uint8_t			EventState;
1327c478bd9Sstevel@tonic-gate 	uint32_t		CurrentSenseBufferHighAddr;
1337c478bd9Sstevel@tonic-gate 	uint16_t		CurReplyFrameSize;
1347c478bd9Sstevel@tonic-gate 	uint8_t			MaxDevices;
1357c478bd9Sstevel@tonic-gate 	uint8_t			MaxBuses;
1367c478bd9Sstevel@tonic-gate 	uint32_t		FWImageSize;
1377c478bd9Sstevel@tonic-gate 	uint32_t		IOCCapabilities;
1387c478bd9Sstevel@tonic-gate 	mpi_fw_version_t	FWVersion;
1397c478bd9Sstevel@tonic-gate 	/* following used in newer mpi implementations */
1407c478bd9Sstevel@tonic-gate 	uint16_t		HighPriorityQueueDepth;
1417c478bd9Sstevel@tonic-gate 	uint16_t		Reserved2;
1427c478bd9Sstevel@tonic-gate 	sge_simple_union_t	HostPageBufferSGE;
1437c478bd9Sstevel@tonic-gate } msg_ioc_facts_reply_t;
1447c478bd9Sstevel@tonic-gate 
1457c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_MSGVERSION_MAJOR_MASK	0xFF00
1467c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_MSGVERSION_MINOR_MASK	0x00FF
1477c478bd9Sstevel@tonic-gate 
1487c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_HEADERVERSION_UNIT_MASK	0xFF00
1497c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_HEADERVERSION_DEV_MASK	0x00FF
1507c478bd9Sstevel@tonic-gate 
1517c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL	0x0001
1527c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID		0x0002
1537c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_EXCEPT_FW_CHECKSUM_FAIL		0x0004
1547c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_EXCEPT_PERSISTENT_TABLE_FULL	0x0008
1557c478bd9Sstevel@tonic-gate 
1567c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT	0x01
1577c478bd9Sstevel@tonic-gate 
1587c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_EVENTSTATE_DISABLED	0x00
1597c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_EVENTSTATE_ENABLED		0x01
1607c478bd9Sstevel@tonic-gate 
1617c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_CAPABILITY_HIGH_PRI_Q		0x00000001
1627c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_CAPABILITY_REPLY_HOST_SIGNAL	0x00000002
1637c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_CAPABILITY_QUEUE_FULL_HANDLING	0x00000004
1647c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER	0x00000008
1657c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER		0x00000010
1667c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_CAPABILITY_EXTENDED_BUFFER		0x00000020
1677c478bd9Sstevel@tonic-gate #define	MPI_IOCFACTS_CAPABILITY_EEDP			0x00000040
1687c478bd9Sstevel@tonic-gate 
1697c478bd9Sstevel@tonic-gate /*
1707c478bd9Sstevel@tonic-gate  * Port Facts message and Reply
1717c478bd9Sstevel@tonic-gate  */
1727c478bd9Sstevel@tonic-gate typedef struct msg_port_facts {
1737c478bd9Sstevel@tonic-gate 	uint8_t			Reserved[2];
1747c478bd9Sstevel@tonic-gate 	uint8_t			ChainOffset;
1757c478bd9Sstevel@tonic-gate 	uint8_t			Function;
1767c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1[2];
1777c478bd9Sstevel@tonic-gate 	uint8_t			PortNumber;
1787c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
1797c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
1807c478bd9Sstevel@tonic-gate } msg_port_facts_t;
1817c478bd9Sstevel@tonic-gate 
1827c478bd9Sstevel@tonic-gate typedef struct msg_port_facts_reply {
1837c478bd9Sstevel@tonic-gate 	uint16_t		Reserved;
1847c478bd9Sstevel@tonic-gate 	uint8_t			MsgLength;
1857c478bd9Sstevel@tonic-gate 	uint8_t			Function;
1867c478bd9Sstevel@tonic-gate 	uint16_t		Reserved1;
1877c478bd9Sstevel@tonic-gate 	uint8_t			PortNumber;
1887c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
1897c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
1907c478bd9Sstevel@tonic-gate 	uint16_t		Reserved2;
1917c478bd9Sstevel@tonic-gate 	uint16_t		IOCStatus;
1927c478bd9Sstevel@tonic-gate 	uint32_t		IOCLogInfo;
1937c478bd9Sstevel@tonic-gate 	uint8_t			Reserved3;
1947c478bd9Sstevel@tonic-gate 	uint8_t			PortType;
1957c478bd9Sstevel@tonic-gate 	uint16_t		MaxDevices;
1967c478bd9Sstevel@tonic-gate 	uint16_t		PortSCSIID;
1977c478bd9Sstevel@tonic-gate 	uint16_t		ProtocolFlags;
1987c478bd9Sstevel@tonic-gate 	uint16_t		MaxPostedCmdBuffers;
1997c478bd9Sstevel@tonic-gate 	uint16_t		MaxPersistentIDs;
2007c478bd9Sstevel@tonic-gate 	uint16_t		MaxLanBuckets;
2017c478bd9Sstevel@tonic-gate 	uint16_t		Reserved4;
2027c478bd9Sstevel@tonic-gate 	uint32_t		Reserved5;
2037c478bd9Sstevel@tonic-gate } msg_port_facts_reply_t;
2047c478bd9Sstevel@tonic-gate 
2057c478bd9Sstevel@tonic-gate /*
2067c478bd9Sstevel@tonic-gate  * PortTypes values
2077c478bd9Sstevel@tonic-gate  */
2087c478bd9Sstevel@tonic-gate #define	MPI_PORTFACTS_PORTTYPE_INACTIVE		0x00
2097c478bd9Sstevel@tonic-gate #define	MPI_PORTFACTS_PORTTYPE_SCSI		0x01
2107c478bd9Sstevel@tonic-gate #define	MPI_PORTFACTS_PORTTYPE_FC		0x10
2117c478bd9Sstevel@tonic-gate #define	MPI_PORTFACTS_PORTTYPE_ISCSI		0x20
2127c478bd9Sstevel@tonic-gate #define	MPI_PORTFACTS_PORTTYPE_SAS		0x30
2137c478bd9Sstevel@tonic-gate 
2147c478bd9Sstevel@tonic-gate /*
2157c478bd9Sstevel@tonic-gate  * ProtocolFlags values
2167c478bd9Sstevel@tonic-gate  */
2177c478bd9Sstevel@tonic-gate #define	MPI_PORTFACTS_PROTOCOL_LOGBUSADDR	0x01
2187c478bd9Sstevel@tonic-gate #define	MPI_PORTFACTS_PROTOCOL_LAN		0x02
2197c478bd9Sstevel@tonic-gate #define	MPI_PORTFACTS_PROTOCOL_TARGET		0x04
2207c478bd9Sstevel@tonic-gate #define	MPI_PORTFACTS_PROTOCOL_INITIATOR	0x08
2217c478bd9Sstevel@tonic-gate 
2227c478bd9Sstevel@tonic-gate /*
2237c478bd9Sstevel@tonic-gate  * Port Enable Message
2247c478bd9Sstevel@tonic-gate  */
2257c478bd9Sstevel@tonic-gate typedef struct msg_port_enable {
2267c478bd9Sstevel@tonic-gate 	uint8_t			Reserved[2];
2277c478bd9Sstevel@tonic-gate 	uint8_t			ChainOffset;
2287c478bd9Sstevel@tonic-gate 	uint8_t			Function;
2297c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1[2];
2307c478bd9Sstevel@tonic-gate 	uint8_t			PortNumber;
2317c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
2327c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
2337c478bd9Sstevel@tonic-gate } msg_port_enable_t;
2347c478bd9Sstevel@tonic-gate 
2357c478bd9Sstevel@tonic-gate typedef struct msg_port_enable_reply {
2367c478bd9Sstevel@tonic-gate 	uint8_t			Reserved[2];
2377c478bd9Sstevel@tonic-gate 	uint8_t			MsgLength;
2387c478bd9Sstevel@tonic-gate 	uint8_t			Function;
2397c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1[2];
2407c478bd9Sstevel@tonic-gate 	uint8_t			PortNumber;
2417c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
2427c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
2437c478bd9Sstevel@tonic-gate 	uint16_t		Reserved2;
2447c478bd9Sstevel@tonic-gate 	uint16_t		IOCStatus;
2457c478bd9Sstevel@tonic-gate 	uint32_t		IOCLogInfo;
2467c478bd9Sstevel@tonic-gate } msg_port_enable_reply_t;
2477c478bd9Sstevel@tonic-gate 
2487c478bd9Sstevel@tonic-gate 
2497c478bd9Sstevel@tonic-gate /*
2507c478bd9Sstevel@tonic-gate  * Event Notification messages
2517c478bd9Sstevel@tonic-gate  */
2527c478bd9Sstevel@tonic-gate typedef struct msg_event_notify {
2537c478bd9Sstevel@tonic-gate 	uint8_t			Switch;
2547c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
2557c478bd9Sstevel@tonic-gate 	uint8_t			ChainOffset;
2567c478bd9Sstevel@tonic-gate 	uint8_t			Function;
2577c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1[3];
2587c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
2597c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
2607c478bd9Sstevel@tonic-gate } msg_event_notify_t;
2617c478bd9Sstevel@tonic-gate 
2627c478bd9Sstevel@tonic-gate /*
2637c478bd9Sstevel@tonic-gate  * Event Notification Reply
2647c478bd9Sstevel@tonic-gate  */
2657c478bd9Sstevel@tonic-gate typedef struct msg_event_notify_reply {
2667c478bd9Sstevel@tonic-gate 	uint16_t		EventDataLength;
2677c478bd9Sstevel@tonic-gate 	uint8_t			MsgLength;
2687c478bd9Sstevel@tonic-gate 	uint8_t			Function;
2697c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1[2];
2707c478bd9Sstevel@tonic-gate 	uint8_t			AckRequired;
2717c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
2727c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
2737c478bd9Sstevel@tonic-gate 	uint8_t			Reserved2[2];
2747c478bd9Sstevel@tonic-gate 	uint16_t		IOCStatus;
2757c478bd9Sstevel@tonic-gate 	uint32_t		IOCLogInfo;
2767c478bd9Sstevel@tonic-gate 	uint32_t		Event;
2777c478bd9Sstevel@tonic-gate 	uint32_t		EventContext;
2787c478bd9Sstevel@tonic-gate 	uint32_t		Data[1];
2797c478bd9Sstevel@tonic-gate } msg_event_notify_reply_t;
2807c478bd9Sstevel@tonic-gate 
2817c478bd9Sstevel@tonic-gate /*
2827c478bd9Sstevel@tonic-gate  * Event Acknowledge
2837c478bd9Sstevel@tonic-gate  */
2847c478bd9Sstevel@tonic-gate typedef struct msg_event_ack {
2857c478bd9Sstevel@tonic-gate 	uint8_t			Reserved[2];
2867c478bd9Sstevel@tonic-gate 	uint8_t			ChainOffset;
2877c478bd9Sstevel@tonic-gate 	uint8_t			Function;
2887c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1[3];
2897c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
2907c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
2917c478bd9Sstevel@tonic-gate 	uint32_t		Event;
2927c478bd9Sstevel@tonic-gate 	uint32_t		EventContext;
2937c478bd9Sstevel@tonic-gate } msg_event_ack_t;
2947c478bd9Sstevel@tonic-gate 
2957c478bd9Sstevel@tonic-gate typedef struct msg_event_ack_reply {
2967c478bd9Sstevel@tonic-gate 	uint8_t			Reserved[2];
2977c478bd9Sstevel@tonic-gate 	uint8_t			Function;
2987c478bd9Sstevel@tonic-gate 	uint8_t			MsgLength;
2997c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1[3];
3007c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
3017c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
3027c478bd9Sstevel@tonic-gate 	uint16_t		Reserved2;
3037c478bd9Sstevel@tonic-gate 	uint16_t		IOCStatus;
3047c478bd9Sstevel@tonic-gate 	uint32_t		IOCLogInfo;
3057c478bd9Sstevel@tonic-gate } msg_event_ack_reply_t;
3067c478bd9Sstevel@tonic-gate 
3077c478bd9Sstevel@tonic-gate /*
3087c478bd9Sstevel@tonic-gate  * Switch
3097c478bd9Sstevel@tonic-gate  */
3107c478bd9Sstevel@tonic-gate #define	MPI_EVENT_NOTIFICATION_SWITCH_OFF	0x00
3117c478bd9Sstevel@tonic-gate #define	MPI_EVENT_NOTIFICATION_SWITCH_ON	0x01
3127c478bd9Sstevel@tonic-gate 
3137c478bd9Sstevel@tonic-gate /*
3147c478bd9Sstevel@tonic-gate  * Event
3157c478bd9Sstevel@tonic-gate  */
3167c478bd9Sstevel@tonic-gate #define	MPI_EVENT_NONE				0x00000000
3177c478bd9Sstevel@tonic-gate #define	MPI_EVENT_LOG_DATA			0x00000001
3187c478bd9Sstevel@tonic-gate #define	MPI_EVENT_STATE_CHANGE			0x00000002
3197c478bd9Sstevel@tonic-gate #define	MPI_EVENT_UNIT_ATTENTION		0x00000003
3207c478bd9Sstevel@tonic-gate #define	MPI_EVENT_IOC_BUS_RESET			0x00000004
3217c478bd9Sstevel@tonic-gate #define	MPI_EVENT_EXT_BUS_RESET			0x00000005
3227c478bd9Sstevel@tonic-gate #define	MPI_EVENT_RESCAN			0x00000006
3237c478bd9Sstevel@tonic-gate #define	MPI_EVENT_LINK_STATUS_CHANGE		0x00000007
3247c478bd9Sstevel@tonic-gate #define	MPI_EVENT_LOOP_STATE_CHANGE		0x00000008
3257c478bd9Sstevel@tonic-gate #define	MPI_EVENT_LOGOUT			0x00000009
3267c478bd9Sstevel@tonic-gate #define	MPI_EVENT_EVENT_CHANGE			0x0000000A
3277c478bd9Sstevel@tonic-gate #define	MPI_EVENT_INTEGRATED_RAID		0x0000000B
3287c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE	0x0000000C
3297c478bd9Sstevel@tonic-gate #define	MPI_EVENT_ON_BUS_TIMER_EXPIRED		0x0000000D
3307c478bd9Sstevel@tonic-gate #define	MPI_EVENT_QUEUE_FULL			0x0000000E
3317c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_DEVICE_STATUS_CHANGE	0x0000000F
3327c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_SES			0x00000010
3337c478bd9Sstevel@tonic-gate #define	MPI_EVENT_PERSISTENT_TABLE_FULL		0x00000011
3347c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_PHY_LINK_STATUS		0x00000012
3357c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_DISCOVERY_ERROR		0x00000013
3366fec3791Sjesseb #define	MPI_EVENT_IR_RESYNC_UPDATE		0x00000014
3376fec3791Sjesseb #define	MPI_EVENT_IR2				0x00000015
3386fec3791Sjesseb #define	MPI_EVENT_SAS_DISCOVERY			0x00000016
339936b7af6Sjw #define	MPI_EVENT_SAS_BROADCAST_PRIMITIVE	0x00000017
340936b7af6Sjw #define	MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE	0x00000018
341936b7af6Sjw #define	MPI_EVENT_SAS_INIT_TABLE_OVERFLOW	0x00000019
342936b7af6Sjw #define	MPI_EVENT_SAS_SMP_ERROR			0x0000001A
343936b7af6Sjw #define	MPI_EVENT_SAS_EXPANDER_STATUS_CHANGE	0x0000001B
3446fec3791Sjesseb #define	MPI_EVENT_LOG_ENTRY_ADDED		0x00000021
3457c478bd9Sstevel@tonic-gate 
3467c478bd9Sstevel@tonic-gate /*
3477c478bd9Sstevel@tonic-gate  * AckRequired field values
3487c478bd9Sstevel@tonic-gate  */
3497c478bd9Sstevel@tonic-gate #define	MPI_EVENT_NOTIFICATION_ACK_NOT_REQUIRED	0x00
3507c478bd9Sstevel@tonic-gate #define	MPI_EVENT_NOTIFICATION_ACK_REQUIRED	0x01
3517c478bd9Sstevel@tonic-gate 
3527c478bd9Sstevel@tonic-gate /*
3537c478bd9Sstevel@tonic-gate  * Eventchange event data
3547c478bd9Sstevel@tonic-gate  */
3557c478bd9Sstevel@tonic-gate typedef struct event_data_event_change {
3567c478bd9Sstevel@tonic-gate 	uint8_t			EventState;
3577c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
3587c478bd9Sstevel@tonic-gate 	uint16_t		Reserved1;
3597c478bd9Sstevel@tonic-gate } event_data_event_change_t;
3607c478bd9Sstevel@tonic-gate 
3617c478bd9Sstevel@tonic-gate /*
3627c478bd9Sstevel@tonic-gate  * SCSI Event data for Port, Bus and Device forms)
3637c478bd9Sstevel@tonic-gate  */
3647c478bd9Sstevel@tonic-gate typedef struct event_data_scsi {
3657c478bd9Sstevel@tonic-gate 	uint8_t			TargetID;
3667c478bd9Sstevel@tonic-gate 	uint8_t			BusPort;
3677c478bd9Sstevel@tonic-gate 	uint16_t		Reserved;
3687c478bd9Sstevel@tonic-gate } event_data_scsi_t;
3697c478bd9Sstevel@tonic-gate 
3707c478bd9Sstevel@tonic-gate /*
3717c478bd9Sstevel@tonic-gate  * SCSI Device Status Change Event data
3727c478bd9Sstevel@tonic-gate  */
3737c478bd9Sstevel@tonic-gate typedef struct event_data_scsi_device_status_change {
3747c478bd9Sstevel@tonic-gate 	uint8_t			TargetID;
3757c478bd9Sstevel@tonic-gate 	uint8_t			Bus;
3767c478bd9Sstevel@tonic-gate 	uint8_t			ReasonCode;
3777c478bd9Sstevel@tonic-gate 	uint8_t			LUN;
3787c478bd9Sstevel@tonic-gate 	uint8_t			ASC;
3797c478bd9Sstevel@tonic-gate 	uint8_t			ASCQ;
3807c478bd9Sstevel@tonic-gate 	uint16_t		Reserved;
3817c478bd9Sstevel@tonic-gate } event_data_scsi_device_status_change_t;
3827c478bd9Sstevel@tonic-gate 
3837c478bd9Sstevel@tonic-gate /*
3847c478bd9Sstevel@tonic-gate  * SCSI Device Status Change Event data ReasonCode values
3857c478bd9Sstevel@tonic-gate  */
3867c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SCSI_DEV_STAT_RC_ADDED		0x03
3877c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SCSI_DEV_STAT_RC_NOT_RESPONDING	0x04
3887c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA		0x05
3897c478bd9Sstevel@tonic-gate 
3907c478bd9Sstevel@tonic-gate /*
3917c478bd9Sstevel@tonic-gate  * SAS Device Status Change event data
3927c478bd9Sstevel@tonic-gate  */
3937c478bd9Sstevel@tonic-gate typedef struct event_data_sas_device_status_change {
3947c478bd9Sstevel@tonic-gate 	uint8_t		TargetID;
3957c478bd9Sstevel@tonic-gate 	uint8_t		Bus;
3967c478bd9Sstevel@tonic-gate 	uint8_t		ReasonCode;
3977c478bd9Sstevel@tonic-gate 	uint8_t		Reserved;
3987c478bd9Sstevel@tonic-gate 	uint8_t		ASC;
3997c478bd9Sstevel@tonic-gate 	uint8_t		ASCQ;
4007c478bd9Sstevel@tonic-gate 	uint16_t	DevHandle;
4017c478bd9Sstevel@tonic-gate 	uint32_t	DeviceInfo;
4027c478bd9Sstevel@tonic-gate 	uint16_t	ParentDevHandle;
4037c478bd9Sstevel@tonic-gate 	uint8_t		PhyNum;
4047c478bd9Sstevel@tonic-gate 	uint8_t		Reserved1;
4057c478bd9Sstevel@tonic-gate 	uint64_t	SASAddress;
4067c478bd9Sstevel@tonic-gate } event_data_sas_device_status_change_t;
4077c478bd9Sstevel@tonic-gate 
4087c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_DEV_STAT_RC_ADDED			0x03
4097c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING	0x04
4107c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA		0x05
4117c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED	0x06
4127c478bd9Sstevel@tonic-gate 
4137c478bd9Sstevel@tonic-gate /*
4147c478bd9Sstevel@tonic-gate  * SCSI event data for queue full event
4157c478bd9Sstevel@tonic-gate  */
4167c478bd9Sstevel@tonic-gate typedef struct event_data_queue_full {
4177c478bd9Sstevel@tonic-gate 	uint8_t		TargetID;
4187c478bd9Sstevel@tonic-gate 	uint8_t		Bus;
4197c478bd9Sstevel@tonic-gate 	uint16_t	CurrentDepth;
4207c478bd9Sstevel@tonic-gate } event_data_queue_full_t;
4217c478bd9Sstevel@tonic-gate 
4227c478bd9Sstevel@tonic-gate /*
4237c478bd9Sstevel@tonic-gate  * MPI Link Status Change Event data
4247c478bd9Sstevel@tonic-gate  */
4257c478bd9Sstevel@tonic-gate typedef struct event_data_link_status {
4267c478bd9Sstevel@tonic-gate 	uint8_t			State;
4277c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
4287c478bd9Sstevel@tonic-gate 	uint16_t		Reserved1;
4297c478bd9Sstevel@tonic-gate 	uint8_t			Reserved2;
4307c478bd9Sstevel@tonic-gate 	uint8_t			Port;
4317c478bd9Sstevel@tonic-gate 	uint16_t		Reserved3;
4327c478bd9Sstevel@tonic-gate } event_data_link_status_t;
4337c478bd9Sstevel@tonic-gate 
4347c478bd9Sstevel@tonic-gate #define	MPI_EVENT_LINK_STATUS_FAILURE		0x00000000
4357c478bd9Sstevel@tonic-gate #define	MPI_EVENT_LINK_STATUS_ACTIVE		0x00000001
4367c478bd9Sstevel@tonic-gate 
4377c478bd9Sstevel@tonic-gate /* MPI Loop State Change Event data */
4387c478bd9Sstevel@tonic-gate 
4397c478bd9Sstevel@tonic-gate typedef struct event_data_loop_state {
4407c478bd9Sstevel@tonic-gate 	uint8_t			Character4;
4417c478bd9Sstevel@tonic-gate 	uint8_t			Character3;
4427c478bd9Sstevel@tonic-gate 	uint8_t			Type;
4437c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
4447c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1;
4457c478bd9Sstevel@tonic-gate 	uint8_t			Port;
4467c478bd9Sstevel@tonic-gate 	uint16_t		Reserved2;
4477c478bd9Sstevel@tonic-gate } event_data_loop_state_t;
4487c478bd9Sstevel@tonic-gate 
4497c478bd9Sstevel@tonic-gate #define	MPI_EVENT_LOOP_STATE_CHANGE_LIP		0x0001
4507c478bd9Sstevel@tonic-gate #define	MPI_EVENT_LOOP_STATE_CHANGE_LPE		0x0002
4517c478bd9Sstevel@tonic-gate #define	MPI_EVENT_LOOP_STATE_CHANGE_LPB		0x0003
4527c478bd9Sstevel@tonic-gate 
4537c478bd9Sstevel@tonic-gate /*
4547c478bd9Sstevel@tonic-gate  * MPI LOGOUT Event data
4557c478bd9Sstevel@tonic-gate  */
4567c478bd9Sstevel@tonic-gate typedef struct event_data_logout {
4577c478bd9Sstevel@tonic-gate 	uint32_t		NPortID;
4587c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
4597c478bd9Sstevel@tonic-gate 	uint8_t			Port;
4607c478bd9Sstevel@tonic-gate 	uint16_t		Reserved1;
4617c478bd9Sstevel@tonic-gate } event_data_logout_t;
4627c478bd9Sstevel@tonic-gate 
4637c478bd9Sstevel@tonic-gate /*
4647c478bd9Sstevel@tonic-gate  * MPI RAID Status Change Event Data
4657c478bd9Sstevel@tonic-gate  */
4667c478bd9Sstevel@tonic-gate typedef struct event_data_raid {
4677c478bd9Sstevel@tonic-gate 	uint8_t			VolumeID;
4687c478bd9Sstevel@tonic-gate 	uint8_t			VolumeBus;
4697c478bd9Sstevel@tonic-gate 	uint8_t			ReasonCode;
4707c478bd9Sstevel@tonic-gate 	uint8_t			PhysDiskNum;
4717c478bd9Sstevel@tonic-gate 	uint8_t			ASC;
4727c478bd9Sstevel@tonic-gate 	uint8_t			ASCQ;
4737c478bd9Sstevel@tonic-gate 	uint16_t		Reserved;
4747c478bd9Sstevel@tonic-gate 	uint32_t		SettingsStatus;
4757c478bd9Sstevel@tonic-gate } event_data_raid_t;
4767c478bd9Sstevel@tonic-gate 
4777c478bd9Sstevel@tonic-gate /* MPI RAID Status Change Event data ReasonCode values */
4787c478bd9Sstevel@tonic-gate #define	MPI_EVENT_RAID_RC_VOLUME_CREATED		0x00
4797c478bd9Sstevel@tonic-gate #define	MPI_EVENT_RAID_RC_VOLUME_DELETED		0x01
4807c478bd9Sstevel@tonic-gate #define	MPI_EVENT_RAID_RC_VOLUME_SETTINGS_CHANGED	0x02
4817c478bd9Sstevel@tonic-gate #define	MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED		0x03
4827c478bd9Sstevel@tonic-gate #define	MPI_EVENT_RAID_RC_VOLUME_PHYSDISK_CHANGED	0x04
4837c478bd9Sstevel@tonic-gate #define	MPI_EVENT_RAID_RC_PHYSDISK_CREATED		0x05
4847c478bd9Sstevel@tonic-gate #define	MPI_EVENT_RAID_RC_PHYSDISK_DELETED		0x06
4857c478bd9Sstevel@tonic-gate #define	MPI_EVENT_RAID_RC_PHYSDISK_SETTINGS_CHANGED	0x07
4867c478bd9Sstevel@tonic-gate #define	MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED	0x08
4877c478bd9Sstevel@tonic-gate #define	MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED		0x09
4887c478bd9Sstevel@tonic-gate #define	MPI_EVENT_RAID_RC_SMART_DATA			0x0A
4897c478bd9Sstevel@tonic-gate #define	MPI_EVENT_RAID_RC_REPLACE_ACTION_STARTED	0x0B
4907c478bd9Sstevel@tonic-gate 
4917c478bd9Sstevel@tonic-gate /*
4927c478bd9Sstevel@tonic-gate  * SAS Phy link down event data
4937c478bd9Sstevel@tonic-gate  */
4947c478bd9Sstevel@tonic-gate typedef struct event_data_sas_phy_link_status {
4957c478bd9Sstevel@tonic-gate 	uint8_t		PhyNum;
4967c478bd9Sstevel@tonic-gate 	uint8_t		LinkRates;
4977c478bd9Sstevel@tonic-gate 	uint16_t	DevHandle;
4987c478bd9Sstevel@tonic-gate 	uint64_t	SASAddress;
4997c478bd9Sstevel@tonic-gate } event_data_sas_phy_link_status_t;
5007c478bd9Sstevel@tonic-gate 
5017c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_PLS_LR_CURRENT_MASK			0xF0
5027c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_PLS_LR_CURRENT_SHIFT			4
5037c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_PLS_LR_PREVIOUS_MASK			0x0F
5047c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_PLS_LR_PREVIOUS_SHIFT			0
5057c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_PLS_LR_RATE_UNKNOWN			0x00
5067c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_PLS_LR_RATE_PHY_DISABLED			0x01
5077c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_PLS_LR_RATE_FAILED_SPEED_NEGOTIATION	0x02
5087c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE		0x03
5097c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_PLS_LR_RATE_1_5				0x08
5107c478bd9Sstevel@tonic-gate #define	MPI_EVENT_SAS_PLS_LR_RATE_3_0				0x09
5117c478bd9Sstevel@tonic-gate 
512*9c8b6a95Sjw /*
513*9c8b6a95Sjw  * sas discovery error structure
514*9c8b6a95Sjw  */
515*9c8b6a95Sjw typedef struct event_data_sas_discovery_error {
516*9c8b6a95Sjw 	uint32_t	DiscoveryStatus;
517*9c8b6a95Sjw 	uint8_t		Port;
518*9c8b6a95Sjw 	uint8_t		Reserved[3];
519*9c8b6a95Sjw } event_data_sas_discovery_error_t;
520*9c8b6a95Sjw 
521*9c8b6a95Sjw /*
522*9c8b6a95Sjw  * values for DiscoveryStatus field of SAS Discovery Error Event Data
523*9c8b6a95Sjw  */
524*9c8b6a95Sjw 
525*9c8b6a95Sjw #define	MPI_EVENT_SAS_DE_DS_LOOP_DETECTED		0x00000001
526*9c8b6a95Sjw #define	MPI_EVENT_SAS_DE_DS_UNADDRESSABLE_DEVICE	0x00000002
527*9c8b6a95Sjw #define	MPI_EVENT_SAS_DE_DS_MULTIPLE_PORTS		0x00000004
528*9c8b6a95Sjw #define	MPI_EVENT_SAS_DE_DS_EXPANDER_ERR		0x00000008
529*9c8b6a95Sjw #define	MPI_EVENT_SAS_DE_DS_SMP_TIMEOUT			0x00000010
530*9c8b6a95Sjw #define	MPI_EVENT_SAS_DE_DS_OUT_ROUTE_ENTRIES		0x00000020
531*9c8b6a95Sjw #define	MPI_EVENT_SAS_DE_DS_INDEX_NOT_EXIST		0x00000040
532*9c8b6a95Sjw #define	MPI_EVENT_SAS_DE_DS_SMP_FUNCTION_FAILED		0x00000080
533*9c8b6a95Sjw #define	MPI_EVENT_SAS_DE_DS_SMP_CRC_ERR			0x00000100
534*9c8b6a95Sjw #define	MPI_EVENT_SAS_DE_DS_MULTIPLE_SUBTRACTIVE	0x00000200
535*9c8b6a95Sjw #define	MPI_EVENT_SAS_DE_DS_TABLE_TO_TABLE		0x00000400
536*9c8b6a95Sjw #define	MPI_EVENT_SAS_DE_DS_MULTIPLE_PATHS		0x00000800
537*9c8b6a95Sjw #define	MPI_EVENT_SAS_DE_DS_MAX_SATA_TARGS		0x00001000
538*9c8b6a95Sjw 
539936b7af6Sjw typedef struct event_data_sas_expander_status_change {
540936b7af6Sjw 	uint8_t		ReasonCode;
541936b7af6Sjw 	uint8_t		Reserved1;
542936b7af6Sjw 	uint16_t	Reserved2;
543936b7af6Sjw 	uint8_t		PhysicalPort;
544936b7af6Sjw 	uint8_t		Reserved3;
545936b7af6Sjw 	uint16_t	EnclosureHandle;
546936b7af6Sjw 	uint64_t	SASAddress;
547936b7af6Sjw 	uint32_t	DiscoveryStatus;
548936b7af6Sjw 	uint16_t	DevHandle;
549936b7af6Sjw 	uint16_t	ParentDevHandle;
550936b7af6Sjw 	uint16_t	ExpanderChangeCount;
551936b7af6Sjw 	uint16_t	ExpanderRouteIndexes;
552936b7af6Sjw 	uint8_t		NumPhys;
553936b7af6Sjw 	uint8_t		SASLevel;
554936b7af6Sjw 	uint8_t		Flags;
555936b7af6Sjw 	uint8_t		Reserved4;
556936b7af6Sjw } event_data_sas_expander_status_change_t;
557936b7af6Sjw 
558936b7af6Sjw /*
559936b7af6Sjw  * values for ReasonCode field of SAS Expander Status Change Event data
560936b7af6Sjw  */
561936b7af6Sjw #define	MPI_EVENT_SAS_EXP_RC_ADDED		0x00
562936b7af6Sjw #define	MPI_EVENT_SAS_EXP_RC_NOT_RESPONDING	0x01
563936b7af6Sjw 
564936b7af6Sjw /*
565936b7af6Sjw  * values for DiscoveryStatus field of SAS Expander Status Change Event data
566936b7af6Sjw  */
567936b7af6Sjw #define	MPI_EVENT_SAS_EXP_DS_LOOP_DETECTED		0x00000001
568936b7af6Sjw #define	MPI_EVENT_SAS_EXP_DS_UNADDRESSABLE_DEVICE	0x00000002
569936b7af6Sjw #define	MPI_EVENT_SAS_EXP_DS_MULTIPLE_PORTS		0x00000004
570936b7af6Sjw #define	MPI_EVENT_SAS_EXP_DS_EXPANDER_ERR		0x00000008
571936b7af6Sjw #define	MPI_EVENT_SAS_EXP_DS_SMP_TIMEOUT		0x00000010
572936b7af6Sjw #define	MPI_EVENT_SAS_EXP_DS_OUT_ROUTE_ENTRIES		0x00000020
573936b7af6Sjw #define	MPI_EVENT_SAS_EXP_DS_INDEX_NOT_EXIST		0x00000040
574936b7af6Sjw #define	MPI_EVENT_SAS_EXP_DS_SMP_FUNCTION_FAILED	0x00000080
575936b7af6Sjw #define	MPI_EVENT_SAS_EXP_DS_SMP_CRC_ERROR		0x00000100
576936b7af6Sjw #define	MPI_EVENT_SAS_EXP_DS_SUBTRACTIVE_LINK		0x00000200
577936b7af6Sjw #define	MPI_EVENT_SAS_EXP_DS_TABLE_LINK			0x00000400
578936b7af6Sjw #define	MPI_EVENT_SAS_EXP_DS_UNSUPPORTED_DEVICE		0x00000800
579936b7af6Sjw 
580936b7af6Sjw /*
581936b7af6Sjw  *  values for Flags field of SAS Expander Status Change Event data
582936b7af6Sjw  */
583936b7af6Sjw #define	MPI_EVENT_SAS_EXP_FLAGS_ROUTE_TABLE_CONFIG	0x02
584936b7af6Sjw #define	MPI_EVENT_SAS_EXP_FLAGS_CONFIG_IN_PROGRESS	0x01
585936b7af6Sjw 
586936b7af6Sjw 
5877c478bd9Sstevel@tonic-gate /*
5887c478bd9Sstevel@tonic-gate  * Firmware Load Messages
5897c478bd9Sstevel@tonic-gate  */
5907c478bd9Sstevel@tonic-gate 
5917c478bd9Sstevel@tonic-gate /*
5927c478bd9Sstevel@tonic-gate  * Firmware download message and associated structures
5937c478bd9Sstevel@tonic-gate  */
5947c478bd9Sstevel@tonic-gate typedef struct msg_fw_download {
5957c478bd9Sstevel@tonic-gate 	uint8_t			ImageType;
5967c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
5977c478bd9Sstevel@tonic-gate 	uint8_t			ChainOffset;
5987c478bd9Sstevel@tonic-gate 	uint8_t			Function;
5997c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1[3];
6007c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
6017c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
6027c478bd9Sstevel@tonic-gate 	sge_mpi_union_t		SGL;
6037c478bd9Sstevel@tonic-gate } msg_fw_download_t;
6047c478bd9Sstevel@tonic-gate 
6057c478bd9Sstevel@tonic-gate #define	MPI_FW_DOWNLOAD_MSGFLGS_LAST_SEGMENT	0x01
6067c478bd9Sstevel@tonic-gate 
6077c478bd9Sstevel@tonic-gate #define	MPI_FW_DOWNLOAD_ITYPE_RESERVED		0x00
6087c478bd9Sstevel@tonic-gate #define	MPI_FW_DOWNLOAD_ITYPE_FW		0x01
6097c478bd9Sstevel@tonic-gate #define	MPI_FW_DOWNLOAD_ITYPE_BIOS		0x02
6107c478bd9Sstevel@tonic-gate #define	MPI_FW_DOWNLOAD_ITYPE_NVDATA		0x03
6117c478bd9Sstevel@tonic-gate #define	MPI_FW_DOWNLOAD_ITYPE_BOOTLOADER	0x04
6127c478bd9Sstevel@tonic-gate 
6137c478bd9Sstevel@tonic-gate typedef struct fw_download_tcsge {
6147c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
6157c478bd9Sstevel@tonic-gate 	uint8_t			ContextSize;
6167c478bd9Sstevel@tonic-gate 	uint8_t			DetailsLength;
6177c478bd9Sstevel@tonic-gate 	uint8_t			Flags;
6187c478bd9Sstevel@tonic-gate 	uint32_t		Reserved_0100_Checksum; /* obsolete */
6197c478bd9Sstevel@tonic-gate 	uint32_t		ImageOffset;
6207c478bd9Sstevel@tonic-gate 	uint32_t		ImageSize;
6217c478bd9Sstevel@tonic-gate } fw_download_tcsge_t;
6227c478bd9Sstevel@tonic-gate 
6237c478bd9Sstevel@tonic-gate typedef struct msg_fw_download_reply {
6247c478bd9Sstevel@tonic-gate 	uint8_t			ImageType;
6257c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
6267c478bd9Sstevel@tonic-gate 	uint8_t			MsgLength;
6277c478bd9Sstevel@tonic-gate 	uint8_t			Function;
6287c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1[3];
6297c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
6307c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
6317c478bd9Sstevel@tonic-gate 	uint16_t		Reserved2;
6327c478bd9Sstevel@tonic-gate 	uint16_t		IOCStatus;
6337c478bd9Sstevel@tonic-gate 	uint32_t		IOCLogInfo;
6347c478bd9Sstevel@tonic-gate } msg_fw_download_reply_t;
6357c478bd9Sstevel@tonic-gate 
6367c478bd9Sstevel@tonic-gate /*
6377c478bd9Sstevel@tonic-gate  * Firmware upload messages and associated structures
6387c478bd9Sstevel@tonic-gate  */
6397c478bd9Sstevel@tonic-gate typedef struct msg_fw_upload {
6407c478bd9Sstevel@tonic-gate 	uint8_t			ImageType;
6417c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
6427c478bd9Sstevel@tonic-gate 	uint8_t			ChainOffset;
6437c478bd9Sstevel@tonic-gate 	uint8_t			Function;
6447c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1[3];
6457c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
6467c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
6477c478bd9Sstevel@tonic-gate 	sge_mpi_union_t		SGL;
6487c478bd9Sstevel@tonic-gate } msg_fw_upload_t;
6497c478bd9Sstevel@tonic-gate 
6507c478bd9Sstevel@tonic-gate #define	MPI_FW_UPLOAD_ITYPE_FW_IOC_MEM	0x00
6517c478bd9Sstevel@tonic-gate #define	MPI_FW_UPLOAD_ITYPE_FW_FLASH	0x01
6527c478bd9Sstevel@tonic-gate #define	MPI_FW_UPLOAD_ITYPE_BIOS_FLASH	0x02
6537c478bd9Sstevel@tonic-gate #define	MPI_FW_UPLOAD_ITYPE_NVDATA	0x03
6547c478bd9Sstevel@tonic-gate #define	MPI_FW_UPLOAD_ITYPE_BOOTLOADER	0x04
6557c478bd9Sstevel@tonic-gate 
6567c478bd9Sstevel@tonic-gate typedef struct fw_upload_tcsge {
6577c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
6587c478bd9Sstevel@tonic-gate 	uint8_t			ContextSize;
6597c478bd9Sstevel@tonic-gate 	uint8_t			DetailsLength;
6607c478bd9Sstevel@tonic-gate 	uint8_t			Flags;
6617c478bd9Sstevel@tonic-gate 	uint32_t		Reserved1;
6627c478bd9Sstevel@tonic-gate 	uint32_t		ImageOffset;
6637c478bd9Sstevel@tonic-gate 	uint32_t		ImageSize;
6647c478bd9Sstevel@tonic-gate } fw_upload_tcsge_t;
6657c478bd9Sstevel@tonic-gate 
6667c478bd9Sstevel@tonic-gate typedef struct msg_fw_upload_reply {
6677c478bd9Sstevel@tonic-gate 	uint8_t			ImageType;
6687c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
6697c478bd9Sstevel@tonic-gate 	uint8_t			MsgLength;
6707c478bd9Sstevel@tonic-gate 	uint8_t			Function;
6717c478bd9Sstevel@tonic-gate 	uint8_t			Reserved1[3];
6727c478bd9Sstevel@tonic-gate 	uint8_t			MsgFlags;
6737c478bd9Sstevel@tonic-gate 	uint32_t		MsgContext;
6747c478bd9Sstevel@tonic-gate 	uint16_t		Reserved2;
6757c478bd9Sstevel@tonic-gate 	uint16_t		IOCStatus;
6767c478bd9Sstevel@tonic-gate 	uint32_t		IOCLogInfo;
6777c478bd9Sstevel@tonic-gate 	uint32_t		ActualImageSize;
6787c478bd9Sstevel@tonic-gate } msg_fw_upload_reply_t;
6797c478bd9Sstevel@tonic-gate 
6807c478bd9Sstevel@tonic-gate typedef struct msg_fw_header {
6817c478bd9Sstevel@tonic-gate 	uint32_t		ArmBranchInstruction0;
6827c478bd9Sstevel@tonic-gate 	uint32_t		Signature0;
6837c478bd9Sstevel@tonic-gate 	uint32_t		Signature1;
6847c478bd9Sstevel@tonic-gate 	uint32_t		Signature2;
6857c478bd9Sstevel@tonic-gate 	uint32_t		ArmBranchInstruction1;
6867c478bd9Sstevel@tonic-gate 	uint32_t		ArmBranchInstruction2;
6877c478bd9Sstevel@tonic-gate 	uint32_t		Reserved;
6887c478bd9Sstevel@tonic-gate 	uint32_t		Checksum;
6897c478bd9Sstevel@tonic-gate 	uint16_t		VendorId;
6907c478bd9Sstevel@tonic-gate 	uint16_t		ProductId;
6917c478bd9Sstevel@tonic-gate 	mpi_fw_version_t	FWVersion;
6927c478bd9Sstevel@tonic-gate 	uint32_t		SeqCodeVersion;
6937c478bd9Sstevel@tonic-gate 	uint32_t		ImageSize;
6947c478bd9Sstevel@tonic-gate 	uint32_t		NextImageHeaderOffset;
6957c478bd9Sstevel@tonic-gate 	uint32_t		LoadStartAddress;
6967c478bd9Sstevel@tonic-gate 	uint32_t		IopResetVectorValue;
6977c478bd9Sstevel@tonic-gate 	uint32_t		IopResetRegAddr;
6987c478bd9Sstevel@tonic-gate 	uint32_t		VersionNameWhat;
6997c478bd9Sstevel@tonic-gate 	uint8_t			VersionName[32];
7007c478bd9Sstevel@tonic-gate 	uint32_t		VendorNameWhat;
7017c478bd9Sstevel@tonic-gate 	uint8_t			VendorName[32];
7027c478bd9Sstevel@tonic-gate } msg_fw_header_t;
7037c478bd9Sstevel@tonic-gate 
7047c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_WHAT_SIGNATURE			0x29232840
7057c478bd9Sstevel@tonic-gate 
7067c478bd9Sstevel@tonic-gate /* defines for using the ProductId field */
7077c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_TYPE_MASK			0xF000
7087c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_TYPE_SCSI			0x0000
7097c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_TYPE_FC			0x1000
7107c478bd9Sstevel@tonic-gate 
7117c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_PROD_MASK			0x0F00
7127c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_PROD_INITIATOR_SCSI		0x0100
7137c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_PROD_TARGET_INITIATOR_SCSI	0x0200
7147c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_PROD_TARGET_SCSI		0x0300
7157c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_PROD_IM_SCSI			0x0400
7167c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_PROD_IS_SCSI			0x0500
7177c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_PROD_CTX_SCSI			0x0600
7187c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_PROD_IR_SCSI			0x0700
7197c478bd9Sstevel@tonic-gate 
7207c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_MASK			0x00FF
7217c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1030A0_SCSI		0x0001
7227c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1030B0_SCSI		0x0002
7237c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1030B1_SCSI		0x0003
7247c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1030C0_SCSI		0x0004
7257c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1020A0_SCSI		0x0005
7267c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1020B0_SCSI		0x0006
7277c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1020B1_SCSI		0x0007
7287c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1020C0_SCSI		0x0008
7297c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1035A0_SCSI		0x0009
7307c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1035B0_SCSI		0x000A
7317c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1030TA0_SCSI		0x000B
7327c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1020TA0_SCSI		0x000C
7337c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_909_FC			0x0000
7347c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_919_FC			0x0001
7357c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_919X_FC		0x0002
7367c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1064_SAS		0x0001
7377c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1068_SAS		0x0002
7387c478bd9Sstevel@tonic-gate #define	MPI_FW_HEADER_PID_FAMILY_1078_SAS		0x0003
7397c478bd9Sstevel@tonic-gate 
7407c478bd9Sstevel@tonic-gate typedef struct mpi_ext_image_header {
7417c478bd9Sstevel@tonic-gate 	uint8_t			ImageType;
7427c478bd9Sstevel@tonic-gate 	uint8_t			Reserved;
7437c478bd9Sstevel@tonic-gate 	uint16_t		Reserved1;
7447c478bd9Sstevel@tonic-gate 	uint32_t		Checksum;
7457c478bd9Sstevel@tonic-gate 	uint32_t		ImageSize;
7467c478bd9Sstevel@tonic-gate 	uint32_t		NextImageHeaderOffset;
7477c478bd9Sstevel@tonic-gate 	uint32_t		LoadStartAddress;
7487c478bd9Sstevel@tonic-gate 	uint32_t		Reserved2;
7497c478bd9Sstevel@tonic-gate } mpi_ext_image_header_t;
7507c478bd9Sstevel@tonic-gate 
7517c478bd9Sstevel@tonic-gate #define	MPI_EXT_IMAGE_TYPE_UNSPECIFIED			0x00
7527c478bd9Sstevel@tonic-gate #define	MPI_EXT_IMAGE_TYPE_FW				0x01
7537c478bd9Sstevel@tonic-gate #define	MPI_EXT_IMAGE_TYPE_NVDATA			0x03
7547c478bd9Sstevel@tonic-gate #define	MPI_EXT_IMAGE_TYPE_BOOTLOADER			0x04
7557c478bd9Sstevel@tonic-gate 
7567c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
7577c478bd9Sstevel@tonic-gate }
7587c478bd9Sstevel@tonic-gate #endif
7597c478bd9Sstevel@tonic-gate 
7607c478bd9Sstevel@tonic-gate #endif	/* _SYS_MPI_IOC_H */
761