diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-12-15 09:47:39 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-12-15 15:47:40 +0800 |
commit | 2e05b1dd0490ce7ecdd15f522e6c700bc6522062 (patch) | |
tree | 5ef88f31906e6dcd4e2079b396a8cd6bbf61fb98 /discover/ipmi.h | |
parent | d3e95283e69d3099fe9f36e56be1f645f565c843 (diff) | |
download | talos-petitboot-2e05b1dd0490ce7ecdd15f522e6c700bc6522062.tar.gz talos-petitboot-2e05b1dd0490ce7ecdd15f522e6c700bc6522062.zip |
discover/platform-powerpc: Implement direct IPMI interface
This change adds a direct IPMI interface to the /dev/ipmi0 device node,
which is present on OpenPower machines.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/ipmi.h')
-rw-r--r-- | discover/ipmi.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/discover/ipmi.h b/discover/ipmi.h index 157cca8..e60ff61 100644 --- a/discover/ipmi.h +++ b/discover/ipmi.h @@ -4,16 +4,33 @@ #include <stdbool.h> #include <stdint.h> +enum ipmi_netfn { + IPMI_NETFN_CHASSIS = 0x0, +}; + +enum ipmi_cmd { + IPMI_CMD_CHASSIS_SET_SYSTEM_BOOT_OPTIONS = 0x08, + IPMI_CMD_CHASSIS_GET_SYSTEM_BOOT_OPTIONS = 0x09, +}; + enum ipmi_bootdev { - IPMI_BOOTDEV_NONE = 0x0, - IPMI_BOOTDEV_NETWORK = 0x1, + IPMI_BOOTDEV_NONE = 0x00, + IPMI_BOOTDEV_NETWORK = 0x01, IPMI_BOOTDEV_DISK = 0x2, IPMI_BOOTDEV_SAFE = 0x3, IPMI_BOOTDEV_CDROM = 0x5, IPMI_BOOTDEV_SETUP = 0x6, }; -bool ipmi_bootdev_is_valid(int x); +struct ipmi; + bool ipmi_present(void); +bool ipmi_bootdev_is_valid(int x); +struct ipmi *ipmi_open(void *ctx); + +int ipmi_transaction(struct ipmi *ipmi, uint8_t netfn, uint8_t cmd, + uint8_t *req_buf, uint16_t req_len, + uint8_t *resp_buf, uint16_t *resp_len, + int timeout_ms); #endif /* _IPMI_H */ |