Fix various typos and spelling errors.
[obnox/wireshark/wip.git] / epan / dissectors / packet-ipmi-picmg.c
1 /* packet-ipmi-picmg.c
2  * Sub-dissectors for IPMI messages (netFn=Group, defining body = PICMG)
3  * Copyright 2007-2008, Alexey Neyman, Pigeon Point Systems <avn@pigeonpoint.com>
4  *
5  * $Id$
6  *
7  * Wireshark - Network traffic analyzer
8  * By Gerald Combs <gerald@wireshark.org>
9  * Copyright 1998 Gerald Combs
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
24  */
25
26 #ifdef HAVE_CONFIG_H
27 #include "config.h"
28 #endif
29
30 #ifdef HAVE_SYS_TYPES_H
31 #include <sys/types.h>
32 #endif
33
34 #include <epan/packet.h>
35
36 #include "packet-ipmi.h"
37
38 static gint ett_ipmi_picmg_led_color = -1;
39 static gint ett_ipmi_picmg_link_info = -1;
40 static gint ett_ipmi_picmg_05_byte1 = -1;
41 static gint ett_ipmi_picmg_06_byte1 = -1;
42 static gint ett_ipmi_picmg_06_byte2 = -1;
43 static gint ett_ipmi_picmg_06_byte3 = -1;
44 static gint ett_ipmi_picmg_08_byte1 = -1;
45 static gint ett_ipmi_picmg_09_ipmba = -1;
46 static gint ett_ipmi_picmg_09_ipmbb = -1;
47 static gint ett_ipmi_picmg_0a_byte2 = -1;
48 static gint ett_ipmi_picmg_0a_byte3 = -1;
49 static gint ett_ipmi_picmg_0b_byte1 = -1;
50 static gint ett_ipmi_picmg_0f_chan = -1;
51 static gint ett_ipmi_picmg_12_byte1 = -1;
52 static gint ett_ipmi_picmg_14_prop = -1;
53 static gint ett_ipmi_picmg_1e_byte1 = -1;
54 static gint ett_ipmi_picmg_21_byte9 = -1;
55 static gint ett_ipmi_picmg_XX_compbits = -1;
56 static gint ett_ipmi_picmg_2e_byte2 = -1;
57 static gint ett_ipmi_picmg_prop00_byte1 = -1;
58 static gint ett_ipmi_picmg_prop01_byte1 = -1;
59 static gint ett_ipmi_picmg_34_byte3 = -1;
60 static gint ett_ipmi_picmg_36_byte2 = -1;
61 static gint ett_ipmi_picmg_37_byte2 = -1;
62
63 static gint hf_ipmi_picmg_led_function = -1;
64 static gint hf_ipmi_picmg_led_on_duration = -1;
65 static gint hf_ipmi_picmg_led_color = -1;
66
67 static gint hf_ipmi_picmg_linkinfo_grpid = -1;
68 static gint hf_ipmi_picmg_linkinfo_type_ext = -1;
69 static gint hf_ipmi_picmg_linkinfo_type = -1;
70 static gint hf_ipmi_picmg_linkinfo_ports = -1;
71 static gint hf_ipmi_picmg_linkinfo_iface = -1;
72 static gint hf_ipmi_picmg_linkinfo_chan = -1;
73 static gint hf_ipmi_picmg_linkinfo_state = -1;
74
75 static gint hf_ipmi_picmg_00_version = -1;
76 static gint hf_ipmi_picmg_00_max_fruid = -1;
77 static gint hf_ipmi_picmg_00_ipmc_fruid = -1;
78
79 static gint hf_ipmi_picmg_01_rq_fruid = -1;
80 static gint hf_ipmi_picmg_01_rq_addr_key_type = -1;
81 static gint hf_ipmi_picmg_01_rq_addr_key = -1;
82 static gint hf_ipmi_picmg_01_rq_site_type = -1;
83 static gint hf_ipmi_picmg_01_rs_hwaddr = -1;
84 static gint hf_ipmi_picmg_01_rs_ipmbaddr = -1;
85 static gint hf_ipmi_picmg_01_rs_rsrv = -1;
86 static gint hf_ipmi_picmg_01_rs_fruid = -1;
87 static gint hf_ipmi_picmg_01_rs_site_num = -1;
88 static gint hf_ipmi_picmg_01_rs_site_type = -1;
89
90 static gint hf_ipmi_picmg_04_fruid = -1;
91 static gint hf_ipmi_picmg_04_cmd = -1;
92
93 static gint hf_ipmi_picmg_05_fruid = -1;
94 static gint hf_ipmi_picmg_05_led3 = -1;
95 static gint hf_ipmi_picmg_05_led2 = -1;
96 static gint hf_ipmi_picmg_05_led1 = -1;
97 static gint hf_ipmi_picmg_05_blue_led = -1;
98 static gint hf_ipmi_picmg_05_app_leds = -1;
99
100 static gint hf_ipmi_picmg_06_fruid = -1;
101 static gint hf_ipmi_picmg_06_ledid = -1;
102 static gint hf_ipmi_picmg_06_cap_white = -1;
103 static gint hf_ipmi_picmg_06_cap_orange = -1;
104 static gint hf_ipmi_picmg_06_cap_amber = -1;
105 static gint hf_ipmi_picmg_06_cap_green = -1;
106 static gint hf_ipmi_picmg_06_cap_red = -1;
107 static gint hf_ipmi_picmg_06_cap_blue = -1;
108 static gint hf_ipmi_picmg_06_default_local_color = -1;
109 static gint hf_ipmi_picmg_06_default_override_color = -1;
110
111 static gint hf_ipmi_picmg_07_fruid = -1;
112 static gint hf_ipmi_picmg_07_ledid = -1;
113
114 static gint hf_ipmi_picmg_08_fruid = -1;
115 static gint hf_ipmi_picmg_08_ledid = -1;
116 static gint hf_ipmi_picmg_08_state_lamptest = -1;
117 static gint hf_ipmi_picmg_08_state_override = -1;
118 static gint hf_ipmi_picmg_08_state_local = -1;
119 static gint hf_ipmi_picmg_08_lamptest_duration = -1;
120
121 static gint hf_ipmi_picmg_09_ipmba = -1;
122 static gint hf_ipmi_picmg_09_ipmbb = -1;
123
124 static gint hf_ipmi_picmg_0a_fruid = -1;
125 static gint hf_ipmi_picmg_0a_msk_d_locked = -1;
126 static gint hf_ipmi_picmg_0a_msk_locked = -1;
127 static gint hf_ipmi_picmg_0a_d_locked = -1;
128 static gint hf_ipmi_picmg_0a_locked = -1;
129
130 static gint hf_ipmi_picmg_0b_fruid = -1;
131 static gint hf_ipmi_picmg_0b_d_locked = -1;
132 static gint hf_ipmi_picmg_0b_locked = -1;
133
134 static gint hf_ipmi_picmg_0c_fruid = -1;
135 static gint hf_ipmi_picmg_0c_cmd = -1;
136
137 static gint hf_ipmi_picmg_0d_fruid = -1;
138 static gint hf_ipmi_picmg_0d_start = -1;
139 static gint hf_ipmi_picmg_0d_recordid = -1;
140
141 static gint hf_ipmi_picmg_0f_iface = -1;
142 static gint hf_ipmi_picmg_0f_chan = -1;
143
144 static gint hf_ipmi_picmg_10_fruid = -1;
145 static gint hf_ipmi_picmg_10_nslots = -1;
146 static gint hf_ipmi_picmg_10_ipmc_loc = -1;
147
148 static gint hf_ipmi_picmg_11_fruid = -1;
149 static gint hf_ipmi_picmg_11_power_level = -1;
150 static gint hf_ipmi_picmg_11_set_to_desired = -1;
151
152 static gint hf_ipmi_picmg_12_fruid = -1;
153 static gint hf_ipmi_picmg_12_pwr_type = -1;
154 static gint hf_ipmi_picmg_12_dynamic = -1;
155 static gint hf_ipmi_picmg_12_pwr_lvl = -1;
156 static gint hf_ipmi_picmg_12_delay = -1;
157 static gint hf_ipmi_picmg_12_pwr_mult = -1;
158 static gint hf_ipmi_picmg_12_pwr_draw = -1;
159
160 static gint hf_ipmi_picmg_13_fruid = -1;
161
162 static gint hf_ipmi_picmg_14_fruid = -1;
163 static gint hf_ipmi_picmg_14_speed_min = -1;
164 static gint hf_ipmi_picmg_14_speed_max = -1;
165 static gint hf_ipmi_picmg_14_speed_norm = -1;
166 static gint hf_ipmi_picmg_14_local_control = -1;
167
168 static gint hf_ipmi_picmg_15_fruid = -1;
169 static gint hf_ipmi_picmg_15_fan_level = -1;
170 static gint hf_ipmi_picmg_15_local_enable = -1;
171
172 static gint hf_ipmi_picmg_16_fruid = -1;
173 static gint hf_ipmi_picmg_16_override_level = -1;
174 static gint hf_ipmi_picmg_16_local_level = -1;
175 static gint hf_ipmi_picmg_16_local_enable = -1;
176
177 static gint hf_ipmi_picmg_17_cmd = -1;
178 static gint hf_ipmi_picmg_17_resid = -1;
179 static gint hf_ipmi_picmg_17_status = -1;
180
181 static gint hf_ipmi_picmg_18_li_key_type = -1;
182 static gint hf_ipmi_picmg_18_li_key = -1;
183 static gint hf_ipmi_picmg_18_link_num = -1;
184 static gint hf_ipmi_picmg_18_sensor_num = -1;
185
186 static gint hf_ipmi_picmg_1b_addr_active = -1;
187 static gint hf_ipmi_picmg_1b_addr_backup = -1;
188
189 static gint hf_ipmi_picmg_1c_fan_site_number = -1;
190 static gint hf_ipmi_picmg_1c_fan_enable_state = -1;
191 static gint hf_ipmi_picmg_1c_fan_policy_timeout = -1;
192 static gint hf_ipmi_picmg_1c_site_number = -1;
193 static gint hf_ipmi_picmg_1c_site_type = -1;
194
195 static gint hf_ipmi_picmg_1d_fan_site_number = -1;
196 static gint hf_ipmi_picmg_1d_site_number = -1;
197 static gint hf_ipmi_picmg_1d_site_type = -1;
198 static gint hf_ipmi_picmg_1d_policy = -1;
199 static gint hf_ipmi_picmg_1d_coverage = -1;
200
201 static gint hf_ipmi_picmg_1e_fruid = -1;
202 static gint hf_ipmi_picmg_1e_cap_diagintr = -1;
203 static gint hf_ipmi_picmg_1e_cap_graceful_reboot = -1;
204 static gint hf_ipmi_picmg_1e_cap_warm_reset = -1;
205
206 static gint hf_ipmi_picmg_1f_rq_fruid = -1;
207 static gint hf_ipmi_picmg_1f_rq_op = -1;
208 static gint hf_ipmi_picmg_1f_rq_lockid = -1;
209 static gint hf_ipmi_picmg_1f_rs_lockid = -1;
210 static gint hf_ipmi_picmg_1f_rs_tstamp = -1;
211
212 static gint hf_ipmi_picmg_20_fruid = -1;
213 static gint hf_ipmi_picmg_20_lockid = -1;
214 static gint hf_ipmi_picmg_20_offset = -1;
215 static gint hf_ipmi_picmg_20_data = -1;
216 static gint hf_ipmi_picmg_20_count = -1;
217
218 static gint hf_ipmi_picmg_21_addr_num = -1;
219 static gint hf_ipmi_picmg_21_tstamp = -1;
220 static gint hf_ipmi_picmg_21_addr_count = -1;
221 static gint hf_ipmi_picmg_21_site_type = -1;
222 static gint hf_ipmi_picmg_21_site_num = -1;
223 static gint hf_ipmi_picmg_21_max_unavail = -1;
224 static gint hf_ipmi_picmg_21_is_shm = -1;
225 static gint hf_ipmi_picmg_21_addr_type = -1;
226 static gint hf_ipmi_picmg_21_ipaddr = -1;
227 static gint hf_ipmi_picmg_21_rmcpport = -1;
228
229 static gint hf_ipmi_picmg_22_feed_idx = -1;
230 static gint hf_ipmi_picmg_22_update_cnt = -1;
231 static gint hf_ipmi_picmg_22_pwr_alloc = -1;
232
233 static gint hf_ipmi_picmg_XX_comp7 = -1;
234 static gint hf_ipmi_picmg_XX_comp6 = -1;
235 static gint hf_ipmi_picmg_XX_comp5 = -1;
236 static gint hf_ipmi_picmg_XX_comp4 = -1;
237 static gint hf_ipmi_picmg_XX_comp3 = -1;
238 static gint hf_ipmi_picmg_XX_comp2 = -1;
239 static gint hf_ipmi_picmg_XX_comp1 = -1;
240 static gint hf_ipmi_picmg_XX_comp0 = -1;
241
242 static gint hf_ipmi_picmg_2e_version = -1;
243 static gint hf_ipmi_picmg_2e_upgrade_undesirable = -1;
244 static gint hf_ipmi_picmg_2e_auto_rollback_override = -1;
245 static gint hf_ipmi_picmg_2e_ipmc_degraded = -1;
246 static gint hf_ipmi_picmg_2e_deferred_activate = -1;
247 static gint hf_ipmi_picmg_2e_services_affected = -1;
248 static gint hf_ipmi_picmg_2e_manual_rollback = -1;
249 static gint hf_ipmi_picmg_2e_auto_rollback = -1;
250 static gint hf_ipmi_picmg_2e_self_test = -1;
251 static gint hf_ipmi_picmg_2e_upgrade_tout = -1;
252 static gint hf_ipmi_picmg_2e_selftest_tout = -1;
253 static gint hf_ipmi_picmg_2e_rollback_tout = -1;
254 static gint hf_ipmi_picmg_2e_inaccessibility_tout = -1;
255
256 static gint hf_ipmi_picmg_prop00_cold_reset = -1;
257 static gint hf_ipmi_picmg_prop00_deferred_activation = -1;
258 static gint hf_ipmi_picmg_prop00_comparison = -1;
259 static gint hf_ipmi_picmg_prop00_preparation = -1;
260 static gint hf_ipmi_picmg_prop00_rollback = -1;
261 static gint hf_ipmi_picmg_prop01_fw_major = -1;
262 static gint hf_ipmi_picmg_prop01_fw_minor = -1;
263 static gint hf_ipmi_picmg_prop01_fw_aux = -1;
264 static gint hf_ipmi_picmg_prop02_desc = -1;
265
266 static gint hf_ipmi_picmg_2f_comp_id = -1;
267 static gint hf_ipmi_picmg_2f_comp_prop = -1;
268 static gint hf_ipmi_picmg_2f_prop_data = -1;
269
270 static gint hf_ipmi_picmg_31_action = -1;
271
272 static gint hf_ipmi_picmg_32_block = -1;
273 static gint hf_ipmi_picmg_32_data = -1;
274 static gint hf_ipmi_picmg_32_sec_offs = -1;
275 static gint hf_ipmi_picmg_32_sec_len = -1;
276
277 static gint hf_ipmi_picmg_33_comp_id = -1;
278 static gint hf_ipmi_picmg_33_img_len = -1;
279
280 static gint hf_ipmi_picmg_34_cmd = -1;
281 static gint hf_ipmi_picmg_34_ccode = -1;
282 static gint hf_ipmi_picmg_34_percentage = -1;
283
284 static gint hf_ipmi_picmg_35_rollback_override = -1;
285
286 static gint hf_ipmi_picmg_36_result = -1;
287 static gint hf_ipmi_picmg_36_fail = -1;
288 static gint hf_ipmi_picmg_36_fail_sel = -1;
289 static gint hf_ipmi_picmg_36_fail_sdr = -1;
290 static gint hf_ipmi_picmg_36_fail_bmc_fru = -1;
291 static gint hf_ipmi_picmg_36_fail_ipmb_sig = -1;
292 static gint hf_ipmi_picmg_36_fail_sdr_empty = -1;
293 static gint hf_ipmi_picmg_36_fail_iua = -1;
294 static gint hf_ipmi_picmg_36_fail_bb_fw = -1;
295 static gint hf_ipmi_picmg_36_fail_oper_fw = -1;
296
297 static gint hf_ipmi_picmg_37_percent = -1;
298
299 static const value_string site_type_vals[] = {
300         { 0x00, "PICMG board" },
301         { 0x01, "Power Entry" },
302         { 0x02, "Shelf FRU Information" },
303         { 0x03, "Dedicated ShMC" },
304         { 0x04, "Fan Tray / Cooling Unit" },
305         { 0x05, "Fan Filter Tray" },
306         { 0x06, "Alarm" },
307         { 0x07, "AdvancedMC module" },
308         { 0x08, "PMC" },
309         { 0x09, "Rear Transition Module" },
310         { 0x0A, "MicroTCA Carrier Hub" },
311         { 0x0B, "Power Module" },
312         { 0xC0, "OEM" },
313         { 0xC1, "OEM" },
314         { 0xC2, "OEM" },
315         { 0xC3, "OEM" },
316         { 0xC4, "OEM" },
317         { 0xC5, "OEM" },
318         { 0xC6, "OEM" },
319         { 0xC7, "OEM" },
320         { 0xC8, "OEM" },
321         { 0xC9, "OEM" },
322         { 0xCA, "OEM" },
323         { 0xCB, "OEM" },
324         { 0xCC, "OEM" },
325         { 0xCD, "OEM" },
326         { 0xCE, "OEM" },
327         { 0xCF, "OEM" },
328         { 0, NULL }
329 };
330
331 static const value_string addr_key_type_vals[] = {
332         { 0x00, "Hardware Address" },
333         { 0x01, "IPMB-0 Address" },
334         { 0x03, "Physical Address" },
335         { 0, NULL }
336 };
337
338 static const struct true_false_string set_clear_tfs = {
339         "Set", "Clear"
340 };
341
342 static const value_string led_color_vals[] = {
343         { 0x00, "Reserved (Control not supported)" },
344         { 0x01, "Blue" },
345         { 0x02, "Red" },
346         { 0x03, "Green" },
347         { 0x04, "Amber" },
348         { 0x05, "Orange" },
349         { 0x06, "White" },
350         { 0x0E, "Do not change" },
351         { 0x0F, "Use default" },
352         { 0, NULL }
353 };
354
355 static const value_string linkinfo_type_vals[] = {
356         { 0x01, "PICMG3.0 Base Interface 10/100/1000 BASE-T" },
357         { 0x02, "PICMG3.1 Ethernet Fabric Interface" },
358         { 0x03, "PICMG3.2 Infiniband Fabric Interface" },
359         { 0x04, "PICMG3.3 StarFabric Fabric Interface" },
360         { 0x05, "PICMG3.4 PCI Express Fabric Interface" },
361         { 0xf0, "OEM" }, { 0xf1, "OEM" }, { 0xf2, "OEM" }, { 0xf3, "OEM" },
362         { 0xf4, "OEM" }, { 0xf5, "OEM" }, { 0xf6, "OEM" }, { 0xf7, "OEM" },
363         { 0xf8, "OEM" }, { 0xf9, "OEM" }, { 0xfa, "OEM" }, { 0xfb, "OEM" },
364         { 0xfc, "OEM" }, { 0xfd, "OEM" }, { 0xfe, "OEM" },
365
366         { 0, NULL }
367 };
368
369 static const value_string linkinfo_ports_vals[] = {
370         { 0x00, "None" },
371         { 0x01, "0" },
372         { 0x02, "1" },
373         { 0x03, "0,1" },
374         { 0x04, "2" },
375         { 0x05, "0,2" },
376         { 0x06, "1,2" },
377         { 0x07, "0,1,2" },
378         { 0x08, "3" },
379         { 0x09, "0,3" },
380         { 0x0a, "1,3" },
381         { 0x0b, "0,1,3" },
382         { 0x0c, "2,3" },
383         { 0x0d, "0,2,3" },
384         { 0x0e, "1,2,3" },
385         { 0x0f, "0,1,2,3" },
386
387         { 0, NULL }
388 };
389
390 static const value_string linkinfo_iface_vals[] = {
391         { 0x00, "Base Interface" },
392         { 0x01, "Fabric Interface" },
393         { 0x02, "Update Channel Interface" },
394
395         { 0, NULL }
396 };
397
398 static const value_string busresid_vals[] = {
399         { 0x00, "Metallic Test Bus #1" },
400         { 0x01, "Metallic Test Bus #2" },
401         { 0x02, "Synch clock group #1" },
402         { 0x03, "Synch clock group #2" },
403         { 0x04, "Synch clock group #3" },
404         { 0, NULL }
405 };
406
407 static const value_string fan_level_vals[] = {
408         { 0xFE, "Shut down" },
409         { 0xFF, "Local control" },
410         { 0, NULL }
411 };
412
413 static const value_string enable_vals[] = {
414         { 0x00, "Disable" },
415         { 0x01, "Enable" },
416         { 0, NULL }
417 };
418
419 static const value_string enabled_vals[] = {
420         { 0x00, "Disabled" },
421         { 0x01, "Enabled" },
422         { 0, NULL }
423 };
424
425 static const value_string vals_04_cmd[] = {
426         { 0x00, "Cold Reset" },
427         { 0x01, "Warm Reset" },
428         { 0x02, "Graceful Reboot" },
429         { 0x03, "Issue Diagnostic Interrupt" },
430         { 0x04, "Quiesce" },
431         { 0, NULL }
432 };
433
434 static const value_string vals_0c_cmd[] = {
435         { 0x00, "Deactivate FRU" },
436         { 0x01, "Activate FRU" },
437         { 0, NULL }
438 };
439
440 static const value_string vals_11_set[] = {
441         { 0x00, "Do not change present levels" },
442         { 0x01, "Copy desired levels to present levels" },
443         { 0, NULL }
444 };
445
446 static const value_string vals_12_pwr_type[] = {
447         { 0x00, "Steady state power draw levels" },
448         { 0x01, "Desired steady state draw levels" },
449         { 0x02, "Early power draw levels" },
450         { 0x03, "Desired early levels" },
451         { 0, NULL }
452 };
453
454 static const value_string vals_18_keytype[] = {
455         { 0x00, "Link Info Key contains Link Number" },
456         { 0x01, "Link Info Key contains Sensor Number" },
457         { 0, NULL }
458 };
459
460 static const value_string vals_1d_policy[] = {
461         { 0x00, "Disabled" },
462         { 0x01, "Enabled" },
463         { 0xFF, "Indeterminate" },
464         { 0, NULL }
465 };
466
467 static const value_string vals_1d_coverage[] = {
468         { 0x00, "Not Covered" },
469         { 0x01, "Covered" },
470         { 0, NULL }
471 };
472
473 static const value_string vals_1f_op[] = {
474         { 0x00, "Get Last Commit Timestamp" },
475         { 0x01, "Lock" },
476         { 0x02, "Unlock and Discard" },
477         { 0x03, "Unlock and Commit" },
478         { 0, NULL }
479 };
480
481 static const value_string vals_21_addr_type[] = {
482         { 0x01, "IPv4" },
483         { 0x60, "OEM" }, { 0x61, "OEM" }, { 0x62, "OEM" }, { 0x63, "OEM" },
484         { 0x64, "OEM" }, { 0x65, "OEM" }, { 0x66, "OEM" }, { 0x67, "OEM" },
485         { 0x68, "OEM" }, { 0x69, "OEM" }, { 0x6a, "OEM" }, { 0x6b, "OEM" },
486         { 0x6c, "OEM" }, { 0x6d, "OEM" }, { 0x6e, "OEM" }, { 0x6f, "OEM" },
487         { 0x70, "OEM" }, { 0x71, "OEM" }, { 0x72, "OEM" }, { 0x73, "OEM" },
488         { 0x74, "OEM" }, { 0x75, "OEM" }, { 0x76, "OEM" }, { 0x77, "OEM" },
489         { 0x78, "OEM" }, { 0x79, "OEM" }, { 0x7a, "OEM" }, { 0x7b, "OEM" },
490         { 0x7c, "OEM" }, { 0x7d, "OEM" }, { 0x7e, "OEM" }, { 0x7f, "OEM" },
491         { 0, NULL }
492 };
493
494 static const value_string vals_prop00_rollback[] = {
495         { 0x00, "Not supported" },
496         { 0x01, "Rollback supported, Backup required" },
497         { 0x02, "Rollback supported, Backup not required" },
498         { 0, NULL }
499 };
500
501 static const value_string vals_31_action[] = {
502         { 0x00, "Backup components" },
503         { 0x01, "Prepare components" },
504         { 0x02, "Upload for upgrade" },
505         { 0x03, "Upload for compare" },
506         { 0, NULL }
507 };
508
509 static const value_string vals_35_override[] = {
510         { 0x00, "Automatic Rollback allowed" },
511         { 0x01, "Automatic Rollback override" },
512         { 0, NULL }
513 };
514
515 static const value_string vals_36_result[] = {
516         { 0x55, "No error. All Self Tests Passed" },
517         { 0x56, "Reserved, cannot be used" },
518         { 0x57, "Corrupted or inaccessible data or devices" },
519         { 0x58, "Fatal hardware error" },
520         { 0x60, "Component failure" },
521         { 0xff, "Reserved" },
522         { 0, NULL }
523 };
524
525 static const struct true_false_string tfs_36_fail_unknown = {
526         "Test failed",
527         "Unknown"
528 };
529
530 /* Get PICMG Properties.
531  */
532 static void
533 rs00(tvbuff_t *tvb, proto_tree *tree)
534 {
535         guint8 v;
536
537         v = tvb_get_guint8(tvb, 0);
538         proto_tree_add_item(tree, hf_ipmi_picmg_00_version, tvb, 0, 1, TRUE);
539         proto_tree_add_item(tree, hf_ipmi_picmg_00_max_fruid, tvb, 1, 1, TRUE);
540         proto_tree_add_item(tree, hf_ipmi_picmg_00_ipmc_fruid, tvb, 2, 1, TRUE);
541 }
542
543 /* Get Address Info Command.
544  */
545 static void
546 rq01(tvbuff_t *tvb, proto_tree *tree)
547 {
548         if (tvb_length(tvb) > 0) {
549                 proto_tree_add_item(tree, hf_ipmi_picmg_01_rq_fruid, tvb, 0, 1, TRUE);
550         }
551         if (tvb_length(tvb) > 1) {
552                 proto_tree_add_item(tree, hf_ipmi_picmg_01_rq_addr_key_type, tvb, 1, 1, TRUE);
553         }
554         if (tvb_length(tvb) > 2) {
555                 proto_tree_add_item(tree, hf_ipmi_picmg_01_rq_addr_key, tvb, 2, 1, TRUE);
556         }
557         if (tvb_length(tvb) > 3) {
558                 proto_tree_add_item(tree, hf_ipmi_picmg_01_rq_site_type, tvb, 3, 1, TRUE);
559         }
560 }
561
562 static void
563 rs01(tvbuff_t *tvb, proto_tree *tree)
564 {
565         proto_tree_add_item(tree, hf_ipmi_picmg_01_rs_hwaddr, tvb, 0, 1, TRUE);
566         proto_tree_add_item(tree, hf_ipmi_picmg_01_rs_ipmbaddr, tvb, 1, 1, TRUE);
567         proto_tree_add_item(tree, hf_ipmi_picmg_01_rs_rsrv, tvb, 2, 1, TRUE);
568         proto_tree_add_item(tree, hf_ipmi_picmg_01_rs_fruid, tvb, 3, 1, TRUE);
569         proto_tree_add_item(tree, hf_ipmi_picmg_01_rs_site_num, tvb, 4, 1, TRUE);
570         proto_tree_add_item(tree, hf_ipmi_picmg_01_rs_site_type, tvb, 5, 1, TRUE);
571         /* TBD Next byte is carrier number in MTCA */
572 }
573
574 /* Get Shelf Address Info
575  */
576 static void
577 rs02(tvbuff_t *tvb, proto_tree *tree)
578 {
579         ipmi_add_typelen(tree, "Shelf Address", tvb, 0, TRUE);
580 }
581
582 /* Set Shelf Address Info
583  */
584 static void
585 rq03(tvbuff_t *tvb, proto_tree *tree)
586 {
587         ipmi_add_typelen(tree, "Shelf Address", tvb, 0, TRUE);
588 }
589
590 /* FRU Control.
591  */
592 static void
593 rq04(tvbuff_t *tvb, proto_tree *tree)
594 {
595         proto_tree_add_item(tree, hf_ipmi_picmg_04_fruid, tvb, 0, 1, TRUE);
596         proto_tree_add_item(tree, hf_ipmi_picmg_04_cmd, tvb, 1, 1, TRUE);
597 }
598
599 /* Get FRU LED Properties
600  */
601 static void
602 rq05(tvbuff_t *tvb, proto_tree *tree)
603 {
604         proto_tree_add_item(tree, hf_ipmi_picmg_05_fruid, tvb, 0, 1, TRUE);
605 }
606
607 static void
608 rs05(tvbuff_t *tvb, proto_tree *tree)
609 {
610         static const int *byte1[] = { &hf_ipmi_picmg_05_led3, &hf_ipmi_picmg_05_led2,
611                 &hf_ipmi_picmg_05_led1, &hf_ipmi_picmg_05_blue_led, NULL };
612
613         proto_tree_add_bitmask_text(tree, tvb, 0, 1, "General Status LEDs: ", "None",
614                         ett_ipmi_picmg_05_byte1, byte1, TRUE, 0);
615         proto_tree_add_item(tree, hf_ipmi_picmg_05_app_leds, tvb, 1, 1, TRUE);
616 }
617
618 /* Get LED Color Capabilities
619  */
620 static void
621 rq06(tvbuff_t *tvb, proto_tree *tree)
622 {
623         proto_tree_add_item(tree, hf_ipmi_picmg_06_fruid, tvb, 0, 1, TRUE);
624         proto_tree_add_item(tree, hf_ipmi_picmg_06_ledid, tvb, 1, 1, TRUE);
625 }
626
627 static void
628 rs06(tvbuff_t *tvb, proto_tree *tree)
629 {
630         static const int *byte1[] = { &hf_ipmi_picmg_06_cap_white, &hf_ipmi_picmg_06_cap_orange,
631                 &hf_ipmi_picmg_06_cap_amber, &hf_ipmi_picmg_06_cap_green, &hf_ipmi_picmg_06_cap_red,
632                 &hf_ipmi_picmg_06_cap_blue, NULL };
633         static const int *byte2[] = { &hf_ipmi_picmg_06_default_local_color, NULL };
634         static const int *byte3[] = { &hf_ipmi_picmg_06_default_override_color, NULL };
635
636         proto_tree_add_bitmask_text(tree, tvb, 0, 1, "Color capabilities: ", "None",
637                         ett_ipmi_picmg_06_byte1, byte1, TRUE, 0);
638         proto_tree_add_bitmask_text(tree, tvb, 1, 1, NULL, NULL,
639                         ett_ipmi_picmg_06_byte2, byte2, TRUE, 0);
640         proto_tree_add_bitmask_text(tree, tvb, 2, 1, NULL, NULL,
641                         ett_ipmi_picmg_06_byte3, byte3, TRUE, 0);
642 }
643
644 static void
645 parse_led_state(proto_tree *tree, tvbuff_t *tvb, guint offs, const char *desc)
646 {
647         static const int *color[] = { &hf_ipmi_picmg_led_color, NULL };
648         static const value_string funcs[] = {
649                 { 0x00, "LED Off override" },
650                 { 0xfb, "Lamp Test state" },
651                 { 0xfc, "Restore Local Control" },
652                 { 0xfd, "Reserved" },
653                 { 0xfe, "Reserved" },
654                 { 0xff, "LED On override" },
655                 { 0, NULL }
656         };
657         proto_item *ti;
658         guint8 v;
659
660         v = tvb_get_guint8(tvb, offs);
661         proto_tree_add_uint_format(tree, hf_ipmi_picmg_led_function, tvb, offs, 1,
662                         v, "%sFunction: %s (0x%02x)", desc,
663                         val_to_str(v, funcs, "LED Blinking override, off-duration %d0ms"),
664                         v);
665         v = tvb_get_guint8(tvb, offs + 1);
666         proto_tree_add_uint_format(tree, hf_ipmi_picmg_led_on_duration, tvb, offs + 1, 1,
667                         v, "%sOn-duration: %d0ms", desc, v);
668         v = tvb_get_guint8(tvb, offs + 2) & 0x0f;
669         ti = proto_tree_add_bitmask_text(tree, tvb, offs + 2, 1,
670                         NULL, NULL, ett_ipmi_picmg_led_color, color, TRUE, 0);
671         proto_item_set_text(ti, "%sColor: %s", desc, val_to_str(v, led_color_vals, "Reserved"));
672 }
673
674 /* Set FRU LED State
675  */
676 static void
677 rq07(tvbuff_t *tvb, proto_tree *tree)
678 {
679         proto_tree_add_item(tree, hf_ipmi_picmg_07_fruid, tvb, 0, 1, TRUE);
680         proto_tree_add_item(tree, hf_ipmi_picmg_07_ledid, tvb, 1, 1, TRUE);
681         parse_led_state(tree, tvb, 2, "");
682 }
683
684 /* Get FRU LED State
685  */
686 static void
687 rq08(tvbuff_t *tvb, proto_tree *tree)
688 {
689         proto_tree_add_item(tree, hf_ipmi_picmg_08_fruid, tvb, 0, 1, TRUE);
690         proto_tree_add_item(tree, hf_ipmi_picmg_08_ledid, tvb, 1, 1, TRUE);
691 }
692
693 static void
694 rs08(tvbuff_t *tvb, proto_tree *tree)
695 {
696         static const int *byte1[] = { &hf_ipmi_picmg_08_state_lamptest, &hf_ipmi_picmg_08_state_override,
697                 &hf_ipmi_picmg_08_state_local, NULL };
698
699         proto_tree_add_bitmask_text(tree, tvb, 0, 1, "LED States: ", "None",
700                         ett_ipmi_picmg_08_byte1, byte1, TRUE, 0);
701         parse_led_state(tree, tvb, 1, "Local Control ");
702         if (tvb_length(tvb) > 4) {
703                 parse_led_state(tree, tvb, 4, "Override ");
704         }
705         if (tvb_length(tvb) > 7) {
706                 proto_tree_add_item(tree, hf_ipmi_picmg_08_lamptest_duration, tvb, 7, 1, TRUE);
707         }
708 }
709
710 /* Set IPMB State
711  */
712 static void
713 parse_ipmb_state(proto_tree *tree, tvbuff_t *tvb, guint offs, int hf, int ett)
714 {
715         char buf[32];
716         const char *desc;
717         proto_tree *s_tree;
718         proto_item *ti;
719         guint8 v, num;
720
721         v = tvb_get_guint8(tvb, offs);
722         if (v == 0xff) {
723                 proto_tree_add_uint_format_value(tree, hf, tvb, 0, 1,
724                                 v, "Don't change (0xff)");
725         } else {
726                 num = v >> 1;
727                 if (!num) {
728                         desc = "All Links";
729                 } else if (num < 0x60) {
730                         g_snprintf(buf, sizeof(buf), "Link #%d", num);
731                         desc = buf;
732                 } else {
733                         desc = "Reserved";
734                 }
735                 ti = proto_tree_add_uint_format_value(tree, hf, tvb, 0, 1,
736                                 v, "%s, %s", desc, (v & 1) ? "Local Control" : "Override");
737                 s_tree = proto_item_add_subtree(ti, ett);
738                 proto_tree_add_text(s_tree, tvb, 0, 1, "%sLink: %s (0x%02x)",
739                                 ipmi_dcd8(v, 0xfe), desc, num);
740                 proto_tree_add_text(s_tree, tvb, 0, 1, "%sState: %s",
741                                 ipmi_dcd8(v, 0x01), (v & 1) ? "Local Control State" : "Override State (Isolate)");
742         }
743 }
744
745 static void
746 rq09(tvbuff_t *tvb, proto_tree *tree)
747 {
748         parse_ipmb_state(tree, tvb, 0, hf_ipmi_picmg_09_ipmba, ett_ipmi_picmg_09_ipmba);
749         parse_ipmb_state(tree, tvb, 1, hf_ipmi_picmg_09_ipmbb, ett_ipmi_picmg_09_ipmbb);
750 }
751
752 /* Set FRU Activation Policy
753  */
754 static void
755 rq0a(tvbuff_t *tvb, proto_tree *tree)
756 {
757         static const int *byte2[] = { &hf_ipmi_picmg_0a_msk_d_locked, &hf_ipmi_picmg_0a_msk_locked, NULL };
758         static const int *byte3[] = { &hf_ipmi_picmg_0a_d_locked, &hf_ipmi_picmg_0a_locked, NULL };
759
760         proto_tree_add_item(tree, hf_ipmi_picmg_0a_fruid, tvb, 0, 1, TRUE);
761         proto_tree_add_bitmask_text(tree, tvb, 1, 1, "Will affect bits: ", "None",
762                         ett_ipmi_picmg_0a_byte2, byte2, TRUE, BMT_NO_TFS);
763         proto_tree_add_bitmask_text(tree, tvb, 2, 1, "Activation Policy Set Bits: ", NULL,
764                         ett_ipmi_picmg_0a_byte3, byte3, TRUE, 0);
765 }
766
767 /* Get FRU Activation Policy
768  */
769 static void
770 rq0b(tvbuff_t *tvb, proto_tree *tree)
771 {
772         proto_tree_add_item(tree, hf_ipmi_picmg_0b_fruid, tvb, 0, 1, TRUE);
773 }
774
775 static void
776 rs0b(tvbuff_t *tvb, proto_tree *tree)
777 {
778         static const int *byte1[] = { &hf_ipmi_picmg_0b_d_locked, &hf_ipmi_picmg_0b_locked, NULL };
779
780         proto_tree_add_bitmask_text(tree, tvb, 0, 1, "Activation Policy Bits: ", NULL,
781                         ett_ipmi_picmg_0b_byte1, byte1, TRUE, 0);
782 }
783
784
785 /* Set FRU Activation
786  */
787 static void
788 rq0c(tvbuff_t *tvb, proto_tree *tree)
789 {
790         proto_tree_add_item(tree, hf_ipmi_picmg_0c_fruid, tvb, 0, 1, TRUE);
791         proto_tree_add_item(tree, hf_ipmi_picmg_0c_cmd, tvb, 1, 1, TRUE);
792 }
793
794 /* Get Device Locator Record ID
795  */
796 static void
797 rq0d(tvbuff_t *tvb, proto_tree *tree)
798 {
799         proto_tree_add_item(tree, hf_ipmi_picmg_0d_fruid, tvb, 0, 1, TRUE);
800         if (tvb_length(tvb) > 1) {
801                 proto_tree_add_item(tree, hf_ipmi_picmg_0d_start, tvb, 1, 2, TRUE);
802         }
803 }
804
805 static void
806 rs0d(tvbuff_t *tvb, proto_tree *tree)
807 {
808         proto_tree_add_item(tree, hf_ipmi_picmg_0d_recordid, tvb, 0, 2, TRUE);
809 }
810
811 static void
812 parse_link_info_state(proto_tree *tree, tvbuff_t *tvb, guint offs, const char *num, const value_string *vs)
813 {
814         static const int *link_info[] = { &hf_ipmi_picmg_linkinfo_grpid, &hf_ipmi_picmg_linkinfo_type_ext,
815                 &hf_ipmi_picmg_linkinfo_type, &hf_ipmi_picmg_linkinfo_ports, &hf_ipmi_picmg_linkinfo_iface,
816                 &hf_ipmi_picmg_linkinfo_chan, NULL };
817         guint8 v = tvb_get_guint8(tvb, offs + 4);
818         char buf[32];
819
820         g_snprintf(buf, sizeof(buf), "Link info%s: ", num);
821         proto_tree_add_bitmask_text(tree, tvb, offs, 4, buf, NULL,
822                         ett_ipmi_picmg_link_info, link_info, TRUE, 0);
823         proto_tree_add_uint_format(tree, hf_ipmi_picmg_linkinfo_state, tvb, offs + 4, 1,
824                         v, "State%s: %s (0x%02x)", num, val_to_str(v, vs, "Reserved"), v);
825 }
826
827 /* Set Port State
828  */
829 static void
830 rq0e(tvbuff_t *tvb, proto_tree *tree)
831 {
832         static const value_string state_vals[] = {
833                 { 0x00, "Disable" },
834                 { 0x01, "Enable" },
835                 { 0, NULL }
836         };
837
838         parse_link_info_state(tree, tvb, 0, "", state_vals);
839 }
840
841 /* Get Port State
842  */
843 static void
844 rq0f(tvbuff_t *tvb, proto_tree *tree)
845 {
846         static const int *chan[] = { &hf_ipmi_picmg_0f_iface, &hf_ipmi_picmg_0f_chan, NULL };
847
848         proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_picmg_0f_chan, chan, TRUE, 0);
849 }
850
851 static void
852 rs0f(tvbuff_t *tvb, proto_tree *tree)
853 {
854         static const value_string state_vals[] = {
855                 { 0x00, "Disabled" },
856                 { 0x01, "Enabled" },
857                 { 0, NULL }
858         };
859
860         if (tvb_length(tvb) > 0) {
861                 parse_link_info_state(tree, tvb, 0, " 1", state_vals);
862         }
863         if (tvb_length(tvb) > 5) {
864                 parse_link_info_state(tree, tvb, 5, " 2", state_vals);
865         }
866         if (tvb_length(tvb) > 10) {
867                 parse_link_info_state(tree, tvb, 10, " 3", state_vals);
868         }
869         if (tvb_length(tvb) > 15) {
870                 parse_link_info_state(tree, tvb, 15, " 4", state_vals);
871         }
872 }
873
874 /* Compute Power Properties
875  */
876 static void
877 rq10(tvbuff_t *tvb, proto_tree *tree)
878 {
879         proto_tree_add_item(tree, hf_ipmi_picmg_10_fruid, tvb, 0, 1, TRUE);
880 }
881
882 static void
883 rs10(tvbuff_t *tvb, proto_tree *tree)
884 {
885         proto_tree_add_item(tree, hf_ipmi_picmg_10_nslots, tvb, 0, 1, TRUE);
886         proto_tree_add_item(tree, hf_ipmi_picmg_10_ipmc_loc, tvb, 1, 1, TRUE);
887 }
888
889 /* Set Power Level
890  */
891 static void
892 rq11(tvbuff_t *tvb, proto_tree *tree)
893 {
894         static const value_string plvl_vals[] = {
895                 { 0x00, "Power Off" },
896                 { 0xff, "Do not change" },
897                 { 0, NULL }
898         };
899         guint8 v = tvb_get_guint8(tvb, 1);
900
901         proto_tree_add_item(tree, hf_ipmi_picmg_11_fruid, tvb, 0, 1, TRUE);
902         proto_tree_add_uint_format_value(tree, hf_ipmi_picmg_11_power_level, tvb, 1, 1,
903                         v, "%s", val_to_str(v, plvl_vals, "Power Level %d"));
904         proto_tree_add_item(tree, hf_ipmi_picmg_11_set_to_desired, tvb, 2, 1, TRUE);
905 }
906
907 /* Get Power Level
908  */
909 static void
910 rq12(tvbuff_t *tvb, proto_tree *tree)
911 {
912         proto_tree_add_item(tree, hf_ipmi_picmg_12_fruid, tvb, 0, 1, TRUE);
913         proto_tree_add_item(tree, hf_ipmi_picmg_12_pwr_type, tvb, 1, 1, TRUE);
914 }
915
916 static void
917 rs12(tvbuff_t *tvb, proto_tree *tree)
918 {
919         static const int *byte1[] = { &hf_ipmi_picmg_12_dynamic, &hf_ipmi_picmg_12_pwr_lvl, NULL };
920         guint8 v, v2, i, max;
921         guint32 tmp;
922
923         proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL, ett_ipmi_picmg_12_byte1, byte1, TRUE, BMT_NO_FALSE);
924         proto_tree_add_item(tree, hf_ipmi_picmg_12_delay, tvb, 1, 1, TRUE);
925         v = tvb_get_guint8(tvb, 2);
926         proto_tree_add_uint_format_value(tree, hf_ipmi_picmg_12_pwr_mult, tvb, 2, 1,
927                         v, "%d.%dW", v / 10, v % 10);
928         max = tvb_length(tvb) - 3;
929         if (max == 0) {
930                 max = 1; /* One byte is mandatory */
931         } else if (max > 20) {
932                 max = 20; /* 20 levels at most */
933         }
934         for (i = 1; i <= max; i++) {
935                 v2 = tvb_get_guint8(tvb, 2 + i);
936                 tmp = (guint)v2 * v;
937                 proto_tree_add_uint_format(tree, hf_ipmi_picmg_12_pwr_draw, tvb, 2 + i, 1,
938                                 v2, "Power Draw [%d]: %d.%dW (0x%02x)", i,
939                                 tmp / 10, tmp % 10, v2);
940
941         }
942 }
943
944 /* Renegotiate Power
945  */
946 static void
947 rq13(tvbuff_t *tvb, proto_tree *tree)
948 {
949         if (tvb_length(tvb) > 0) {
950                 proto_tree_add_item(tree, hf_ipmi_picmg_13_fruid, tvb, 0, 1, TRUE);
951         }
952 }
953
954 /* Get Fan Speed Properties
955  */
956 static void
957 rq14(tvbuff_t *tvb, proto_tree *tree)
958 {
959         proto_tree_add_item(tree, hf_ipmi_picmg_14_fruid, tvb, 0, 1, TRUE);
960 }
961
962 static void
963 rs14(tvbuff_t *tvb, proto_tree *tree)
964 {
965         static const int *prop[] = { &hf_ipmi_picmg_14_local_control, NULL };
966
967         proto_tree_add_item(tree, hf_ipmi_picmg_14_speed_min, tvb, 0, 1, TRUE);
968         proto_tree_add_item(tree, hf_ipmi_picmg_14_speed_max, tvb, 1, 1, TRUE);
969         proto_tree_add_item(tree, hf_ipmi_picmg_14_speed_norm, tvb, 2, 1, TRUE);
970         proto_tree_add_bitmask_text(tree, tvb, 3, 1, "Fan Tray Properties: ", "None",
971                         ett_ipmi_picmg_14_prop, prop, TRUE, 0);
972 }
973
974 /* Set Fan Level
975  */
976 static void
977 rq15(tvbuff_t *tvb, proto_tree *tree)
978 {
979         guint8 v = tvb_get_guint8(tvb, 1);
980
981         proto_tree_add_item(tree, hf_ipmi_picmg_15_fruid, tvb, 0, 1, TRUE);
982         proto_tree_add_uint_format_value(tree, hf_ipmi_picmg_15_fan_level, tvb, 1, 1,
983                         v, "%s", val_to_str(v, fan_level_vals, "%d"));
984         if (tvb_length(tvb) > 2) {
985                 proto_tree_add_item(tree, hf_ipmi_picmg_15_local_enable, tvb, 2, 1, TRUE);
986         }
987 }
988
989 /* Get Fan Level
990  */
991 static void
992 rq16(tvbuff_t *tvb, proto_tree *tree)
993 {
994         proto_tree_add_item(tree, hf_ipmi_picmg_16_fruid, tvb, 0, 1, TRUE);
995 }
996
997 static void
998 rs16(tvbuff_t *tvb, proto_tree *tree)
999 {
1000         guint8 v;
1001
1002         v = tvb_get_guint8(tvb, 0);
1003         proto_tree_add_uint_format_value(tree, hf_ipmi_picmg_16_override_level, tvb, 0, 1,
1004                         v, "%s", val_to_str(v, fan_level_vals, "%d"));
1005         if (tvb_length(tvb) > 1) {
1006                 proto_tree_add_item(tree, hf_ipmi_picmg_16_local_level, tvb, 1, 1, TRUE);
1007         }
1008         if (tvb_length(tvb) > 2) {
1009                 proto_tree_add_item(tree, hf_ipmi_picmg_16_local_enable, tvb, 2, 1, TRUE);
1010         }
1011 }
1012
1013 /* Bused Resource Control
1014  */
1015 static void
1016 rq17(tvbuff_t *tvb, proto_tree *tree)
1017 {
1018         static const value_string vals_17_cmd_fromshmm[] = {
1019                 { 0x00, "Query" },
1020                 { 0x01, "Release" },
1021                 { 0x02, "Force" },
1022                 { 0x03, "Bus Free" },
1023                 { 0, NULL }
1024         };
1025         static const value_string vals_17_cmd_toshmm[] = {
1026                 { 0x00, "Request" },
1027                 { 0x01, "Relinquish" },
1028                 { 0x02, "Notify" },
1029                 { 0, NULL }
1030         };
1031         guint to_shmm = ipmi_current_hdr->trg_sa == 0x20;
1032         guint cmd = tvb_get_guint8(tvb, 0);
1033
1034         if (!tree) {
1035                 ipmi_setsaveddata(0, (to_shmm << 8) | cmd);
1036                 return;
1037         }
1038
1039         proto_tree_add_uint_format_value(tree, hf_ipmi_picmg_17_cmd, tvb, 0, 1,
1040                         cmd, "%s (0x%02x)", val_to_str(cmd,
1041                                 to_shmm ? vals_17_cmd_toshmm : vals_17_cmd_fromshmm,
1042                                 "Reserved"), cmd);
1043         proto_tree_add_item(tree, hf_ipmi_picmg_17_resid, tvb, 1, 1, TRUE);
1044 }
1045
1046 static void
1047 rs17(tvbuff_t *tvb, proto_tree *tree)
1048 {
1049         /* Key is 3 bytes: direction, command, status */
1050         static const value_string response_vals[] = {
1051                 { 0x000000, "In Control" },
1052                 { 0x000001, "No Control" },
1053                 { 0x000100, "Ack" },
1054                 { 0x000101, "Refused" },
1055                 { 0x000102, "No Control" },
1056                 { 0x000200, "Ack" },
1057                 { 0x000201, "No Control" },
1058                 { 0x000300, "Accept" },
1059                 { 0x000301, "Not Needed" },
1060                 { 0x010000, "Grant" },
1061                 { 0x010001, "Busy" },
1062                 { 0x010002, "Defer" },
1063                 { 0x010003, "Deny" },
1064                 { 0x010100, "Ack" },
1065                 { 0x010101, "Error" },
1066                 { 0x010200, "Ack" },
1067                 { 0x010201, "Error" },
1068                 { 0x010202, "Deny" },
1069                 { 0, NULL }
1070         };
1071         guint32 val;
1072         guint8 status;
1073
1074         if (!ipmi_getsaveddata(0, &val)) {
1075                 /* Without knowing the command, we cannot decipher the response */
1076                 proto_tree_add_item(tree, hf_ipmi_picmg_17_status, tvb, 0, 1, TRUE);
1077                 return;
1078         }
1079
1080         status = tvb_get_guint8(tvb, 0);
1081         val = (val << 8) | status;
1082         proto_tree_add_uint_format_value(tree, hf_ipmi_picmg_17_status, tvb, 0, 1,
1083                         status, "%s (0x%02x)", val_to_str(val, response_vals, "Reserved"), status);
1084 }
1085
1086 /* Get IPMB Link Info
1087  */
1088 static void
1089 rq18(tvbuff_t *tvb, proto_tree *tree)
1090 {
1091         proto_tree_add_item(tree, hf_ipmi_picmg_18_li_key_type, tvb, 0, 1, TRUE);
1092         proto_tree_add_item(tree, hf_ipmi_picmg_18_li_key, tvb, 1, 1, TRUE);
1093 }
1094
1095 static void
1096 rs18(tvbuff_t *tvb, proto_tree *tree)
1097 {
1098         proto_tree_add_item(tree, hf_ipmi_picmg_18_link_num, tvb, 0, 1, TRUE);
1099         proto_tree_add_item(tree, hf_ipmi_picmg_18_sensor_num, tvb, 1, 1, TRUE);
1100 }
1101
1102 /* Get Shelf Manager IPMB Address
1103  */
1104 static void
1105 rs1b(tvbuff_t *tvb, proto_tree *tree)
1106 {
1107         proto_tree_add_item(tree, hf_ipmi_picmg_1b_addr_active, tvb, 0, 1, TRUE);
1108         proto_tree_add_item(tree, hf_ipmi_picmg_1b_addr_backup, tvb, 0, 1, TRUE);
1109 }
1110
1111 /* Set Fan Policy
1112  */
1113 static void
1114 rq1c(tvbuff_t *tvb, proto_tree *tree)
1115 {
1116         proto_tree_add_item(tree, hf_ipmi_picmg_1c_fan_site_number, tvb, 0, 1, TRUE);
1117         proto_tree_add_item(tree, hf_ipmi_picmg_1c_fan_enable_state, tvb, 1, 1, TRUE);
1118         proto_tree_add_item(tree, hf_ipmi_picmg_1c_fan_policy_timeout, tvb, 2, 1, TRUE);
1119         if (tvb_length(tvb) > 3) {
1120                 proto_tree_add_item(tree, hf_ipmi_picmg_1c_site_number, tvb, 3, 1, TRUE);
1121                 proto_tree_add_item(tree, hf_ipmi_picmg_1c_site_type, tvb, 4, 1, TRUE);
1122         }
1123 }
1124
1125 /* Get Fan Policy
1126  */
1127 static void
1128 rq1d(tvbuff_t *tvb, proto_tree *tree)
1129 {
1130         proto_tree_add_item(tree, hf_ipmi_picmg_1d_fan_site_number, tvb, 0, 1, TRUE);
1131         if (tvb_length(tvb) > 1) {
1132                 proto_tree_add_item(tree, hf_ipmi_picmg_1d_site_number, tvb, 1, 1, TRUE);
1133                 proto_tree_add_item(tree, hf_ipmi_picmg_1d_site_type, tvb, 2, 1, TRUE);
1134         }
1135 }
1136
1137 static void
1138 rs1d(tvbuff_t *tvb, proto_tree *tree)
1139 {
1140         proto_tree_add_item(tree, hf_ipmi_picmg_1d_policy, tvb, 0, 1, TRUE);
1141         if (tvb_length(tvb) > 1) {
1142                 proto_tree_add_item(tree, hf_ipmi_picmg_1d_coverage, tvb, 1, 1, TRUE);
1143         }
1144 }
1145
1146 /* FRU Control Capabilities
1147  */
1148 static void
1149 rq1e(tvbuff_t *tvb, proto_tree *tree)
1150 {
1151         proto_tree_add_item(tree, hf_ipmi_picmg_1e_fruid, tvb, 0, 1, TRUE);
1152 }
1153
1154 static void
1155 rs1e(tvbuff_t *tvb, proto_tree *tree)
1156 {
1157         static const int *byte1[] = { &hf_ipmi_picmg_1e_cap_diagintr,
1158                 &hf_ipmi_picmg_1e_cap_graceful_reboot, &hf_ipmi_picmg_1e_cap_warm_reset, NULL };
1159
1160         proto_tree_add_bitmask_text(tree, tvb, 0, 1, "FRU Control Capabilities: ", "None",
1161                         ett_ipmi_picmg_1e_byte1, byte1, TRUE, 0);
1162 }
1163
1164 /* FRU Inventory Device Lock Control
1165  */
1166 static void
1167 rq1f(tvbuff_t *tvb, proto_tree *tree)
1168 {
1169         proto_tree_add_item(tree, hf_ipmi_picmg_1f_rq_fruid, tvb, 0, 1, TRUE);
1170         proto_tree_add_item(tree, hf_ipmi_picmg_1f_rq_op, tvb, 1, 1, TRUE);
1171         proto_tree_add_item(tree, hf_ipmi_picmg_1f_rq_lockid, tvb, 2, 2, TRUE);
1172 }
1173
1174 static void
1175 rs1f(tvbuff_t *tvb, proto_tree *tree)
1176 {
1177         proto_tree_add_item(tree, hf_ipmi_picmg_1f_rs_lockid, tvb, 0, 2, TRUE);
1178         ipmi_add_timestamp(tree, hf_ipmi_picmg_1f_rs_tstamp, tvb, 2);
1179 }
1180
1181 static const value_string cc1f[] = {
1182         { 0x80, "Invalid FRU Information" },
1183         { 0x81, "Lock Failed" },
1184         { 0, NULL }
1185 };
1186
1187 /* FRU Inventory Device Write
1188  */
1189 static void
1190 rq20(tvbuff_t *tvb, proto_tree *tree)
1191 {
1192         proto_tree_add_item(tree, hf_ipmi_picmg_20_fruid, tvb, 0, 1, TRUE);
1193         proto_tree_add_item(tree, hf_ipmi_picmg_20_lockid, tvb, 1, 2, TRUE);
1194         proto_tree_add_item(tree, hf_ipmi_picmg_20_offset, tvb, 3, 2, TRUE);
1195         proto_tree_add_item(tree, hf_ipmi_picmg_20_data, tvb, 5, tvb_length(tvb) - 5, TRUE);
1196 }
1197
1198 static void
1199 rs20(tvbuff_t *tvb, proto_tree *tree)
1200 {
1201         proto_tree_add_item(tree, hf_ipmi_picmg_20_count, tvb, 0, 1, TRUE);
1202 }
1203
1204 static const value_string cc20[] = {
1205         { 0x80, "Invalid Lock ID" },
1206         { 0, NULL }
1207 };
1208
1209 /* Get Shelf Manager IP Address
1210  */
1211 static void
1212 rq21(tvbuff_t *tvb, proto_tree *tree)
1213 {
1214         proto_tree_add_item(tree, hf_ipmi_picmg_21_addr_num, tvb, 0, 1, TRUE);
1215 }
1216
1217 static void
1218 rs21(tvbuff_t *tvb, proto_tree *tree)
1219 {
1220         static const int *byte9[] = { &hf_ipmi_picmg_21_is_shm, &hf_ipmi_picmg_21_addr_type, NULL };
1221         guint8 addrtype;
1222
1223         ipmi_add_timestamp(tree, hf_ipmi_picmg_21_tstamp, tvb, 0);
1224         proto_tree_add_item(tree, hf_ipmi_picmg_21_addr_count, tvb, 4, 1, TRUE);
1225         proto_tree_add_item(tree, hf_ipmi_picmg_21_site_type, tvb, 5, 1, TRUE);
1226         proto_tree_add_item(tree, hf_ipmi_picmg_21_site_num, tvb, 6, 1, TRUE);
1227         proto_tree_add_item(tree, hf_ipmi_picmg_21_max_unavail, tvb, 7, 1, TRUE);
1228         proto_tree_add_bitmask_text(tree, tvb, 8, 1, NULL, NULL, ett_ipmi_picmg_21_byte9, byte9, TRUE, 0);
1229
1230         addrtype = tvb_get_guint8(tvb, 8) & 0x7f;
1231         if (addrtype == 0x01) {
1232                 /* IP address and RMCP port are in network byte order! */
1233                 proto_tree_add_item(tree, hf_ipmi_picmg_21_ipaddr, tvb, 9, 4, FALSE);
1234                 proto_tree_add_item(tree, hf_ipmi_picmg_21_rmcpport, tvb, 13, 2, FALSE);
1235         };
1236 }
1237
1238 /* Get Shelf Power Allocation
1239  */
1240 static void
1241 rq22(tvbuff_t *tvb, proto_tree *tree)
1242 {
1243         if (!tree) {
1244                 ipmi_setsaveddata(0, tvb_get_guint8(tvb, 0));
1245                 return;
1246         }
1247         proto_tree_add_item(tree, hf_ipmi_picmg_22_feed_idx, tvb, 0, 1, TRUE);
1248 }
1249
1250 static void
1251 rs22(tvbuff_t *tvb, proto_tree *tree)
1252 {
1253         guint32 offs = 0;
1254         guint16 v;
1255         guint i, max;
1256
1257         proto_tree_add_item(tree, hf_ipmi_picmg_22_update_cnt, tvb, 0, 2, TRUE);
1258
1259         max = tvb_length(tvb) / 2 - 1;
1260         if (!max) {
1261                 /* At least one shall be present */
1262                 max = 1;
1263         }
1264         ipmi_getsaveddata(0, &offs);
1265         for (i = 0; i < max; i++) {
1266                 v = tvb_get_letohs(tvb, 2 + 2 * i);
1267                 proto_tree_add_uint_format(tree, hf_ipmi_picmg_22_pwr_alloc, tvb, 2 + 2 * i, 2,
1268                                 v, "Power Feed [%d] Allocation: %d Watts", offs + i, v);
1269         }
1270 }
1271
1272 static void
1273 add_component_bits(proto_tree *tree, tvbuff_t *tvb, guint offs, const char *desc)
1274 {
1275         static const gint *compbits[] = { &hf_ipmi_picmg_XX_comp7, &hf_ipmi_picmg_XX_comp6, &hf_ipmi_picmg_XX_comp5,
1276                 &hf_ipmi_picmg_XX_comp4, &hf_ipmi_picmg_XX_comp3, &hf_ipmi_picmg_XX_comp2, &hf_ipmi_picmg_XX_comp1, &hf_ipmi_picmg_XX_comp0, NULL };
1277
1278         proto_tree_add_bitmask_text(tree, tvb, offs, 1, desc, "None",
1279                         ett_ipmi_picmg_XX_compbits, compbits, TRUE, 0);
1280 }
1281
1282 /* Get Target Upgrade Capabilities
1283  */
1284 static void
1285 rs2e(tvbuff_t *tvb, proto_tree *tree)
1286 {
1287         static const gint *byte2[] = { &hf_ipmi_picmg_2e_upgrade_undesirable, &hf_ipmi_picmg_2e_auto_rollback_override,
1288                 &hf_ipmi_picmg_2e_ipmc_degraded, &hf_ipmi_picmg_2e_deferred_activate, &hf_ipmi_picmg_2e_services_affected,
1289                 &hf_ipmi_picmg_2e_manual_rollback, &hf_ipmi_picmg_2e_auto_rollback, &hf_ipmi_picmg_2e_self_test, NULL };
1290
1291         proto_tree_add_item(tree, hf_ipmi_picmg_2e_version, tvb, 0, 1, TRUE);
1292         proto_tree_add_bitmask_text(tree, tvb, 1, 1, "Capabilities: ", "None",
1293                         ett_ipmi_picmg_2e_byte2, byte2, TRUE, 0);
1294         proto_tree_add_item(tree, hf_ipmi_picmg_2e_upgrade_tout, tvb, 2, 1, TRUE);
1295         proto_tree_add_item(tree, hf_ipmi_picmg_2e_selftest_tout, tvb, 3, 1, TRUE);
1296         proto_tree_add_item(tree, hf_ipmi_picmg_2e_rollback_tout, tvb, 4, 1, TRUE);
1297         proto_tree_add_item(tree, hf_ipmi_picmg_2e_inaccessibility_tout, tvb, 5, 1, TRUE);
1298         add_component_bits(tree, tvb, 6, "Components present: ");
1299 }
1300
1301 static const value_string cc2e[] = {
1302         { 0x81, "Firmware Upgrade is not supported over this interface" },
1303         { 0, NULL }
1304 };
1305
1306 /* Get Component Properties
1307  */
1308 static void
1309 prop_00(tvbuff_t *tvb, proto_tree *tree)
1310 {
1311         static const gint *byte1[] = { &hf_ipmi_picmg_prop00_cold_reset, &hf_ipmi_picmg_prop00_deferred_activation,
1312                 &hf_ipmi_picmg_prop00_comparison, &hf_ipmi_picmg_prop00_preparation, &hf_ipmi_picmg_prop00_rollback, NULL };
1313
1314         proto_tree_add_bitmask_text(tree, tvb, 0, 1, "General Component Properties: ", "None",
1315                         ett_ipmi_picmg_prop00_byte1, byte1, TRUE, 0);
1316 }
1317
1318 static void
1319 parse_version(tvbuff_t *tvb, proto_tree *tree)
1320 {
1321         static const gint *byte1[] = { &hf_ipmi_picmg_prop01_fw_major, NULL };
1322
1323         proto_tree_add_bitmask_text(tree, tvb, 0, 1, NULL, NULL,
1324                         ett_ipmi_picmg_prop01_byte1, byte1, TRUE, 0);
1325         proto_tree_add_item(tree, hf_ipmi_picmg_prop01_fw_minor, tvb, 1, 1, TRUE);
1326         proto_tree_add_item(tree, hf_ipmi_picmg_prop01_fw_aux, tvb, 2, 4, TRUE);
1327 }
1328
1329 static void
1330 prop_02(tvbuff_t *tvb, proto_tree *tree)
1331 {
1332         guint len = tvb_length(tvb);
1333
1334         if (len > 12) {
1335                 len = 12;
1336         }
1337         proto_tree_add_item(tree, hf_ipmi_picmg_prop02_desc, tvb, 0, len, TRUE);
1338 }
1339
1340 static const struct {
1341         void (*intrp)(tvbuff_t *tvb, proto_tree *tree);
1342         const char *name;
1343 } compprops[] = {
1344         { prop_00, "General Component Properties" },
1345         { parse_version, "Current Version" },
1346         { prop_02, "Description String" },
1347         { parse_version, "Rollback firmware version" },
1348         { parse_version, "Deferred upgrade firmware version" }
1349 };
1350
1351 static void
1352 rq2f(tvbuff_t *tvb, proto_tree *tree)
1353 {
1354         guint8 pno = tvb_get_guint8(tvb, 1);
1355         const char *desc;
1356
1357         if (!tree) {
1358                 ipmi_setsaveddata(0, pno);
1359                 return;
1360         }
1361
1362         if (pno < array_length(compprops)) {
1363                 desc = compprops[pno].name;
1364         } else if (pno >= 0xC0) {
1365                 desc = "OEM";
1366         } else {
1367                 desc = "Reserved";
1368         }
1369
1370         proto_tree_add_item(tree, hf_ipmi_picmg_2f_comp_id, tvb, 0, 1, TRUE);
1371         proto_tree_add_uint_format_value(tree, hf_ipmi_picmg_2f_comp_prop, tvb, 1, 1, pno,
1372                         "%s (0x%02x)", desc, pno);
1373 }
1374
1375 static void
1376 rs2f(tvbuff_t *tvb, proto_tree *tree)
1377 {
1378         guint32 pno;
1379         const char *desc;
1380         proto_item *ti;
1381
1382         if (!ipmi_getsaveddata(0, &pno)) {
1383                 /* Can't parse further if property selector is not known */
1384                 proto_tree_add_item(tree, hf_ipmi_picmg_2f_prop_data, tvb, 0, tvb_length(tvb), TRUE);
1385                 return;
1386         }
1387
1388         if (pno < array_length(compprops)) {
1389                 desc = compprops[pno].name;
1390         } else if (pno >= 0xC0) {
1391                 desc = "OEM";
1392         } else {
1393                 desc = "Reserved";
1394         }
1395
1396         ti = proto_tree_add_text(tree, tvb, 0, 0, "Property selector: %s (0x%02x)", desc, pno);
1397         PROTO_ITEM_SET_GENERATED(ti);
1398         if (pno < array_length(compprops)) {
1399                 compprops[pno].intrp(tvb, tree);
1400         } else {
1401                 proto_tree_add_item(tree, hf_ipmi_picmg_2f_prop_data, tvb, 0, tvb_length(tvb), TRUE);
1402         }
1403 }
1404
1405 static const value_string cc2f[] = {
1406         { 0x81, "Firmware Upgrade is not supported over this interface" },
1407         { 0x82, "Invalid Component ID" },
1408         { 0x83, "Invalid Component property selector" },
1409         { 0, NULL }
1410 };
1411
1412 /* Abort Firmware Upgrade
1413  */
1414 static const value_string cc30[] = {
1415         { 0x80, "Firmware Upgrade cannot be aborted at this moment" },
1416         { 0x81, "Firmware Upgrade aborted, IPMC cannot resume normal operation" },
1417         { 0, NULL }
1418 };
1419
1420 /* Initiate upgrade action
1421  */
1422 static void
1423 rq31(tvbuff_t *tvb, proto_tree *tree)
1424 {
1425         add_component_bits(tree, tvb, 0, "Components: ");
1426         proto_tree_add_item(tree, hf_ipmi_picmg_31_action, tvb, 1, 1, TRUE);
1427 }
1428
1429 static const value_string cc31[] = {
1430         { 0x80, "Command in progress" },
1431         { 0x81, "Invalid component" },
1432         { 0, NULL }
1433 };
1434
1435 /* Upload Firmware Block
1436  */
1437 static void
1438 rq32(tvbuff_t *tvb, proto_tree *tree)
1439 {
1440         proto_tree_add_item(tree, hf_ipmi_picmg_32_block, tvb, 0, 1, TRUE);
1441         proto_tree_add_item(tree, hf_ipmi_picmg_32_data, tvb, 1, tvb_length(tvb) - 1, TRUE);
1442 }
1443
1444 static void
1445 rs32(tvbuff_t *tvb, proto_tree *tree)
1446 {
1447         if (tvb_length(tvb) > 0) {
1448                 proto_tree_add_item(tree, hf_ipmi_picmg_32_sec_offs, tvb, 0, 4, TRUE);
1449                 proto_tree_add_item(tree, hf_ipmi_picmg_32_sec_len, tvb, 4, 4, TRUE);
1450         }
1451 }
1452
1453 static const value_string cc32[] = {
1454         { 0x80, "Command in progress" },
1455         { 0x81, "Invalid component" },
1456         { 0x82, "Internal checksum error detected in the received blocks" },
1457         { 0, NULL }
1458 };
1459
1460 /* Finish Firmware Upgrade
1461  */
1462 static void
1463 rq33(tvbuff_t *tvb, proto_tree *tree)
1464 {
1465         proto_tree_add_item(tree, hf_ipmi_picmg_33_comp_id, tvb, 0, 1, TRUE);
1466         proto_tree_add_item(tree, hf_ipmi_picmg_33_img_len, tvb, 1, 4, TRUE);
1467 }
1468
1469 static const value_string cc33[] = {
1470         { 0x80, "Command in progress" },
1471         { 0x81, "Number of bytes received does not match size in the request" },
1472         { 0x82, "Internal checksum error detected in the received image" },
1473         { 0x83, "Uploaded firmware does not match current" },
1474         { 0, NULL }
1475 };
1476
1477 /* Get Upgrade Status
1478  */
1479 static void
1480 rs34(tvbuff_t *tvb, proto_tree *tree)
1481 {
1482         static const guint8 sig = 0;
1483         static const gint *byte3[] = { &hf_ipmi_picmg_34_percentage, NULL };
1484         guint8 v;
1485         ipmi_cmd_t *c;
1486
1487         v = tvb_get_guint8(tvb, 0);
1488         c = ipmi_getcmd(ipmi_getnetfn(IPMI_GROUP_REQ, &sig), v);
1489         proto_tree_add_uint_format_value(tree, hf_ipmi_picmg_34_cmd, tvb, 0, 1, v,
1490                         "%s (0x%02x)", c->desc, v);
1491         v = tvb_get_guint8(tvb, 1);
1492         proto_tree_add_uint_format_value(tree, hf_ipmi_picmg_34_ccode, tvb, 1, 1, v,
1493                         "%s (0x%02x)", ipmi_get_completion_code(v, c), v);
1494         if (tvb_length(tvb) > 2) {
1495                 proto_tree_add_bitmask_text(tree, tvb, 2, 1, NULL, NULL,
1496                                 ett_ipmi_picmg_34_byte3, byte3, TRUE, 0);
1497         }
1498 }
1499
1500 static const value_string cc34[] = {
1501         { 0x80, "Command in progress" },
1502         { 0, NULL }
1503 };
1504
1505 /* Activate Firmware
1506  */
1507 static void
1508 rq35(tvbuff_t *tvb, proto_tree *tree)
1509 {
1510         if (tvb_length(tvb) > 0) {
1511                 proto_tree_add_item(tree, hf_ipmi_picmg_35_rollback_override, tvb, 0, 1, TRUE);
1512         }
1513 }
1514
1515 static const value_string cc35[] = {
1516         { 0x80, "Command in progress" },
1517         { 0, NULL }
1518 };
1519
1520 /* Query Self-test Results
1521  */
1522 static void
1523 rs36(tvbuff_t *tvb, proto_tree *tree)
1524 {
1525         static const gint *byte2[] = { &hf_ipmi_picmg_36_fail_sel, &hf_ipmi_picmg_36_fail_sdr,
1526                 &hf_ipmi_picmg_36_fail_bmc_fru, &hf_ipmi_picmg_36_fail_ipmb_sig, &hf_ipmi_picmg_36_fail_sdr_empty,
1527                 &hf_ipmi_picmg_36_fail_iua, &hf_ipmi_picmg_36_fail_bb_fw, &hf_ipmi_picmg_36_fail_oper_fw, NULL };
1528         int res, fail;
1529
1530         res = tvb_get_guint8(tvb, 0);
1531         fail = tvb_get_guint8(tvb, 1);
1532
1533         proto_tree_add_uint_format(tree, hf_ipmi_picmg_36_result, tvb, 0, 1,
1534                         res, "Self test result: %s (0x%02x)",
1535                         val_to_str(res, vals_36_result, "Device-specific internal failure"),
1536                         res);
1537
1538         if (res == 0x55 || res == 0xff) {
1539                 proto_tree_add_uint_format_value(tree, hf_ipmi_picmg_36_fail, tvb, 1, 1,
1540                                 fail, "0x%02x (must be 0x00)",
1541                                 fail);
1542         } else if (res == 0x57) {
1543                 proto_tree_add_bitmask(tree, tvb, 1, hf_ipmi_picmg_36_fail, ett_ipmi_picmg_36_byte2, byte2, TRUE);
1544         } else if (res == 0x60) {
1545                 add_component_bits(tree, tvb, 1, "Failed components: ");
1546         } else {
1547                 proto_tree_add_uint_format_value(tree, hf_ipmi_picmg_36_fail, tvb, 1, 1,
1548                                 fail, "0x%02x (device-specific)", fail);
1549         }
1550 }
1551
1552 static const value_string cc36[] = {
1553         { 0x80, "Self-test in progress" },
1554         { 0x81, "Firmware upgrade not supported over this interface" },
1555         { 0, NULL }
1556 };
1557
1558 /* Query Rollback Results
1559  */
1560 static void
1561 rs37(tvbuff_t *tvb, proto_tree *tree)
1562 {
1563         static const gint *byte2[] = { &hf_ipmi_picmg_37_percent, NULL };
1564         const char *desc;
1565
1566         switch (ipmi_current_hdr->ccode) {
1567         case 0x00: desc = "Components completed rollback: "; break;
1568         case 0x80: desc = "Components (should be None): "; break;
1569         case 0x81: desc = "Components failed to rollback: "; break;
1570         default: desc = "Components (ignored): "; break;
1571         }
1572
1573         add_component_bits(tree, tvb, 0, desc);
1574         if (tvb_length(tvb) > 1) {
1575                 proto_tree_add_bitmask_text(tree, tvb, 1, 1, NULL, NULL,
1576                                 ett_ipmi_picmg_37_byte2, byte2, TRUE, 0);
1577         }
1578 }
1579
1580 static const value_string cc37[] = {
1581         { 0x80, "Rollback in progress" },
1582         { 0x81, "Rollback failure" },
1583         { 0x82, "Rollback overridden" },
1584         { 0x83, "Rollback denied for integrity reasons" },
1585         { 0, NULL }
1586 };
1587
1588 /* Initiate Manual Rollback
1589  */
1590 static const value_string cc38[] = {
1591         { 0x80, "Rollback in progress" },
1592         { 0, NULL }
1593 };
1594
1595 static ipmi_cmd_t cmd_picmg[] = {
1596   /* AdvancedTCA Commands */
1597   { 0x00, NULL, rs00, NULL, NULL, "[ATCA] Get PICMG Properties", 0 },
1598   { 0x01, rq01, rs01, NULL, NULL, "[ATCA] Get Address Info", 0 },
1599   { 0x02, NULL, rs02, NULL, NULL, "[ATCA] Get Shelf Address Info", 0 },
1600   { 0x03, rq03, NULL, NULL, NULL, "[ATCA] Set Shelf Address Info", 0 },
1601   { 0x04, rq04, NULL, NULL, NULL, "[ATCA] FRU Control", 0 },
1602   { 0x05, rq05, rs05, NULL, NULL, "[ATCA] Get FRU LED Properties", 0 },
1603   { 0x06, rq06, rs06, NULL, NULL, "[ATCA] Get LED Color Capabilities", 0 },
1604   { 0x07, rq07, NULL, NULL, NULL, "[ATCA] Set FRU LED State", 0 },
1605   { 0x08, rq08, rs08, NULL, NULL, "[ATCA] Get FRU LED State", 0 },
1606   { 0x09, rq09, NULL, NULL, NULL, "[ATCA] Set IPMB State", 0 },
1607   { 0x0a, rq0a, NULL, NULL, NULL, "[ATCA] Set FRU Activation Policy", 0 },
1608   { 0x0b, rq0b, rs0b, NULL, NULL, "[ATCA] Get FRU Activation Policy", 0 },
1609   { 0x0c, rq0c, NULL, NULL, NULL, "[ATCA] Set FRU Activation", 0 },
1610   { 0x0d, rq0d, rs0d, NULL, NULL, "[ATCA] Get Device Locator Record ID", 0 },
1611   { 0x0e, rq0e, NULL, NULL, NULL, "[ATCA] Set Port State", 0 },
1612   { 0x0f, rq0f, rs0f, NULL, NULL, "[ATCA] Get Port State", 0 },
1613   { 0x10, rq10, rs10, NULL, NULL, "[ATCA] Compute Power Properties", 0 },
1614   { 0x11, rq11, NULL, NULL, NULL, "[ATCA] Set Power Level", 0 },
1615   { 0x12, rq12, rs12, NULL, NULL, "[ATCA] Get Power Level", 0 },
1616   { 0x13, rq13, NULL, NULL, NULL, "[ATCA] Renegotiate Power", 0 },
1617   { 0x14, rq14, rs14, NULL, NULL, "[ATCA] Get Fan Speed Properties", 0 },
1618   { 0x15, rq15, NULL, NULL, NULL, "[ATCA] Set Fan Level", 0 },
1619   { 0x16, rq16, rs16, NULL, NULL, "[ATCA] Get Fan Level", 0 },
1620   { 0x17, rq17, rs17, NULL, NULL, "[ATCA] Bused Resource Control", CMD_CALLRQ },
1621   { 0x18, rq18, rs18, NULL, NULL, "[ATCA] Get IPMB Link Info", 0 },
1622   { 0x19, IPMI_TBD,   NULL, NULL, "[AMC.0] Set AMC Port State", 0 },
1623   { 0x1a, IPMI_TBD,   NULL, NULL, "[AMC.0] Get AMC Port State", 0 },
1624   { 0x1b, NULL, rs1b, NULL, NULL, "[ATCA] Get Shelf Manager IPMB Address", 0 },
1625   { 0x1c, rq1c, NULL, NULL, NULL, "[ATCA] Set Fan Policy", 0 },
1626   { 0x1d, rq1d, rs1d, NULL, NULL, "[ATCA] Get Fan Policy", 0 },
1627   { 0x1e, rq1e, rs1e, NULL, NULL, "[ATCA] FRU Control Capabilities", 0 },
1628   { 0x1f, rq1f, rs1f, cc1f, NULL, "[ATCA] FRU Inventory Device Lock Control", 0 },
1629   { 0x20, rq20, rs20, cc20, NULL, "[ATCA] FRU Inventory Device Write", 0 },
1630   { 0x21, rq21, rs21, NULL, NULL, "[ATCA] Get Shelf Manager IP Addresses", 0 },
1631   { 0x22, rq22, rs22, NULL, NULL, "[ATCA] Get Shelf Power Allocation", CMD_CALLRQ },
1632   { 0x23, IPMI_TBD,   NULL, NULL, "[uTCA] Get Location Information", 0 },
1633   { 0x24, IPMI_TBD,   NULL, NULL, "[uTCA] Power Channel Control", 0 },
1634   { 0x25, IPMI_TBD,   NULL, NULL, "[uTCA] Get Power Channel Status", 0 },
1635   { 0x26, IPMI_TBD,   NULL, NULL, "[uTCA] PM Reset", 0 },
1636   { 0x27, IPMI_TBD,   NULL, NULL, "[uTCA] Get PM Status", 0 },
1637   { 0x28, IPMI_TBD,   NULL, NULL, "[uTCA] PM Heartbeat", 0 },
1638   { 0x29, IPMI_TBD,   NULL, NULL, "[uTCA] Get Telco Alarm Capability", 0 },
1639   { 0x2a, IPMI_TBD,   NULL, NULL, "[uTCA] Set Telco Alarm State", 0 },
1640   { 0x2b, IPMI_TBD,   NULL, NULL, "[uTCA] Get Telco Alarm State", 0 },
1641   { 0x2c, IPMI_TBD,   NULL, NULL, "[AMC.0] Set Clock State", 0 },
1642   { 0x2d, IPMI_TBD,   NULL, NULL, "[AMC.0] Get Clock State", 0 },
1643   { 0x2e, NULL, rs2e, cc2e, NULL, "[HPM.1] Get Target Upgrade Capabilities", 0 },
1644   { 0x2f, rq2f, rs2f, cc2f, NULL, "[HPM.1] Get Component Properties", CMD_CALLRQ },
1645   { 0x30, NULL, NULL, cc30, NULL, "[HPM.1] Abort Firmware Upgrade", 0 },
1646   { 0x31, rq31, NULL, cc31, NULL, "[HPM.1] Initiate Upgrade Action", 0 },
1647   { 0x32, rq32, rs32, cc32, NULL, "[HPM.1] Upload Firmware Block", 0 },
1648   { 0x33, rq33, NULL, cc33, NULL, "[HPM.1] Finish Firmware Upload", 0 },
1649   { 0x34, NULL, rs34, cc34, NULL, "[HPM.1] Get Upgrade Status", 0 },
1650   { 0x35, rq35, NULL, cc35, NULL, "[HPM.1] Activate Firmware", 0 },
1651   { 0x36, NULL, rs36, cc36, NULL, "[HPM.1] Query Self-test Results", 0 },
1652   { 0x37, NULL, rs37, cc37, NULL, "[HPM.1] Query Rollback Status", 0 },
1653   { 0x38, NULL, NULL, cc38, NULL, "[HPM.1] Initiate Manual Rollback", 0 },
1654 };
1655
1656 void
1657 ipmi_register_picmg(gint proto_ipmi)
1658 {
1659         static hf_register_info hf[] = {
1660                 { &hf_ipmi_picmg_led_function,
1661                         { "LED Function",
1662                                 "ipmi.led.function", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
1663                 { &hf_ipmi_picmg_led_on_duration,
1664                         { "On-duration",
1665                                 "ipmi.led.on_duration", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
1666                 { &hf_ipmi_picmg_led_color,
1667                         { "Color",
1668                                 "ipmi.led.color", FT_UINT8, BASE_HEX, led_color_vals, 0x0f, NULL, HFILL }},
1669
1670                 { &hf_ipmi_picmg_linkinfo_grpid,
1671                         { "Grouping ID",
1672                                 "ipmi.linkinfo.grpid", FT_UINT32, BASE_DEC, NULL, 0xff000000, NULL, HFILL }},
1673                 { &hf_ipmi_picmg_linkinfo_type_ext,
1674                         { "Type extension",
1675                                 "ipmi.linkinfo.type_ext", FT_UINT32, BASE_HEX, NULL, 0x00f00000, NULL, HFILL }},
1676                 { &hf_ipmi_picmg_linkinfo_type,
1677                         { "Type",
1678                                 "ipmi.linkinfo.type", FT_UINT32, BASE_HEX, linkinfo_type_vals, 0x000ff000, NULL, HFILL }},
1679                 { &hf_ipmi_picmg_linkinfo_ports,
1680                         { "Ports",
1681                                 "ipmi.linkinfo.ports", FT_UINT32, BASE_HEX, linkinfo_ports_vals, 0x00000f00, NULL, HFILL }},
1682                 { &hf_ipmi_picmg_linkinfo_iface,
1683                         { "Interface",
1684                                 "ipmi.linkinfo.iface", FT_UINT32, BASE_HEX, linkinfo_iface_vals, 0x000000c0, NULL, HFILL }},
1685                 { &hf_ipmi_picmg_linkinfo_chan,
1686                         { "Channel",
1687                                 "ipmi.linkinfo.chan", FT_UINT32, BASE_DEC, NULL, 0x0000003f, NULL, HFILL }},
1688                 { &hf_ipmi_picmg_linkinfo_state,
1689                         { "State",
1690                                 "ipmi.picmg0e.state", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
1691
1692                 { &hf_ipmi_picmg_00_version,
1693                         { "PICMG Extension Version",
1694                                 "ipmi.picmg00.version", FT_UINT8, BASE_CUSTOM, ipmi_fmt_version, 0, NULL, HFILL }},
1695                 { &hf_ipmi_picmg_00_max_fruid,
1696                         { "Max FRU Device ID",
1697                                 "ipmi.picmg00.max_fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1698                 { &hf_ipmi_picmg_00_ipmc_fruid,
1699                         { "FRU Device ID for IPMC",
1700                                 "ipmi.picmg00.ipmc_fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1701
1702                 { &hf_ipmi_picmg_01_rq_fruid,
1703                         { "FRU ID",
1704                                 "ipmi.picmg01.rq_fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1705                 { &hf_ipmi_picmg_01_rq_addr_key_type,
1706                         { "Address Key Type",
1707                                 "ipmi.picmg01.rq_addr_key_type", FT_UINT8, BASE_HEX, addr_key_type_vals, 0, NULL, HFILL }},
1708                 { &hf_ipmi_picmg_01_rq_addr_key,
1709                         { "Address Key",
1710                                 "ipmi.picmg01.rq_addr_key", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
1711                 { &hf_ipmi_picmg_01_rq_site_type,
1712                         { "Site Type",
1713                                 "ipmi.picmg01.rq_site_type", FT_UINT8, BASE_HEX, site_type_vals, 0, NULL, HFILL }},
1714                 { &hf_ipmi_picmg_01_rs_hwaddr,
1715                         { "Hardware Address",
1716                                 "ipmi.picmg01.rs_hwaddr", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
1717                 { &hf_ipmi_picmg_01_rs_ipmbaddr,
1718                         { "IPMB-0 Address",
1719                                 "ipmi.picmg01.rs_ipmbaddr", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
1720                 { &hf_ipmi_picmg_01_rs_rsrv,
1721                         { "Reserved (shall be 0xFF)",
1722                                 "ipmi.picmg01.rs_rsrv", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
1723                 { &hf_ipmi_picmg_01_rs_fruid,
1724                         { "FRU ID",
1725                                 "ipmi.picmg01.rs_fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1726                 { &hf_ipmi_picmg_01_rs_site_num,
1727                         { "Site Number",
1728                                 "ipmi.picmg01.rs_site_num", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1729                 { &hf_ipmi_picmg_01_rs_site_type,
1730                         { "Site Type",
1731                                 "ipmi.picmg01.rs_site_type", FT_UINT8, BASE_HEX, site_type_vals, 0, NULL, HFILL }},
1732
1733                 { &hf_ipmi_picmg_04_fruid,
1734                         { "FRU ID",
1735                                 "ipmi.picmg04.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1736                 { &hf_ipmi_picmg_04_cmd,
1737                         { "Command",
1738                                 "ipmi.picmg04.cmd", FT_UINT8, BASE_HEX, vals_04_cmd, 0, NULL, HFILL }},
1739
1740                 { &hf_ipmi_picmg_05_fruid,
1741                         { "FRU ID",
1742                                 "ipmi.picmg05.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1743                 { &hf_ipmi_picmg_05_led3,
1744                         { "LED 3",
1745                                 "ipmi.picmg05.led3", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
1746                 { &hf_ipmi_picmg_05_led2,
1747                         { "LED 2",
1748                                 "ipmi.picmg05.led2", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
1749                 { &hf_ipmi_picmg_05_led1,
1750                         { "LED 1",
1751                                 "ipmi.picmg05.led1", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
1752                 { &hf_ipmi_picmg_05_blue_led,
1753                         { "BLUE LED",
1754                                 "ipmi.picmg05.blue_led", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
1755                 { &hf_ipmi_picmg_05_app_leds,
1756                         { "Application-specific LED Count",
1757                                 "ipmi.picmg05.app_leds", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1758
1759                 { &hf_ipmi_picmg_06_fruid,
1760                         { "FRU ID",
1761                                 "ipmi.picmg06.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1762                 { &hf_ipmi_picmg_06_ledid,
1763                         { "LED ID",
1764                                 "ipmi.picmg06.ledid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1765                 { &hf_ipmi_picmg_06_cap_white,
1766                         { "White",
1767                                 "ipmi.picmg06.cap_white", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
1768                 { &hf_ipmi_picmg_06_cap_orange,
1769                         { "Orange",
1770                                 "ipmi.picmg06.cap_orange", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }},
1771                 { &hf_ipmi_picmg_06_cap_amber,
1772                         { "Amber",
1773                                 "ipmi.picmg06.cap_amber", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
1774                 { &hf_ipmi_picmg_06_cap_green,
1775                         { "Green",
1776                                 "ipmi.picmg06.cap_green", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
1777                 { &hf_ipmi_picmg_06_cap_red,
1778                         { "Red",
1779                                 "ipmi.picmg06.cap_red", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
1780                 { &hf_ipmi_picmg_06_cap_blue,
1781                         { "Blue",
1782                                 "ipmi.picmg06.cap_blue", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
1783                 { &hf_ipmi_picmg_06_default_local_color,
1784                         { "Default LED Color in Local Control state",
1785                                 "ipmi.picmg06.def_local", FT_UINT8, BASE_HEX, led_color_vals, 0x0f, NULL, HFILL }},
1786                 { &hf_ipmi_picmg_06_default_override_color,
1787                         { "Default LED Color in Override state",
1788                                 "ipmi.picmg06.def_override", FT_UINT8, BASE_HEX, led_color_vals, 0x0f, NULL, HFILL }},
1789
1790                 { &hf_ipmi_picmg_07_fruid,
1791                         { "FRU ID",
1792                                 "ipmi.picmg07.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1793                 { &hf_ipmi_picmg_07_ledid,
1794                         { "LED ID",
1795                                 "ipmi.picmg07.ledid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1796
1797                 { &hf_ipmi_picmg_08_fruid,
1798                         { "FRU ID",
1799                                 "ipmi.picmg08.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1800                 { &hf_ipmi_picmg_08_ledid,
1801                         { "LED ID",
1802                                 "ipmi.picmg08.ledid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1803                 { &hf_ipmi_picmg_08_state_lamptest,
1804                         { "Lamp Test",
1805                                 "ipmi.picmg08.state_lamptest", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
1806                 { &hf_ipmi_picmg_08_state_override,
1807                         { "Override",
1808                                 "ipmi.picmg08.state_override", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
1809                 { &hf_ipmi_picmg_08_state_local,
1810                         { "Local Control",
1811                                 "ipmi.picmg08.state_local", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
1812                 { &hf_ipmi_picmg_08_lamptest_duration,
1813                         { "Lamp test duration",
1814                                 "ipmi.picmg08.lamptest_duration", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1815
1816                 { &hf_ipmi_picmg_09_ipmba,
1817                         { "IPMB-A State",
1818                                 "ipmi.picmg09.ipmba", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
1819                 { &hf_ipmi_picmg_09_ipmbb,
1820                         { "IPMB-B State",
1821                                 "ipmi.picmg09.ipmbb", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
1822
1823                 { &hf_ipmi_picmg_0a_fruid,
1824                         { "FRU ID",
1825                                 "ipmi.picmg0a.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1826                 { &hf_ipmi_picmg_0a_msk_d_locked,
1827                         { "Deactivation-Locked bit",
1828                                 "ipmi.picmg0a.msk_deactivation", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
1829                 { &hf_ipmi_picmg_0a_msk_locked,
1830                         { "Locked bit",
1831                                 "ipmi.picmg0a.msk_locked", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
1832                 { &hf_ipmi_picmg_0a_d_locked,
1833                         { "Deactivation-Locked bit",
1834                                 "ipmi.picmg0a.deactivation", FT_BOOLEAN, 8, TFS(&set_clear_tfs), 0x02, NULL, HFILL }},
1835                 { &hf_ipmi_picmg_0a_locked,
1836                         { "Locked bit",
1837                                 "ipmi.picmg0a.locked", FT_BOOLEAN, 8, TFS(&set_clear_tfs), 0x01, NULL, HFILL }},
1838
1839                 { &hf_ipmi_picmg_0b_fruid,
1840                         { "FRU ID",
1841                                 "ipmi.picmg0b.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1842                 { &hf_ipmi_picmg_0b_d_locked,
1843                         { "Deactivation-Locked bit",
1844                                 "ipmi.picmg0b.deactivation", FT_BOOLEAN, 8, TFS(&set_clear_tfs), 0x02, NULL, HFILL }},
1845                 { &hf_ipmi_picmg_0b_locked,
1846                         { "Locked bit",
1847                                 "ipmi.picmg0b.locked", FT_BOOLEAN, 8, TFS(&set_clear_tfs), 0x01, NULL, HFILL }},
1848
1849                 { &hf_ipmi_picmg_0c_fruid,
1850                         { "FRU ID",
1851                                 "ipmi.picmg0c.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1852                 { &hf_ipmi_picmg_0c_cmd,
1853                         { "Command",
1854                                 "ipmi.picmg0c.cmd", FT_UINT8, BASE_HEX, vals_0c_cmd, 0, NULL, HFILL }},
1855
1856                 { &hf_ipmi_picmg_0d_fruid,
1857                         { "FRU ID",
1858                                 "ipmi.picmg0d.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1859                 { &hf_ipmi_picmg_0d_start,
1860                         { "Search after record ID",
1861                                 "ipmi.picmg0d.start", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
1862                 { &hf_ipmi_picmg_0d_recordid,
1863                         { "Record ID",
1864                                 "ipmi.picmg0d.recordid", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
1865
1866                 { &hf_ipmi_picmg_0f_iface,
1867                         { "Interface",
1868                                 "ipmi.linkinfo.iface", FT_UINT8, BASE_HEX, linkinfo_iface_vals, 0x000000c0, NULL, HFILL }},
1869                 { &hf_ipmi_picmg_0f_chan,
1870                         { "Channel",
1871                                 "ipmi.linkinfo.chan", FT_UINT8, BASE_DEC, NULL, 0x0000003f, NULL, HFILL }},
1872
1873                 { &hf_ipmi_picmg_10_fruid,
1874                         { "FRU ID",
1875                                 "ipmi.picmg10.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1876                 { &hf_ipmi_picmg_10_nslots,
1877                         { "Number of spanned slots",
1878                                 "ipmi.picmg10.nslots", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1879                 { &hf_ipmi_picmg_10_ipmc_loc,
1880                         { "IPMC Location",
1881                                 "ipmi.picmg10.ipmc_loc", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1882
1883                 { &hf_ipmi_picmg_11_fruid,
1884                         { "FRU ID",
1885                                 "ipmi.picmg11.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1886                 { &hf_ipmi_picmg_11_power_level,
1887                         { "Power Level",
1888                                 "ipmi.picmg11.power_level", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1889                 { &hf_ipmi_picmg_11_set_to_desired,
1890                         { "Set Present Levels to Desired",
1891                                 "ipmi.picmg11.set_to_desired", FT_UINT8, BASE_HEX, vals_11_set, 0, NULL, HFILL }},
1892
1893                 { &hf_ipmi_picmg_12_fruid,
1894                         { "FRU ID",
1895                                 "ipmi.picmg12.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1896                 { &hf_ipmi_picmg_12_pwr_type,
1897                         { "Power Type",
1898                                 "ipmi.picmg12.pwr_type", FT_UINT8, BASE_HEX, vals_12_pwr_type, 0, NULL, HFILL }},
1899                 { &hf_ipmi_picmg_12_dynamic,
1900                         { "Dynamic Power Configuration",
1901                                 "ipmi.picmg12.dynamic", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
1902                 { &hf_ipmi_picmg_12_pwr_lvl,
1903                         { "Power Level",
1904                                 "ipmi.picmg12.pwd_lvl", FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL }},
1905                 { &hf_ipmi_picmg_12_delay,
1906                         { "Delay to stable power",
1907                                 "ipmi.picmg12.delay", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1908                 { &hf_ipmi_picmg_12_pwr_mult,
1909                         { "Power multiplier",
1910                                 "ipmi.picmg12.pwr_mult", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1911                 { &hf_ipmi_picmg_12_pwr_draw,
1912                         { "Power draw",
1913                                 "ipmi.picmg12.pwr_draw", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1914
1915                 { &hf_ipmi_picmg_13_fruid,
1916                         { "FRU ID",
1917                                 "ipmi.picmg13.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1918
1919                 { &hf_ipmi_picmg_14_fruid,
1920                         { "FRU ID",
1921                                 "ipmi.picmg14.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1922                 { &hf_ipmi_picmg_14_speed_min,
1923                         { "Minimum Speed Level",
1924                                 "ipmi.picmg14.speed_min", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1925                 { &hf_ipmi_picmg_14_speed_max,
1926                         { "Maximum Speed Level",
1927                                 "ipmi.picmg14.speed_max", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1928                 { &hf_ipmi_picmg_14_speed_norm,
1929                         { "Normal Operating Level",
1930                                 "ipmi.picmg14.speed_norm", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1931                 { &hf_ipmi_picmg_14_local_control,
1932                         { "Local Control Mode Supported",
1933                                 "ipmi.picmg14.local_control", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
1934
1935                 { &hf_ipmi_picmg_15_fruid,
1936                         { "FRU ID",
1937                                 "ipmi.picmg15.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1938                 { &hf_ipmi_picmg_15_fan_level,
1939                         { "Fan Level",
1940                                 "ipmi.picmg15.fan_level", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1941                 { &hf_ipmi_picmg_15_local_enable,
1942                         { "Local Control Enable State",
1943                                 "ipmi.picmg15.local_enable", FT_UINT8, BASE_HEX, enable_vals, 0, NULL, HFILL }},
1944
1945                 { &hf_ipmi_picmg_16_fruid,
1946                         { "FRU ID",
1947                                 "ipmi.picmg16.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1948                 { &hf_ipmi_picmg_16_override_level,
1949                         { "Override Fan Level",
1950                                 "ipmi.picmg16.override_level", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1951                 { &hf_ipmi_picmg_16_local_level,
1952                         { "Local Control Fan Level",
1953                                 "ipmi.picmg16.local_level", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1954                 { &hf_ipmi_picmg_16_local_enable,
1955                         { "Local Control Enable State",
1956                                 "ipmi.picmg16.local_enable", FT_UINT8, BASE_HEX, enabled_vals, 0, NULL, HFILL }},
1957
1958                 { &hf_ipmi_picmg_17_cmd,
1959                         { "Command",
1960                                 "ipmi.picmg17.cmd", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
1961                 { &hf_ipmi_picmg_17_resid,
1962                         { "Bused Resource ID",
1963                                 "ipmi.picmg17.resid", FT_UINT8, BASE_HEX, busresid_vals, 0, NULL, HFILL }},
1964                 { &hf_ipmi_picmg_17_status,
1965                         { "Status",
1966                                 "ipmi.picmg17.status", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
1967
1968                 { &hf_ipmi_picmg_18_li_key_type,
1969                         { "Link Info Key Type",
1970                                 "ipmi.picmg18.li_key_type", FT_UINT8, BASE_HEX, vals_18_keytype, 0, NULL, HFILL }},
1971                 { &hf_ipmi_picmg_18_li_key,
1972                         { "Link Info Key",
1973                                 "ipmi.picmg18.li_key", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1974                 { &hf_ipmi_picmg_18_link_num,
1975                         { "Link Number",
1976                                 "ipmi.picmg18.link_num", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1977                 { &hf_ipmi_picmg_18_sensor_num,
1978                         { "Sensor Number",
1979                                 "ipmi.picmg18.sensor_num", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1980
1981                 { &hf_ipmi_picmg_1b_addr_active,
1982                         { "Active Shelf Manager IPMB Address",
1983                                 "ipmi.picmg1b.addr_active", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
1984                 { &hf_ipmi_picmg_1b_addr_backup,
1985                         { "Backup Shelf Manager IPMB Address",
1986                                 "ipmi.picmg1b.addr_backup", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
1987
1988                 { &hf_ipmi_picmg_1c_fan_site_number,
1989                         { "Fan Tray Site Number",
1990                                 "ipmi.picmg1c.fan_site_number", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
1991                 { &hf_ipmi_picmg_1c_fan_enable_state,
1992                         { "Fan Enable state",
1993                                 "ipmi.picmg1c.fan_enable_state", FT_UINT8, BASE_HEX, enable_vals, 0, NULL, HFILL }},
1994                 { &hf_ipmi_picmg_1c_fan_policy_timeout,
1995                         { "Fan Policy Timeout",
1996                                 "ipmi.picmg1c.fan_policy_timeout", FT_UINT8, BASE_CUSTOM, ipmi_fmt_5s_1based, 0, NULL, HFILL }},
1997                 { &hf_ipmi_picmg_1c_site_number,
1998                         { "Site Number",
1999                                 "ipmi.picmg1c.site_number", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2000                 { &hf_ipmi_picmg_1c_site_type,
2001                         { "Site Type",
2002                                 "ipmi.picmg1c.site_type", FT_UINT8, BASE_HEX, site_type_vals, 0, NULL, HFILL }},
2003
2004                 { &hf_ipmi_picmg_1d_fan_site_number,
2005                         { "Fan Tray Site Number",
2006                                 "ipmi.picmg1d.fan_site_number", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2007                 { &hf_ipmi_picmg_1d_site_number,
2008                         { "Site Number",
2009                                 "ipmi.picmg1d.site_number", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2010                 { &hf_ipmi_picmg_1d_site_type,
2011                         { "Site Type",
2012                                 "ipmi.picmg1d.site_type", FT_UINT8, BASE_HEX, site_type_vals, 0, NULL, HFILL }},
2013                 { &hf_ipmi_picmg_1d_policy,
2014                         { "Policy",
2015                                 "ipmi.picmg1d.fan_enable_state", FT_UINT8, BASE_HEX, vals_1d_policy, 0, NULL, HFILL }},
2016                 { &hf_ipmi_picmg_1d_coverage,
2017                         { "Coverage",
2018                                 "ipmi.picmg1d.coverage", FT_UINT8, BASE_HEX, vals_1d_coverage, 0, NULL, HFILL }},
2019
2020                 { &hf_ipmi_picmg_1e_fruid,
2021                         { "FRU ID",
2022                                 "ipmi.picmg1e.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2023                 { &hf_ipmi_picmg_1e_cap_diagintr,
2024                         { "Diagnostic interrupt",
2025                                 "ipmi.picmg1e.cap_diagintr", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
2026                 { &hf_ipmi_picmg_1e_cap_graceful_reboot,
2027                         { "Graceful reboot",
2028                                 "ipmi.picmg1e.cap_reboot", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
2029                 { &hf_ipmi_picmg_1e_cap_warm_reset,
2030                         { "Warm Reset",
2031                                 "ipmi.picmg1e.cap_warmreset", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
2032
2033                 { &hf_ipmi_picmg_1f_rq_fruid,
2034                         { "FRU ID",
2035                                 "ipmi.picmg1f.rq_fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2036                 { &hf_ipmi_picmg_1f_rq_op,
2037                         { "Operation",
2038                                 "ipmi.picmg1f.rq_op", FT_UINT8, BASE_HEX, vals_1f_op, 0, NULL, HFILL }},
2039                 { &hf_ipmi_picmg_1f_rq_lockid,
2040                         { "Lock ID",
2041                                 "ipmi.picmg1f.rq_lockid", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
2042                 { &hf_ipmi_picmg_1f_rs_lockid,
2043                         { "Lock ID",
2044                                 "ipmi.picmg1f.rs_lockid", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
2045                 { &hf_ipmi_picmg_1f_rs_tstamp,
2046                         { "Last Commit Timestamp",
2047                                 "ipmi.picmg1f.rs_tstamp", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
2048
2049                 { &hf_ipmi_picmg_20_fruid,
2050                         { "FRU ID",
2051                                 "ipmi.picmg20.fruid", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2052                 { &hf_ipmi_picmg_20_lockid,
2053                         { "Lock ID",
2054                                 "ipmi.picmg20.lockid", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }},
2055                 { &hf_ipmi_picmg_20_offset,
2056                         { "Offset to write",
2057                                 "ipmi.picmg20.offset", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2058                 { &hf_ipmi_picmg_20_data,
2059                         { "Data to write",
2060                                 "ipmi.picmg20.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
2061                 { &hf_ipmi_picmg_20_count,
2062                         { "Count written",
2063                                 "ipmi.picmg20.count", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
2064
2065                 { &hf_ipmi_picmg_21_addr_num,
2066                         { "Address Number",
2067                                 "ipmi.picmg21.addr_num", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2068                 { &hf_ipmi_picmg_21_tstamp,
2069                         { "Shelf IP Address Last Change Timestamp",
2070                                 "ipmi.picmg21.tstamp", FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
2071                 { &hf_ipmi_picmg_21_addr_count,
2072                         { "Address Count",
2073                                 "ipmi.picmg21.addr_count", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2074                 { &hf_ipmi_picmg_21_site_type,
2075                         { "Site Type",
2076                                 "ipmi.picmg21.site_type", FT_UINT8, BASE_HEX, site_type_vals, 0, NULL, HFILL }},
2077                 { &hf_ipmi_picmg_21_site_num,
2078                         { "Site Number",
2079                                 "ipmi.picmg21.site_num", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2080                 { &hf_ipmi_picmg_21_max_unavail,
2081                         { "Maximum Unavailable Time",
2082                                 "ipmi.picmg21.max_unavail", FT_UINT8, BASE_CUSTOM, ipmi_fmt_1s_1based, 0, NULL, HFILL }},
2083                 { &hf_ipmi_picmg_21_is_shm,
2084                         { "Shelf Manager IP Address",
2085                                 "ipmi.picmg21.is_shm", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
2086                 { &hf_ipmi_picmg_21_addr_type,
2087                         { "Address Type",
2088                                 "ipmi.picmg21.addr_type", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL }},
2089                 { &hf_ipmi_picmg_21_ipaddr,
2090                         { "IP Address",
2091                                 "ipmi.picmg21.ip_addr", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL }},
2092                 { &hf_ipmi_picmg_21_rmcpport,
2093                         { "RMCP Port",
2094                                 "ipmi.picmg21.rmcp_port", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2095
2096                 { &hf_ipmi_picmg_22_feed_idx,
2097                         { "Power Feed Index",
2098                                 "ipmi.picmg22.feed_idx", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }},
2099                 { &hf_ipmi_picmg_22_update_cnt,
2100                         { "Update Counter",
2101                                 "ipmi.picmg22.update_cnt", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2102                 { &hf_ipmi_picmg_22_pwr_alloc,
2103                         { "Power Feed Allocation",
2104                                 "ipmi.picmg22.pwr_alloc", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }},
2105
2106                 { &hf_ipmi_picmg_XX_comp7,
2107                         { "Component 7",
2108                                 "ipmi.hpm1.comp7", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
2109                 { &hf_ipmi_picmg_XX_comp6,
2110                         { "Component 6",
2111                                 "ipmi.hpm1.comp6", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
2112                 { &hf_ipmi_picmg_XX_comp5,
2113                         { "Component 5",
2114                                 "ipmi.hpm1.comp5", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }},
2115                 { &hf_ipmi_picmg_XX_comp4,
2116                         { "Component 4",
2117                                 "ipmi.hpm1.comp4", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
2118                 { &hf_ipmi_picmg_XX_comp3,
2119                         { "Component 3",
2120                                 "ipmi.hpm1.comp3", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
2121                 { &hf_ipmi_picmg_XX_comp2,
2122                         { "Component 2",
2123                                 "ipmi.hpm1.comp2", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
2124                 { &hf_ipmi_picmg_XX_comp1,
2125                         { "Component 1",
2126                                 "ipmi.hpm1.comp1", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
2127                 { &hf_ipmi_picmg_XX_comp0,
2128                         { "Component 0",
2129                                 "ipmi.hpm1.comp0", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
2130
2131                 { &hf_ipmi_picmg_2e_version,
2132                         { "HPM.1 version",
2133                                 "ipmi.picmg2e.hpm1_version", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
2134                 { &hf_ipmi_picmg_2e_upgrade_undesirable,
2135                         { "Firmware Upgrade Undesirable",
2136                                 "ipmi.picmg2e.upgrade_undesirable", FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
2137                 { &hf_ipmi_picmg_2e_auto_rollback_override,
2138                         { "Automatic Rollback Overridden",
2139                                 "ipmi.picmg2e.auto_rollback_override", FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
2140                 { &hf_ipmi_picmg_2e_ipmc_degraded,
2141                         { "IPMC degraded during upgrade",
2142                                 "ipmi.picmg2e.ipmc_degraded", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }},
2143                 { &hf_ipmi_picmg_2e_deferred_activate,
2144                         { "Deferred Activation supported",
2145                                 "ipmi.picmg2e.deferred_activate", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
2146                 { &hf_ipmi_picmg_2e_services_affected,
2147                         { "Services affected by upgrade",
2148                                 "ipmi.picmg2e.services_affected", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
2149                 { &hf_ipmi_picmg_2e_manual_rollback,
2150                         { "Manual Rollback supported",
2151                                 "ipmi.picmg2e.manual_rollback", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
2152                 { &hf_ipmi_picmg_2e_auto_rollback,
2153                         { "Automatic Rollback supported",
2154                                 "ipmi.picmg2e.auto_rollback", FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL }},
2155                 { &hf_ipmi_picmg_2e_self_test,
2156                         { "Self-Test supported",
2157                                 "ipmi.picmg2e.self_test", FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
2158                 { &hf_ipmi_picmg_2e_upgrade_tout,
2159                         { "Upgrade timeout",
2160                                 "ipmi.picmg2e.upgrade_tout", FT_UINT8, BASE_CUSTOM, ipmi_fmt_5s_1based, 0, NULL, HFILL }},
2161                 { &hf_ipmi_picmg_2e_selftest_tout,
2162                         { "Self-test timeout",
2163                                 "ipmi.picmg2e.selftest_tout", FT_UINT8, BASE_CUSTOM, ipmi_fmt_5s_1based, 0, NULL, HFILL }},
2164                 { &hf_ipmi_picmg_2e_rollback_tout,
2165                         { "Rollback timeout",
2166                                 "ipmi.picmg2e.rollback_tout", FT_UINT8, BASE_CUSTOM, ipmi_fmt_5s_1based, 0, NULL, HFILL }},
2167                 { &hf_ipmi_picmg_2e_inaccessibility_tout,
2168                         { "Inaccessibility timeout",
2169                                 "ipmi.picmg2e.inaccessibility_tout", FT_UINT8, BASE_CUSTOM, ipmi_fmt_5s_1based, 0, NULL, HFILL }},
2170
2171                 { &hf_ipmi_picmg_prop00_cold_reset,
2172                         { "Payload cold reset required",
2173                                 "ipmi.prop00.cold_reset", FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }},
2174                 { &hf_ipmi_picmg_prop00_deferred_activation,
2175                         { "Deferred firmware activation supported",
2176                                 "ipmi.prop00.deferred_activation", FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
2177                 { &hf_ipmi_picmg_prop00_comparison,
2178                         { "Firmware comparison supported",
2179                                 "ipmi.prop00.firmware_comparison", FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
2180                 { &hf_ipmi_picmg_prop00_preparation,
2181                         { "Prepare Components action required",
2182                                 "ipmi.prop00.preparation", FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
2183                 { &hf_ipmi_picmg_prop00_rollback,
2184                         { "Rollback/Backup support",
2185                                 "ipmi.prop00.rollback", FT_UINT8, BASE_HEX, vals_prop00_rollback, 0x03, NULL, HFILL }},
2186                 { &hf_ipmi_picmg_prop01_fw_major,
2187                         { "Major Firmware Revision (binary encoded)",
2188                                 "ipmi.prop01.fw_major", FT_UINT8, BASE_HEX, NULL, 0x7f, NULL, HFILL }},
2189                 { &hf_ipmi_picmg_prop01_fw_minor,
2190                         { "Minor Firmware Revision (BCD encoded)",
2191                                 "ipmi.prop01.fw_minor", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
2192                 { &hf_ipmi_picmg_prop01_fw_aux,
2193                         { "Auxiliary Firmware Revision Information",
2194                                 "ipmi.prop01.fw_aux", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
2195                 { &hf_ipmi_picmg_prop02_desc,
2196                         { "Description string",
2197                                 "ipmi.prop02.desc", FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
2198
2199                 { &hf_ipmi_picmg_2f_comp_id,
2200                         { "Component ID",
2201                                 "ipmi.picmg2f.comp_id", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
2202                 { &hf_ipmi_picmg_2f_comp_prop,
2203                         { "Component property selector",
2204                                 "ipmi.picmg2f.comp_prop", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
2205                 { &hf_ipmi_picmg_2f_prop_data,
2206                         { "Unknown property data",
2207                                 "ipmi.picmg2f.prop_data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
2208
2209                 { &hf_ipmi_picmg_31_action,
2210                         { "Upgrade action",
2211                                 "ipmi.picmg31.action", FT_UINT8, BASE_HEX, vals_31_action, 0, NULL, HFILL }},
2212
2213                 { &hf_ipmi_picmg_32_block,
2214                         { "Block Number",
2215                                 "ipmi.picmg32.block", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
2216                 { &hf_ipmi_picmg_32_data,
2217                         { "Data",
2218                                 "ipmi.picmg32.data", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
2219                 { &hf_ipmi_picmg_32_sec_offs,
2220                         { "Section Offset",
2221                                 "ipmi.picmg32.sec_offs", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
2222                 { &hf_ipmi_picmg_32_sec_len,
2223                         { "Section Length",
2224                                 "ipmi.picmg32.sec_len", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
2225
2226                 { &hf_ipmi_picmg_33_comp_id,
2227                         { "Component ID",
2228                                 "ipmi.picmg33.comp_id", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
2229                 { &hf_ipmi_picmg_33_img_len,
2230                         { "Image Length",
2231                                 "ipmi.picmg33.img_len", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }},
2232
2233                 { &hf_ipmi_picmg_34_cmd,
2234                         { "Command in progress",
2235                                 "ipmi.picmg34.cmd", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
2236                 { &hf_ipmi_picmg_34_ccode,
2237                         { "Last command completion code",
2238                                 "ipmi.picmg34.ccode", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
2239                 { &hf_ipmi_picmg_34_percentage,
2240                         { "Completion estimate",
2241                                 "ipmi.picmg34.percent", FT_UINT8, BASE_CUSTOM, ipmi_fmt_percent, 0x7f, NULL, HFILL }},
2242
2243                 { &hf_ipmi_picmg_35_rollback_override,
2244                         { "Rollback Override Policy",
2245                                 "ipmi.picmg35.rollback_override", FT_UINT8, BASE_HEX, vals_35_override, 0, NULL, HFILL }},
2246
2247                 { &hf_ipmi_picmg_36_result,
2248                         { "Self test result",
2249                                 "ipmi.picmg36.self_test_result", FT_UINT8, BASE_HEX, vals_36_result, 0, NULL, HFILL }},
2250                 { &hf_ipmi_picmg_36_fail,
2251                         { "Self-test error bitfield",
2252                                 "ipmi.picmg36.fail", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
2253                 { &hf_ipmi_picmg_36_fail_sel,
2254                         { "Cannot access SEL device",
2255                                 "ipmi.picmg36.fail.sel", FT_BOOLEAN, 8, TFS(&tfs_36_fail_unknown), 0x80, NULL, HFILL }},
2256                 { &hf_ipmi_picmg_36_fail_sdr,
2257                         { "Cannot access SDR Repository",
2258                                 "ipmi.picmg36.fail.sdr", FT_BOOLEAN, 8, TFS(&tfs_36_fail_unknown), 0x40, NULL, HFILL }},
2259                 { &hf_ipmi_picmg_36_fail_bmc_fru,
2260                         { "Cannot access BMC FRU device",
2261                                 "ipmi.picmg36.fail.bmc_fru", FT_BOOLEAN, 8, TFS(&tfs_36_fail_unknown), 0x20, NULL, HFILL }},
2262                 { &hf_ipmi_picmg_36_fail_ipmb_sig,
2263                         { "IPMB signal lines do not respond",
2264                                 "ipmi.picmg36.fail.ipmb_sig", FT_BOOLEAN, 8, TFS(&tfs_36_fail_unknown), 0x10, NULL, HFILL }},
2265                 { &hf_ipmi_picmg_36_fail_sdr_empty,
2266                         { "SDR Repository is empty",
2267                                 "ipmi.picmg36.fail.sdr_empty", FT_BOOLEAN, 8, TFS(&tfs_36_fail_unknown), 0x08, NULL, HFILL }},
2268                 { &hf_ipmi_picmg_36_fail_iua,
2269                         { "Internal Use Area of BMC FRU corrupted",
2270                                 "ipmi.picmg36.fail.iua", FT_BOOLEAN, 8, TFS(&tfs_36_fail_unknown), 0x04, NULL, HFILL }},
2271                 { &hf_ipmi_picmg_36_fail_bb_fw,
2272                         { "Controller update boot block firmware corrupted",
2273                                 "ipmi.picmg36.fail.bb_fw", FT_BOOLEAN, 8, TFS(&tfs_36_fail_unknown), 0x02, NULL, HFILL }},
2274                 { &hf_ipmi_picmg_36_fail_oper_fw,
2275                         { "Controller operational firmware corrupted",
2276                                 "ipmi.picmg36.fail.oper_fw", FT_BOOLEAN, 8, TFS(&tfs_36_fail_unknown), 0x01, NULL, HFILL }},
2277
2278                 { &hf_ipmi_picmg_37_percent,
2279                         { "Estimated percentage complete",
2280                                 "ipmi.picmg37.percent", FT_UINT8, BASE_CUSTOM, ipmi_fmt_percent, 0x7f, NULL, HFILL }},
2281
2282         };
2283         static gint *ett[] = {
2284                 &ett_ipmi_picmg_led_color,
2285                 &ett_ipmi_picmg_link_info,
2286                 &ett_ipmi_picmg_05_byte1,
2287                 &ett_ipmi_picmg_06_byte1,
2288                 &ett_ipmi_picmg_06_byte2,
2289                 &ett_ipmi_picmg_06_byte3,
2290                 &ett_ipmi_picmg_08_byte1,
2291                 &ett_ipmi_picmg_09_ipmba,
2292                 &ett_ipmi_picmg_09_ipmbb,
2293                 &ett_ipmi_picmg_0a_byte2,
2294                 &ett_ipmi_picmg_0a_byte3,
2295                 &ett_ipmi_picmg_0b_byte1,
2296                 &ett_ipmi_picmg_0f_chan,
2297                 &ett_ipmi_picmg_12_byte1,
2298                 &ett_ipmi_picmg_14_prop,
2299                 &ett_ipmi_picmg_1e_byte1,
2300                 &ett_ipmi_picmg_21_byte9,
2301                 &ett_ipmi_picmg_XX_compbits,
2302                 &ett_ipmi_picmg_2e_byte2,
2303                 &ett_ipmi_picmg_prop00_byte1,
2304                 &ett_ipmi_picmg_prop01_byte1,
2305                 &ett_ipmi_picmg_34_byte3,
2306                 &ett_ipmi_picmg_36_byte2,
2307                 &ett_ipmi_picmg_37_byte2,
2308         };
2309         static guint8 sig_picmg[1] = { 0 };
2310
2311         proto_register_field_array(proto_ipmi, hf, array_length(hf));
2312         proto_register_subtree_array(ett, array_length(ett));
2313         ipmi_register_netfn_cmdtab(IPMI_GROUP_REQ, IPMI_OEM_NONE, sig_picmg, 1,
2314                         "PICMG", cmd_picmg, array_length(cmd_picmg));
2315 }