Matthias Fuchs wrote:
> [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 <[EMAIL PROTECTED]>
> ---
>  README    |    4 ++++
>  net/eth.c |    9 +++++++++
>  2 files changed, 13 insertions(+), 0 deletions(-)
>
> diff --git a/README b/README
> index f2a4914..d9c2ee2 100644
> --- 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
> diff --git a/net/eth.c b/net/eth.c
> index 5d9e9c1..d55fd7e 100644
> --- a/net/eth.c
> +++ b/net/eth.c
> @@ -522,6 +522,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;
>   
Excellent!  Applied.

thanks,
Ben

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
U-Boot-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to