1 /*
2  * Copyright (C) 2003-2015 FreeIPMI Core Team
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  *
17  */
18 
19 #ifndef IPMI_CHASSIS_CMDS_H
20 #define IPMI_CHASSIS_CMDS_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #include <stdint.h>
27 #include <freeipmi/fiid/fiid.h>
28 
29 #define IPMI_POWER_RESTORE_POLICY_POWERED_OFF_AFTER_AC_RETURNS              0x00
30 #define IPMI_POWER_RESTORE_POLICY_POWER_RESTORED_TO_STATE                   0x01
31 #define IPMI_POWER_RESTORE_POLICY_POWERS_UP_AFTER_AC_RETURNS                0x02
32 #define IPMI_POWER_RESTORE_POLICY_UNKNOWN                                   0x03
33 
34 #define IPMI_SYSTEM_POWER_IS_ON  1
35 #define IPMI_SYSTEM_POWER_IS_OFF 0
36 
37 #define IPMI_LAST_POWER_EVENT_AC_FAILED                                     0x00
38 #define IPMI_LAST_POWER_EVENT_POWER_DOWN_POWER_OVERLOAD                     0x01
39 #define IPMI_LAST_POWER_EVENT_POWER_DOWN_INTERLOCK_ACTIVATED                0x02
40 #define IPMI_LAST_POWER_EVENT_POWER_DOWN_POWER_FAULT                        0x03
41 #define IPMI_LAST_POWER_EVENT_POWER_ON_VIA_IPMI                             0x04
42 #define IPMI_LAST_POWER_EVENT_UNKNOWN                                       0x05
43 
44 #define IPMI_CHASSIS_CONTROL_POWER_DOWN                                     0x00
45 #define IPMI_CHASSIS_CONTROL_POWER_UP                                       0x01
46 #define IPMI_CHASSIS_CONTROL_POWER_CYCLE                                    0x02
47 #define IPMI_CHASSIS_CONTROL_HARD_RESET                                     0x03
48 #define IPMI_CHASSIS_CONTROL_PULSE_DIAGNOSTIC_INTERRUPT                     0x04
49 #define IPMI_CHASSIS_CONTROL_INITIATE_SOFT_SHUTDOWN                         0x05
50 
51 #define IPMI_CHASSIS_CONTROL_VALID(__chassis_control)                         \
52   (((__chassis_control) == IPMI_CHASSIS_CONTROL_POWER_DOWN                    \
53     || (__chassis_control) == IPMI_CHASSIS_CONTROL_POWER_UP                   \
54     || (__chassis_control) == IPMI_CHASSIS_CONTROL_POWER_CYCLE                \
55     || (__chassis_control) == IPMI_CHASSIS_CONTROL_HARD_RESET                 \
56     || (__chassis_control) == IPMI_CHASSIS_CONTROL_PULSE_DIAGNOSTIC_INTERRUPT \
57     || (__chassis_control) == IPMI_CHASSIS_CONTROL_INITIATE_SOFT_SHUTDOWN) ? 1 : 0)
58 
59 #define IPMI_CHASSIS_FORCE_IDENTIFY_OFF                                     0x00
60 #define IPMI_CHASSIS_FORCE_IDENTIFY_ON                                      0x01
61 
62 #define IPMI_CHASSIS_FORCE_IDENTIFY_VALID(__force_identify) \
63   (((__force_identify) == IPMI_CHASSIS_FORCE_IDENTIFY_OFF   \
64     || (__force_identify) == IPMI_CHASSIS_FORCE_IDENTIFY_ON) ? 1 : 0)
65 
66 #define IPMI_CHASSIS_IDENTIFY_STATE_OFF                                     0x00
67 #define IPMI_CHASSIS_IDENTIFY_STATE_TEMPORARY_ON                            0x01
68 #define IPMI_CHASSIS_IDENTIFY_STATE_INDEFINITE_ON                           0x02
69 
70 /* min is degenerate "off" case */
71 #define IPMI_CHASSIS_IDENTIFY_INTERVAL_MIN                                  0x00
72 #define IPMI_CHASSIS_IDENTIFY_INTERVAL_MAX                                  0xFF
73 
74 /* min is degenerate "no delay" case */
75 #define IPMI_CHASSIS_POWER_CYCLE_INTERVAL_MIN                                  0x00
76 #define IPMI_CHASSIS_POWER_CYCLE_INTERVAL_MAX                                  0xFF
77 
78 /* achu: it's backwards on buttons, I don't know why */
79 #define IPMI_CHASSIS_BUTTON_ENABLE                                          0x00
80 #define IPMI_CHASSIS_BUTTON_DISABLE                                         0x01
81 
82 #define IPMI_CHASSIS_BUTTON_VALID(__button)  \
83   (((__button) == IPMI_CHASSIS_BUTTON_ENABLE \
84     || (__button) == IPMI_CHASSIS_BUTTON_DISABLE) ? 1 : 0)
85 
86 #define IPMI_CHASSIS_BUTTON_DISABLE_ALLOWED                                 0x1
87 #define IPMI_CHASSIS_BUTTON_DISABLE_NOT_ALLOWED                             0x0
88 
89 #define IPMI_POWER_RESTORE_POLICY_ALWAYS_STAY_POWERED_OFF                   0x00
90 #define IPMI_POWER_RESTORE_POLICY_RESTORE_POWER_TO_STATE_WHEN_AC_WAS_LOST   0x01
91 #define IPMI_POWER_RESTORE_POLICY_ALWAYS_POWER_UP_AFTER_AC_IS_LOST          0x02
92 #define IPMI_POWER_RESTORE_POLICY_NO_CHANGE                                 0x03
93 
94 #define IPMI_POWER_RESTORE_POLICY_VALID(__policy)                                      \
95   (((__policy) == IPMI_POWER_RESTORE_POLICY_NO_CHANGE                                  \
96     || (__policy) == IPMI_POWER_RESTORE_POLICY_ALWAYS_POWER_UP_AFTER_AC_IS_LOST        \
97     || (__policy) == IPMI_POWER_RESTORE_POLICY_RESTORE_POWER_TO_STATE_WHEN_AC_WAS_LOST \
98     || (__policy) == IPMI_POWER_RESTORE_POLICY_ALWAYS_STAY_POWERED_OFF) ? 1 : 0)
99 
100 #define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_UNKNOWN                                  0x00
101 #define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_CHASSIS_CONTROL_COMMAND                  0x01
102 #define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_RESET_VIA_PUSHBUTTON                     0x02
103 #define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_POWER_UP_VIA_POWER_PUSHBUTTON            0x03
104 #define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_WATCHDOG_EXPIRATION                      0x04
105 #define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_OEM                                      0x05
106 #define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_AUTOMATIC_POWER_UP_ALWAYS_RESTORE        0x06
107 #define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_AUTOMATIC_POWER_UP_RESTORE_PREVIOUS      0x07
108 #define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_RESET_VIA_PEF                            0x08
109 #define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_POWER_CYCLE_VIA_PEF                      0x09
110 #define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_SOFT_RESET                               0x0A
111 #define IPMI_CHASSIS_SYSTEM_RESTART_CAUSE_POWER_UP_VIA_RTC                         0x0B
112 
113 #define IPMI_SYSTEM_BOOT_OPTIONS_PARAMETER_VALID_UNLOCKED                   0x0
114 #define IPMI_SYSTEM_BOOT_OPTIONS_PARAMETER_INVALID_LOCKED                   0x1
115 
116 #define IPMI_SYSTEM_BOOT_OPTIONS_PARAMETER_VALID_VALID(__value)    \
117   (((__value) == IPMI_SYSTEM_BOOT_OPTIONS_PARAMETER_VALID_UNLOCKED \
118     || (__value) == IPMI_SYSTEM_BOOT_OPTIONS_PARAMETER_INVALID_LOCKED) ? 1 : 0)
119 
120 #define IPMI_SYSTEM_BOOT_OPTIONS_NO_SET_SELECTOR                            0x0
121 #define IPMI_SYSTEM_BOOT_OPTIONS_NO_BLOCK_SELECTOR                          0x0
122 
123 #define IPMI_SYSTEM_BOOT_OPTION_SET_COMPLETE                              0x00
124 #define IPMI_SYSTEM_BOOT_OPTION_SET_IN_PROGRESS                           0x01
125 #define IPMI_SYSTEM_BOOT_OPTION_SET_COMMIT_WRITE                          0x02
126 
127 #define IPMI_SYSTEM_BOOT_OPTION_SET_IN_PROGRESS_VALID(__value) \
128   (((__value) == IPMI_SYSTEM_BOOT_OPTION_SET_COMPLETE          \
129     || (__value) == IPMI_SYSTEM_BOOT_OPTION_SET_IN_PROGRESS    \
130     || (__value) == IPMI_SYSTEM_BOOT_OPTION_SET_COMMIT_WRITE) ? 1 : 0)
131 
132 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_INVALID                         0x00
133 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_VALID                           0x01
134 
135 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_VALID_FOR_NEXT_BOOT             0x00
136 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_VALID_PERSISTENTLY              0x01
137 
138 /* achu: below is not a typo, IPMI spec orders it 0x09, 0x08, 0x0B, 0x0F */
139 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_NO_OVERRIDE                                              0x00
140 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_PXE                                                0x01
141 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_HARD_DRIVE                                         0x02
142 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_HARD_DRIVE_SAFE_MODE                               0x03
143 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_DIAGNOSTIC_PARTITION                               0x04
144 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_CD_DVD                                             0x05
145 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_BIOS_SETUP                                         0x06
146 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_REMOTELY_CONNECTED_FLOPPY_PRIMARY_REMOVEABLE_MEDIA 0x07
147 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_PRIMARY_REMOTE_MEDIA                               0x09
148 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_REMOTELY_CONNECTED_CD_DVD                          0x08
149 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_REMOTELY_CONNECTED_HARD_DRIVE                      0x0B
150 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_FLOPPY_REMOVEABLE_MEDIA                            0x0F
151 
152 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_VALID(__boot_device)                                                       \
153   (((__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_NO_OVERRIDE                                                 \
154     || (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_PXE                                                \
155     || (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_HARD_DRIVE                                         \
156     || (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_HARD_DRIVE_SAFE_MODE                               \
157     || (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_DIAGNOSTIC_PARTITION                               \
158     || (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_CD_DVD                                             \
159     || (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_BIOS_SETUP                                         \
160     || (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_REMOTELY_CONNECTED_FLOPPY_PRIMARY_REMOVEABLE_MEDIA \
161     || (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_PRIMARY_REMOTE_MEDIA                               \
162     || (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_REMOTELY_CONNECTED_CD_DVD                          \
163     || (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_REMOTELY_CONNECTED_HARD_DRIVE                      \
164     || (__boot_device) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_DEVICE_FORCE_FLOPPY_REMOVEABLE_MEDIA) ? 1 : 0)
165 
166 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_DEFAULT      0x00
167 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_BIOS_SETTING IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_DEFAULT
168 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_SUPPRESS     0x01
169 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_ENABLE       0x02
170 
171 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_VALID(__console_redirection)       \
172   (((__console_redirection) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_DEFAULT     \
173     || (__console_redirection) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_SUPPRESS \
174     || (__console_redirection) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_CONSOLE_REDIRECTION_ENABLE) ? 1 : 0)
175 
176 #define IPMI_SYSTEM_BOOT_OPTION_NO                                        0x00
177 #define IPMI_SYSTEM_BOOT_OPTION_YES                                       0x01
178 
179 #define IPMI_SYSTEM_BOOT_OPTION_DISABLE                                   0x00
180 #define IPMI_SYSTEM_BOOT_OPTION_ENABLE                                    0x01
181 
182 #define IPMI_SYSTEM_BOOT_OPTION_ENABLE_VALID(__value) \
183   (((__value) == IPMI_SYSTEM_BOOT_OPTION_ENABLE       \
184     || (__value) == IPMI_SYSTEM_BOOT_OPTION_DISABLE) ? 1 : 0)
185 
186 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_TYPE_PC_COMPATIBLE         0x00
187 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_TYPE_EFI                   0x01
188 
189 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BIOS_BOOT_TYPE_VALID(__boot_type)    \
190   (((__boot_type) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_TYPE_PC_COMPATIBLE \
191     || (__boot_type) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_BOOT_TYPE_EFI) ? 1 : 0)
192 
193 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_FIRMWARE_BIOS_VERBOSITY_DEFAULT 0x00
194 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_FIRMWARE_BIOS_VERBOSITY_QUIET   0x01
195 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_FIRMWARE_BIOS_VERBOSITY_VERBOSE 0x02
196 
197 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_FIRMWARE_BIOS_VERBOSITY_VALID(__verbosity)    \
198   (((__verbosity) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_FIRMWARE_BIOS_VERBOSITY_DEFAULT  \
199     || (__verbosity) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_FIRMWARE_BIOS_VERBOSITY_QUIET \
200     || (__verbosity) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAG_FIRMWARE_BIOS_VERBOSITY_VERBOSE) ? 1 : 0)
201 
202 #define IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_UNSPECIFIED             0x00
203 
204 #define IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_DISCOVERED              0X01
205 #define IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_UNDISCOVERED            0X00
206 
207 #define IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_DISCOVERED_VALID(__value) \
208   (((__value) == IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_DISCOVERED  \
209     || (__value) == IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_UNDISCOVERED) ? 1 : 0)
210 
211 #define IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_SCAN                    0X01
212 #define IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_DO_NOT_SCAN             0X00
213 
214 #define IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_SCAN_VALID(__value) \
215   (((__value) == IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_SCAN  \
216     || (__value) == IPMI_SYSTEM_BOOT_OPTION_SERVICE_PARTITION_DO_NOT_SCAN) ? 1 : 0)
217 
218 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_INFO_ACKNOWLEDGE                     0x00
219 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_INFO_UNACKNOWLEDGE                   0x01
220 
221 #define IPMI_SYSTEM_BOOT_OPTION_DONT_CLEAR_VALID_BIT                      0x01
222 #define IPMI_SYSTEM_BOOT_OPTION_CLEAR_VALID_BIT                           0x00
223 
224 #define IPMI_SYSTEM_BOOT_OPTION_CLEAR_VALID_BIT_VALID(__value) \
225   (((__value) == IPMI_SYSTEM_BOOT_OPTION_DONT_CLEAR_VALID_BIT  \
226     || (__value) == IPMI_SYSTEM_BOOT_OPTION_CLEAR_VALID_BIT) ? 1 : 0)
227 
228 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAGS_SET_MUX_TO_RECOMENDED_AT_END_OF_POST  0x00
229 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAGS_SET_MUX_TO_BMC                        0x01
230 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAGS_SET_MUX_TO_SYSTEM                     0x02
231 
232 #define IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAGS_BIOS_MUX_CONTROL_OVERRIDE_VALID(__bios_mux_control)      \
233   (((__bios_mux_control) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAGS_SET_MUX_TO_RECOMENDED_AT_END_OF_POST \
234     || (__bios_mux_control) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAGS_SET_MUX_TO_BMC                    \
235     || (__bios_mux_control) == IPMI_SYSTEM_BOOT_OPTION_BOOT_FLAGS_SET_MUX_TO_SYSTEM) ? 1 : 0)
236 
237 #define IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_MIN 0x00
238 #define IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_MAX 0x31
239 
240 #define IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_RANGE_MIN 0x01
241 #define IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_RANGE_MAX 0x15
242 
243 /* To avoid gcc warnings, add +1 in comparison */
244 #define IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_VALID(__value) \
245   ((((__value) + 1) >= (IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_MIN + 1) \
246     && (__value) <= IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_MAX) ? 1 : 0)
247 
248 #define IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_RANGE_VALID(__value) \
249   (((__value) >= IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_RANGE_MIN \
250     && (__value) <= IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_RANGE_MAX) ? 1 : 0)
251 
252 #define IPMI_SYSTEM_BOOT_OPTION_DEVICE_INSTANCE_SELECTOR_INTERNAL_BITMASK 0x10
253 
254 #define IPMI_SYSTEM_BOOT_OPTION_BLOCK_DATA_LEN_MAX 16
255 
256 /*
257  * fill* functions return 0 on success, -1 on error.
258  *
259  * obj_cmd_rq must be for the fill function's respective fiid
260  * template request.
261  *
262  * see freeipmi/templates/ for template definitions
263  */
264 
265 extern fiid_template_t tmpl_cmd_get_chassis_capabilities_rq;
266 extern fiid_template_t tmpl_cmd_get_chassis_capabilities_rs;
267 extern fiid_template_t tmpl_cmd_get_chassis_status_rq;
268 extern fiid_template_t tmpl_cmd_get_chassis_status_rs;
269 extern fiid_template_t tmpl_cmd_chassis_control_rq;
270 extern fiid_template_t tmpl_cmd_chassis_control_rs;
271 extern fiid_template_t tmpl_cmd_chassis_identify_rq;
272 extern fiid_template_t tmpl_cmd_chassis_identify_rs;
273 extern fiid_template_t tmpl_cmd_set_front_panel_enables_rq;
274 extern fiid_template_t tmpl_cmd_set_front_panel_enables_rs;
275 extern fiid_template_t tmpl_cmd_set_power_restore_policy_rq;
276 extern fiid_template_t tmpl_cmd_set_power_restore_policy_rs;
277 extern fiid_template_t tmpl_cmd_set_power_cycle_interval_rq;
278 extern fiid_template_t tmpl_cmd_set_power_cycle_interval_rs;
279 extern fiid_template_t tmpl_cmd_get_system_restart_cause_rq;
280 extern fiid_template_t tmpl_cmd_get_system_restart_cause_rs;
281 
282 extern fiid_template_t tmpl_cmd_set_system_boot_options_rq;
283 extern fiid_template_t tmpl_cmd_set_system_boot_options_rs;
284 extern fiid_template_t tmpl_cmd_set_system_boot_options_set_in_progress_rq;
285 extern fiid_template_t tmpl_cmd_set_system_boot_options_service_partition_selector_rq;
286 extern fiid_template_t tmpl_cmd_set_system_boot_options_service_partition_scan_rq;
287 extern fiid_template_t tmpl_cmd_set_system_boot_options_BMC_boot_flag_valid_bit_clearing_rq;
288 extern fiid_template_t tmpl_cmd_set_system_boot_options_boot_info_acknowledge_rq;
289 extern fiid_template_t tmpl_cmd_set_system_boot_options_boot_flags_rq;
290 extern fiid_template_t tmpl_cmd_set_system_boot_options_boot_initiator_info_rq;
291 extern fiid_template_t tmpl_cmd_set_system_boot_options_boot_initiator_mailbox_rq;
292 
293 extern fiid_template_t tmpl_cmd_get_system_boot_options_rq;
294 extern fiid_template_t tmpl_cmd_get_system_boot_options_rs;
295 extern fiid_template_t tmpl_cmd_get_system_boot_options_set_in_progress_rs;
296 extern fiid_template_t tmpl_cmd_get_system_boot_options_service_partition_selector_rs;
297 extern fiid_template_t tmpl_cmd_get_system_boot_options_service_partition_scan_rs;
298 extern fiid_template_t tmpl_cmd_get_system_boot_options_BMC_boot_flag_valid_bit_clearing_rs;
299 extern fiid_template_t tmpl_cmd_get_system_boot_options_boot_info_acknowledge_rs;
300 extern fiid_template_t tmpl_cmd_get_system_boot_options_boot_flags_rs;
301 extern fiid_template_t tmpl_cmd_get_system_boot_options_boot_initiator_info_rs;
302 extern fiid_template_t tmpl_cmd_get_system_boot_options_boot_initiator_mailbox_rs;
303 
304 extern fiid_template_t tmpl_cmd_get_power_on_hours_counter_rq;
305 extern fiid_template_t tmpl_cmd_get_power_on_hours_counter_rs;
306 
307 int fill_cmd_get_chassis_capabilities (fiid_obj_t obj_cmd_rq);
308 
309 int fill_cmd_get_chassis_status (fiid_obj_t obj_cmd_rq);
310 
311 int fill_cmd_chassis_control (uint8_t chassis_control,
312                               fiid_obj_t obj_cmd_rq);
313 
314 int fill_cmd_chassis_identify (const uint8_t *identify_interval,
315                                const uint8_t *force_identify,
316                                fiid_obj_t obj_cmd_rq);
317 
318 int fill_cmd_set_front_panel_enables (uint8_t disable_power_off_button_for_power_off_only,
319                                       uint8_t disable_reset_button,
320                                       uint8_t disable_diagnostic_interrupt_button,
321                                       uint8_t disable_standby_button_for_entering_standby,
322                                       fiid_obj_t obj_cmd_rq);
323 
324 int fill_cmd_set_power_restore_policy (uint8_t power_restore_policy,
325                                        fiid_obj_t obj_cmd_rq);
326 
327 int fill_cmd_set_power_cycle_interval (uint8_t interval,
328                                        fiid_obj_t obj_cmd_rq);
329 
330 int fill_cmd_get_system_restart_cause (fiid_obj_t obj_cmd_rq);
331 
332 int fill_cmd_set_system_boot_options (uint8_t parameter_selector,
333                                       uint8_t parameter_valid,
334                                       const void *configuration_parameter_data,
335                                       unsigned int configuration_parameter_data_len,
336                                       fiid_obj_t obj_cmd_rq);
337 
338 int fill_cmd_set_system_boot_options_set_in_progress (uint8_t parameter_valid,
339                                                       uint8_t state,
340                                                       fiid_obj_t obj_cmd_rq);
341 
342 int fill_cmd_set_system_boot_options_service_partition_selector (uint8_t parameter_valid,
343                                                                  uint8_t service_partition_selector,
344                                                                  fiid_obj_t obj_cmd_rq);
345 
346 int fill_cmd_set_system_boot_options_service_partition_scan (uint8_t parameter_valid,
347                                                              uint8_t service_partition_discovered,
348                                                              uint8_t service_partition_scan,
349                                                              fiid_obj_t obj_cmd_rq);
350 
351 int fill_cmd_set_system_boot_options_BMC_boot_flag_valid_bit_clearing (uint8_t parameter_valid,
352                                                                        uint8_t dont_clear_on_power_up,
353                                                                        uint8_t dont_clear_on_pushbutton_or_soft_reset,
354                                                                        uint8_t dont_clear_on_watchdog_timeout,
355                                                                        uint8_t dont_clear_on_chassis_control,
356                                                                        uint8_t dont_clear_on_PEF,
357                                                                        fiid_obj_t obj_cmd_rq);
358 
359 int fill_cmd_set_system_boot_options_boot_info_acknowledge (uint8_t parameter_valid,
360                                                             const uint8_t *bios_or_post_handled_boot_info,
361                                                             const uint8_t *os_loader_handled_boot_info,
362                                                             const uint8_t *os_or_service_partition_handled_boot_info,
363                                                             const uint8_t *sms_handled_boot_info,
364                                                             const uint8_t *oem_handled_boot_info,
365                                                             fiid_obj_t obj_cmd_rq);
366 
367 int fill_cmd_set_system_boot_options_boot_flags (uint8_t parameter_valid,
368                                                  uint8_t bios_boot_type,
369                                                  uint8_t boot_flags_persistent,
370                                                  uint8_t boot_flags_valid,
371                                                  uint8_t lock_out_reset_button,
372                                                  uint8_t screen_blank,
373                                                  uint8_t boot_device,
374                                                  uint8_t lock_keyboard,
375                                                  uint8_t clear_cmos,
376                                                  uint8_t console_redirection,
377                                                  uint8_t lock_out_sleep_button,
378                                                  uint8_t user_password_bypass,
379                                                  uint8_t force_progress_event_traps,
380                                                  uint8_t firmware_bios_verbosity,
381                                                  uint8_t lock_out_via_power_button,
382                                                  uint8_t bios_mux_control_override,
383                                                  uint8_t bios_shared_mode_override,
384                                                  uint8_t device_instance_selector,
385                                                  fiid_obj_t obj_cmd_rq);
386 
387 int fill_cmd_set_system_boot_options_boot_initiator_info (uint8_t parameter_valid,
388                                                           uint8_t boot_source_channel_number,
389                                                           uint32_t session_id,
390                                                           uint32_t boot_info_timestamp,
391                                                           fiid_obj_t obj_cmd_rq);
392 
393 int fill_cmd_set_system_boot_options_boot_initiator_mailbox (uint8_t parameter_valid,
394                                                              uint8_t set_selector,
395                                                              const void *block_data,
396                                                              unsigned int block_data_length,
397                                                              fiid_obj_t obj_cmd_rq);
398 
399 int fill_cmd_get_system_boot_options (uint8_t parameter_selector,
400                                       uint8_t set_selector,
401                                       uint8_t block_selector,
402                                       fiid_obj_t obj_cmd_rq);
403 
404 int fill_cmd_get_power_on_hours_counter (fiid_obj_t obj_cmd_rq);
405 
406 #ifdef __cplusplus
407 }
408 #endif
409 
410 #endif /* IPMI_CHASSIS_CMDS_H */
411