From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Fuchs Date: Thu, 10 Jan 2008 10:03:54 +0100 Subject: [U-Boot-Users] [PATCH V2] net: add 'ethrotate' environment variable In-Reply-To: <20080109215130.E58C7242E7@gemini.denx.de> References: <20080109215130.E58C7242E7@gemini.denx.de> Message-ID: <200801101003.55140.matthias.fuchs@esd-electronics.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This patch replaces the buildtime configuration option CONFIG_NET_DO_NOT_TRY_ANOTHER through the 'ethrotate' runtime configuration variable. See README. Signed-off-by: Matthias Fuchs --- README | 4 ++++ net/net.c | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README b/README index 9a8b3b9..9ca512d 100644 --- a/README +++ b/README @@ -2687,6 +2687,10 @@ Some configuration options can be set using Environment Variables: => setenv ethact SCC ETHERNET => ping 10.0.0.1 # traffic sent on SCC ETHERNET + ethrotate - When set to "no" U-Boot does not go through all + available network interfaces. + It just stays at the currently selected interface. + netretry - When set to "no" each network operation will either succeed or fail without retrying. When set to "once" the network operation will diff --git a/net/net.c b/net/net.c index 44feee2..e1b71a9 100644 --- a/net/net.c +++ b/net/net.c @@ -581,6 +581,7 @@ void NetStartAgain (void) { char *nretry; int noretry = 0, once = 0; + char *ethrotate; if ((nretry = getenv ("netretry")) != NULL) { noretry = (strcmp (nretry, "no") == 0); @@ -596,9 +597,15 @@ void NetStartAgain (void) NetSetHandler (startAgainHandler); #else /* !CONFIG_NET_MULTI*/ eth_halt (); -#if !defined(CONFIG_NET_DO_NOT_TRY_ANOTHER) - eth_try_another (!NetRestarted); -#endif + + /* + * Do not rotate between network interfaces when + * 'ethrotate' variable is set to 'no'. + */ + if (((ethrotate = getenv ("ethrotate")) == NULL) || + (strcmp(ethrotate, "no") != 0)) + eth_try_another (!NetRestarted); + eth_init (gd->bd); if (NetRestartWrap) { NetRestartWrap = 0; -- 1.5.3