Commit 5c421331d5a8eac754c4509a4c710ef334b823c5

Authored by Joe Hershberger
Committed by Simon Glass
1 parent d2eaec6006

net: Make netretry actually do something

netretry previously would only retry in one specific case (your MAC
address is not set) and no other. This is basically useless. In the DM
implementation for eth it turns this into a completely useless case
since an un-configured MAC address results in not even entering the
NetLoop. The behavior is now changed to retry any failed command
(rotating through the eth adapters if ethrotate != no).

It also defaulted to retry forever. It is now changed to default to not
retry

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>

Showing 1 changed file with 6 additions and 2 deletions Side-by-side Diff

... ... @@ -527,6 +527,8 @@
527 527 (*x)();
528 528 }
529 529  
  530 + if (net_state == NETLOOP_FAIL)
  531 + NetStartAgain();
530 532  
531 533 switch (net_state) {
532 534  
... ... @@ -602,8 +604,10 @@
602 604 retrycnt = 1;
603 605 else
604 606 retrycnt = simple_strtoul(nretry, NULL, 0);
605   - } else
606   - retry_forever = 1;
  607 + } else {
  608 + retrycnt = 0;
  609 + retry_forever = 0;
  610 + }
607 611  
608 612 if ((!retry_forever) && (NetTryCount >= retrycnt)) {
609 613 eth_halt();