xref: /illumos-gate/usr/src/cmd/picl/plugins/sun4v/include/picloids.h (revision bd97c7ce2344fa3252d8785c35895490916bc79b)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_PICLOIDS_H
28 #define	_PICLOIDS_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 /*
35  * IETF OIDs (not all are used by PICL)
36  */
37 #define	OID_ISO				"1"
38 #define	OID_ORG				OID_ISO ".3"
39 #define	OID_DOD				OID_ORG ".6"
40 #define	OID_INTERNET			OID_DOD ".1"
41 
42 #define	OID_PRIVATE			OID_INTERNET ".4"
43 #define	OID_ENTERPRISES			OID_PRIVATE ".1"
44 #define	OID_SUN				OID_ENTERPRISES ".42"
45 
46 #define	OID_MGMT			OID_INTERNET ".2"
47 #define	OID_MIB2			OID_MGMT ".1"
48 #define	OID_entityMIB			OID_MIB2 ".47"
49 #define	OID_entityMIBObjects		OID_entityMIB ".1"
50 
51 #define	OID_entityPhysical		OID_entityMIBObjects ".1"
52 #define	OID_entPhysicalTable		OID_entityPhysical ".1"
53 #define	OID_entPhysicalEntry		OID_entPhysicalTable ".1"
54 
55 #define	OID_entPhysicalIndex		OID_entPhysicalEntry ".1"
56 #define	OID_entPhysicalDescr		OID_entPhysicalEntry ".2"
57 #define	OID_entPhysicalVendorType	OID_entPhysicalEntry ".3"
58 #define	OID_entPhysicalContainedIn	OID_entPhysicalEntry ".4"
59 #define	OID_entPhysicalClass		OID_entPhysicalEntry ".5"
60 #define	OID_entPhysicalParentRelPos	OID_entPhysicalEntry ".6"
61 #define	OID_entPhysicalName		OID_entPhysicalEntry ".7"
62 #define	OID_entPhysicalHardwareRev	OID_entPhysicalEntry ".8"
63 #define	OID_entPhysicalFirmwareRev	OID_entPhysicalEntry ".9"
64 #define	OID_entPhysicalSoftwareRev	OID_entPhysicalEntry ".10"
65 #define	OID_entPhysicalSerialNum	OID_entPhysicalEntry ".11"
66 #define	OID_entPhysicalMfgName		OID_entPhysicalEntry ".12"
67 #define	OID_entPhysicalModelName	OID_entPhysicalEntry ".13"
68 #define	OID_entPhysicalAlias		OID_entPhysicalEntry ".14"
69 #define	OID_entPhysicalAssetID		OID_entPhysicalEntry ".15"
70 #define	OID_entPhysicalIsFRU		OID_entPhysicalEntry ".16"
71 
72 /*
73  * Conceptual row change time for handling hotplug/hotswap events
74  */
75 #define	OID_entityGeneral		OID_entityMIBObjects ".4"
76 #define	OID_entLastChangeTime		OID_entityGeneral ".1"
77 
78 /*
79  * Sun Platform MIB OIDs used by PICL
80  */
81 #define	OID_products			OID_SUN ".2"
82 #define	OID_sunFire			OID_products ".70"
83 #define	OID_sunPlatMIB			OID_sunFire ".101"
84 #define	OID_sunPlatMIBObjects		OID_sunPlatMIB ".1"
85 #define	OID_sunPlatMIBPhysicalObjects	OID_sunPlatMIBObjects ".1"
86 
87 /*
88  * Equipment Table
89  */
90 #define	OID_sunPlatEquipmentTable	OID_sunPlatMIBPhysicalObjects ".2"
91 #define	OID_sunPlatEquipmentEntry	OID_sunPlatEquipmentTable ".1"
92 #define	OID_sunPlatEquipmentOperationalState	\
93 					OID_sunPlatEquipmentEntry ".2"
94 
95 /*
96  * Equipment Holder Table
97  */
98 #define	OID_sunPlatEquipmentHolderTable	OID_sunPlatMIBPhysicalObjects ".3"
99 #define	OID_sunPlatEquipmentHolderEntry	OID_sunPlatEquipmentHolderTable ".1"
100 #define	OID_sunPlatEquipmentHolderAcceptableTypes	\
101 					OID_sunPlatEquipmentHolderEntry ".2"
102 
103 /*
104  * Circuit Pack Table
105  */
106 #define	OID_sunPlatCircuitPackTable	OID_sunPlatMIBPhysicalObjects ".4"
107 #define	OID_sunPlatCircuitPackEntry	OID_sunPlatCircuitPackTable ".1"
108 #define	OID_sunPlatCircuitPackReplaceable	\
109 					OID_sunPlatCircuitPackEntry ".3"
110 #define	OID_sunPlatCircuitPackHotSwappable	\
111 					OID_sunPlatCircuitPackEntry ".4"
112 
113 /*
114  * Physical Class Table
115  */
116 #define	OID_sunPlatPhysicalTable	OID_sunPlatMIBPhysicalObjects ".5"
117 #define	OID_sunPlatPhysicalEntry	OID_sunPlatPhysicalTable ".1"
118 #define	OID_sunPlatPhysicalClass	OID_sunPlatPhysicalEntry ".1"
119 
120 /*
121  * Sensor Table
122  */
123 #define	OID_sunPlatSensorTable		OID_sunPlatMIBPhysicalObjects ".6"
124 #define	OID_sunPlatSensorEntry		OID_sunPlatSensorTable ".1"
125 #define	OID_sunPlatSensorClass		OID_sunPlatSensorEntry ".1"
126 #define	OID_sunPlatSensorType		OID_sunPlatSensorEntry ".2"
127 
128 /*
129  * Binary Sensor Table
130  */
131 #define	OID_sunPlatBinarySensorTable	OID_sunPlatMIBPhysicalObjects ".7"
132 #define	OID_sunPlatBinarySensorEntry	OID_sunPlatBinarySensorTable ".1"
133 
134 #define	OID_sunPlatBinarySensorCurrent	OID_sunPlatBinarySensorEntry ".1"
135 #define	OID_sunPlatBinarySensorExpected	OID_sunPlatBinarySensorEntry ".2"
136 #define	OID_sunPlatBinarySensorInterpretTrue	\
137 					OID_sunPlatBinarySensorEntry ".3"
138 #define	OID_sunPlatBinarySensorInterpretFalse	\
139 					OID_sunPlatBinarySensorEntry ".4"
140 
141 /*
142  * Numeric Sensor Table
143  */
144 #define	OID_sunPlatNumericSensorTable	OID_sunPlatMIBPhysicalObjects ".8"
145 #define	OID_sunPlatNumericSensorEntry	OID_sunPlatNumericSensorTable ".1"
146 #define	OID_sunPlatNumericSensorCurrent	OID_sunPlatNumericSensorEntry ".4"
147 #define	OID_sunPlatNumericSensorBaseUnits	\
148 					OID_sunPlatNumericSensorEntry ".1"
149 #define	OID_sunPlatNumericSensorExponent	\
150 					OID_sunPlatNumericSensorEntry ".2"
151 #define	OID_sunPlatNumericSensorRateUnits	\
152 					OID_sunPlatNumericSensorEntry ".3"
153 #define	OID_sunPlatNumericSensorLowerThresholdNonCritical	\
154 					OID_sunPlatNumericSensorEntry ".8"
155 #define	OID_sunPlatNumericSensorUpperThresholdNonCritical	\
156 					OID_sunPlatNumericSensorEntry ".9"
157 #define	OID_sunPlatNumericSensorLowerThresholdCritical	\
158 					OID_sunPlatNumericSensorEntry ".10"
159 #define	OID_sunPlatNumericSensorUpperThresholdCritical	\
160 					OID_sunPlatNumericSensorEntry ".11"
161 #define	OID_sunPlatNumericSensorLowerThresholdFatal	\
162 					OID_sunPlatNumericSensorEntry ".12"
163 #define	OID_sunPlatNumericSensorUpperThresholdFatal	\
164 					OID_sunPlatNumericSensorEntry ".13"
165 #define	OID_sunPlatNumericSensorEnabledThresholds	\
166 					OID_sunPlatNumericSensorEntry ".15"
167 
168 /*
169  * Alarm Table
170  */
171 #define	OID_sunPlatAlarmTable		OID_sunPlatMIBPhysicalObjects ".12"
172 #define	OID_sunPlatAlarmEntry		OID_sunPlatAlarmTable ".1"
173 #define	OID_sunPlatAlarmType		OID_sunPlatAlarmEntry ".1"
174 #define	OID_sunPlatAlarmState		OID_sunPlatAlarmEntry ".2"
175 
176 /*
177  * Power Supply Table
178  */
179 #define	OID_sunPlatPowerSupplyTable	OID_sunPlatMIBPhysicalObjects ".14"
180 #define	OID_sunPlatPowerSupplyEntry	OID_sunPlatPowerSupplyTable ".1"
181 #define	OID_sunPlatPowerSupplyClass	OID_sunPlatPowerSupplyEntry ".1"
182 
183 /*
184  * Battery Table
185  */
186 #define	OID_sunPlatBatteryTable		OID_sunPlatMIBPhysicalObjects ".15"
187 #define	OID_sunPlatBatteryEntry		OID_sunPlatBatteryTable ".1"
188 #define	OID_sunPlatBatteryStatus	OID_sunPlatBatteryEntry ".1"
189 
190 /*
191  * Integer enumeration classes used by PICL
192  */
193 typedef enum {
194 	ST_TRUE = 1,
195 	ST_FALSE = 2
196 } snmp_truthval_t;
197 
198 /*
199  * Note that the truth values could be much longer than the length
200  * of the strings "true" or "false", since we actuallly interpret them
201  * using InterpretTrue and InterpretFalse values in the MIB. Currently
202  * we limit them to be 32 (see MAX_TRUTHVAL_LEN definition below)
203  */
204 #define	STR_ST_TRUE	"true"
205 #define	STR_ST_FALSE	"false"
206 
207 /* entPhysicalClass */
208 typedef enum {
209 	SPC_OTHER = 1,
210 	SPC_UNKNOWN = 2,
211 	SPC_CHASSIS = 3,
212 	SPC_BACKPLANE = 4,
213 	SPC_CONTAINER = 5,
214 	SPC_POWERSUPPLY = 6,
215 	SPC_FAN = 7,
216 	SPC_SENSOR = 8,
217 	SPC_MODULE = 9,
218 	SPC_PORT = 10,
219 	SPC_STACK = 11
220 } snmp_physical_class_t;
221 
222 /* sunPlatEquipmentOperationalState */
223 typedef enum {
224 	SSOS_DISABLED = 1,
225 	SSOS_ENABLED = 2
226 } snmp_sunplat_op_state_t;
227 
228 /*
229  * Update MAX_OPSTATE_LEN below if these strings are changed
230  */
231 #define	STR_SSOS_DISABLED	"disabled"
232 #define	STR_SSOS_ENABLED	"enabled"
233 
234 /* sunPlatPhysicalClass */
235 typedef enum {
236 	SSPC_OTHER = 1,
237 	SSPC_ALARM = 2,
238 	SSPC_WATCHDOG = 3
239 } snmp_sunplat_phys_class_t;
240 
241 /* sunPlatSensorClass */
242 typedef enum {
243 	SSSC_BINARY = 1,
244 	SSSC_NUMERIC = 2,
245 	SSSC_DISCRETE = 3
246 } snmp_sunplat_sensor_class_t;
247 
248 /* sunPlatSensorType */
249 typedef enum {
250 	SSST_OTHER = 1,
251 	SSST_UNKNOWN = 2,
252 	SSST_TEMPERATURE = 3,
253 	SSST_VOLTAGE = 4,
254 	SSST_CURRENT = 5,
255 	SSST_TACHOMETER = 6,
256 	SSST_COUNTER = 7,
257 	SSST_SWITCH = 8,
258 	SSST_LOCK = 9,
259 	SSST_HUMIDITY = 10,
260 	SSST_SMOKE_DETECTION = 11,
261 	SSST_PRESENCE = 12,
262 	SSST_AIRFLOW = 13
263 } snmp_sunplat_sensor_type_t;
264 
265 /* sunPlatAlarmType */
266 typedef enum {
267 	SSAT_OTHER = 1,
268 	SSAT_AUDIBLE = 2,
269 	SSAT_VISIBLE = 3,
270 	SSAT_MOTION = 4,
271 	SSAT_SWITCH = 5
272 } snmp_sunplat_alarm_type_t;
273 
274 /* sunPlatAlarmState */
275 typedef enum {
276 	SSAS_UNKNOWN = 1,
277 	SSAS_OFF = 2,
278 	SSAS_STEADY = 3,
279 	SSAS_ALTERNATING = 4
280 } snmp_sunplat_alarm_state_t;
281 
282 /*
283  * Update MAX_ALARMSTATE_LEN below if these strings are changed
284  */
285 #define	STR_SSAS_UNKNOWN	"unknown"
286 #define	STR_SSAS_OFF		"off"
287 #define	STR_SSAS_STEADY		"steady"
288 #define	STR_SSAS_ALTERNATING	"alternating"
289 
290 /*
291  * Bit masks for the sunPlatNumericSensorEnabledThresholds
292  */
293 #define	LOWER_NON_CRITICAL	0x80
294 #define	UPPER_NON_CRITICAL	0x40
295 #define	LOWER_CRITICAL		0x20
296 #define	UPPER_CRITICAL		0x10
297 #define	LOWER_FATAL		0x08
298 #define	UPPER_FATAL		0x04
299 
300 /*
301  * sunPlatPowerSupplyClass
302  */
303 typedef enum {
304 	SSPSC_OTHER = 1,
305 	SSPSC_POWERSUPPLY = 2,
306 	SSPSC_BATTERY = 3
307 } snmp_sunplat_power_supply_class_t;
308 
309 /*
310  * sunPlatBatteryStatus
311  */
312 typedef enum {
313 	SSBS_OTHER = 1,
314 	SSBS_UNKNOWN = 2,
315 	SSBS_FULLYCHARGED = 3,
316 	SSBS_LOW = 4,
317 	SSBS_CRITICAL = 5,
318 	SSBS_CHARGING = 6,
319 	SSBS_CHARGING_AND_LOW = 7,
320 	SSBS_CHARGING_AND_HIGH = 8,
321 	SSBS_CHARGING_AND_CRITICAL = 9,
322 	SSBS_UNDEFINED = 10,
323 	SSBS_PARTIALLY_CHARGED = 11
324 } snmp_sunplat_battery_status_t;
325 
326 /*
327  * Update MAX_BATTERYSTATUS_LEN below if these strings are changed
328  */
329 #define	STR_SSBS_OTHER			"Other"
330 #define	STR_SSBS_UNKNOWN		"Unknown"
331 #define	STR_SSBS_FULLYCHARGED		"Fully Charged"
332 #define	STR_SSBS_LOW			"Low"
333 #define	STR_SSBS_CRITICAL		"Critical"
334 #define	STR_SSBS_CHARGING		"Charging"
335 #define	STR_SSBS_CHARGING_AND_LOW	"Charging and Low"
336 #define	STR_SSBS_CHARGING_AND_HIGH	"Charging and High"
337 #define	STR_SSBS_CHARGING_AND_CRITICAL	"Charging and Critical"
338 #define	STR_SSBS_UNDEFINED		"Undefined"
339 #define	STR_SSBS_PARTIALLY_CHARGED	"Partially Charged"
340 
341 /*
342  * Max limits of all volatiles
343  */
344 #define	MAX_OPSTATE_LEN			10
345 #define	MAX_ALARMSTATE_LEN		12
346 #define	MAX_TRUTHVAL_LEN		32
347 #define	MAX_BATTERYSTATUS_LEN		32
348 
349 #ifdef	__cplusplus
350 }
351 #endif
352 
353 #endif	/* _PICLOIDS_H */
354