xref: /titanic_41/usr/src/uts/common/sys/mpt/mpi_ioc.h (revision e7cbe64f7a72dae5cb44f100db60ca88f3313c65)
1 /*
2  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 #ifndef _SYS_MPI_IOC_H
7 #define	_SYS_MPI_IOC_H
8 
9 #pragma ident	"%Z%%M%	%I%	%E% SMI"
10 
11 #ifdef	__cplusplus
12 extern "C" {
13 #endif
14 
15 /*
16  * IOCInit message
17  */
18 typedef struct msg_ioc_init {
19 	uint8_t			WhoInit;
20 	uint8_t			Reserved;
21 	uint8_t			ChainOffset;
22 	uint8_t			Function;
23 	uint8_t			Flags;
24 	uint8_t			MaxDevices;
25 	uint8_t			MaxBuses;
26 	uint8_t			MsgFlags;
27 	uint32_t		MsgContext;
28 	uint16_t		ReplyFrameSize;
29 	uint8_t			Reserved1[2];
30 	uint32_t		HostMfaHighAddr;
31 	uint32_t		SenseBufferHighAddr;
32 	/* following used in new mpi implementations */
33 	uint32_t		ReplyFifoHostSignalingAddr;
34 	sge_simple_union_t	HostPageBufferSGE;
35 	uint16_t		MsgVersion;
36 	uint16_t		HeaderVersion;
37 } msg_ioc_init_t;
38 
39 typedef struct msg_ioc_init_reply {
40 	uint8_t			WhoInit;
41 	uint8_t			Reserved;
42 	uint8_t			MsgLength;
43 	uint8_t			Function;
44 	uint8_t			Flags;
45 	uint8_t			MaxDevices;
46 	uint8_t			MaxBuses;
47 	uint8_t			MsgFlags;
48 	uint32_t		MsgContext;
49 	uint16_t		Reserved2;
50 	uint16_t		IOCStatus;
51 	uint32_t		IOCLogInfo;
52 } msg_ioc_init_reply_t;
53 
54 /*
55  *  WhoInit values
56  */
57 #define	MPI_WHOINIT_NO_ONE			0x00
58 #define	MPI_WHOINIT_SYSTEM_BIOS			0x01
59 #define	MPI_WHOINIT_ROM_BIOS			0x02
60 #define	MPI_WHOINIT_PCI_PEER			0x03
61 #define	MPI_WHOINIT_HOST_DRIVER			0x04
62 #define	MPI_WHOINIT_MANUFACTURER		0x05
63 
64 /*
65  * Flags values
66  */
67 #define	MPI_IOCINIT_FLAGS_DISCARD_FW_IMAGE		0x01
68 #define	MPI_IOCINIT_FLAGS_REPLY_FIFO_HOST_SIGNAL	0x02
69 
70 #define	MPI_IOCINIT_MSGVERSION_MAJOR_MASK	(0xFF00)
71 #define	MPI_IOCINIT_MSGVERSION_MAJOR_SHIFT	(8)
72 #define	MPI_IOCINIT_MSGVERSION_MINOR_MASK	(0x00FF)
73 #define	MPI_IOCINIT_MSGVERSION_MINOR_SHIFT	(0)
74 
75 #define	MPI_IOCINIT_HEADERVERSION_UNIT_MASK	(0xFF00)
76 #define	MPI_IOCINIT_HEADERVERSION_UNIT_SHIFT	(8)
77 #define	MPI_IOCINIT_HEADERVERSION_DEV_MASK	(0x00FF)
78 #define	MPI_IOCINIT_HEADERVERSION_DEV_SHIFT	(0)
79 
80 
81 /*
82  * IOC Facts message
83  */
84 typedef struct msg_ioc_facts {
85 	uint8_t			Reserved[2];
86 	uint8_t			ChainOffset;
87 	uint8_t			Function;
88 	uint8_t			Reserved1[3];
89 	uint8_t			MsgFlags;
90 	uint32_t		MsgContext;
91 } msg_ioc_facts_t;
92 
93 /*
94  * FW version
95  */
96 typedef struct mpi_fw_version_struct {
97 	uint8_t			Dev;
98 	uint8_t			Unit;
99 	uint8_t			Minor;
100 	uint8_t			Major;
101 } mpi_fw_version_struct_t;
102 
103 typedef union mpi_fw_version {
104 	mpi_fw_version_struct_t	Struct;
105 	uint32_t		Word;
106 } mpi_fw_version_t;
107 
108 /*
109  * IOC Facts Reply
110  */
111 typedef struct msg_ioc_facts_reply {
112 	uint16_t		MsgVersion;
113 	uint8_t			MsgLength;
114 	uint8_t			Function;
115 	uint16_t		HeaderVersion;
116 	uint8_t			IOCNumber;
117 	uint8_t			MsgFlags;
118 	uint32_t		MsgContext;
119 	uint16_t		IOCExceptions;
120 	uint16_t		IOCStatus;
121 	uint32_t		IOCLogInfo;
122 	uint8_t			MaxChainDepth;
123 	uint8_t			WhoInit;
124 	uint8_t			BlockSize;
125 	uint8_t			Flags;
126 	uint16_t		ReplyQueueDepth;
127 	uint16_t		RequestFrameSize;
128 	uint16_t		Reserved_0101_FWVersion; /* obsolete */
129 	uint16_t		ProductID;
130 	uint32_t		CurrentHostMfaHighAddr;
131 	uint16_t		GlobalCredits;
132 	uint8_t			NumberOfPorts;
133 	uint8_t			EventState;
134 	uint32_t		CurrentSenseBufferHighAddr;
135 	uint16_t		CurReplyFrameSize;
136 	uint8_t			MaxDevices;
137 	uint8_t			MaxBuses;
138 	uint32_t		FWImageSize;
139 	uint32_t		IOCCapabilities;
140 	mpi_fw_version_t	FWVersion;
141 	/* following used in newer mpi implementations */
142 	uint16_t		HighPriorityQueueDepth;
143 	uint16_t		Reserved2;
144 	sge_simple_union_t	HostPageBufferSGE;
145 } msg_ioc_facts_reply_t;
146 
147 #define	MPI_IOCFACTS_MSGVERSION_MAJOR_MASK	0xFF00
148 #define	MPI_IOCFACTS_MSGVERSION_MINOR_MASK	0x00FF
149 
150 #define	MPI_IOCFACTS_HEADERVERSION_UNIT_MASK	0xFF00
151 #define	MPI_IOCFACTS_HEADERVERSION_DEV_MASK	0x00FF
152 
153 #define	MPI_IOCFACTS_EXCEPT_CONFIG_CHECKSUM_FAIL	0x0001
154 #define	MPI_IOCFACTS_EXCEPT_RAID_CONFIG_INVALID		0x0002
155 #define	MPI_IOCFACTS_EXCEPT_FW_CHECKSUM_FAIL		0x0004
156 #define	MPI_IOCFACTS_EXCEPT_PERSISTENT_TABLE_FULL	0x0008
157 
158 #define	MPI_IOCFACTS_FLAGS_FW_DOWNLOAD_BOOT	0x01
159 
160 #define	MPI_IOCFACTS_EVENTSTATE_DISABLED	0x00
161 #define	MPI_IOCFACTS_EVENTSTATE_ENABLED		0x01
162 
163 #define	MPI_IOCFACTS_CAPABILITY_HIGH_PRI_Q		0x00000001
164 #define	MPI_IOCFACTS_CAPABILITY_REPLY_HOST_SIGNAL	0x00000002
165 #define	MPI_IOCFACTS_CAPABILITY_QUEUE_FULL_HANDLING	0x00000004
166 #define	MPI_IOCFACTS_CAPABILITY_DIAG_TRACE_BUFFER	0x00000008
167 #define	MPI_IOCFACTS_CAPABILITY_SNAPSHOT_BUFFER		0x00000010
168 #define	MPI_IOCFACTS_CAPABILITY_EXTENDED_BUFFER		0x00000020
169 #define	MPI_IOCFACTS_CAPABILITY_EEDP			0x00000040
170 
171 /*
172  * Port Facts message and Reply
173  */
174 typedef struct msg_port_facts {
175 	uint8_t			Reserved[2];
176 	uint8_t			ChainOffset;
177 	uint8_t			Function;
178 	uint8_t			Reserved1[2];
179 	uint8_t			PortNumber;
180 	uint8_t			MsgFlags;
181 	uint32_t		MsgContext;
182 } msg_port_facts_t;
183 
184 typedef struct msg_port_facts_reply {
185 	uint16_t		Reserved;
186 	uint8_t			MsgLength;
187 	uint8_t			Function;
188 	uint16_t		Reserved1;
189 	uint8_t			PortNumber;
190 	uint8_t			MsgFlags;
191 	uint32_t		MsgContext;
192 	uint16_t		Reserved2;
193 	uint16_t		IOCStatus;
194 	uint32_t		IOCLogInfo;
195 	uint8_t			Reserved3;
196 	uint8_t			PortType;
197 	uint16_t		MaxDevices;
198 	uint16_t		PortSCSIID;
199 	uint16_t		ProtocolFlags;
200 	uint16_t		MaxPostedCmdBuffers;
201 	uint16_t		MaxPersistentIDs;
202 	uint16_t		MaxLanBuckets;
203 	uint16_t		Reserved4;
204 	uint32_t		Reserved5;
205 } msg_port_facts_reply_t;
206 
207 /*
208  * PortTypes values
209  */
210 #define	MPI_PORTFACTS_PORTTYPE_INACTIVE		0x00
211 #define	MPI_PORTFACTS_PORTTYPE_SCSI		0x01
212 #define	MPI_PORTFACTS_PORTTYPE_FC		0x10
213 #define	MPI_PORTFACTS_PORTTYPE_ISCSI		0x20
214 #define	MPI_PORTFACTS_PORTTYPE_SAS		0x30
215 
216 /*
217  * ProtocolFlags values
218  */
219 #define	MPI_PORTFACTS_PROTOCOL_LOGBUSADDR	0x01
220 #define	MPI_PORTFACTS_PROTOCOL_LAN		0x02
221 #define	MPI_PORTFACTS_PROTOCOL_TARGET		0x04
222 #define	MPI_PORTFACTS_PROTOCOL_INITIATOR	0x08
223 
224 /*
225  * Port Enable Message
226  */
227 typedef struct msg_port_enable {
228 	uint8_t			Reserved[2];
229 	uint8_t			ChainOffset;
230 	uint8_t			Function;
231 	uint8_t			Reserved1[2];
232 	uint8_t			PortNumber;
233 	uint8_t			MsgFlags;
234 	uint32_t		MsgContext;
235 } msg_port_enable_t;
236 
237 typedef struct msg_port_enable_reply {
238 	uint8_t			Reserved[2];
239 	uint8_t			MsgLength;
240 	uint8_t			Function;
241 	uint8_t			Reserved1[2];
242 	uint8_t			PortNumber;
243 	uint8_t			MsgFlags;
244 	uint32_t		MsgContext;
245 	uint16_t		Reserved2;
246 	uint16_t		IOCStatus;
247 	uint32_t		IOCLogInfo;
248 } msg_port_enable_reply_t;
249 
250 
251 /*
252  * Event Notification messages
253  */
254 typedef struct msg_event_notify {
255 	uint8_t			Switch;
256 	uint8_t			Reserved;
257 	uint8_t			ChainOffset;
258 	uint8_t			Function;
259 	uint8_t			Reserved1[3];
260 	uint8_t			MsgFlags;
261 	uint32_t		MsgContext;
262 } msg_event_notify_t;
263 
264 /*
265  * Event Notification Reply
266  */
267 typedef struct msg_event_notify_reply {
268 	uint16_t		EventDataLength;
269 	uint8_t			MsgLength;
270 	uint8_t			Function;
271 	uint8_t			Reserved1[2];
272 	uint8_t			AckRequired;
273 	uint8_t			MsgFlags;
274 	uint32_t		MsgContext;
275 	uint8_t			Reserved2[2];
276 	uint16_t		IOCStatus;
277 	uint32_t		IOCLogInfo;
278 	uint32_t		Event;
279 	uint32_t		EventContext;
280 	uint32_t		Data[1];
281 } msg_event_notify_reply_t;
282 
283 /*
284  * Event Acknowledge
285  */
286 typedef struct msg_event_ack {
287 	uint8_t			Reserved[2];
288 	uint8_t			ChainOffset;
289 	uint8_t			Function;
290 	uint8_t			Reserved1[3];
291 	uint8_t			MsgFlags;
292 	uint32_t		MsgContext;
293 	uint32_t		Event;
294 	uint32_t		EventContext;
295 } msg_event_ack_t;
296 
297 typedef struct msg_event_ack_reply {
298 	uint8_t			Reserved[2];
299 	uint8_t			Function;
300 	uint8_t			MsgLength;
301 	uint8_t			Reserved1[3];
302 	uint8_t			MsgFlags;
303 	uint32_t		MsgContext;
304 	uint16_t		Reserved2;
305 	uint16_t		IOCStatus;
306 	uint32_t		IOCLogInfo;
307 } msg_event_ack_reply_t;
308 
309 /*
310  * Switch
311  */
312 #define	MPI_EVENT_NOTIFICATION_SWITCH_OFF	0x00
313 #define	MPI_EVENT_NOTIFICATION_SWITCH_ON	0x01
314 
315 /*
316  * Event
317  */
318 #define	MPI_EVENT_NONE				0x00000000
319 #define	MPI_EVENT_LOG_DATA			0x00000001
320 #define	MPI_EVENT_STATE_CHANGE			0x00000002
321 #define	MPI_EVENT_UNIT_ATTENTION		0x00000003
322 #define	MPI_EVENT_IOC_BUS_RESET			0x00000004
323 #define	MPI_EVENT_EXT_BUS_RESET			0x00000005
324 #define	MPI_EVENT_RESCAN			0x00000006
325 #define	MPI_EVENT_LINK_STATUS_CHANGE		0x00000007
326 #define	MPI_EVENT_LOOP_STATE_CHANGE		0x00000008
327 #define	MPI_EVENT_LOGOUT			0x00000009
328 #define	MPI_EVENT_EVENT_CHANGE			0x0000000A
329 #define	MPI_EVENT_INTEGRATED_RAID		0x0000000B
330 #define	MPI_EVENT_SCSI_DEVICE_STATUS_CHANGE	0x0000000C
331 #define	MPI_EVENT_ON_BUS_TIMER_EXPIRED		0x0000000D
332 #define	MPI_EVENT_QUEUE_FULL			0x0000000E
333 #define	MPI_EVENT_SAS_DEVICE_STATUS_CHANGE	0x0000000F
334 #define	MPI_EVENT_SAS_SES			0x00000010
335 #define	MPI_EVENT_PERSISTENT_TABLE_FULL		0x00000011
336 #define	MPI_EVENT_SAS_PHY_LINK_STATUS		0x00000012
337 #define	MPI_EVENT_SAS_DISCOVERY_ERROR		0x00000013
338 #define	MPI_EVENT_IR_RESYNC_UPDATE		0x00000014
339 #define	MPI_EVENT_IR2				0x00000015
340 #define	MPI_EVENT_SAS_DISCOVERY			0x00000016
341 #define	MPI_EVENT_SAS_BROADCAST_PRIMITIVE	0x00000017
342 #define	MPI_EVENT_SAS_INIT_DEVICE_STATUS_CHANGE	0x00000018
343 #define	MPI_EVENT_SAS_INIT_TABLE_OVERFLOW	0x00000019
344 #define	MPI_EVENT_SAS_SMP_ERROR			0x0000001A
345 #define	MPI_EVENT_SAS_EXPANDER_STATUS_CHANGE	0x0000001B
346 #define	MPI_EVENT_LOG_ENTRY_ADDED		0x00000021
347 
348 /*
349  * AckRequired field values
350  */
351 #define	MPI_EVENT_NOTIFICATION_ACK_NOT_REQUIRED	0x00
352 #define	MPI_EVENT_NOTIFICATION_ACK_REQUIRED	0x01
353 
354 /*
355  * Eventchange event data
356  */
357 typedef struct event_data_event_change {
358 	uint8_t			EventState;
359 	uint8_t			Reserved;
360 	uint16_t		Reserved1;
361 } event_data_event_change_t;
362 
363 /*
364  * SCSI Event data for Port, Bus and Device forms)
365  */
366 typedef struct event_data_scsi {
367 	uint8_t			TargetID;
368 	uint8_t			BusPort;
369 	uint16_t		Reserved;
370 } event_data_scsi_t;
371 
372 /*
373  * SCSI Device Status Change Event data
374  */
375 typedef struct event_data_scsi_device_status_change {
376 	uint8_t			TargetID;
377 	uint8_t			Bus;
378 	uint8_t			ReasonCode;
379 	uint8_t			LUN;
380 	uint8_t			ASC;
381 	uint8_t			ASCQ;
382 	uint16_t		Reserved;
383 } event_data_scsi_device_status_change_t;
384 
385 /*
386  * SCSI Device Status Change Event data ReasonCode values
387  */
388 #define	MPI_EVENT_SCSI_DEV_STAT_RC_ADDED		0x03
389 #define	MPI_EVENT_SCSI_DEV_STAT_RC_NOT_RESPONDING	0x04
390 #define	MPI_EVENT_SCSI_DEV_STAT_RC_SMART_DATA		0x05
391 
392 /*
393  * SAS Device Status Change event data
394  */
395 typedef struct event_data_sas_device_status_change {
396 	uint8_t		TargetID;
397 	uint8_t		Bus;
398 	uint8_t		ReasonCode;
399 	uint8_t		Reserved;
400 	uint8_t		ASC;
401 	uint8_t		ASCQ;
402 	uint16_t	DevHandle;
403 	uint32_t	DeviceInfo;
404 	uint16_t	ParentDevHandle;
405 	uint8_t		PhyNum;
406 	uint8_t		Reserved1;
407 	uint64_t	SASAddress;
408 } event_data_sas_device_status_change_t;
409 
410 #define	MPI_EVENT_SAS_DEV_STAT_RC_ADDED			0x03
411 #define	MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING	0x04
412 #define	MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA		0x05
413 #define	MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED	0x06
414 
415 /*
416  * SCSI event data for queue full event
417  */
418 typedef struct event_data_queue_full {
419 	uint8_t		TargetID;
420 	uint8_t		Bus;
421 	uint16_t	CurrentDepth;
422 } event_data_queue_full_t;
423 
424 /*
425  * MPI Link Status Change Event data
426  */
427 typedef struct event_data_link_status {
428 	uint8_t			State;
429 	uint8_t			Reserved;
430 	uint16_t		Reserved1;
431 	uint8_t			Reserved2;
432 	uint8_t			Port;
433 	uint16_t		Reserved3;
434 } event_data_link_status_t;
435 
436 #define	MPI_EVENT_LINK_STATUS_FAILURE		0x00000000
437 #define	MPI_EVENT_LINK_STATUS_ACTIVE		0x00000001
438 
439 /* MPI Loop State Change Event data */
440 
441 typedef struct event_data_loop_state {
442 	uint8_t			Character4;
443 	uint8_t			Character3;
444 	uint8_t			Type;
445 	uint8_t			Reserved;
446 	uint8_t			Reserved1;
447 	uint8_t			Port;
448 	uint16_t		Reserved2;
449 } event_data_loop_state_t;
450 
451 #define	MPI_EVENT_LOOP_STATE_CHANGE_LIP		0x0001
452 #define	MPI_EVENT_LOOP_STATE_CHANGE_LPE		0x0002
453 #define	MPI_EVENT_LOOP_STATE_CHANGE_LPB		0x0003
454 
455 /*
456  * MPI LOGOUT Event data
457  */
458 typedef struct event_data_logout {
459 	uint32_t		NPortID;
460 	uint8_t			Reserved;
461 	uint8_t			Port;
462 	uint16_t		Reserved1;
463 } event_data_logout_t;
464 
465 /*
466  * MPI RAID Status Change Event Data
467  */
468 typedef struct event_data_raid {
469 	uint8_t			VolumeID;
470 	uint8_t			VolumeBus;
471 	uint8_t			ReasonCode;
472 	uint8_t			PhysDiskNum;
473 	uint8_t			ASC;
474 	uint8_t			ASCQ;
475 	uint16_t		Reserved;
476 	uint32_t		SettingsStatus;
477 } event_data_raid_t;
478 
479 /* MPI RAID Status Change Event data ReasonCode values */
480 #define	MPI_EVENT_RAID_RC_VOLUME_CREATED		0x00
481 #define	MPI_EVENT_RAID_RC_VOLUME_DELETED		0x01
482 #define	MPI_EVENT_RAID_RC_VOLUME_SETTINGS_CHANGED	0x02
483 #define	MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED		0x03
484 #define	MPI_EVENT_RAID_RC_VOLUME_PHYSDISK_CHANGED	0x04
485 #define	MPI_EVENT_RAID_RC_PHYSDISK_CREATED		0x05
486 #define	MPI_EVENT_RAID_RC_PHYSDISK_DELETED		0x06
487 #define	MPI_EVENT_RAID_RC_PHYSDISK_SETTINGS_CHANGED	0x07
488 #define	MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED	0x08
489 #define	MPI_EVENT_RAID_RC_DOMAIN_VAL_NEEDED		0x09
490 #define	MPI_EVENT_RAID_RC_SMART_DATA			0x0A
491 #define	MPI_EVENT_RAID_RC_REPLACE_ACTION_STARTED	0x0B
492 
493 /*
494  * SAS Phy link down event data
495  */
496 typedef struct event_data_sas_phy_link_status {
497 	uint8_t		PhyNum;
498 	uint8_t		LinkRates;
499 	uint16_t	DevHandle;
500 	uint64_t	SASAddress;
501 } event_data_sas_phy_link_status_t;
502 
503 #define	MPI_EVENT_SAS_PLS_LR_CURRENT_MASK			0xF0
504 #define	MPI_EVENT_SAS_PLS_LR_CURRENT_SHIFT			4
505 #define	MPI_EVENT_SAS_PLS_LR_PREVIOUS_MASK			0x0F
506 #define	MPI_EVENT_SAS_PLS_LR_PREVIOUS_SHIFT			0
507 #define	MPI_EVENT_SAS_PLS_LR_RATE_UNKNOWN			0x00
508 #define	MPI_EVENT_SAS_PLS_LR_RATE_PHY_DISABLED			0x01
509 #define	MPI_EVENT_SAS_PLS_LR_RATE_FAILED_SPEED_NEGOTIATION	0x02
510 #define	MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE		0x03
511 #define	MPI_EVENT_SAS_PLS_LR_RATE_1_5				0x08
512 #define	MPI_EVENT_SAS_PLS_LR_RATE_3_0				0x09
513 
514 typedef struct event_data_sas_expander_status_change {
515 	uint8_t		ReasonCode;
516 	uint8_t		Reserved1;
517 	uint16_t	Reserved2;
518 	uint8_t		PhysicalPort;
519 	uint8_t		Reserved3;
520 	uint16_t	EnclosureHandle;
521 	uint64_t	SASAddress;
522 	uint32_t	DiscoveryStatus;
523 	uint16_t	DevHandle;
524 	uint16_t	ParentDevHandle;
525 	uint16_t	ExpanderChangeCount;
526 	uint16_t	ExpanderRouteIndexes;
527 	uint8_t		NumPhys;
528 	uint8_t		SASLevel;
529 	uint8_t		Flags;
530 	uint8_t		Reserved4;
531 } event_data_sas_expander_status_change_t;
532 
533 /*
534  * values for ReasonCode field of SAS Expander Status Change Event data
535  */
536 #define	MPI_EVENT_SAS_EXP_RC_ADDED		0x00
537 #define	MPI_EVENT_SAS_EXP_RC_NOT_RESPONDING	0x01
538 
539 /*
540  * values for DiscoveryStatus field of SAS Expander Status Change Event data
541  */
542 #define	MPI_EVENT_SAS_EXP_DS_LOOP_DETECTED		0x00000001
543 #define	MPI_EVENT_SAS_EXP_DS_UNADDRESSABLE_DEVICE	0x00000002
544 #define	MPI_EVENT_SAS_EXP_DS_MULTIPLE_PORTS		0x00000004
545 #define	MPI_EVENT_SAS_EXP_DS_EXPANDER_ERR		0x00000008
546 #define	MPI_EVENT_SAS_EXP_DS_SMP_TIMEOUT		0x00000010
547 #define	MPI_EVENT_SAS_EXP_DS_OUT_ROUTE_ENTRIES		0x00000020
548 #define	MPI_EVENT_SAS_EXP_DS_INDEX_NOT_EXIST		0x00000040
549 #define	MPI_EVENT_SAS_EXP_DS_SMP_FUNCTION_FAILED	0x00000080
550 #define	MPI_EVENT_SAS_EXP_DS_SMP_CRC_ERROR		0x00000100
551 #define	MPI_EVENT_SAS_EXP_DS_SUBTRACTIVE_LINK		0x00000200
552 #define	MPI_EVENT_SAS_EXP_DS_TABLE_LINK			0x00000400
553 #define	MPI_EVENT_SAS_EXP_DS_UNSUPPORTED_DEVICE		0x00000800
554 
555 /*
556  *  values for Flags field of SAS Expander Status Change Event data
557  */
558 #define	MPI_EVENT_SAS_EXP_FLAGS_ROUTE_TABLE_CONFIG	0x02
559 #define	MPI_EVENT_SAS_EXP_FLAGS_CONFIG_IN_PROGRESS	0x01
560 
561 
562 /*
563  * Firmware Load Messages
564  */
565 
566 /*
567  * Firmware download message and associated structures
568  */
569 typedef struct msg_fw_download {
570 	uint8_t			ImageType;
571 	uint8_t			Reserved;
572 	uint8_t			ChainOffset;
573 	uint8_t			Function;
574 	uint8_t			Reserved1[3];
575 	uint8_t			MsgFlags;
576 	uint32_t		MsgContext;
577 	sge_mpi_union_t		SGL;
578 } msg_fw_download_t;
579 
580 #define	MPI_FW_DOWNLOAD_MSGFLGS_LAST_SEGMENT	0x01
581 
582 #define	MPI_FW_DOWNLOAD_ITYPE_RESERVED		0x00
583 #define	MPI_FW_DOWNLOAD_ITYPE_FW		0x01
584 #define	MPI_FW_DOWNLOAD_ITYPE_BIOS		0x02
585 #define	MPI_FW_DOWNLOAD_ITYPE_NVDATA		0x03
586 #define	MPI_FW_DOWNLOAD_ITYPE_BOOTLOADER	0x04
587 
588 typedef struct fw_download_tcsge {
589 	uint8_t			Reserved;
590 	uint8_t			ContextSize;
591 	uint8_t			DetailsLength;
592 	uint8_t			Flags;
593 	uint32_t		Reserved_0100_Checksum; /* obsolete */
594 	uint32_t		ImageOffset;
595 	uint32_t		ImageSize;
596 } fw_download_tcsge_t;
597 
598 typedef struct msg_fw_download_reply {
599 	uint8_t			ImageType;
600 	uint8_t			Reserved;
601 	uint8_t			MsgLength;
602 	uint8_t			Function;
603 	uint8_t			Reserved1[3];
604 	uint8_t			MsgFlags;
605 	uint32_t		MsgContext;
606 	uint16_t		Reserved2;
607 	uint16_t		IOCStatus;
608 	uint32_t		IOCLogInfo;
609 } msg_fw_download_reply_t;
610 
611 /*
612  * Firmware upload messages and associated structures
613  */
614 typedef struct msg_fw_upload {
615 	uint8_t			ImageType;
616 	uint8_t			Reserved;
617 	uint8_t			ChainOffset;
618 	uint8_t			Function;
619 	uint8_t			Reserved1[3];
620 	uint8_t			MsgFlags;
621 	uint32_t		MsgContext;
622 	sge_mpi_union_t		SGL;
623 } msg_fw_upload_t;
624 
625 #define	MPI_FW_UPLOAD_ITYPE_FW_IOC_MEM	0x00
626 #define	MPI_FW_UPLOAD_ITYPE_FW_FLASH	0x01
627 #define	MPI_FW_UPLOAD_ITYPE_BIOS_FLASH	0x02
628 #define	MPI_FW_UPLOAD_ITYPE_NVDATA	0x03
629 #define	MPI_FW_UPLOAD_ITYPE_BOOTLOADER	0x04
630 
631 typedef struct fw_upload_tcsge {
632 	uint8_t			Reserved;
633 	uint8_t			ContextSize;
634 	uint8_t			DetailsLength;
635 	uint8_t			Flags;
636 	uint32_t		Reserved1;
637 	uint32_t		ImageOffset;
638 	uint32_t		ImageSize;
639 } fw_upload_tcsge_t;
640 
641 typedef struct msg_fw_upload_reply {
642 	uint8_t			ImageType;
643 	uint8_t			Reserved;
644 	uint8_t			MsgLength;
645 	uint8_t			Function;
646 	uint8_t			Reserved1[3];
647 	uint8_t			MsgFlags;
648 	uint32_t		MsgContext;
649 	uint16_t		Reserved2;
650 	uint16_t		IOCStatus;
651 	uint32_t		IOCLogInfo;
652 	uint32_t		ActualImageSize;
653 } msg_fw_upload_reply_t;
654 
655 typedef struct msg_fw_header {
656 	uint32_t		ArmBranchInstruction0;
657 	uint32_t		Signature0;
658 	uint32_t		Signature1;
659 	uint32_t		Signature2;
660 	uint32_t		ArmBranchInstruction1;
661 	uint32_t		ArmBranchInstruction2;
662 	uint32_t		Reserved;
663 	uint32_t		Checksum;
664 	uint16_t		VendorId;
665 	uint16_t		ProductId;
666 	mpi_fw_version_t	FWVersion;
667 	uint32_t		SeqCodeVersion;
668 	uint32_t		ImageSize;
669 	uint32_t		NextImageHeaderOffset;
670 	uint32_t		LoadStartAddress;
671 	uint32_t		IopResetVectorValue;
672 	uint32_t		IopResetRegAddr;
673 	uint32_t		VersionNameWhat;
674 	uint8_t			VersionName[32];
675 	uint32_t		VendorNameWhat;
676 	uint8_t			VendorName[32];
677 } msg_fw_header_t;
678 
679 #define	MPI_FW_HEADER_WHAT_SIGNATURE			0x29232840
680 
681 /* defines for using the ProductId field */
682 #define	MPI_FW_HEADER_PID_TYPE_MASK			0xF000
683 #define	MPI_FW_HEADER_PID_TYPE_SCSI			0x0000
684 #define	MPI_FW_HEADER_PID_TYPE_FC			0x1000
685 
686 #define	MPI_FW_HEADER_PID_PROD_MASK			0x0F00
687 #define	MPI_FW_HEADER_PID_PROD_INITIATOR_SCSI		0x0100
688 #define	MPI_FW_HEADER_PID_PROD_TARGET_INITIATOR_SCSI	0x0200
689 #define	MPI_FW_HEADER_PID_PROD_TARGET_SCSI		0x0300
690 #define	MPI_FW_HEADER_PID_PROD_IM_SCSI			0x0400
691 #define	MPI_FW_HEADER_PID_PROD_IS_SCSI			0x0500
692 #define	MPI_FW_HEADER_PID_PROD_CTX_SCSI			0x0600
693 #define	MPI_FW_HEADER_PID_PROD_IR_SCSI			0x0700
694 
695 #define	MPI_FW_HEADER_PID_FAMILY_MASK			0x00FF
696 #define	MPI_FW_HEADER_PID_FAMILY_1030A0_SCSI		0x0001
697 #define	MPI_FW_HEADER_PID_FAMILY_1030B0_SCSI		0x0002
698 #define	MPI_FW_HEADER_PID_FAMILY_1030B1_SCSI		0x0003
699 #define	MPI_FW_HEADER_PID_FAMILY_1030C0_SCSI		0x0004
700 #define	MPI_FW_HEADER_PID_FAMILY_1020A0_SCSI		0x0005
701 #define	MPI_FW_HEADER_PID_FAMILY_1020B0_SCSI		0x0006
702 #define	MPI_FW_HEADER_PID_FAMILY_1020B1_SCSI		0x0007
703 #define	MPI_FW_HEADER_PID_FAMILY_1020C0_SCSI		0x0008
704 #define	MPI_FW_HEADER_PID_FAMILY_1035A0_SCSI		0x0009
705 #define	MPI_FW_HEADER_PID_FAMILY_1035B0_SCSI		0x000A
706 #define	MPI_FW_HEADER_PID_FAMILY_1030TA0_SCSI		0x000B
707 #define	MPI_FW_HEADER_PID_FAMILY_1020TA0_SCSI		0x000C
708 #define	MPI_FW_HEADER_PID_FAMILY_909_FC			0x0000
709 #define	MPI_FW_HEADER_PID_FAMILY_919_FC			0x0001
710 #define	MPI_FW_HEADER_PID_FAMILY_919X_FC		0x0002
711 #define	MPI_FW_HEADER_PID_FAMILY_1064_SAS		0x0001
712 #define	MPI_FW_HEADER_PID_FAMILY_1068_SAS		0x0002
713 #define	MPI_FW_HEADER_PID_FAMILY_1078_SAS		0x0003
714 
715 typedef struct mpi_ext_image_header {
716 	uint8_t			ImageType;
717 	uint8_t			Reserved;
718 	uint16_t		Reserved1;
719 	uint32_t		Checksum;
720 	uint32_t		ImageSize;
721 	uint32_t		NextImageHeaderOffset;
722 	uint32_t		LoadStartAddress;
723 	uint32_t		Reserved2;
724 } mpi_ext_image_header_t;
725 
726 #define	MPI_EXT_IMAGE_TYPE_UNSPECIFIED			0x00
727 #define	MPI_EXT_IMAGE_TYPE_FW				0x01
728 #define	MPI_EXT_IMAGE_TYPE_NVDATA			0x03
729 #define	MPI_EXT_IMAGE_TYPE_BOOTLOADER			0x04
730 
731 #ifdef	__cplusplus
732 }
733 #endif
734 
735 #endif	/* _SYS_MPI_IOC_H */
736