]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - net/nfs.c
Move simple_itoa to vsprintf
[karo-tx-uboot.git] / net / nfs.c
index 27395fbf2e4b7068dc0de94d7f2df7f3118696f3..5e717e3c6d63221569ce94210afd5197dcd041db 100644 (file)
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -29,8 +29,6 @@
 #include "nfs.h"
 #include "bootp.h"
 
-#if defined(CONFIG_CMD_NET) && defined(CONFIG_CMD_NFS)
-
 #define HASHES_PER_LINE 65     /* Number of "loading" hashes per line  */
 #define NFS_RETRY_COUNT 30
 #define NFS_TIMEOUT 2000UL
@@ -516,7 +514,7 @@ nfs_readlink_reply (uchar *pkt, unsigned len)
                strcat (nfs_path, "/");
                pathlen = strlen(nfs_path);
                memcpy (nfs_path+pathlen, (uchar *)&(rpc_pkt.u.reply.data[2]), rlen);
-               nfs_path[pathlen+rlen+1] = 0;
+               nfs_path[pathlen + rlen] = 0;
        } else {
                memcpy (nfs_path, (uchar *)&(rpc_pkt.u.reply.data[2]), rlen);
                nfs_path[rlen] = 0;
@@ -571,17 +569,18 @@ Interfaces of U-BOOT
 static void
 NfsTimeout (void)
 {
-       if ( NfsTimeoutCount++ < NFS_RETRY_COUNT ) {
+       if ( ++NfsTimeoutCount > NFS_RETRY_COUNT ) {
+               puts ("\nRetry count exceeded; starting again\n");
+               NetStartAgain ();
+       } else {
+               puts("T ");
+               NetSetTimeout (NFS_TIMEOUT, NfsTimeout);
                NfsSend ();
-               return;
        }
-       puts ("Timeout\n");
-       NetState = NETLOOP_FAIL;
-       return;
 }
 
 static void
-NfsHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len)
+NfsHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, unsigned len)
 {
        int rlen;
 
@@ -715,9 +714,7 @@ NfsStart (void)
        nfs_filename = basename (nfs_path);
        nfs_path     = dirname (nfs_path);
 
-#if defined(CONFIG_NET_MULTI)
        printf ("Using %s device\n", eth_get_name());
-#endif
 
        printf("File transfer via NFS from server %pI4"
                "; our IP address is %pI4", &NfsServerIP, &NetOurIP);
@@ -754,5 +751,3 @@ NfsStart (void)
 
        NfsSend ();
 }
-
-#endif