aboutsummaryrefslogtreecommitdiff
path: root/core/ipmi.c
diff options
context:
space:
mode:
authorJeremy Kerr <jeremy.kerr@au.ibm.com>2015-02-05 13:40:02 +1030
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-02-09 14:03:50 +1100
commit6e42e6364ed2b1e976d7ddace2e28f27c0b46ba4 (patch)
treeeb41ec3e3866059770fb7ead6a3ef44a0977e777 /core/ipmi.c
parentc5a06a551ef55468e7bc46615f71f4ee4dbeaa02 (diff)
downloadskiboot-6e42e6364ed2b1e976d7ddace2e28f27c0b46ba4.zip
skiboot-6e42e6364ed2b1e976d7ddace2e28f27c0b46ba4.tar.gz
skiboot-6e42e6364ed2b1e976d7ddace2e28f27c0b46ba4.tar.bz2
ipmi: handle SMS_ATN events
When the bt interface sets the SMS_ATN flag, we perform a Get Message Flags to determine what messages are available. The only message type currently processed is the Event Message Buffer, which provides SEL messages for indicating OEM specific events such as graceful system shutdown and PNOR access requested. These events will be handled by the IPMI layer in skiboot. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/ipmi.c')
-rw-r--r--core/ipmi.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/core/ipmi.c b/core/ipmi.c
index 941cf52..04c381a 100644
--- a/core/ipmi.c
+++ b/core/ipmi.c
@@ -137,6 +137,46 @@ void ipmi_queue_msg_sync(struct ipmi_msg *msg)
unlock(&sync_lock);
}
+static void ipmi_read_event_complete(struct ipmi_msg *msg)
+{
+ prlog(PR_DEBUG, "IPMI read event %02x complete: %d bytes. cc: %02x\n",
+ msg->cmd, msg->resp_size, msg->cc);
+
+ /* TODO: Handle power control & PNOR handshake events */
+
+ ipmi_free_msg(msg);
+}
+
+static void ipmi_get_message_flags_complete(struct ipmi_msg *msg)
+{
+ uint8_t flags = msg->data[0];
+
+ ipmi_free_msg(msg);
+
+ prlog(PR_DEBUG, "IPMI Get Message Flags: %02x\n", flags);
+
+ /* Message available in the event buffer? Queue a Read Event command
+ * to retrieve it. The flag is cleared by performing a read */
+ if (flags & IPMI_MESSAGE_FLAGS_EVENT_BUFFER) {
+ msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE, IPMI_READ_EVENT,
+ ipmi_read_event_complete, NULL, NULL, 0, 16);
+ ipmi_queue_msg(msg);
+ }
+}
+
+void ipmi_sms_attention(void)
+{
+ struct ipmi_msg *msg;
+
+ /* todo: when we handle multiple IPMI interfaces, we'll need to
+ * ensure that this message is associated with the appropriate
+ * backend. */
+ msg = ipmi_mkmsg(IPMI_DEFAULT_INTERFACE, IPMI_GET_MESSAGE_FLAGS,
+ ipmi_get_message_flags_complete, NULL, NULL, 0, 1);
+
+ ipmi_queue_msg(msg);
+}
+
void ipmi_register_backend(struct ipmi_backend *backend)
{
/* We only support one backend at the moment */