public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] net: add 'ethtoggle' environment variable
@ 2008-01-09 16:56 Matthias Fuchs
  2008-01-09 17:45 ` Ben Warren
  2008-01-09 21:51 ` Wolfgang Denk
  0 siblings, 2 replies; 16+ messages in thread
From: Matthias Fuchs @ 2008-01-09 16:56 UTC (permalink / raw)
  To: u-boot

This patch replaces the buildtime configuration option
CONFIG_NET_DO_NOT_TRY_ANOTHER through the 'ethtoggle' runtime
configuration veriable. See README.

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
---
 README    |    4 ++++
 net/net.c |   13 ++++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/README b/README
index 9a8b3b9..9eac840 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
 
+  ethtoggle	- When set to "no" U-Boot does not go through all
+		  available network interfaces.
+		  It just stays at the default 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..48ccd96 100644
--- a/net/net.c
+++ b/net/net.c
@@ -581,6 +581,7 @@ void NetStartAgain (void)
 {
 	char *nretry;
 	int noretry = 0, once = 0;
+	char *ethtoggle;
 
 	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 toggle between network interfaces when
+	 * 'ethtoggle' variable is set to 'no'.
+	 */
+	if (((ethtoggle = getenv ("ethtoggle")) == NULL) ||
+	    (strcmp(ethtoggle, "no") != 0))
+		eth_try_another (!NetRestarted);
+
 	eth_init (gd->bd);
 	if (NetRestartWrap) {
 		NetRestartWrap = 0;
-- 
1.5.3

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2008-01-16 11:31 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-09 16:56 [U-Boot-Users] [PATCH] net: add 'ethtoggle' environment variable Matthias Fuchs
2008-01-09 17:45 ` Ben Warren
2008-01-09 21:55   ` Matthias Fuchs
2008-01-09 21:58   ` Wolfgang Denk
2008-01-09 22:10     ` Ben Warren
2008-01-09 22:11     ` Kim Phillips
2008-01-09 22:14       ` Ben Warren
2008-01-09 22:51         ` Wolfgang Denk
2008-01-09 23:09         ` Matthias Fuchs
2008-01-10  0:33           ` Ben Warren
2008-01-10  9:02             ` Matthias Fuchs
2008-01-09 21:51 ` Wolfgang Denk
2008-01-10  9:03   ` [U-Boot-Users] [PATCH V2] net: add 'ethrotate' " Matthias Fuchs
2008-01-10 16:21     ` Ben Warren
2008-01-12  2:49     ` Ben Warren
2008-01-16 11:31       ` Matthias Fuchs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox