diff options
author | Alistair Popple <alistair@popple.id.au> | 2015-02-04 16:07:43 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2015-02-09 13:55:25 +1100 |
commit | 91b9a6f43ab16a66c4fe792a5d2615eea8a5620c (patch) | |
tree | 2efe60ff6f3d2f8777c3504134fff0f43bf5008a /include | |
parent | 38bb327d1ad3d5971dc7ddab4ad6d2386e5f6036 (diff) | |
download | skiboot-91b9a6f43ab16a66c4fe792a5d2615eea8a5620c.zip skiboot-91b9a6f43ab16a66c4fe792a5d2615eea8a5620c.tar.gz skiboot-91b9a6f43ab16a66c4fe792a5d2615eea8a5620c.tar.bz2 |
ipmi: Add a function to (re)initialise a message without allocation
Currently the only functions we have for initialising ipmi messages
with the correct values also allocate memory for the message. In some
cases we want to reuse previously allocated messages to avoid
continually freeing/allocating memory.
This patch introduces a function which (re)initialises a previously
allocated message and converts existing instances of this behaviour
over to the new function.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/ipmi.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/ipmi.h b/include/ipmi.h index 50de293..bbeae5a 100644 --- a/include/ipmi.h +++ b/include/ipmi.h @@ -163,6 +163,13 @@ struct ipmi_msg *ipmi_mkmsg(int interface, uint32_t code, void *user_data, void *req_data, size_t req_size, size_t resp_size); +/* Initialise a previously allocated message with the required +fields. The caller must ensure the message is large enough to hold the +request and response data. */ +void ipmi_init_msg(struct ipmi_msg *msg, int interface, + uint32_t code, void (*complete)(struct ipmi_msg *), + void *user_data, size_t req_size, size_t resp_size); + /* Add an ipmi message to the queue */ int ipmi_queue_msg(struct ipmi_msg *msg); |