ui/ncurses: Add nc-subset selection screen
[petitboot] / discover / ipmi.h
1 #ifndef _IPMI_H
2 #define _IPMI_H
3
4 #include <stdbool.h>
5 #include <stdint.h>
6
7 enum ipmi_netfn {
8         IPMI_NETFN_CHASSIS      = 0x0,
9         IPMI_NETFN_SE           = 0x04,
10 };
11
12 enum ipmi_cmd {
13         IPMI_CMD_CHASSIS_SET_SYSTEM_BOOT_OPTIONS        = 0x08,
14         IPMI_CMD_CHASSIS_GET_SYSTEM_BOOT_OPTIONS        = 0x09,
15         IPMI_CMD_SENSOR_SET                             = 0x30,
16 };
17
18 enum ipmi_bootdev {
19         IPMI_BOOTDEV_NONE = 0x00,
20         IPMI_BOOTDEV_NETWORK = 0x01,
21         IPMI_BOOTDEV_DISK = 0x2,
22         IPMI_BOOTDEV_SAFE = 0x3,
23         IPMI_BOOTDEV_CDROM = 0x5,
24         IPMI_BOOTDEV_SETUP = 0x6,
25 };
26
27 enum ipmi_sensor_ids {
28         IPMI_SENSOR_ID_OS_BOOT          = 0x1F,
29 };
30
31 struct ipmi;
32
33 bool ipmi_present(void);
34 bool ipmi_bootdev_is_valid(int x);
35 struct ipmi *ipmi_open(void *ctx);
36
37 int ipmi_transaction(struct ipmi *ipmi, uint8_t netfn, uint8_t cmd,
38                 uint8_t *req_buf, uint16_t req_len,
39                 uint8_t *resp_buf, uint16_t *resp_len,
40                 int timeout_ms);
41
42 #endif /* _IPMI_H */