summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_net.c
diff options
context:
space:
mode:
authorAdriano Cordova <adrianox@gmail.com>2025-03-03 11:13:13 -0300
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2025-03-10 06:41:10 +0100
commit6a832d4b2e5d4d1ebc9d036afcc02d9550257ab2 (patch)
tree1834b2f4a356528d9c3dcefdd1f838bc0509fd5e /lib/efi_loader/efi_net.c
parentfba5be3b60f6549483c6bb9e441c1f4e468d31b8 (diff)
efi_loader: efi_net: Add efi_net_do_start() to efi_net.c
This gets called each time a payload is to get executed by bootefi. For now this only updates the PXE IP address. Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
Diffstat (limited to 'lib/efi_loader/efi_net.c')
-rw-r--r--lib/efi_loader/efi_net.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
index afca2000e6f..27fc4014112 100644
--- a/lib/efi_loader/efi_net.c
+++ b/lib/efi_loader/efi_net.c
@@ -879,6 +879,30 @@ static efi_status_t EFIAPI efi_pxe_base_code_set_packets(
}
/**
+ * efi_net_do_start() - start the efi network stack
+ *
+ * This gets called from do_bootefi_exec() each time a payload gets executed.
+ *
+ * Return: status code
+ */
+efi_status_t efi_net_do_start(void)
+{
+ efi_status_t r = EFI_SUCCESS;
+
+#ifdef CONFIG_EFI_HTTP_PROTOCOL
+ /*
+ * No harm on doing the following. If the PXE handle is present, the client could
+ * find it and try to get its IP address from it. In here the PXE handle is present
+ * but the PXE protocol is not yet implmenented, so we add this in the meantime.
+ */
+ efi_net_get_addr((struct efi_ipv4_address *)&netobj->pxe_mode.station_ip,
+ (struct efi_ipv4_address *)&netobj->pxe_mode.subnet_mask, NULL);
+#endif
+
+ return r;
+}
+
+/**
* efi_net_register() - register the simple network protocol
*
* This gets called from do_bootefi_exec().
@@ -1022,13 +1046,6 @@ efi_status_t efi_net_register(void)
r = efi_http_register(&netobj->header, &netobj->http_service_binding);
if (r != EFI_SUCCESS)
goto failure_to_add_protocol;
- /*
- * No harm on doing the following. If the PXE handle is present, the client could
- * find it and try to get its IP address from it. In here the PXE handle is present
- * but the PXE protocol is not yet implmenented, so we add this in the meantime.
- */
- efi_net_get_addr((struct efi_ipv4_address *)&netobj->pxe_mode.station_ip,
- (struct efi_ipv4_address *)&netobj->pxe_mode.subnet_mask, NULL);
#endif
return EFI_SUCCESS;