]> git.sur5r.net Git - u-boot/commitdiff
net: add 'ethrotate' environment variable
authorMatthias Fuchs <matthias.fuchs@esd-electronics.com>
Thu, 17 Jan 2008 06:45:05 +0000 (07:45 +0100)
committerBen Warren <biggerbadderben@gmail.com>
Thu, 17 Jan 2008 14:41:09 +0000 (09:41 -0500)
[PATCH] net: add 'ethrotate' environment variable

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

Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
README
net/eth.c

diff --git a/README b/README
index f2a4914923876bead95b28d8d55caf3c87221353..d9c2ee2ed8151c801064105a01c343c49aeff15f 100644 (file)
--- a/README
+++ b/README
@@ -2691,6 +2691,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
index 63a4cb652a2c3d06540544b3b3aaac20a36480df..316e8177862d8c0d47a30395fd5ab57ef1ed11db 100644 (file)
--- a/net/eth.c
+++ b/net/eth.c
@@ -525,6 +525,15 @@ int eth_receive(volatile void *packet, int length)
 void eth_try_another(int first_restart)
 {
        static struct eth_device *first_failed = NULL;
+       char *ethrotate;
+
+       /*
+        * Do not rotate between network interfaces when
+        * 'ethrotate' variable is set to 'no'.
+        */
+       if (((ethrotate = getenv ("ethrotate")) != NULL) &&
+           (strcmp(ethrotate, "no") == 0))
+               return;
 
        if (!eth_current)
                return;