Module Name: src Committed By: rin Date: Mon Jan 1 13:38:57 UTC 2024
Modified Files: src/sys/stand/efiboot: efinet.c Log Message: MI efiboot: Revert "Stop using efi_bootdp after exclusive open for PXE" http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/stand/efiboot/efinet.c#rev1.7 Some UEFI implementations pass multiple boot options as boot device path, and NULL-clearing it results in boot failures. Thanks skrll@ for pointing it out. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/stand/efiboot/efinet.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/stand/efiboot/efinet.c diff -u src/sys/stand/efiboot/efinet.c:1.8 src/sys/stand/efiboot/efinet.c:1.9 --- src/sys/stand/efiboot/efinet.c:1.8 Wed Dec 27 09:40:35 2023 +++ src/sys/stand/efiboot/efinet.c Mon Jan 1 13:38:57 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: efinet.c,v 1.8 2023/12/27 09:40:35 rin Exp $ */ +/* $NetBSD: efinet.c,v 1.9 2024/01/01 13:38:57 rin Exp $ */ /*- * Copyright (c) 2001 Doug Rabson @@ -333,7 +333,7 @@ efi_net_probe(void) EFI_STATUS status; UINTN i, nhandles; int nifs, depth = -1; - bool found, is_bootdp; + bool found; status = LibLocateHandle(ByProtocol, &SimpleNetworkProtocol, NULL, &nhandles, &handles); @@ -377,9 +377,6 @@ efi_net_probe(void) if (!found) continue; - is_bootdp = depth > 0 && - efi_device_path_ncmp(efi_bootdp, dp0, depth) == 0; - status = uefi_call_wrapper(BS->OpenProtocol, 6, handles[i], &SimpleNetworkProtocol, (void **)&net, IH, NULL, EFI_OPEN_PROTOCOL_EXCLUSIVE); @@ -407,21 +404,10 @@ efi_net_probe(void) return; } - if (is_bootdp) { - /* - * This is boot device... - */ + if (depth > 0 && efi_device_path_ncmp(efi_bootdp, dp0, depth) == 0) { char devname[9]; - snprintf(devname, sizeof(devname), "net%u", nifs); set_default_device(devname); - - /* - * and now opened for us excluively. Therefore, - * access via device path is illegal. - */ - efi_bootdp = NULL; - depth = -1; } nifs++;