From 2dcef4b7a11a780a684a69021a0c91bc43e03883 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sun, 15 Jan 2023 22:42:30 +0000 Subject: [efi] Create VLAN autoboot device automatically When chainloading iPXE from an EFI VLAN device, configure the corresponding iPXE VLAN device to be created automatically. Signed-off-by: Michael Brown --- src/interface/efi/efi_autoboot.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/interface/efi/efi_autoboot.c b/src/interface/efi/efi_autoboot.c index ec7793cd7..a103c2f19 100644 --- a/src/interface/efi/efi_autoboot.c +++ b/src/interface/efi/efi_autoboot.c @@ -25,6 +25,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL ); #include #include +#include +#include #include #include #include @@ -81,6 +83,13 @@ int efi_set_autoboot_ll_addr ( EFI_HANDLE device, efi_handle_name ( device ), vlan ); } + /* Configure automatic VLAN device, if applicable */ + if ( vlan && ( mode->HwAddressSize == ETH_ALEN ) ) { + vlan_auto ( &mode->CurrentAddress, vlan ); + DBGC ( device, "EFI %s configured automatic VLAN %d\n", + efi_handle_name ( device ), vlan ); + } + /* Close protocol */ bs->CloseProtocol ( device, &efi_simple_network_protocol_guid, efi_image_handle, NULL ); -- cgit