]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - net/rarp.c
menu.c: use puts() instead of printf() where possible
[karo-tx-uboot.git] / net / rarp.c
index 21dfa529c9a381934612e12e62da1e9c0ea438f8..097f970f442770153cc3f36209c5db26f0737380 100644 (file)
@@ -29,9 +29,7 @@
 #include "rarp.h"
 #include "tftp.h"
 
-#if defined(CONFIG_CMD_NET)
-
-#define TIMEOUT                5               /* Seconds before trying BOOTP again */
+#define TIMEOUT                5000UL  /* Milliseconds before trying BOOTP again */
 #ifndef        CONFIG_NET_RETRY_COUNT
 # define TIMEOUT_COUNT 5               /* # of timeouts before giving up  */
 #else
@@ -45,28 +43,11 @@ int         RarpTry;
  *     Handle a RARP received packet.
  */
 static void
-RarpHandler(uchar * dummi0, unsigned dummi1, unsigned dummi2, unsigned dummi3)
+RarpHandler(uchar *dummi0, unsigned dummi1, IPaddr_t sip, unsigned dummi2,
+           unsigned dummi3)
 {
-       char *s;
-#ifdef DEBUG
-       puts ("Got good RARP\n");
-#endif
-       if ((s = getenv("autoload")) != NULL) {
-               if (*s == 'n') {
-                       /*
-                        * Just use RARP to configure system;
-                        * Do not use TFTP/NFS to to load the bootfile.
-                        */
-                       NetState = NETLOOP_SUCCESS;
-                       return;
-#if defined(CONFIG_CMD_NFS)
-               } else if ((s != NULL) && !strcmp(s, "NFS")) {
-                       NfsStart();
-                       return;
-#endif
-               }
-       }
-       TftpStart ();
+       debug("Got good RARP\n");
+       net_auto_load();
 }
 
 
@@ -80,7 +61,7 @@ RarpTimeout(void)
                puts ("\nRetry count exceeded; starting again\n");
                NetStartAgain ();
        } else {
-               NetSetTimeout (TIMEOUT * CFG_HZ, RarpTimeout);
+               NetSetTimeout (TIMEOUT, RarpTimeout);
                RarpRequest ();
        }
 }
@@ -115,8 +96,6 @@ RarpRequest (void)
 
        NetSendPacket(NetTxPacket, (pkt - NetTxPacket) + ARP_HDR_SIZE);
 
-       NetSetTimeout(TIMEOUT * CFG_HZ, RarpTimeout);
+       NetSetTimeout(TIMEOUT, RarpTimeout);
        NetSetHandler(RarpHandler);
 }
-
-#endif