]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[efi] Add efi_path_vlan() utility function
authorMichael Brown <mcb30@ipxe.org>
Thu, 22 Dec 2022 14:27:56 +0000 (14:27 +0000)
committerMichael Brown <mcb30@ipxe.org>
Thu, 22 Dec 2022 14:27:56 +0000 (14:27 +0000)
commitb9571ca12ed80472051663e2618dfe083f995da3
tree9e04c6e86af2a67ed5be0ad517672417058f1eaf
parent099e4d39b355a10b0bc7d23bb0e96615bf06470b
[efi] Add efi_path_vlan() utility function

EFI provides no API for determining the VLAN tag (if any) for a
specified device handle.  There is the EFI_VLAN_CONFIG_PROTOCOL, but
that exists only on the trunk device handle (not on the VLAN device
handle), and provides no way to match VLAN tags against the trunk
device's child device handles.

The EDK2 codebase seems to rely solely on the device path to determine
the VLAN tag for a specified device handle: both NetLibGetVlanId() and
BmGetNetworkDescription() will parse the device path to search for a
VLAN_DEVICE_PATH component.

Add efi_path_vlan() which uses the same device path parsing logic to
determine the VLAN tag.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/efi/efi_path.h
src/interface/efi/efi_path.c