efi_loader: efi_net: Add device path cache
In preparation to support mutiple efi net udevices. Add a device path
cache to support device paths from multiple ethernet udevices.
The device paths can be added to the cache before EFI gets initialized and
the protocols get installed.
Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
index 64183d4..c9bf272 100644
--- a/lib/efi_loader/efi_device_path.c
+++ b/lib/efi_loader/efi_device_path.c
@@ -1048,7 +1048,7 @@
(!server && IS_ENABLED(CONFIG_NET_LWIP)))
return NULL;
- efi_net_get_addr(&ip, &mask, NULL);
+ efi_net_get_addr(&ip, &mask, NULL, dev);
dp1 = efi_dp_from_ipv4(&ip, &mask, NULL, dev);
if (!dp1)
@@ -1189,8 +1189,8 @@
dp = efi_dp_from_mem(EFI_RESERVED_MEMORY_TYPE,
(uintptr_t)image_addr, image_size);
} else if (IS_ENABLED(CONFIG_NETDEVICES) &&
- (!strcmp(dev, "Net") || !strcmp(dev, "Http"))) {
- efi_net_get_dp(&dp);
+ (!strcmp(dev, "Net") || !strcmp(dev, "Http"))) {
+ efi_net_dp_from_dev(&dp, eth_get_dev(), false);
} else if (!strcmp(dev, "Uart")) {
dp = efi_dp_from_uart();
} else {