1 /* ----------------------------------------------------------------------- *
3 * Copyright 2006 Erwan Velu - All Rights Reserved
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 * Boston MA 02111-1307, USA; either version 2 of the License, or
9 * (at your option) any later version; incorporated herein by reference.
11 * ----------------------------------------------------------------------- */
16 #define CHASSIS_MANUFACTURER_SIZE 32
17 #define CHASSIS_TYPE_SIZE 16
18 #define CHASSIS_LOCK_SIZE 16
19 #define CHASSIS_VERSION_SIZE 16
20 #define CHASSIS_SERIAL_SIZE 32
21 #define CHASSIS_ASSET_TAG_SIZE 32
22 #define CHASSIS_BOOT_UP_STATE_SIZE 32
23 #define CHASSIS_POWER_SUPPLY_STATE_SIZE 32
24 #define CHASSIS_THERMAL_STATE_SIZE 32
25 #define CHASSIS_SECURITY_STATUS_SIZE 32
26 #define CHASSIS_OEM_INFORMATION_SIZE 32
29 char manufacturer
[CHASSIS_MANUFACTURER_SIZE
];
30 char type
[CHASSIS_TYPE_SIZE
];
31 char lock
[CHASSIS_LOCK_SIZE
];
32 char version
[CHASSIS_VERSION_SIZE
];
33 char serial
[CHASSIS_SERIAL_SIZE
];
34 char asset_tag
[CHASSIS_ASSET_TAG_SIZE
];
35 char boot_up_state
[CHASSIS_BOOT_UP_STATE_SIZE
];
36 char power_supply_state
[CHASSIS_POWER_SUPPLY_STATE_SIZE
];
37 char thermal_state
[CHASSIS_THERMAL_STATE_SIZE
];
38 char security_status
[CHASSIS_SECURITY_STATUS_SIZE
];
39 char oem_information
[CHASSIS_OEM_INFORMATION_SIZE
];
44 static const char *dmi_chassis_type(u8 code
)
47 static const char *type
[]={
51 "Low Profile Desktop",
64 "Main Server Chassis", /* master.mif says System */
67 "Bus Expansion Chassis",
72 "Multi-system" /* 0x19 */
75 if(code
>=0x01 && code
<=0x19)
76 return type
[code
-0x01];
80 static const char *dmi_chassis_lock(u8 code
)
82 static const char *lock
[]={
83 "Not Present", /* 0x00 */
90 static const char *dmi_chassis_state(u8 code
)
93 static const char *state
[]={
96 "Safe", /* master.mif says OK */
99 "Non-recoverable" /* 0x06 */
102 if(code
>=0x01 && code
<=0x06)
103 return(state
[code
-0x01]);
107 static const char *dmi_chassis_security_status(u8 code
)
110 static const char *status
[]={
114 "External Interface Locked Out",
115 "External Interface Enabled" /* 0x05 */
118 if(code
>=0x01 && code
<=0x05)
119 return(status
[code
-0x01]);