[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 10/17] ipmi: Add a firmware configuration repository
From: |
minyard |
Subject: |
[Qemu-devel] [PATCH 10/17] ipmi: Add a firmware configuration repository |
Date: |
Thu, 23 Apr 2015 17:57:51 -0500 |
From: Corey Minyard <address@hidden>
Add a way for IPMI devices to register their firmware information
with the IPMI subsystem so that various firmware entities can pull
that information later for adding to firmware tables.
Signed-off-by: Corey Minyard <address@hidden>
---
hw/ipmi/ipmi.c | 25 +++++++++++++++++++++++++
hw/ipmi/ipmi.h | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+)
diff --git a/hw/ipmi/ipmi.c b/hw/ipmi/ipmi.c
index f3e5e9e..c43c844 100644
--- a/hw/ipmi/ipmi.c
+++ b/hw/ipmi/ipmi.c
@@ -150,3 +150,28 @@ static void ipmi_register_types(void)
}
type_init(ipmi_register_types)
+
+struct fw_entry_handlers {
+ IPMIFwHandler handler;
+ void *opaque;
+ QSLIST_ENTRY(fw_entry_handlers) next;
+};
+static QSLIST_HEAD(, fw_entry_handlers) fw_entries;
+
+void ipmi_add_fwinfo(IPMIFwInfo *info)
+{
+ struct fw_entry_handlers *e;
+
+ QSLIST_FOREACH(e, &fw_entries, next) {
+ e->handler(info, e->opaque);
+ }
+}
+
+void ipmi_register_fwinfo_handler(IPMIFwHandler handler, void *opaque)
+{
+ struct fw_entry_handlers *e = g_malloc(sizeof(*e));
+
+ e->handler = handler;
+ e->opaque = opaque;
+ QSLIST_INSERT_HEAD(&fw_entries, e, next);
+}
diff --git a/hw/ipmi/ipmi.h b/hw/ipmi/ipmi.h
index 56cb423..62b757a 100644
--- a/hw/ipmi/ipmi.h
+++ b/hw/ipmi/ipmi.h
@@ -25,6 +25,7 @@
#ifndef HW_IPMI_H
#define HW_IPMI_H
+#include <qemu/queue.h>
#include "exec/memory.h"
#include "qemu-common.h"
#include "hw/qdev.h"
@@ -207,6 +208,41 @@ typedef struct IPMIBmcClass {
void ipmi_bmc_init(IPMIBmc *s, Error **errp);
+/*
+ * Used for transferring information to interfaces that add
+ * entries to firmware tables.
+ */
+typedef struct IPMIFwInfo {
+ const char *interface_name;
+ int interface_type;
+ uint8_t ipmi_spec_major_revision;
+ uint8_t ipmi_spec_minor_revision;
+ uint8_t i2c_slave_address;
+
+ uint64_t base_address;
+ uint64_t register_length;
+ uint8_t register_spacing;
+ enum {
+ IPMI_MEMSPACE_IO,
+ IPMI_MEMSPACE_MEM32,
+ IPMI_MEMSPACE_MEM64,
+ IPMI_MEMSPACE_SMBUS
+ } memspace;
+
+ int interrupt_number;
+ enum {
+ IPMI_LEVEL_IRQ,
+ IPMI_EDGE_IRQ
+ } irq_type;
+
+ const char *acpi_parent;
+} IPMIFwInfo;
+
+typedef void (*IPMIFwHandler)(IPMIFwInfo *info, void *opaque);
+
+void ipmi_add_fwinfo(IPMIFwInfo *info);
+void ipmi_register_fwinfo_handler(IPMIFwHandler handler, void *opaque);
+
#ifdef IPMI_DEBUG
#define ipmi_debug(fs, ...) \
fprintf(stderr, "IPMI (%s): " fs, __func__, ##__VA_ARGS__)
--
1.8.3.1
- Re: [Qemu-devel] [PATCH 02/17] ipmi: Add a PC ISA type structure, (continued)
- [Qemu-devel] [PATCH 03/17] ipmi: Add a KCS low-level interface, minyard, 2015/04/23
- [Qemu-devel] [PATCH 04/17] ipmi: Add a BT low-level interface, minyard, 2015/04/23
- [Qemu-devel] [PATCH 05/17] ipmi: Add a local BMC simulation, minyard, 2015/04/23
- [Qemu-devel] [PATCH 06/17] ipmi: Add an external connection simulation interface, minyard, 2015/04/23
- [Qemu-devel] [PATCH 07/17] ipmi: Add tests, minyard, 2015/04/23
- [Qemu-devel] [PATCH 08/17] ipmi: Add documentation, minyard, 2015/04/23
- [Qemu-devel] [PATCH 09/17] ipmi: Add migration capability to the IPMI device., minyard, 2015/04/23
- [Qemu-devel] [PATCH 10/17] ipmi: Add a firmware configuration repository,
minyard <=
- [Qemu-devel] [PATCH 12/17] smbios: Add a function to directly add an entry, minyard, 2015/04/23
- [Qemu-devel] [PATCH 13/17] pc: Postpone SMBIOS table installation to post machine init, minyard, 2015/04/23
- [Qemu-devel] [PATCH 14/17] ipmi: Add SMBIOS table entry, minyard, 2015/04/23
- [Qemu-devel] [PATCH 15/17] acpi: Add a way for devices to add ACPI tables, minyard, 2015/04/23
- [Qemu-devel] [PATCH 16/17] ipmi: Add ACPI table entries, minyard, 2015/04/23
- [Qemu-devel] [PATCH 17/17] bios: Add tests for the IPMI ACPI and SMBIOS entries, minyard, 2015/04/23
- Re: [Qemu-devel] [PATCH 00/17] Update to adding an IPMI device to qemu, Eric Blake, 2015/04/23