[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 32/47] ipmi: introduce an ipmi_bmc_sdr_find() API
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 32/47] ipmi: introduce an ipmi_bmc_sdr_find() API |
Date: |
Mon, 24 Apr 2017 11:59:12 +1000 |
From: Cédric Le Goater <address@hidden>
This patch exposes a new IPMI routine to query a sdr entry from the
sdr table maintained by the IPMI BMC simulator. The API is very
similar to the internal sdr_find_entry() routine and should be used
the same way to query one or all sdrs.
A typical use would be to loop on the sdrs to build nodes of a device
tree.
Signed-off-by: Cédric Le Goater <address@hidden>
Acked-by: Corey Minyard <address@hidden>
Signed-off-by: David Gibson <address@hidden>
---
hw/ipmi/ipmi_bmc_sim.c | 16 ++++++++++++++++
include/hw/ipmi/ipmi.h | 2 ++
2 files changed, 18 insertions(+)
diff --git a/hw/ipmi/ipmi_bmc_sim.c b/hw/ipmi/ipmi_bmc_sim.c
index eae7b2d..8185a84 100644
--- a/hw/ipmi/ipmi_bmc_sim.c
+++ b/hw/ipmi/ipmi_bmc_sim.c
@@ -416,6 +416,22 @@ static int sdr_find_entry(IPMISdr *sdr, uint16_t recid,
return 1;
}
+int ipmi_bmc_sdr_find(IPMIBmc *b, uint16_t recid,
+ const struct ipmi_sdr_compact **sdr, uint16_t *nextrec)
+
+{
+ IPMIBmcSim *ibs = IPMI_BMC_SIMULATOR(b);
+ unsigned int pos;
+
+ pos = 0;
+ if (sdr_find_entry(&ibs->sdr, recid, &pos, nextrec)) {
+ return -1;
+ }
+
+ *sdr = (const struct ipmi_sdr_compact *) &ibs->sdr.sdr[pos];
+ return 0;
+}
+
static void sel_inc_reservation(IPMISel *sel)
{
sel->reservation++;
diff --git a/include/hw/ipmi/ipmi.h b/include/hw/ipmi/ipmi.h
index 91b83b5..0d36cfc 100644
--- a/include/hw/ipmi/ipmi.h
+++ b/include/hw/ipmi/ipmi.h
@@ -259,4 +259,6 @@ struct ipmi_sdr_compact {
typedef uint8_t ipmi_sdr_compact_buffer[sizeof(struct ipmi_sdr_compact)];
+int ipmi_bmc_sdr_find(IPMIBmc *b, uint16_t recid,
+ const struct ipmi_sdr_compact **sdr, uint16_t *nextrec);
#endif
--
2.9.3
- [Qemu-devel] [PULL 12/47] spapr: Workaround for broken radix guests, (continued)
- [Qemu-devel] [PULL 12/47] spapr: Workaround for broken radix guests, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 08/47] target/ppc: Add new H-CALL shells for in memory table translation, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 15/47] spapr_pci: Removed unused include, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 18/47] spapr: move the IRQ server number mapping under the machine, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 14/47] spapr_pci: Warn when RAM page size is not enabled in IOMMU page mask, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 19/47] spapr: allocate the ICPState object from under sPAPRCPUCore, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 23/47] ppc/pnv: extend the machine with a InterruptStatsProvider interface, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 11/47] spapr: Enable ISA 3.0 MMU mode selection via CAS, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 16/47] target/ppc: Add ibm, processor-radix-AP-encodings for TCG, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 29/47] ppc: add IPMI support, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 32/47] ipmi: introduce an ipmi_bmc_sdr_find() API,
David Gibson <=
- [Qemu-devel] [PULL 40/47] ppc/pnv: populate device tree for serial devices, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 21/47] ppc/pnv: add a PnvICPState object, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 27/47] ppc/pnv: Add cut down PSI bridge model and hookup external interrupt, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 30/47] ipmi: use a file to load SDRs, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 20/47] ppc/xics: add a realize() handler to ICPStateClass, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 43/47] ppc/pnv: generate an OEM SEL event on shutdown, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 42/47] ppc/pnv: add initial IPMI sensors for the BMC simulator, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 35/47] spapr: remove the 'nr_servers' field from the machine, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 17/47] ppc/xics: introduce an 'intc' backlink under PowerPCCPU, David Gibson, 2017/04/23
- [Qemu-devel] [PULL 24/47] ppc/pnv: create the ICP object under PnvCore, David Gibson, 2017/04/23