[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 32/48] ipmi: introduce an ipmi_bmc_sdr_find() API
From: |
David Gibson |
Subject: |
[Qemu-devel] [PULL 32/48] ipmi: introduce an ipmi_bmc_sdr_find() API |
Date: |
Wed, 26 Apr 2017 17:00:18 +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 feb7627..09213ab 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 41/48] ppc/pnv: populate device tree for IPMI BT devices, (continued)
- [Qemu-devel] [PULL 41/48] ppc/pnv: populate device tree for IPMI BT devices, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 29/48] ppc: add IPMI support, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 35/48] spapr: remove the 'nr_servers' field from the machine, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 36/48] ppc/pnv: Add support for POWER8+ LPC Controller, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 34/48] target/ppc: Fix size of struct PPCElfPrstatus, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 38/48] ppc/pnv: scan ISA bus to populate device tree, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 47/48] target/ppc: Style fixes, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 48/48] MAINTAINERS: Remove myself from e500, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 27/48] ppc/pnv: Add cut down PSI bridge model and hookup external interrupt, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 40/48] ppc/pnv: populate device tree for serial devices, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 32/48] ipmi: introduce an ipmi_bmc_sdr_find() API,
David Gibson <=
- [Qemu-devel] [PULL 43/48] ppc/pnv: generate an OEM SEL event on shutdown, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 42/48] ppc/pnv: add initial IPMI sensors for the BMC simulator, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 46/48] e500, book3s: mfspr 259: Register mapped/aliased SPRG3 user read, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 37/48] ppc/pnv: enable only one LPC bus, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 44/48] spapr-cpu-core: Release ICPState object during CPU unrealization, David Gibson, 2017/04/26
- [Qemu-devel] [PULL 45/48] target/ppc: Flush TLB on write to PIDR, David Gibson, 2017/04/26
- Re: [Qemu-devel] [PULL 00/48] ppc-for-2.10 queue 20170426, no-reply, 2017/04/26
- Re: [Qemu-devel] [PULL 00/48] ppc-for-2.10 queue 20170426, Peter Maydell, 2017/04/26