From 415f13372dc957f96a6576aac923e699cacf4133 Mon Sep 17 00:00:00 2001 From: Bowen Wang Date: Fri, 26 Jan 2024 17:35:17 +0800 Subject: [PATCH] x86_64_netinitialize: support CONFIG_NETDEV_LATEINIT for x86_64 Now x86_64 can use config CONFIG_NETDEV_LATEINIT Signed-off-by: Bowen Wang --- arch/x86_64/src/common/x86_64_initialize.c | 2 ++ arch/x86_64/src/common/x86_64_internal.h | 2 +- boards/x86_64/intel64/qemu-intel64/src/qemu_net.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86_64/src/common/x86_64_initialize.c b/arch/x86_64/src/common/x86_64_initialize.c index b9f32c2d25..db124d327e 100644 --- a/arch/x86_64/src/common/x86_64_initialize.c +++ b/arch/x86_64/src/common/x86_64_initialize.c @@ -117,7 +117,9 @@ void up_initialize(void) /* Initialize the network */ +#ifndef CONFIG_NETDEV_LATEINIT x86_64_netinitialize(); +#endif /* Initialize USB -- device and/or host */ diff --git a/arch/x86_64/src/common/x86_64_internal.h b/arch/x86_64/src/common/x86_64_internal.h index f98d9605bf..072e7210c7 100644 --- a/arch/x86_64/src/common/x86_64_internal.h +++ b/arch/x86_64/src/common/x86_64_internal.h @@ -221,7 +221,7 @@ void x86_64_timer_initialize(void); /* Defined in board/x86_64_network.c */ -#ifdef CONFIG_NET +#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) void x86_64_netinitialize(void); #else # define x86_64_netinitialize() diff --git a/boards/x86_64/intel64/qemu-intel64/src/qemu_net.c b/boards/x86_64/intel64/qemu-intel64/src/qemu_net.c index 7514c9dfd7..d538dae96f 100644 --- a/boards/x86_64/intel64/qemu-intel64/src/qemu_net.c +++ b/boards/x86_64/intel64/qemu-intel64/src/qemu_net.c @@ -49,7 +49,7 @@ * ****************************************************************************/ -#ifdef CONFIG_NET +#if defined(CONFIG_NET) && !defined(CONFIG_NETDEV_LATEINIT) void x86_64_netinitialize(void) { }