diff options
author | Alistair Popple <alistair@popple.id.au> | 2014-10-23 16:14:09 +1100 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-10-30 16:35:51 +1100 |
commit | b2a374da98aa710b4c55556f9a9047d4d4a8665d (patch) | |
tree | 31055569f5e456f721f011d2646be7ee6b1e9f57 /include | |
parent | b118964db9acd6a36ae1ffe70c09715479a58095 (diff) | |
download | skiboot-b2a374da98aa710b4c55556f9a9047d4d4a8665d.zip skiboot-b2a374da98aa710b4c55556f9a9047d4d4a8665d.tar.gz skiboot-b2a374da98aa710b4c55556f9a9047d4d4a8665d.tar.bz2 |
ipmi: Add an opal interface to the ipmi stack
This patch adds two opal calls (opal_ipmi_send and opal_ipmi_recv)
to allow an operating system to send and receive arbitrary ipmi
messages to the BMC.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/ipmi.h | 13 | ||||
-rw-r--r-- | include/opal.h | 5 |
2 files changed, 17 insertions, 1 deletions
diff --git a/include/ipmi.h b/include/ipmi.h index 9543515..42906e6 100644 --- a/include/ipmi.h +++ b/include/ipmi.h @@ -18,6 +18,7 @@ #define __IPMI_H #include <stdint.h> +#include <ccan/list/list.h> #include <stdbool.h> /* @@ -108,8 +109,14 @@ #define IPMI_DEFAULT_INTERFACE 0 +#define IPMI_MAX_REQ_SIZE 64 +#define IPMI_MAX_RESP_SIZE 64 + struct ipmi_backend; struct ipmi_msg { + /* Can be used by command implementations to track requests */ + struct list_node link; + struct ipmi_backend *backend; uint8_t netfn; uint8_t cmd; @@ -128,12 +135,15 @@ struct ipmi_msg { }; struct ipmi_backend { + uint64_t opal_event_ipmi_recv; struct ipmi_msg *(*alloc_msg)(size_t, size_t); void (*free_msg)(struct ipmi_msg *); int (*queue_msg)(struct ipmi_msg *); int (*dequeue_msg)(struct ipmi_msg *); }; +extern struct ipmi_backend *ipmi_backend; + /* Initialise the IPMI interface */ void ipmi_init(void); @@ -166,4 +176,7 @@ void ipmi_register_backend(struct ipmi_backend *backend); /* Register rtc ipmi commands with as opal callbacks. */ void ipmi_rtc_init(void); +/* Register ipmi host interface access callbacks */ +void ipmi_opal_init(void); + #endif diff --git a/include/opal.h b/include/opal.h index 8a833df..730aee7 100644 --- a/include/opal.h +++ b/include/opal.h @@ -36,6 +36,7 @@ #define OPAL_HARDWARE_FROZEN -13 #define OPAL_WRONG_STATE -14 #define OPAL_ASYNC_COMPLETION -15 +#define OPAL_EMPTY -16 /* API Tokens (in r0) */ #define OPAL_TEST 0 @@ -142,7 +143,9 @@ #define OPAL_READ_TPO 104 #define OPAL_GET_DPO_STATUS 105 #define OPAL_I2C_REQUEST 106 -#define OPAL_LAST 106 +#define OPAL_IPMI_SEND 107 +#define OPAL_IPMI_RECV 108 +#define OPAL_LAST 108 #ifndef __ASSEMBLY__ |