summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/efi/efi_path.h
diff options
context:
space:
mode:
authorMichael Brown2022-12-22 15:27:56 +0100
committerMichael Brown2022-12-22 15:27:56 +0100
commitb9571ca12ed80472051663e2618dfe083f995da3 (patch)
tree9e04c6e86af2a67ed5be0ad517672417058f1eaf /src/include/ipxe/efi/efi_path.h
parent[efi] Expose efi_path_next() utility function (diff)
downloadipxe-b9571ca12ed80472051663e2618dfe083f995da3.tar.gz
ipxe-b9571ca12ed80472051663e2618dfe083f995da3.tar.xz
ipxe-b9571ca12ed80472051663e2618dfe083f995da3.zip
[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>
Diffstat (limited to 'src/include/ipxe/efi/efi_path.h')
-rw-r--r--src/include/ipxe/efi/efi_path.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/include/ipxe/efi/efi_path.h b/src/include/ipxe/efi/efi_path.h
index 18810a75..9dea74b5 100644
--- a/src/include/ipxe/efi/efi_path.h
+++ b/src/include/ipxe/efi/efi_path.h
@@ -26,6 +26,7 @@ efi_path_next ( EFI_DEVICE_PATH_PROTOCOL *path );
extern EFI_DEVICE_PATH_PROTOCOL *
efi_path_end ( EFI_DEVICE_PATH_PROTOCOL *path );
extern size_t efi_path_len ( EFI_DEVICE_PATH_PROTOCOL *path );
+extern unsigned int efi_path_vlan ( EFI_DEVICE_PATH_PROTOCOL *path );
extern EFI_DEVICE_PATH_PROTOCOL * efi_paths ( EFI_DEVICE_PATH_PROTOCOL *first,
... );
extern EFI_DEVICE_PATH_PROTOCOL * efi_netdev_path ( struct net_device *netdev );