]> git.baikalelectronics.ru Git - uboot.git/commitdiff
efi_loader: Let networking support depend on NETDEVICES
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 14 Oct 2022 16:10:06 +0000 (18:10 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 6 Nov 2022 09:50:04 +0000 (10:50 +0100)
CONFIG_NET does not imply that there are actually network devices
available, only CONFIG_NETDEVICES does. Changing to this dependency
obsoletes the check in Kconfig because NETDEVICES means DM_ETH.

Fixes: 0efe1bcf5c2c ("efi_loader: Add network access support")
Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/Kconfig
lib/efi_loader/Makefile
lib/efi_loader/efi_device_path.c
lib/efi_loader/efi_setup.c
lib/efi_selftest/Makefile
net/bootp.c

index 41756ea53961cb7b7f009d1bb24c4b71347f4fd0..68e6c2531e10d6964587bcdd463395a457f944cd 100644 (file)
@@ -11,7 +11,6 @@ config EFI_LOADER
        # We need EFI_STUB_32BIT to be set on x86_32 with EFI_STUB
        depends on !EFI_STUB || !X86 || X86_64 || EFI_STUB_32BIT
        depends on BLK
-       depends on DM_ETH || !NET
        depends on !EFI_APP
        default y if !ARM || SYS_CPU = armv7 || SYS_CPU = armv8
        select CHARSET
index f8e8afe1284b89356140978690ca231964e24169..8738757dd2c16b8e980e511aa578bb89ec84c065 100644 (file)
@@ -68,7 +68,7 @@ obj-y += efi_watchdog.o
 obj-$(CONFIG_EFI_ESRT) += efi_esrt.o
 obj-$(CONFIG_VIDEO) += efi_gop.o
 obj-$(CONFIG_BLK) += efi_disk.o
-obj-$(CONFIG_NET) += efi_net.o
+obj-$(CONFIG_NETDEVICES) += efi_net.o
 obj-$(CONFIG_GENERATE_ACPI_TABLE) += efi_acpi.o
 obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += efi_smbios.o
 obj-$(CONFIG_EFI_RNG_PROTOCOL) += efi_rng.o
index acae007f26f5be1401bb8bac762bb1ea08740908..d45985a760124452f009030f6b942a4beed2689f 100644 (file)
@@ -613,7 +613,7 @@ __maybe_unused static void *dp_fill(void *buf, struct udevice *dev)
                *vdp = ROOT;
                return &vdp[1];
        }
-#ifdef CONFIG_NET
+#ifdef CONFIG_NETDEVICES
        case UCLASS_ETH: {
                struct efi_device_path_mac_addr *dp =
                        dp_fill(buf, dev->parent);
@@ -1052,7 +1052,7 @@ struct efi_device_path *efi_dp_from_uart(void)
        return buf;
 }
 
-#ifdef CONFIG_NET
+#ifdef CONFIG_NETDEVICES
 struct efi_device_path *efi_dp_from_eth(void)
 {
        void *buf, *start;
@@ -1169,7 +1169,7 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
                return EFI_INVALID_PARAMETER;
 
        if (!strcmp(dev, "Net")) {
-#ifdef CONFIG_NET
+#ifdef CONFIG_NETDEVICES
                if (device)
                        *device = efi_dp_from_eth();
 #endif
index a340bc38806042a7d197e67e543006a9cf153d50..e40f64fd0e6750021c232261dc6a4542405645c5 100644 (file)
@@ -331,7 +331,7 @@ efi_status_t efi_init_obj_list(void)
                if (ret != EFI_SUCCESS)
                        goto out;
        }
-#ifdef CONFIG_NET
+#ifdef CONFIG_NETDEVICES
        ret = efi_net_register();
        if (ret != EFI_SUCCESS)
                goto out;
index daac6c3968206f0fc8727785f45675f55bbcf4ff..e4d75420bff6ab4e37c4bb11f266ae879c5b9c06 100644 (file)
@@ -50,7 +50,7 @@ efi_selftest_variables_runtime.o \
 efi_selftest_watchdog.o
 
 obj-$(CONFIG_EFI_ECPT) += efi_selftest_ecpt.o
-obj-$(CONFIG_NET) += efi_selftest_snp.o
+obj-$(CONFIG_NETDEVICES) += efi_selftest_snp.o
 
 obj-$(CONFIG_EFI_DEVICE_PATH_TO_TEXT) += efi_selftest_devicepath.o
 obj-$(CONFIG_EFI_UNICODE_COLLATION_PROTOCOL2) += \
index b260d5d09e6d04b408d25e1e02fd89b9937bdf6f..6c01e3815320b2660b15368e4047fcb06cd9397e 100644 (file)
@@ -1077,7 +1077,9 @@ static void dhcp_handler(uchar *pkt, unsigned dest, struct in_addr sip,
                            strlen(CONFIG_SYS_BOOTFILE_PREFIX)) == 0) {
 #endif /* CONFIG_SYS_BOOTFILE_PREFIX */
                        dhcp_packet_process_options(bp);
-                       efi_net_set_dhcp_ack(pkt, len);
+                       if (CONFIG_IS_ENABLED(EFI_LOADER) &&
+                           CONFIG_IS_ENABLED(NET_DEVICES))
+                               efi_net_set_dhcp_ack(pkt, len);
 
 #if defined(CONFIG_SERVERIP_FROM_PROXYDHCP)
                        if (!net_server_ip.s_addr)