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