summaryrefslogtreecommitdiff
path: root/lib/efi_loader/efi_net.c
diff options
context:
space:
mode:
authorAdriano Cordova <adrianox@gmail.com>2024-12-04 00:05:25 -0300
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-12-04 12:24:38 +0100
commit929363cbb35ef9943f9c02938dc23d2c78582c5f (patch)
treec93b3ba63d415c36087dd3a434999386b06fc115 /lib/efi_loader/efi_net.c
parent5a5c5bf40a0ea479426ad3f5c0cbc5afa675786f (diff)
efi_loader: efi_net: add EFI_IP4_CONFIG2_PROTOCOL
Add an implementation of the EFI_IP4_CONFIG2_PROTOCOL. The protocol is attached to the handle of the efi network device. This is the same handle where snp and pxe are attached to. Signed-off-by: Adriano Cordova <adrianox@gmail.com>
Diffstat (limited to 'lib/efi_loader/efi_net.c')
-rw-r--r--lib/efi_loader/efi_net.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c
index 368f62c5b2d..916c15999e2 100644
--- a/lib/efi_loader/efi_net.c
+++ b/lib/efi_loader/efi_net.c
@@ -60,11 +60,12 @@ static struct efi_event *wait_for_packet;
/**
* struct efi_net_obj - EFI object representing a network interface
*
- * @header: EFI object header
- * @net: simple network protocol interface
- * @net_mode: status of the network interface
- * @pxe: PXE base code protocol interface
- * @pxe_mode: status of the PXE base code protocol
+ * @header: EFI object header
+ * @net: simple network protocol interface
+ * @net_mode: status of the network interface
+ * @pxe: PXE base code protocol interface
+ * @pxe_mode: status of the PXE base code protocol
+ * @ip4_config2: IP4 Config2 protocol interface
*/
struct efi_net_obj {
struct efi_object header;
@@ -72,6 +73,9 @@ struct efi_net_obj {
struct efi_simple_network_mode net_mode;
struct efi_pxe_base_code_protocol pxe;
struct efi_pxe_mode pxe_mode;
+#if IS_ENABLED(CONFIG_EFI_IP4_CONFIG2_PROTOCOL)
+ struct efi_ip4_config2_protocol ip4_config2;
+#endif
};
/*
@@ -999,6 +1003,12 @@ efi_status_t efi_net_register(void)
return r;
}
+#if IS_ENABLED(CONFIG_EFI_IP4_CONFIG2_PROTOCOL)
+ r = efi_ipconfig_register(&netobj->header, &netobj->ip4_config2);
+ if (r != EFI_SUCCESS)
+ goto failure_to_add_protocol;
+#endif
+
return EFI_SUCCESS;
failure_to_add_protocol:
printf("ERROR: Failure to add protocol\n");