diff options
-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 */ |