summaryrefslogtreecommitdiff
path: root/sys/arch/arm64/stand/efiboot/efipxe.c
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2020-05-18 12:14:34 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2020-05-18 12:14:34 +0000
commit55944ac0535a0d5fb9727b508db145e482236caf (patch)
tree170cb0881d4bfc4a1ab9721f95b2bf4d4d325384 /sys/arch/arm64/stand/efiboot/efipxe.c
parent813632fd435e4a9b06da75c682ce162490868708 (diff)
Our check to see if the EFI services support Mtftp() doesn't work
on U-Boot anymore, since we checked if the method is provided, but now U-Boot provides a simple stub that only returns EFI_UNSUPPORTED. A proper UEFI would throw EFI_INVALID_PARAMETER if we pass NULL as first parameter, but U-Boot doesn't. This way we can see if the method is actually provided and not just a stub. ok kettenis@
Diffstat (limited to 'sys/arch/arm64/stand/efiboot/efipxe.c')
-rw-r--r--sys/arch/arm64/stand/efiboot/efipxe.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/arch/arm64/stand/efiboot/efipxe.c b/sys/arch/arm64/stand/efiboot/efipxe.c
index fb01d65aceb..9acf452ab8b 100644
--- a/sys/arch/arm64/stand/efiboot/efipxe.c
+++ b/sys/arch/arm64/stand/efiboot/efipxe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: efipxe.c,v 1.7 2019/08/20 23:38:19 patrick Exp $ */
+/* $OpenBSD: efipxe.c,v 1.8 2020/05/18 12:14:33 patrick Exp $ */
/*
* Copyright (c) 2017 Patrick Wildt <patrick@blueri.se>
*
@@ -113,8 +113,12 @@ efi_pxeprobe(void)
if (pxe->Mode == NULL)
continue;
- if (pxe->Mtftp != NULL)
- use_mtftp = 1;
+ if (pxe->Mtftp != NULL) {
+ status = EFI_CALL(pxe->Mtftp, NULL, 0, NULL,
+ FALSE, NULL, NULL, NULL, NULL, NULL, FALSE);
+ if (status != EFI_UNSUPPORTED)
+ use_mtftp = 1;
+ }
dhcp = (EFI_PXE_BASE_CODE_DHCPV4_PACKET *)&pxe->Mode->DhcpAck;
memcpy(&bootip, dhcp->BootpYiAddr, sizeof(bootip));