From f43b2df3e068cc7be1aa5656c0c3223e270bba63 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 17 Jan 2023 10:47:27 -0700 Subject: sandbox: Allow ethernet to be disabled at runtime For bootstd tests it is seldom useful to have ethernet enabled. Add a way to disable it, so that ethernet operations like tftpboot do nothing. Signed-off-by: Simon Glass --- net/net.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'net/net.c') diff --git a/net/net.c b/net/net.c index 57da9bda85a..c9a749f6cc8 100644 --- a/net/net.c +++ b/net/net.c @@ -106,6 +106,7 @@ #endif #include #include +#include #include "arp.h" #include "bootp.h" #include "cdp.h" @@ -465,6 +466,9 @@ restart: debug_cond(DEBUG_INT_STATE, "--- net_loop Init\n"); net_init_loop(); + if (!test_eth_enabled()) + return 0; + switch (net_check_prereq(protocol)) { case 1: /* network not configured */ -- cgit v1.2.3