diff --git a/system/fastboot/Kconfig b/system/fastboot/Kconfig index f5b14cd02..0842bcb0d 100644 --- a/system/fastboot/Kconfig +++ b/system/fastboot/Kconfig @@ -45,4 +45,11 @@ config SYSTEM_FASTBOOTD_SHELL e.g. fastboot oem shell ps e.g. fastboot oem shell "mkrd -m 10 -s 512 640" +config SYSTEM_FASTBOOTD_NET_INIT + bool "Network initialization" + default n + select NETUTILS_NETINIT + ---help--- + This option enables/disables all network initialization in fastboot server. + endif # SYSTEM_FASTBOOTD diff --git a/system/fastboot/fastboot.c b/system/fastboot/fastboot.c index b20be6b7d..2a24e9b9f 100644 --- a/system/fastboot/fastboot.c +++ b/system/fastboot/fastboot.c @@ -52,6 +52,10 @@ #include #include +#ifdef CONFIG_SYSTEM_FASTBOOTD_NET_INIT +# include "netutils/netinit.h" +#endif + /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ @@ -1259,6 +1263,12 @@ static int fastboot_tcp_initialize(FAR struct fastboot_ctx_s *ctx) { struct sockaddr_in addr; +#ifdef CONFIG_SYSTEM_FASTBOOTD_NET_INIT + /* Bring up the network */ + + netinit_bringup(); +#endif + ctx->tran_fd[0] = socket(AF_INET, SOCK_STREAM, SOCK_CLOEXEC | SOCK_NONBLOCK); if (ctx->tran_fd[0] < 0)