diff options
author | Masami Hiramatsu <masami.hiramatsu@linaro.org> | 2021-09-16 17:53:27 +0900 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-10-21 03:46:03 +0200 |
commit | 39a37adf51f88aca245c40ce8652be5c9c5277b9 (patch) | |
tree | 4d14ae4280744f18d5682b4324e21068115d2ab4 /lib | |
parent | 6b7b9ff14daa130f220310810963acb9e0c36c6d (diff) | |
download | u-boot-39a37adf51f88aca245c40ce8652be5c9c5277b9.tar.gz u-boot-39a37adf51f88aca245c40ce8652be5c9c5277b9.tar.bz2 u-boot-39a37adf51f88aca245c40ce8652be5c9c5277b9.zip |
efi_selftest: Use EFI_SIMPLE_NETWORK_PROTOCOL::GetStatus() for media check
According to the UEF specification v2.9, the main purpose of the
EFI_SIMPLE_NETWORK_PROTOCOL::GetStatus() is for checking the link
status via EFI_SIMPLE_NETWORK_MODE::MediaPresent.
So this uses net->get_status() for checking the link status before
running network test.
Signed-off-by: Masami Hiramatsu <masami.hiramatsu@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_selftest/efi_selftest_snp.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/efi_selftest/efi_selftest_snp.c b/lib/efi_selftest/efi_selftest_snp.c index 79f0467803..cb0db7eea2 100644 --- a/lib/efi_selftest/efi_selftest_snp.c +++ b/lib/efi_selftest/efi_selftest_snp.c @@ -309,6 +309,18 @@ static int execute(void) return EFI_ST_FAILURE; } + /* Check media connected */ + ret = net->get_status(net, NULL, NULL); + if (ret != EFI_SUCCESS) { + efi_st_error("Failed to get status"); + return EFI_ST_FAILURE; + } + if (net->mode && net->mode->media_present_supported && + !net->mode->media_present) { + efi_st_error("Network media is not connected"); + return EFI_ST_FAILURE; + } + /* * Send DHCP discover message */ |