[Skiboot] [PATCH V6 08/21] core/pldm: Encode GetPLDMVersion response
Joel Stanley
joel at jms.id.au
Thu Apr 13 16:38:59 AEST 2023
On Tue, 13 Sept 2022 at 10:30, Christophe Lombard
<clombard at linux.vnet.ibm.com> wrote:
>
> The GetPLDMVersion command can be used to retrieve the PLDM base
> specification versions that the PLDM terminus supports, as well as the
> PLDM Type specification versions supported for each PLDM Type.
>
> The reported version for Type 0 (PLDMbase) shall be encoded as 0xF1F1F000.
>
> Reviewed-by: Abhishek Singh Tomar <abhishek at linux.ibm.com>
What happened to the format of the mail address here?
> Signed-off-by: Christophe Lombard <clombard at linux.vnet.ibm.com>
> ---
> core/pldm/pldm-responder.c | 84 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 84 insertions(+)
>
> diff --git a/core/pldm/pldm-responder.c b/core/pldm/pldm-responder.c
> index 88545685..230b9c05 100644
> --- a/core/pldm/pldm-responder.c
> +++ b/core/pldm/pldm-responder.c
> @@ -208,6 +208,7 @@ static struct pldm_cmd pldm_base_get_types = {
> /*
> * Extended error codes defined for the Base command set.
> */
> +#define INVALID_TRANSFER_OPERATION_FLAG 0x80
> #define INVALID_PLDM_TYPE_IN_REQUEST_DATA 0x83
> #define INVALID_PLDM_VERSION_IN_REQUEST_DATA 0x84
>
> @@ -294,6 +295,88 @@ static struct pldm_cmd pldm_base_get_commands = {
> .handler = base_get_commands_handler,
> };
>
> +/*
> + * GetPLDMVersion (0x03)
> + * The GetPLDMVersion command can be used to retrieve the PLDM base
> + * specification versions that the PLDM terminus supports, as well as
> + * the PLDM Type specification versions supported for each PLDM Type.
> + */
> +static int base_get_version_handler(const struct pldm_rx_data *req)
> +{
> + uint32_t tmp[2];
> + char response_msg[PKT_SIZE(struct pldm_get_version_resp) + sizeof(tmp)];
This PKT_SIZE macro is unfortunately named. It's not obvious that it's
exported by the pldm library.
I went hunting as I was wondering how big the allocation would be.
Would it be safer to use malloc?
Finally, can you explain what's going on with the buffer named "tmp"
tacked onto the end?
More information about the Skiboot
mailing list