1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 #ifndef _I386_SMBIOSVAR_
29 #define _I386_SMBIOSVAR_
30
31 #define SMBIOS_START 0xf0000
32 #define SMBIOS_END 0xfffff
33
34 #define SMBIOS_UUID_NPRESENT 0x1
35 #define SMBIOS_UUID_NSET 0x2
36
37
38
39
40
41
42 #define SMBIOS_UUID_REP "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
43 #define SMBIOS_UUID_REPLEN 37
44
45 struct smbios_entry {
46 u_int8_t mjr;
47 u_int8_t min;
48 u_int8_t *addr;
49 u_int16_t len;
50 u_int16_t count;
51 };
52
53 struct smbhdr {
54 u_int32_t sig;
55 u_int8_t checksum;
56 u_int8_t len;
57 u_int8_t majrev;
58 u_int8_t minrev;
59 u_int16_t mss;
60 u_int8_t epr;
61 u_int8_t fa[5];
62 u_int8_t sasig[5];
63 u_int8_t sachecksum;
64 u_int16_t size;
65 u_int32_t addr;
66 u_int16_t count;
67 u_int8_t rev;
68 } __packed;
69
70 struct smbtblhdr {
71 u_int8_t type;
72 u_int8_t size;
73 u_int16_t handle;
74 } __packed;
75
76 struct smbtable {
77 struct smbtblhdr *hdr;
78 void *tblhdr;
79 u_int32_t cookie;
80 };
81
82 #define SMBIOS_TYPE_BIOS 0
83 #define SMBIOS_TYPE_SYSTEM 1
84 #define SMBIOS_TYPE_BASEBOARD 2
85 #define SMBIOS_TYPE_ENCLOSURE 3
86 #define SMBIOS_TYPE_PROCESSOR 4
87 #define SMBIOS_TYPE_MEMCTRL 5
88 #define SMBIOS_TYPE_MEMMOD 6
89 #define SMBIOS_TYPE_CACHE 7
90 #define SMBIOS_TYPE_PORT 8
91 #define SMBIOS_TYPE_SLOTS 9
92 #define SMBIOS_TYPE_OBD 10
93 #define SMBIOS_TYPE_OEM 11
94 #define SMBIOS_TYPE_SYSCONFOPT 12
95 #define SMBIOS_TYPE_BIOSLANG 13
96 #define SMBIOS_TYPE_GROUPASSOC 14
97 #define SMBIOS_TYPE_SYSEVENTLOG 15
98 #define SMBIOS_TYPE_PHYMEM 16
99 #define SMBIOS_TYPE_MEMDEV 17
100 #define SMBIOS_TYPE_ECCINFO32 18
101 #define SMBIOS_TYPE_MEMMAPARRAYADDR 19
102 #define SMBIOS_TYPE_MEMMAPDEVADDR 20
103 #define SMBIOS_TYPE_INBUILTPOINT 21
104 #define SMBIOS_TYPE_PORTBATT 22
105 #define SMBIOS_TYPE_SYSRESET 23
106 #define SMBIOS_TYPE_HWSECUIRTY 24
107 #define SMBIOS_TYPE_PWRCTRL 25
108 #define SMBIOS_TYPE_VOLTPROBE 26
109 #define SMBIOS_TYPE_COOLING 27
110 #define SMBIOS_TYPE_TEMPPROBE 28
111 #define SMBIOS_TYPE_CURRENTPROBE 29
112 #define SMBIOS_TYPE_OOB_REMOTEACCESS 30
113 #define SMBIOS_TYPE_BIS 31
114 #define SMBIOS_TYPE_SBI 32
115 #define SMBIOS_TYPE_ECCINFO64 33
116 #define SMBIOS_TYPE_MGMTDEV 34
117 #define SMBIOS_TYPE_MGTDEVCOMP 35
118 #define SMBIOS_TYPE_MGTDEVTHRESH 36
119 #define SMBIOS_TYPE_MEMCHANNEL 37
120 #define SMBIOS_TYPE_IPMIDEV 38
121 #define SMBIOS_TYPE_SPS 39
122 #define SMBIOS_TYPE_INACTIVE 126
123 #define SMBIOS_TYPE_EOT 127
124
125
126
127
128
129 struct smbios_struct_bios {
130 u_int8_t vendor;
131 u_int8_t version;
132 u_int16_t startaddr;
133 u_int8_t release;
134 u_int8_t romsize;
135 u_int64_t characteristics;
136 u_int32_t charext;
137 u_int8_t major_rel;
138 u_int8_t minor_rel;
139 u_int8_t ecf_mjr_rel;
140 u_int8_t ecf_min_rel;
141 } __packed;
142
143
144
145
146
147
148 struct smbios_sys {
149
150 u_int8_t vendor;
151 u_int8_t product;
152 u_int8_t version;
153 u_int8_t serial;
154
155 u_int8_t uuid[16];
156 u_int8_t wakeup;
157
158 u_int8_t sku;
159 u_int8_t family;
160 } __packed;
161
162
163
164
165
166 struct smbios_board {
167 u_int8_t vendor;
168 u_int8_t product;
169 u_int8_t version;
170 u_int8_t serial;
171 u_int8_t asset;
172 u_int8_t feature;
173 u_int8_t location;
174 u_int16_t handle;
175 u_int8_t type;
176 u_int8_t noc;
177 } __packed;
178
179
180
181
182
183 struct smbios_ipmi {
184 u_int8_t smipmi_if_type;
185 u_int8_t smipmi_if_rev;
186 u_int8_t smipmi_i2c_address;
187 u_int8_t smipmi_nvram_address;
188
189 u_int64_t smipmi_base_address;
190
191 u_int8_t smipmi_base_flags;
192
193
194
195
196
197
198
199
200
201 u_int8_t smipmi_irq;
202 } __packed;
203
204 int smbios_find_table(u_int8_t, struct smbtable *);
205 char *smbios_get_string(struct smbtable *, u_int8_t, char *, size_t);
206
207 #endif