1 /*
2  * ipmi_bits.h
3  *
4  * MontaVista IPMI interface, various values.
5  *
6  * Author: MontaVista Software, Inc.
7  *         Corey Minyard <minyard@mvista.com>
8  *         source@mvista.com
9  *
10  * Copyright 2003,2004,2005 MontaVista Software Inc.
11  *
12  * This software is available to you under a choice of one of two
13  * licenses.  You may choose to be licensed under the terms of the GNU
14  * Lesser General Public License (GPL) Version 2 or the modified BSD
15  * license below.  The following disclamer applies to both licenses:
16  *
17  *  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
18  *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
19  *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20  *  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21  *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
22  *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
23  *  OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  *  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
25  *  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
26  *  USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  *
28  * GNU Lesser General Public Licence
29  *
30  *  This program is free software; you can redistribute it and/or
31  *  modify it under the terms of the GNU Lesser General Public License
32  *  as published by the Free Software Foundation; either version 2 of
33  *  the License, or (at your option) any later version.
34  *
35  *  You should have received a copy of the GNU Lesser General Public
36  *  License along with this program; if not, write to the Free
37  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
38  *
39  * Modified BSD Licence
40  *
41  * Redistribution and use in source and binary forms, with or without
42  * modification, are permitted provided that the following conditions
43  * are met:
44  *
45  *   1. Redistributions of source code must retain the above copyright
46  *      notice, this list of conditions and the following disclaimer.
47  *   2. Redistributions in binary form must reproduce the above
48  *      copyright notice, this list of conditions and the following
49  *      disclaimer in the documentation and/or other materials provided
50  *      with the distribution.
51  *   3. The name of the author may not be used to endorse or promote
52  *      products derived from this software without specific prior
53  *      written permission.
54  */
55 
56 #ifndef OPENIPMI_BITS_H
57 #define OPENIPMI_BITS_H
58 
59 #include <limits.h>
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
65 /* Used in various operations to tell what has happened to a sensor,
66    control, entity, or whatever. */
67 enum ipmi_update_e { IPMI_ADDED = 0, IPMI_DELETED = 1, IPMI_CHANGED = 2 };
68 const char *ipmi_update_e_string(enum ipmi_update_e val);
69 
70 /*
71  * Like the above, but with an error value.  Certain things, like
72  * reading FRU data, can result in an error, this is used to report
73  * those situations.  Must match the previous values.
74  */
75 enum ipmi_update_werr_e { IPMIE_ADDED = 0, IPMIE_DELETED = 1, IPMIE_CHANGED = 2,
76 			  IPMIE_ERROR = 3 };
77 const char *ipmi_update_werr_e_string(enum ipmi_update_werr_e val);
78 
79 /*
80  * When dealing with strings, they can be unicode or ASCII, and some
81  * can be binary.
82  */
83 enum ipmi_str_type_e {
84   IPMI_ASCII_STR	= 0,
85   IPMI_UNICODE_STR	= 1,
86   IPMI_BINARY_STR	= 2,
87 };
88 
89 /* Used to tell if some value is present.  */
90 enum ipmi_value_present_e { IPMI_NO_VALUES_PRESENT,
91 			    IPMI_RAW_VALUE_PRESENT,
92 			    IPMI_BOTH_VALUES_PRESENT };
93 
94 /*
95  * Sensor bits
96  */
97 
98 /* Note that a sensor with a settable hysteresis value can also be
99    read, but a fixed value cannot be read (it's in the SDR). */
100 #define IPMI_HYSTERESIS_SUPPORT_NONE		0
101 #define IPMI_HYSTERESIS_SUPPORT_READABLE	1
102 #define IPMI_HYSTERESIS_SUPPORT_SETTABLE	2
103 #define IPMI_HYSTERESIS_SUPPORT_FIXED		3
104 const char *ipmi_get_hysteresis_support_string(unsigned int val);
105 
106 #define IPMI_THRESHOLD_ACCESS_SUPPORT_NONE	0
107 #define IPMI_THRESHOLD_ACCESS_SUPPORT_READABLE	1
108 #define IPMI_THRESHOLD_ACCESS_SUPPORT_SETTABLE	2
109 #define IPMI_THRESHOLD_ACCESS_SUPPORT_FIXED	3
110 const char *ipmi_get_threshold_access_support_string(unsigned int val);
111 
112 #define IPMI_EVENT_SUPPORT_PER_STATE		0
113 #define IPMI_EVENT_SUPPORT_ENTIRE_SENSOR	1
114 #define IPMI_EVENT_SUPPORT_GLOBAL_ENABLE	2
115 #define IPMI_EVENT_SUPPORT_NONE			3
116 const char *ipmi_get_event_support_string(unsigned int val);
117 
118 
119 #define IPMI_SENSOR_TYPE_TEMPERATURE			0x01
120 #define IPMI_SENSOR_TYPE_VOLTAGE			0x02
121 #define IPMI_SENSOR_TYPE_CURRENT			0x03
122 #define IPMI_SENSOR_TYPE_FAN				0x04
123 #define IPMI_SENSOR_TYPE_PHYSICAL_SECURITY		0x05
124 #define IPMI_SENSOR_TYPE_PLATFORM_SECURITY		0x06
125 #define IPMI_SENSOR_TYPE_PROCESSOR			0x07
126 #define IPMI_SENSOR_TYPE_POWER_SUPPLY			0x08
127 #define IPMI_SENSOR_TYPE_POWER_UNIT			0x09
128 #define IPMI_SENSOR_TYPE_COOLING_DEVICE			0x0a
129 #define IPMI_SENSOR_TYPE_OTHER_UNITS_BASED_SENSOR	0x0b
130 #define IPMI_SENSOR_TYPE_MEMORY				0x0c
131 #define IPMI_SENSOR_TYPE_DRIVE_SLOT			0x0d
132 #define IPMI_SENSOR_TYPE_POWER_MEMORY_RESIZE		0x0e
133 #define IPMI_SENSOR_TYPE_SYSTEM_FIRMWARE_PROGRESS	0x0f
134 #define IPMI_SENSOR_TYPE_EVENT_LOGGING_DISABLED		0x10
135 #define IPMI_SENSOR_TYPE_WATCHDOG_1			0x11
136 #define IPMI_SENSOR_TYPE_SYSTEM_EVENT			0x12
137 #define IPMI_SENSOR_TYPE_CRITICAL_INTERRUPT		0x13
138 #define IPMI_SENSOR_TYPE_BUTTON				0x14
139 #define IPMI_SENSOR_TYPE_MODULE_BOARD			0x15
140 #define IPMI_SENSOR_TYPE_MICROCONTROLLER_COPROCESSOR	0x16
141 #define IPMI_SENSOR_TYPE_ADD_IN_CARD			0x17
142 #define IPMI_SENSOR_TYPE_CHASSIS			0x18
143 #define IPMI_SENSOR_TYPE_CHIP_SET			0x19
144 #define IPMI_SENSOR_TYPE_OTHER_FRU			0x1a
145 #define IPMI_SENSOR_TYPE_CABLE_INTERCONNECT		0x1b
146 #define IPMI_SENSOR_TYPE_TERMINATOR			0x1c
147 #define IPMI_SENSOR_TYPE_SYSTEM_BOOT_INITIATED		0x1d
148 #define IPMI_SENSOR_TYPE_BOOT_ERROR			0x1e
149 #define IPMI_SENSOR_TYPE_OS_BOOT			0x1f
150 #define IPMI_SENSOR_TYPE_OS_CRITICAL_STOP		0x20
151 #define IPMI_SENSOR_TYPE_SLOT_CONNECTOR			0x21
152 #define IPMI_SENSOR_TYPE_SYSTEM_ACPI_POWER_STATE	0x22
153 #define IPMI_SENSOR_TYPE_WATCHDOG_2			0x23
154 #define IPMI_SENSOR_TYPE_PLATFORM_ALERT			0x24
155 #define IPMI_SENSOR_TYPE_ENTITY_PRESENCE		0x25
156 #define IPMI_SENSOR_TYPE_MONITOR_ASIC_IC		0x26
157 #define IPMI_SENSOR_TYPE_LAN				0x27
158 #define IPMI_SENSOR_TYPE_MANAGEMENT_SUBSYSTEM_HEALTH	0x28
159 #define IPMI_SENSOR_TYPE_BATTERY			0x29
160 #define IPMI_SENSOR_TYPE_SESSION_AUDIT			0x2a
161 #define IPMI_SENSOR_TYPE_VERSION_CHANGE			0x2b
162 #define IPMI_SENSOR_TYPE_FRU_STATE			0x2c
163 const char *ipmi_get_sensor_type_string(unsigned int val);
164 
165 #define IPMI_EVENT_READING_TYPE_THRESHOLD			0x01
166 #define IPMI_EVENT_READING_TYPE_DISCRETE_USAGE			0x02
167 #define IPMI_EVENT_READING_TYPE_DISCRETE_STATE			0x03
168 #define IPMI_EVENT_READING_TYPE_DISCRETE_PREDICTIVE_FAILURE	0x04
169 #define IPMI_EVENT_READING_TYPE_DISCRETE_LIMIT_EXCEEDED		0x05
170 #define IPMI_EVENT_READING_TYPE_DISCRETE_PERFORMANCE_MET	0x06
171 #define IPMI_EVENT_READING_TYPE_DISCRETE_SEVERITY		0x07
172 #define IPMI_EVENT_READING_TYPE_DISCRETE_DEVICE_PRESENCE	0x08
173 #define IPMI_EVENT_READING_TYPE_DISCRETE_DEVICE_ENABLE		0x09
174 #define IPMI_EVENT_READING_TYPE_DISCRETE_AVAILABILITY		0x0a
175 #define IPMI_EVENT_READING_TYPE_DISCRETE_REDUNDANCY		0x0b
176 #define IPMI_EVENT_READING_TYPE_DISCRETE_ACPI_POWER		0x0c
177 #define IPMI_EVENT_READING_TYPE_SENSOR_SPECIFIC			0x6f
178 const char *ipmi_get_event_reading_type_string(unsigned int val);
179 
180 #define IPMI_SENSOR_DIRECTION_UNSPECIFIED	0
181 #define IPMI_SENSOR_DIRECTION_INPUT		1
182 #define IPMI_SENSOR_DIRECTION_OUTPUT		2
183 const char *ipmi_get_sensor_direction_string(unsigned int val);
184 
185 const char *ipmi_get_reading_name(unsigned int event_reading_type,
186 				  unsigned int sensor_type,
187 				  unsigned int val);
188 
189 #define IPMI_ANALOG_DATA_FORMAT_UNSIGNED   0
190 #define IPMI_ANALOG_DATA_FORMAT_1_COMPL    1
191 #define IPMI_ANALOG_DATA_FORMAT_2_COMPL    2
192 #define IPMI_ANALOG_DATA_FORMAT_NOT_ANALOG 3
193 
194 enum ipmi_rate_unit_e {
195     IPMI_RATE_UNIT_NONE = 0,
196     IPMI_RATE_UNIT_PER_US,
197     IPMI_RATE_UNIT_PER_MS,
198     IPMI_RATE_UNIT_PER_SEC,
199     IPMI_RATE_UNIT_MIN,
200     IPMI_RATE_UNIT_HOUR,
201     IPMI_RATE_UNIT_DAY,
202 };
203 const char *ipmi_get_rate_unit_string(enum ipmi_rate_unit_e val);
204 
205 enum ipmi_unit_type_e {
206     IPMI_UNIT_TYPE_UNSPECIFIED = 0,
207     IPMI_UNIT_TYPE_DEGREES_C,
208     IPMI_UNIT_TYPE_DEGREES_F,
209     IPMI_UNIT_TYPE_DEGREES_K,
210     IPMI_UNIT_TYPE_VOLTS,
211     IPMI_UNIT_TYPE_AMPS,
212     IPMI_UNIT_TYPE_WATTS,
213     IPMI_UNIT_TYPE_JOULES,
214     IPMI_UNIT_TYPE_COULOMBS,
215     IPMI_UNIT_TYPE_VA,
216     IPMI_UNIT_TYPE_NITS = 10,
217     IPMI_UNIT_TYPE_LUMENS,
218     IPMI_UNIT_TYPE_LUX,
219     IPMI_UNIT_TYPE_CANDELA,
220     IPMI_UNIT_TYPE_KPA,
221     IPMI_UNIT_TYPE_PSI,
222     IPMI_UNIT_TYPE_NEWTONS,
223     IPMI_UNIT_TYPE_CFM,
224     IPMI_UNIT_TYPE_RPM,
225     IPMI_UNIT_TYPE_HZ,
226     IPMI_UNIT_TYPE_USECONDS = 20,
227     IPMI_UNIT_TYPE_MSECONDS,
228     IPMI_UNIT_TYPE_SECONDS,
229     IPMI_UNIT_TYPE_MINUTE,
230     IPMI_UNIT_TYPE_HOUR,
231     IPMI_UNIT_TYPE_DAY,
232     IPMI_UNIT_TYPE_WEEK,
233     IPMI_UNIT_TYPE_MIL,
234     IPMI_UNIT_TYPE_INCHES,
235     IPMI_UNIT_TYPE_FEET,
236     IPMI_UNIT_TYPE_CUBIC_INCHS = 30,
237     IPMI_UNIT_TYPE_CUBIC_FEET,
238     IPMI_UNIT_TYPE_MILLIMETERS,
239     IPMI_UNIT_TYPE_CENTIMETERS,
240     IPMI_UNIT_TYPE_METERS,
241     IPMI_UNIT_TYPE_CUBIC_CENTIMETERS,
242     IPMI_UNIT_TYPE_CUBIC_METERS,
243     IPMI_UNIT_TYPE_LITERS,
244     IPMI_UNIT_TYPE_FL_OZ,
245     IPMI_UNIT_TYPE_RADIANS,
246     IPMI_UNIT_TYPE_SERADIANS = 40,
247     IPMI_UNIT_TYPE_REVOLUTIONS,
248     IPMI_UNIT_TYPE_CYCLES,
249     IPMI_UNIT_TYPE_GRAVITIES,
250     IPMI_UNIT_TYPE_OUNCES,
251     IPMI_UNIT_TYPE_POUNDS,
252     IPMI_UNIT_TYPE_FOOT_POUNDS,
253     IPMI_UNIT_TYPE_OUNCE_INCHES,
254     IPMI_UNIT_TYPE_GAUSS,
255     IPMI_UNIT_TYPE_GILBERTS,
256     IPMI_UNIT_TYPE_HENRIES = 50,
257     IPMI_UNIT_TYPE_MHENRIES,
258     IPMI_UNIT_TYPE_FARADS,
259     IPMI_UNIT_TYPE_UFARADS,
260     IPMI_UNIT_TYPE_OHMS,
261     IPMI_UNIT_TYPE_SIEMENS,
262     IPMI_UNIT_TYPE_MOLES,
263     IPMI_UNIT_TYPE_BECQUERELS,
264     IPMI_UNIT_TYPE_PPM,
265     IPMI_UNIT_TYPE_reserved1,
266     IPMI_UNIT_TYPE_DECIBELS = 60,
267     IPMI_UNIT_TYPE_DbA,
268     IPMI_UNIT_TYPE_DbC,
269     IPMI_UNIT_TYPE_GRAYS,
270     IPMI_UNIT_TYPE_SIEVERTS,
271     IPMI_UNIT_TYPE_COLOR_TEMP_DEG_K,
272     IPMI_UNIT_TYPE_BITS,
273     IPMI_UNIT_TYPE_KBITS,
274     IPMI_UNIT_TYPE_MBITS,
275     IPMI_UNIT_TYPE_GBITS,
276     IPMI_UNIT_TYPE_BYTES = 70,
277     IPMI_UNIT_TYPE_KBYTES,
278     IPMI_UNIT_TYPE_MBYTES,
279     IPMI_UNIT_TYPE_GBYTES,
280     IPMI_UNIT_TYPE_WORDS,
281     IPMI_UNIT_TYPE_DWORDS,
282     IPMI_UNIT_TYPE_QWORDS,
283     IPMI_UNIT_TYPE_LINES,
284     IPMI_UNIT_TYPE_HITS,
285     IPMI_UNIT_TYPE_MISSES,
286     IPMI_UNIT_TYPE_RETRIES = 80,
287     IPMI_UNIT_TYPE_RESETS,
288     IPMI_UNIT_TYPE_OVERRUNS,
289     IPMI_UNIT_TYPE_UNDERRUNS,
290     IPMI_UNIT_TYPE_COLLISIONS,
291     IPMI_UNIT_TYPE_PACKETS,
292     IPMI_UNIT_TYPE_MESSAGES,
293     IPMI_UNIT_TYPE_CHARACTERS,
294     IPMI_UNIT_TYPE_ERRORS,
295     IPMI_UNIT_TYPE_CORRECTABLE_ERRORS,
296     IPMI_UNIT_TYPE_UNCORRECTABLE_ERRORS = 90,
297     IPMI_UNIT_TYPE_FATAL_ERRORS,
298     IPMI_UNIT_TYPE_GRAMS,
299 };
300 const char *ipmi_get_unit_type_string(enum ipmi_unit_type_e val);
301 
302 enum ipmi_modifier_unit_use_e {
303     IPMI_MODIFIER_UNIT_NONE = 0,
304     IPMI_MODIFIER_UNIT_BASE_DIV_MOD,
305     IPMI_MODIFIER_UNIT_BASE_MULT_MOD,
306 };
307 
308 #define IPMI_LINEARIZATION_LINEAR	0
309 #define IPMI_LINEARIZATION_LN		1
310 #define IPMI_LINEARIZATION_LOG10	2
311 #define IPMI_LINEARIZATION_LOG2		3
312 #define IPMI_LINEARIZATION_E		4
313 #define IPMI_LINEARIZATION_EXP10	5
314 #define IPMI_LINEARIZATION_EXP2		6
315 #define IPMI_LINEARIZATION_1_OVER_X	7
316 #define IPMI_LINEARIZATION_SQR		8
317 #define IPMI_LINEARIZATION_CUBE		9
318 #define IPMI_LINEARIZATION_SQRT		10
319 #define IPMI_LINEARIZATION_1_OVER_CUBE	11
320 #define IPMI_LINEARIZATION_NONLINEAR	0x70
321 
322 /* Event types and directions for sensors. */
323 enum ipmi_thresh_e {
324     IPMI_LOWER_NON_CRITICAL = 0,
325     IPMI_LOWER_CRITICAL,
326     IPMI_LOWER_NON_RECOVERABLE,
327     IPMI_UPPER_NON_CRITICAL,
328     IPMI_UPPER_CRITICAL,
329     IPMI_UPPER_NON_RECOVERABLE
330 };
331 const char *ipmi_get_threshold_string(enum ipmi_thresh_e val);
332 
333 enum ipmi_event_value_dir_e {
334     IPMI_GOING_LOW = 0,
335     IPMI_GOING_HIGH
336 };
337 const char *ipmi_get_value_dir_string(enum ipmi_event_value_dir_e val);
338 
339 enum ipmi_event_dir_e {
340     IPMI_ASSERTION = 0,
341     IPMI_DEASSERTION
342 };
343 const char *ipmi_get_event_dir_string(enum ipmi_event_dir_e val);
344 
345 /* Global init field for MC device locator SDR. */
346 #define IPMI_GLOBAL_INIT_ENABLE_EVENT_MSG_GENERATION 0
347 #define IPMI_GLOBAL_INIT_DISABLE_EVENT_MSG_GENERATION 1
348 #define IPMI_GLOBAL_INIT_DO_NOT_INIT 2
349 
350 /*
351  * Entity IDs
352  */
353 #define IPMI_ENTITY_ID_UNSPECIFIED			0
354 #define IPMI_ENTITY_ID_OTHER				1
355 #define IPMI_ENTITY_ID_UNKOWN				2
356 #define IPMI_ENTITY_ID_PROCESSOR			3
357 #define IPMI_ENTITY_ID_DISK				4
358 #define IPMI_ENTITY_ID_PERIPHERAL			5
359 #define IPMI_ENTITY_ID_SYSTEM_MANAGEMENT_MODULE		6
360 #define IPMI_ENTITY_ID_SYSTEM_BOARD			7
361 #define IPMI_ENTITY_ID_MEMORY_MODULE			8
362 #define IPMI_ENTITY_ID_PROCESSOR_MODULE			9
363 #define IPMI_ENTITY_ID_POWER_SUPPLY			10
364 #define IPMI_ENTITY_ID_ADD_IN_CARD			11
365 #define IPMI_ENTITY_ID_FRONT_PANEL_BOARD		12
366 #define IPMI_ENTITY_ID_BACK_PANEL_BOARD			13
367 #define IPMI_ENTITY_ID_POWER_SYSTEM_BOARD		14
368 #define IPMI_ENTITY_ID_DRIVE_BACKPLANE			15
369 #define IPMI_ENTITY_ID_SYSTEM_INTERNAL_EXPANSION_BOARD	16
370 #define IPMI_ENTITY_ID_OTHER_SYSTEM_BOARD		17
371 #define IPMI_ENTITY_ID_PROCESSOR_BOARD			18
372 #define IPMI_ENTITY_ID_POWER_UNIT			19
373 #define IPMI_ENTITY_ID_POWER_MODULE			20
374 #define IPMI_ENTITY_ID_POWER_MANAGEMENT_BOARD		21
375 #define IPMI_ENTITY_ID_CHASSIS_BACK_PANEL_BOARD		22
376 #define IPMI_ENTITY_ID_SYSTEM_CHASSIS			23
377 #define IPMI_ENTITY_ID_SUB_CHASSIS			24
378 #define IPMI_ENTITY_ID_OTHER_CHASSIS_BOARD		25
379 #define IPMI_ENTITY_ID_DISK_DRIVE_BAY			26
380 #define IPMI_ENTITY_ID_PERIPHERAL_BAY			27
381 #define IPMI_ENTITY_ID_DEVICE_BAY			28
382 #define IPMI_ENTITY_ID_FAN_COOLING			29
383 #define IPMI_ENTITY_ID_COOLING_UNIT			30
384 #define IPMI_ENTITY_ID_CABLE_INTERCONNECT		31
385 #define IPMI_ENTITY_ID_MEMORY_DEVICE			32
386 #define IPMI_ENTITY_ID_SYSTEM_MANAGEMENT_SOFTWARE	33
387 #define IPMI_ENTITY_ID_BIOS				34
388 #define IPMI_ENTITY_ID_OPERATING_SYSTEM			35
389 #define IPMI_ENTITY_ID_SYSTEM_BUS			36
390 #define IPMI_ENTITY_ID_GROUP				37
391 #define IPMI_ENTITY_ID_REMOTE_MGMT_COMM_DEVICE		38
392 #define IPMI_ENTITY_ID_EXTERNAL_ENVIRONMENT		39
393 #define IPMI_ENTITY_ID_BATTERY				40
394 #define IPMI_ENTITY_ID_PROCESSING_BLADE			41
395 #define IPMI_ENTITY_ID_CONNECTIVITY_SWITCH		42
396 #define IPMI_ENTITY_ID_PROCESSOR_MEMORY_MODULE		43
397 #define IPMI_ENTITY_ID_IO_MODULE			44
398 #define IPMI_ENTITY_ID_PROCESSOR_IO_MODULE		45
399 #define IPMI_ENTITY_ID_MGMT_CONTROLLER_FIRMWARE		46
400 #define IPMI_ENTITY_ID_IPMI_CHANNEL			47
401 #define IPMI_ENTITY_ID_PCI_BUS				48
402 #define IPMI_ENTITY_ID_PCI_EXPRESS_BUS			49
403 #define IPMI_ENTITY_ID_SCSI_BUS				50
404 #define IPMI_ENTITY_ID_SATA_SAS_BUS			51
405 #define IPMI_ENTITY_ID_PROCESSOR_FRONT_SIDE_BUS		52
406 const char *ipmi_get_entity_id_string(unsigned int val);
407 
408 
409 /*
410  * Control types.
411  */
412 #define IPMI_CONTROL_LIGHT		1
413 #define IPMI_CONTROL_RELAY		2
414 #define IPMI_CONTROL_DISPLAY		3
415 #define IPMI_CONTROL_ALARM		4
416 #define IPMI_CONTROL_RESET		5
417 #define IPMI_CONTROL_POWER		6
418 #define IPMI_CONTROL_FAN_SPEED		7
419 #define IPMI_CONTROL_IDENTIFIER		8
420 #define IPMI_CONTROL_ONE_SHOT_RESET	9
421 #define IPMI_CONTROL_OUTPUT		10
422 #define IPMI_CONTROL_ONE_SHOT_OUTPUT	11
423 const char *ipmi_get_control_type_string(unsigned int val);
424 
425 #define IPMI_CONTROL_COLOR_BLACK	0
426 #define IPMI_CONTROL_COLOR_WHITE	1
427 #define IPMI_CONTROL_COLOR_RED		2
428 #define IPMI_CONTROL_COLOR_GREEN	3
429 #define IPMI_CONTROL_COLOR_BLUE		4
430 #define IPMI_CONTROL_COLOR_YELLOW	5
431 #define IPMI_CONTROL_COLOR_ORANGE	6
432 const char *ipmi_get_color_string(unsigned int val);
433 
434 
435 /*
436  * chassis types from FRUs
437  */
438 #define IPMI_FRU_CT_OTHER                  1
439 #define IPMI_FRU_CT_UNKNOWN                2
440 #define IPMI_FRU_CT_DESKTOP                3
441 #define IPMI_FRU_CT_LOW_PROFILE_DESKTOP    4
442 #define IPMI_FRU_CT_PIZZA_BOX              5
443 #define IPMI_FRU_CT_MINI_TOWER             6
444 #define IPMI_FRU_CT_TOWER                  7
445 #define IPMI_FRU_CT_PORTABLE               8
446 #define IPMI_FRU_CT_LAPTOP                 9
447 #define IPMI_FRU_CT_NOTEBOOK              10
448 #define IPMI_FRU_CT_HANDHELD              11
449 #define IPMI_FRU_CT_DOCKING_STATION       12
450 #define IPMI_FRU_CT_ALL_IN_ONE            13
451 #define IPMI_FRU_CT_SUB_NOTEBOOK          14
452 #define IPMI_FRU_CT_SPACE_SAVING          15
453 #define IPMI_FRU_CT_LUNCH_BOX             16
454 #define IPMI_FRU_CT_MAIN_SERVER_CHASSIS   17
455 #define IPMI_FRU_CT_EXPANSION_CHASSIS     18
456 #define IPMI_FRU_CT_SUB_CHASSIS           19
457 #define IPMI_FRU_CT_BUS_EXPANSION_CHASSIS 20
458 #define IPMI_FRU_CT_PERIPERAL_CHASSIS     21
459 #define IPMI_FRU_CT_RAID_CHASSIS          22
460 #define IPMI_FRU_CT_RACK_MOUNT_CHASSIS    23
461 
462 
463 /*
464  * Various SDR values
465  */
466 #define IPMI_SDR_FULL_SENSOR_RECORD		0x01
467 #define IPMI_SDR_COMPACT_SENSOR_RECORD		0x02
468 #define IPMI_SDR_ENTITY_ASSOCIATION_RECORD	0x08
469 #define IPMI_SDR_DR_ENTITY_ASSOCIATION_RECORD	0x09
470 #define IPMI_SDR_GENERIC_DEVICE_LOCATOR_RECORD	0x10
471 #define IPMI_SDR_FRU_DEVICE_LOCATOR_RECORD	0x11
472 #define IPMI_SDR_MC_DEVICE_LOCATOR_RECORD	0x12
473 #define IPMI_SDR_MC_CONFIRMATION_RECORD		0x13
474 #define IPMI_SDR_MC_BMC_MESSAGE_CHANNEL_RECORD	0x14
475 
476 /*
477  * Misc values
478  */
479 /* Event was handled (so don't send it to the unhandled event
480    handler), and do NOT pass the event contents to other event
481    handlers. */
482 #define IPMI_EVENT_HANDLED		0
483 /* I did not handle this event. */
484 #define IPMI_EVENT_NOT_HANDLED		1
485 /* Event was handled (so don't send it to the unhandled event
486    handler), but still pass the event contents to other event
487    handlers. */
488 #define IPMI_EVENT_HANDLED_PASS		2
489 
490 #define IPMI_TIMEOUT_NOW	0
491 #define IPMI_TIMEOUT_FOREVER	LONG_MAX
492 
493 /* Used when setting data that can be volatile or non-volatile. */
494 enum ipmi_set_dest_e {
495     IPMI_SET_DEST_NON_VOLATILE = 1,
496     IPMI_SET_DEST_VOLATILE = 2
497 };
498 
499 /* Used for options on FRUs and strings. */
500 #define IPMI_STRING_OPTION_NONE		0
501 #define IPMI_STRING_OPTION_8BIT_ONLY	(1 << 0) /* Don't use 4/6 bit chars */
502 
503 #ifdef __cplusplus
504 }
505 #endif
506 
507 #endif /* OPENIPMI_BITS_H */
508