[Skiboot] [PATCH V2 06/15] core/pldm: Find PDR record by record handle

Christophe Lombard clombard at linux.ibm.com
Wed May 17 00:14:14 AEST 2023



Le 26/04/2023 à 15:39, Frederic Barrat a écrit :
>
>
> On 29/04/2022 11:47, Christophe Lombard wrote:
>> Add a wrapper for the libpldm api: pldm_pdr_find_record()
>>
>> Signed-off-by: Christophe Lombard <clombard at linux.vnet.ibm.com>
>> ---
>>   core/pldm/pldm-platform-requests.c | 22 ++++++++++++++++++++++
>>   core/pldm/pldm.h                   |  4 ++++
>>   2 files changed, 26 insertions(+)
>>
>> diff --git a/core/pldm/pldm-platform-requests.c 
>> b/core/pldm/pldm-platform-requests.c
>> index c3baad54..a84712d0 100644
>> --- a/core/pldm/pldm-platform-requests.c
>> +++ b/core/pldm/pldm-platform-requests.c
>> @@ -32,6 +32,28 @@ static void pdr_init_complete(bool success)
>>       pdr_ready = true;
>>   }
>>   +/*
>> + * Find PDR record by record handle.
>> + */
>> +int pldm_platform_pdr_find_record(uint32_t record_handle,
>> +                  uint8_t **pdr_data,
>> +                  uint32_t *pdr_data_size,
>> +                  uint32_t *next_record_handle)
>> +{
>> +    const pldm_pdr_record *pdr_record;
>> +
>
>
> We should test for the validity of "repo" here.
>

Correct. Thanks

> Fred
>
>
>> +    pdr_record = pldm_pdr_find_record(repo,
>> +                      record_handle,
>> +                      pdr_data,
>> +                      pdr_data_size,
>> +                      next_record_handle);
>> +
>> +    if (!pdr_record)
>> +        return OPAL_PARAMETER;
>> +
>> +    return OPAL_SUCCESS;
>> +}
>> +
>>   /*
>>    * Search the matching record and return the effecter id.
>>    * PDR type = PLDM_STATE_EFFECTER_PDR
>> diff --git a/core/pldm/pldm.h b/core/pldm/pldm.h
>> index 938a554c..bc399271 100644
>> --- a/core/pldm/pldm.h
>> +++ b/core/pldm/pldm.h
>> @@ -80,6 +80,10 @@ int pldm_bios_init(void);
>>     int pldm_base_get_tid_req(void);
>>   +int pldm_platform_pdr_find_record(uint32_t record_handle,
>> +                  uint8_t **pdr_data,
>> +                  uint32_t *pdr_data_size,
>> +                  uint32_t *next_record_handle);
>>   int plmd_platform_reload_pdrs(void);
>>   int pldm_platform_init(void);
>>   void pldm_platform_exit(void);



More information about the Skiboot mailing list