[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [PATCH 08/21] ipmi: introduce an ipmi_bmc_sdr_find() API
From: |
Cédric Le Goater |
Subject: |
Re: [Qemu-ppc] [PATCH 08/21] ipmi: introduce an ipmi_bmc_sdr_find() API |
Date: |
Thu, 6 Apr 2017 09:36:34 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 04/06/2017 07:36 AM, David Gibson wrote:
> On Wed, Apr 05, 2017 at 02:41:33PM +0200, Cédric Le Goater wrote:
>> 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>
>
> I don't know much about IPMI, but since it has Corey's ack, I've
> staged 5..8/21 in my for-2.10 tree.
thanks for doing so. The patchset needs the interface introduced in
patch 9 and 10 to build the sensor nodes in the device tree and to
generate shutdown events which is important for the machine.
> 9 I've left for now, since Corey has comments.
It's patch 10 in fact which is about the SET_SENSOR_READING command.
I think this is the most complex command in the IPMI specs ... It's
not a strong requirement for the firmware but as I have started it
I am trying to reach a minimal and correct implementation ... It really
is giving me headaches tough. I am glad that Corey is giving some
support.
C.
>> ---
>> 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 eae7b2d8c92b..8185a84b76b9 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 91b83b5bb0b6..0d36cfc6b7f3 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
>
- Re: [Qemu-ppc] [PATCH 04/21] ppc/pnv: enable only one LPC bus, (continued)
- Re: [Qemu-ppc] [PATCH 04/21] ppc/pnv: enable only one LPC bus, Benjamin Herrenschmidt, 2017/04/06
- Re: [Qemu-ppc] [PATCH 04/21] ppc/pnv: enable only one LPC bus, Cédric Le Goater, 2017/04/06
- Re: [Qemu-ppc] [PATCH 04/21] ppc/pnv: enable only one LPC bus, Benjamin Herrenschmidt, 2017/04/06
- Re: [Qemu-ppc] [PATCH 04/21] ppc/pnv: enable only one LPC bus, Cédric Le Goater, 2017/04/07
- Re: [Qemu-ppc] [PATCH 04/21] ppc/pnv: enable only one LPC bus, David Gibson, 2017/04/08
[Qemu-ppc] [PATCH 05/21] ppc: add IPMI support, Cédric Le Goater, 2017/04/05
[Qemu-ppc] [PATCH 06/21] ipmi: use a file to load SDRs, Cédric Le Goater, 2017/04/05
[Qemu-ppc] [PATCH 07/21] ipmi: provide support for FRUs, Cédric Le Goater, 2017/04/05
[Qemu-ppc] [PATCH 08/21] ipmi: introduce an ipmi_bmc_sdr_find() API, Cédric Le Goater, 2017/04/05
[Qemu-ppc] [PATCH 09/21] ipmi: introduce an ipmi_bmc_gen_event() API, Cédric Le Goater, 2017/04/05
[Qemu-ppc] [PATCH 10/21] ipmi: add SET_SENSOR_READING command, Cédric Le Goater, 2017/04/05
[Qemu-ppc] [PATCH 11/21] ppc/pnv: scan ISA bus to populate device tree, Cédric Le Goater, 2017/04/05