From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: u-boot@lists.denx.de
Subject: [PATCH 2/2] efi_selftest: multi part device path to text
Date: Fri, 19 Feb 2021 12:15:09 +0200 [thread overview]
Message-ID: <YC+PrVgsLDJA9Hai@enceladus> (raw)
In-Reply-To: <20210218173044.127456-3-xypron.glpk@gmx.de>
On Thu, Feb 18, 2021 at 06:30:44PM +0100, Heinrich Schuchardt wrote:
> Test EFI_DEVICE_PATH_TO_TEXT_PROTOCOL.ConvertDevicePathToText() for a multi
> part device path.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> lib/efi_selftest/efi_selftest_devicepath.c | 65 ++++++++++++++++++++++
> 1 file changed, 65 insertions(+)
>
> diff --git a/lib/efi_selftest/efi_selftest_devicepath.c b/lib/efi_selftest/efi_selftest_devicepath.c
> index 4ce3fad895..d87b9f7dcd 100644
> --- a/lib/efi_selftest/efi_selftest_devicepath.c
> +++ b/lib/efi_selftest/efi_selftest_devicepath.c
> @@ -45,6 +45,55 @@ static u8 *dp1;
> static u8 *dp2;
> static u8 *dp3;
>
> +static struct {
> + struct efi_device_path_sd_mmc_path sd1;
> + struct efi_device_path sep1;
> + struct efi_device_path_sd_mmc_path sd2;
> + struct efi_device_path sep2;
> + struct efi_device_path_sd_mmc_path sd3;
> + struct efi_device_path end;
> +} multi_part_dp = {
> + {
> + {
> + DEVICE_PATH_TYPE_MESSAGING_DEVICE,
> + DEVICE_PATH_SUB_TYPE_MSG_SD,
> + sizeof(struct efi_device_path_sd_mmc_path),
> + },
> + 0,
> + },
> + {
> + DEVICE_PATH_TYPE_END,
> + DEVICE_PATH_SUB_TYPE_INSTANCE_END,
> + sizeof(struct efi_device_path),
> + },
> + {
> + {
> + DEVICE_PATH_TYPE_MESSAGING_DEVICE,
> + DEVICE_PATH_SUB_TYPE_MSG_SD,
> + sizeof(struct efi_device_path_sd_mmc_path),
> + },
> + 1,
> + },
> + {
> + DEVICE_PATH_TYPE_END,
> + DEVICE_PATH_SUB_TYPE_INSTANCE_END,
> + sizeof(struct efi_device_path),
> + },
> + {
> + {
> + DEVICE_PATH_TYPE_MESSAGING_DEVICE,
> + DEVICE_PATH_SUB_TYPE_MSG_SD,
> + sizeof(struct efi_device_path_sd_mmc_path),
> + },
> + 2,
> + },
> + {
> + DEVICE_PATH_TYPE_END,
> + DEVICE_PATH_SUB_TYPE_END,
> + sizeof(struct efi_device_path),
> + },
> +};
> +
> struct efi_device_path_to_text_protocol *device_path_to_text;
>
> /*
> @@ -340,6 +389,22 @@ static int execute(void)
> return EFI_ST_FAILURE;
> }
>
> + string = device_path_to_text->convert_device_path_to_text(
> + (struct efi_device_path *)&multi_part_dp, true, false);
> + if (efi_st_strcmp_16_8(
> + string,
> + "/SD(0),/SD(1),/SD(2)")
> + ) {
> + efi_st_printf("multi_part_dp: %ps\n", string);
> + efi_st_error("Incorrect text from ConvertDevicePathToText\n");
> + return EFI_ST_FAILURE;
> + }
> + ret = boottime->free_pool(string);
> + if (ret != EFI_SUCCESS) {
> + efi_st_error("FreePool failed\n");
> + return EFI_ST_FAILURE;
> + }
> +
> /* Test ConvertDeviceNodeToText */
> string = device_path_to_text->convert_device_node_to_text(
> (struct efi_device_path *)&dp_node, true, false);
> --
> 2.30.0
>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
prev parent reply other threads:[~2021-02-19 10:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-18 17:30 [PATCH 0/2] efi_loader: multi part device paths to text Heinrich Schuchardt
2021-02-18 17:30 ` [PATCH 1/2] " Heinrich Schuchardt
2021-02-19 10:13 ` Ilias Apalodimas
2021-02-19 11:45 ` Heinrich Schuchardt
2021-02-19 12:02 ` Ilias Apalodimas
2021-02-18 17:30 ` [PATCH 2/2] efi_selftest: multi part device path " Heinrich Schuchardt
2021-02-19 10:15 ` Ilias Apalodimas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YC+PrVgsLDJA9Hai@enceladus \
--to=ilias.apalodimas@linaro.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox