xref: /titanic_41/usr/src/uts/common/io/cpqary3/cpqary3_noe.h (revision 0b42f15ac52b077791d4ba079e8c163c592c3fda)
1 /*
2  * This file and its contents are supplied under the terms of the
3  * Common Development and Distribution License ("CDDL"), version 1.0.
4  * You may only use this file in accordance with the terms of version
5  * 1.0 of the CDDL.
6  *
7  * A full copy of the text of the CDDL should have accompanied this
8  * source.  A copy of the CDDL is also available via the Internet at
9  * http://www.illumos.org/license/CDDL.
10  */
11 
12 /*
13  * Copyright (C) 2013 Hewlett-Packard Development Company, L.P.
14  */
15 
16 #ifndef	_CPQARY3_NOE_H
17 #define	_CPQARY3_NOE_H
18 
19 #ifdef	__cplusplus
20 extern "C" {
21 #endif
22 
23 /*
24  * Information from CPQARY3 on Notification of Events
25  * View Hardware API for more information
26  */
27 
28 #define	CISS_NOE_CDB_LEN 			0x0D
29 #define	CISS_CANCEL_NOE_CDB_LEN		0x10
30 #define	BMIC_NOTIFY_ON_EVENT 		0xD0
31 #define	BMIC_CANCEL_NOTIFY_ON_EVENT 0xD1
32 #define	NOE_BUFFER_LENGTH			0x200
33 
34 #pragma pack(1)
35 
36 typedef struct Noe_Buffer {
37 	uint32_t	relative_controller_time;
38 	uint16_t	event_class_code;
39 	uint16_t	event_subclass_code;
40 	uint16_t	event_detail_code;
41 	uint8_t		event_specific_data[64];
42 	uint8_t		ascii_message[80];
43 	uint32_t	event_tag;
44 	uint16_t	month_day;
45 	uint16_t	year;
46 	uint32_t	hms;
47 	uint16_t	pre_powerup_time;
48 	uint8_t		device_address[8];
49 	uint8_t		reserved[336];
50 } NoeBuffer;
51 
52 #pragma pack()
53 
54 #define	CPQARY3_NOE_INIT	0
55 #define	CPQARY3_NOE_RESUBMIT 	1
56 #define	CPQARY3_NOE_FAILED	3
57 
58 /*
59  * This hierarchy is described in the firmware spec.
60  * It provides various categories of reports to provide for
61  * notification to host regarding asynchronous phenomena.
62  */
63 #define	CLASS_PROTOCOL		0	/* Event Notifier Protocol */
64 #define	SUB_CLASS_NON_EVENT	0
65 #define	DETAIL_DISABLED		1
66 #define	SUB_CLASS_PROTOCOL_ERR	1
67 #define	DETAIL_EVENT_Q_OVERFLOW	0
68 
69 #define	CLASS_HOT_PLUG		1	/* All Hot-Plug Operations */
70 #define	SUB_CLASS_HP_CHANGE	0
71 
72 /*
73  * New events for HP Smart Array controllers - FW revision greater than 5.14
74  * or later
75  */
76 
77 /* Storage Box HotPlug or Cabling Change */
78 #define	SUB_CLASS_SB_HP_CHANGE		6
79 #define	DETAIL_STORAGEBOX_REMOVED	0	/* Storage box Removed */
80 #define	DETAIL_STORAGEBOX_ADDED		1	/* Storage Box Added */
81 /* Storage Box Redundant I/O Module Removed */
82 #define	DETAIL_PATH_REMOVED		2
83 /* Storage Box Redundant I/O Module (or its path) Added */
84 #define	DETAIL_PATH_ADDED		3
85 /* Storage Box (or its first path) Repaired (re-added after failure) */
86 #define	DETIAL_STORAGEBOX_REPAIRED	4
87 /* Storage Box Redundant I/O Module (or its path) Repaired */
88 #define	DETAIL_PATH_REPAIRED		5
89 
90 /* Disk Drive Redundant Path Change */
91 #define	SUB_CLASS_DD_PATH_CHANGE	7
92 /* Redundant path to configured disk drive is Hot Removed */
93 #define	DETAIL_DD_HOT_REMOVED		0
94 
95 #define	CLASS_HARDWARE		2	/* Cable, Memory, Fan */
96 #define	SUB_CLASS_RC_CHANGE	7	/* Redundant Cabling Change */
97 /* Unsupported Configuration Occurred Online */
98 #define	DETAIL_UNSUPPORTED_CONFIGURATION 0
99 #define	CLASS_ENVIRONMENT	3	/* Temperature, Power, Chasis, UPS */
100 
101 #define	CLASS_PHYSICAL_DRIVE	4	/* Physical drive Changes */
102 
103 #define	CLASS_LOGICAL_DRIVE	5	/* Logical drive Changes */
104 #define	SUB_CLASS_STATUS	0
105 #define	DETAIL_CHANGE		0
106 #define	MEDIA_EXCHANGE		1
107 
108 /* Spare Status States */
109 #define	SPARE_UNDEFINED		0x00
110 #define	SPARES_DESIGNATED	0x01
111 #define	SPARE_REBUILDING	0x02
112 #define	SPARE_REBUILT		0x04
113 #define	SPARES_BAD		0x08
114 #define	SPARE_ACTIVE		0x10
115 #define	SPARE_AVAILABLE   		0x20
116 
117 #ifdef	__cplusplus
118 }
119 #endif
120 
121 #endif	/* _CPQARY3_NOE_H */
122