diff -ruNb u-boot-original/README u-boot-work/README --- u-boot-original/README 2004-04-16 02:14:49.000000000 +0300 +++ u-boot-work/README 2004-04-16 19:28:29.278549688 +0300 @@ -2244,6 +2244,9 @@ netretry - When set to "no" each network operation will either succeed or fail without retrying. + When set to "once" the network operation will + fail when all the available network interfaces + are tried once without success. Useful on scripts which control the retry operation themselves. diff -ruNb u-boot-original/common/cmd_net.c u-boot-work/common/cmd_net.c --- u-boot-original/common/cmd_net.c 2004-04-16 00:48:48.000000000 +0300 +++ u-boot-work/common/cmd_net.c 2004-04-16 18:38:02.505689104 +0300 @@ -139,16 +139,6 @@ if (NetOurNISDomain[0]) setenv("domain", NetOurNISDomain); - if (ntohs(NetOurVLAN) != (ushort)-1) { - VLAN_to_string(NetOurVLAN, tmp); - setenv("vlan", tmp); - } - - if (ntohs(NetOurNativeVLAN) != (ushort)-1) { - VLAN_to_string(NetOurNativeVLAN, tmp); - setenv("vlan", tmp); - } - } static int netboot_common (int proto, cmd_tbl_t *cmdtp, int argc, char *argv[]) diff -ruNb u-boot-original/net/net.c u-boot-work/net/net.c --- u-boot-original/net/net.c 2004-04-16 00:48:55.000000000 +0300 +++ u-boot-work/net/net.c 2004-04-16 18:38:02.690660984 +0300 @@ -132,8 +132,10 @@ static int NetDevExists = 0; /* At least one device configured */ #endif -ushort NetOurVLAN = ntohs(-1); /* default is without VLAN */ -ushort NetOurNativeVLAN = htons(-1); /* dido */ +/* XXX in both little & big endian machines -1 == ntohs(-1) */ +/* XXX let's hope nobody ports u-boot to a PDP-11 :-) */ +ushort NetOurVLAN = -1; /* default is without VLAN */ +ushort NetOurNativeVLAN = -1; /* dido */ char BootFile[128]; /* Boot File name */ @@ -523,9 +525,15 @@ NetStartAgain(void) { DECLARE_GLOBAL_DATA_PTR; - char *s; + char *nretry; + int noretry = 0, once = 0; - if ((s = getenv("netretry")) != NULL && *s == 'n') { + nretry = getenv("netretry"); + if (nretry != NULL) { + noretry = *nretry == 'n'; + once = *nretry == 'o'; + } + if (noretry) { eth_halt(); NetState = NETLOOP_FAIL; return; @@ -541,7 +549,7 @@ if (NetRestartWrap) { NetRestartWrap = 0; - if (NetDevExists) + if (NetDevExists && !once) { NetSetTimeout(10 * CFG_HZ, startAgainTimeout); NetSetHandler(startAgainHandler);