[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 09/16] ipmi: Add a firmware configuration reposit
From: |
minyard |
Subject: |
[Qemu-devel] [PATCH v3 09/16] ipmi: Add a firmware configuration repository |
Date: |
Mon, 8 Jun 2015 20:12:04 -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 +++++++++++++++++++++++++
include/hw/ipmi/ipmi.h | 35 +++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+)
diff --git a/hw/ipmi/ipmi.c b/hw/ipmi/ipmi.c
index 7d17469..ced588d 100644
--- a/hw/ipmi/ipmi.c
+++ b/hw/ipmi/ipmi.c
@@ -123,3 +123,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/include/hw/ipmi/ipmi.h b/include/hw/ipmi/ipmi.h
index e4f7738..9bd9c9d 100644
--- a/include/hw/ipmi/ipmi.h
+++ b/include/hw/ipmi/ipmi.h
@@ -168,6 +168,41 @@ typedef struct IPMIBmcClass {
*/
void ipmi_bmc_find_and_link(Object *obj, Object **bmc);
+/*
+ * 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
- [Qemu-devel] [PATCH v3 00/16] Add an IPMI device to QEMU, minyard, 2015/06/08
- [Qemu-devel] [PATCH v3 12/16] pc: Postpone SMBIOS table installation to post machine init, minyard, 2015/06/08
- [Qemu-devel] [PATCH v3 09/16] ipmi: Add a firmware configuration repository,
minyard <=
- [Qemu-devel] [PATCH v3 10/16] ipmi: Add firmware registration to the ISA interface, minyard, 2015/06/08
- [Qemu-devel] [PATCH v3 07/16] ipmi: Add documentation, minyard, 2015/06/08
- [Qemu-devel] [PATCH v3 08/16] ipmi: Add migration capability to the IPMI devices., minyard, 2015/06/08
- [Qemu-devel] [PATCH v3 15/16] ipmi: Add ACPI table entries, minyard, 2015/06/08
- [Qemu-devel] [PATCH v3 13/16] ipmi: Add SMBIOS table entry, minyard, 2015/06/08
- [Qemu-devel] [PATCH v3 11/16] smbios: Add a function to directly add an entry, minyard, 2015/06/08
- [Qemu-devel] [PATCH v3 16/16] bios: Add tests for the IPMI ACPI and SMBIOS entries, minyard, 2015/06/08
- [Qemu-devel] [PATCH v3 06/16] ipmi: Add tests, minyard, 2015/06/08
- [Qemu-devel] [PATCH v3 14/16] acpi: Add a way for devices to add ACPI tables, minyard, 2015/06/08
- [Qemu-devel] [PATCH v3 01/16] Add a base IPMI interface, minyard, 2015/06/08