net: add 'ethtoggle' environment variable
PATCH 1/1 net: add 'ethtoggle' environment variable
This patch replaces the buildtime configuration option CONFIG_NET_DO_NOT_TRY_ANOTHER through the 'ethtoggle' runtime configuration veriable. See README.
--- README | 4 ++++ net/net.c | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
README +4 -0
@@ -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
net/net.c +10 -3
@@ -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 ;
Signature · 1 line
1.5.3
PATCH 1/1 net: add 'ethtoggle' environment variable
Quoted 4 lines · Matthias Fuchs
This patch replaces the buildtime configuration option
CONFIG_NET_DO_NOT_TRY_ANOTHERthrough the 'ethtoggle' runtime configuration veriable. See README.
Good idea, but surely you can come up with a better word than 'ethtoggle'... It sounds like something Elmo would show to Big Bird and doesn't have anything to do with automatically advancing devices. Of course, I don't have any useful suggestions, but will think about it.
cheers,
Ben
PATCH 1/1 net: add 'ethtoggle' environment variable
Hi Ben,
'ethtoggle' is the result of a discussion on irc some hours ago. Arguments have been: no 'eth' prefix and underscore (because 'ethprime' and 'ethact'). It was clear that the name of the variable would be most difficult site of its implementation.
If you suggest a better name, I am willing to rename it:-)
Matthias
Quoted 12 lines · Ben Warren
Quoted 4 lines · Matthias Fuchs
This patch replaces the buildtime configuration option
CONFIG_NET_DO_NOT_TRY_ANOTHERthrough the 'ethtoggle' runtime configuration veriable. See README.Good idea, but surely you can come up with a better word than 'ethtoggle'... It sounds like something Elmo would show to Big Bird and doesn't have anything to do with automatically advancing devices. Of course, I don't have any useful suggestions, but will think about it.
cheers,
Ben
PATCH 1/1 net: add 'ethtoggle' environment variable
In reply to Ben WarrenQuoted 9 lines · In message <[email protected]> you wrote:
Quoted 4 lines · Matthias Fuchs
This patch replaces the buildtime configuration option
CONFIG_NET_DO_NOT_TRY_ANOTHERthrough the 'ethtoggle' runtime configuration veriable. See README.Good idea, but surely you can come up with a better word than 'ethtoggle'... It sounds like something Elmo would show to Big Bird and doesn't have anything to do with automatically advancing devices. Of course, I don't have any useful suggestions, but will think about it.
We discussed this on IRC this afternoon. The name was agreed between Matthias Fuchs, Stefan Roese, Jean-Christophe Plagniol-Villard, and me...
Best regards,
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de HEALTH WARNING: Care Should Be Taken When Lifting This Product, Since Its Mass, and Thus Its Weight, Is Dependent on Its Velocity Relative to the User.
PATCH 1/1 net: add 'ethtoggle' environment variable
Quoted 15 lines · Wolfgang Denk
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 5 lines · Matthias Fuchs
This patch replaces the buildtime configuration option
CONFIG_NET_DO_NOT_TRY_ANOTHERthrough the 'ethtoggle' runtime configuration veriable. See README.Quoted 5 lines
Good idea, but surely you can come up with a better word than 'ethtoggle'... It sounds like something Elmo would show to Big Bird and doesn't have anything to do with automatically advancing devices. Of course, I don't have any useful suggestions, but will think about it.
Quoted 9 lines
We discussed this on IRC this afternoon. The name was agreed between Matthias Fuchs, Stefan Roese, Jean-Christophe Plagniol-Villard, and me...
Best regards,
Wolfgang Denk
Fair enough. Lacking any creativity today, I'll shake my head and pull it in...
regards,
Ben
PATCH 1/1 net: add 'ethtoggle' environment variable
In reply to Wolfgang DenkQuoted 6 lines · On Wed, 09 Jan 2008 22:58:21 +0100 Wolfgang Denk <[email protected]> wrote:
Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 4 lines · Matthias Fuchs
This patch replaces the buildtime configuration option
CONFIG_NET_DO_NOT_TRY_ANOTHERthrough the 'ethtoggle' runtime configuration veriable. See README.
Quoted 9 lines
Quoted 4 lines
Good idea, but surely you can come up with a better word than 'ethtoggle'... It sounds like something Elmo would show to Big Bird and doesn't have anything to do with automatically advancing devices. Of course, I don't have any useful suggestions, but will think about it.
We discussed this on IRC this afternoon. The name was agreed between Matthias Fuchs, Stefan Roese, Jean-Christophe Plagniol-Villard, and me...
toggle to me implies a binary sense, e.g. toggling a switch on/off, whereas this code doesn't turn eth on/off, it enables/disables the round-robin polling of eth devices. 'ethpoll' isn't quite precise enough either; what about 'ethcycle' ?
Kim
PATCH 1/1 net: add 'ethtoggle' environment variable
Quoted 23 lines · Kim Phillips
Quoted 9 lines · On Wed, 09 Jan 2008 22:58:21 +0100 Wolfgang Denk <[email protected]> wrote:
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 5 lines · Matthias Fuchs
This patch replaces the buildtime configuration option
CONFIG_NET_DO_NOT_TRY_ANOTHERthrough the 'ethtoggle' runtime configuration veriable. See README.Quoted 10 lines
Quoted 5 lines
Good idea, but surely you can come up with a better word than 'ethtoggle'... It sounds like something Elmo would show to Big Bird and doesn't have anything to do with automatically advancing devices. Of course, I don't have any useful suggestions, but will think about it.
We discussed this on IRC this afternoon. The name was agreed between Matthias Fuchs, Stefan Roese, Jean-Christophe Plagniol-Villard, and me...
Quoted 8 lines
toggle to me implies a binary sense, e.g. toggling a switch on/off, whereas this code doesn't turn eth on/off, it enables/disables the round-robin polling of eth devices. 'ethpoll' isn't quite precise enough either; what about 'ethcycle' ?
Kim
Getting better...
PATCH 1/1 net: add 'ethtoggle' environment variable
Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 5 lines
toggle to me implies a binary sense, e.g. toggling a switch on/off, whereas this code doesn't turn eth on/off, it enables/disables the round-robin polling of eth devices. 'ethpoll' isn't quite precise enough either; what about 'ethcycle' ?
...
Quoted 1 line
Getting better...
Well, the function that get's called is "eth_try_another()", so maybe "ethtryanother" ;-)
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Build a system that even a fool can use and only a fool will want to use it.
PATCH 1/1 net: add 'ethtoggle' environment variable
In reply to Ben WarrenWhat about 'ethrotate' or 'ethshift' ?
Matthias
Quoted 44 lines · Ben Warren
Quoted 23 lines · Kim Phillips
Quoted 9 lines · On Wed, 09 Jan 2008 22:58:21 +0100 Wolfgang Denk <[email protected]> wrote:
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 5 lines · Matthias Fuchs
This patch replaces the buildtime configuration option
CONFIG_NET_DO_NOT_TRY_ANOTHERthrough the 'ethtoggle' runtime configuration veriable. See README.Quoted 10 lines
Quoted 5 lines
Good idea, but surely you can come up with a better word than 'ethtoggle'... It sounds like something Elmo would show to Big Bird and doesn't have anything to do with automatically advancing devices. Of course, I don't have any useful suggestions, but will think about it.
We discussed this on IRC this afternoon. The name was agreed between Matthias Fuchs, Stefan Roese, Jean-Christophe Plagniol-Villard, and me...
Quoted 8 lines
toggle to me implies a binary sense, e.g. toggling a switch on/off, whereas this code doesn't turn eth on/off, it enables/disables the round-robin polling of eth devices. 'ethpoll' isn't quite precise enough either; what about 'ethcycle' ?
Kim
Getting better...
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
U-Boot-Users mailing list
U-Boot-Users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/u-boot-users
PATCH 1/1 net: add 'ethtoggle' environment variable
Quoted 4 lines · Matthias Fuchs
What about 'ethrotate' or 'ethshift' ?
Matthias
See, that's 10x better already! Personally, I like 'ethautorotate', but if that's too long 'ethrotate' will do.
regards,
Ben
PATCH 1/1 net: add 'ethtoggle' environment variable
Ok, let's call the baby 'ethrotate'.
Matthias
PATCH 1/1 net: add 'ethtoggle' environment variable
In reply to Matthias FuchsDear Ben,
in message <[email protected]>
Quoted 5 lines · Matthias Fuchs
This patch replaces the buildtime configuration option
CONFIG_NET_DO_NOT_TRY_ANOTHERthrough the 'ethtoggle' runtime configuration veriable. See README.Signed-off-by Matthias Fuchs <[email protected]>
But please edit the doc:
README Some configuration options can be set using Environment Variables: · line 2692
Quoted 11 lines
README +3
-0@@ -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.
... It just stays at the currently selected interface.
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Abstainer: A weak person who yields to the temptation of denying him- self a pleasure. A total abstainer is one who abstains from every- thing but abstention, and especially from inactivity in the affairs of others. - Ambrose Bierce
PATCH v2 1/1 net: add 'ethrotate' environment variable
This patch replaces the buildtime configuration option CONFIG_NET_DO_NOT_TRY_ANOTHER through the 'ethrotate' runtime configuration variable. See README.
--- README | 4 ++++ net/net.c | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)
README +4 -0
@@ -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
net/net.c +10 -3
@@ -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 ;
Signature · 1 line
1.5.3
PATCH v2 1/1 net: add 'ethrotate' environment variable
Quoted 47 lines · Matthias Fuchs
This patch replaces the buildtime configuration option
CONFIG_NET_DO_NOT_TRY_ANOTHERthrough the 'ethrotate' runtime configuration variable. See README.Signed-off-by Matthias Fuchs <[email protected]>--- README | 4 ++++ net/net.c | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)README +4
-0@@ -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 willnet/net.c +3
-3@@ -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 + +/*
net/net.c void NetStartAgain (void) · line 611
Quoted 10 lines
net/net.c +7
-0+* 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 ;
Thanks - applied.
regards,
Ben
PATCH v2 1/1 net: add 'ethrotate' environment variable
In reply to Matthias FuchsHi Matthias,
Quoted 47 lines · Matthias Fuchs
This patch replaces the buildtime configuration option
CONFIG_NET_DO_NOT_TRY_ANOTHERthrough the 'ethrotate' runtime configuration variable. See README.Signed-off-by Matthias Fuchs <[email protected]>--- README | 4 ++++ net/net.c | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-)README +4
-0@@ -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 willnet/net.c +3
-3@@ -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 + +/*
net/net.c void NetStartAgain (void) · line 611
Quoted 10 lines
net/net.c +7
-0+* 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 ;
I'm a little curious about what it is you're trying to do. If you want to prevent Ethernet devices from ever rotating, this doesn't work. For example, if you set 'ethact' to an interface that isn't connected, eth_init() will rotate the interfaces until it reaches a valid link or the end of the chain, never reaching your change. If you really want to prevent rotation, I'd move your logic into the 'eth_try_another()' function itself, returning quickly if "ethrotate=no".
regards,
Ben
PATCH v2 1/1 net: add 'ethrotate' environment variable
Hi Ben,
Quoted 11 lines · Ben Warren
I'm a little curious about what it is you're trying to do. If you want to prevent Ethernet devices from ever rotating, this doesn't work. For example, if you set 'ethact' to an interface that isn't connected,
eth_init()will rotate the interfaces until it reaches a valid link or the end of the chain, never reaching your change. If you really want to prevent rotation, I'd move your logic into the 'eth_try_another()' function itself, returning quickly if "ethrotate=no".regards,
Ben
I will post a fixing patch in a minute.
Matthias