Skip to content
Snippets Groups Projects
Commit 23a7a32d authored by Wolfgang Denk's avatar Wolfgang Denk
Browse files

Fix return code of NFS command

Patch by Hiroshi Ito, 11 Dec 2004
parent 3836221d
Branches
Tags
No related merge requests found
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
Changes for U-Boot 1.1.3: Changes for U-Boot 1.1.3:
====================================================================== ======================================================================
* Fix return code of NFS command
Patch by Hiroshi Ito, 11 Dec 2004
* Fix typo * Fix typo
* Fix compiler warnings in cpu/ppc4xx/usbdev.c * Fix compiler warnings in cpu/ppc4xx/usbdev.c
......
...@@ -44,6 +44,7 @@ static int nfs_len; ...@@ -44,6 +44,7 @@ static int nfs_len;
static char dirfh[NFS_FHSIZE]; /* file handle of directory */ static char dirfh[NFS_FHSIZE]; /* file handle of directory */
static char filefh[NFS_FHSIZE]; /* file handle of kernel image */ static char filefh[NFS_FHSIZE]; /* file handle of kernel image */
static int NfsDownloadState;
static IPaddr_t NfsServerIP; static IPaddr_t NfsServerIP;
static int NfsSrvMountPort; static int NfsSrvMountPort;
static int NfsSrvNfsPort; static int NfsSrvNfsPort;
...@@ -63,7 +64,7 @@ static char *nfs_filename; ...@@ -63,7 +64,7 @@ static char *nfs_filename;
static char *nfs_path; static char *nfs_path;
static char nfs_path_buff[2048]; static char nfs_path_buff[2048];
static __inline__ void static __inline__ int
store_block (uchar * src, unsigned offset, unsigned len) store_block (uchar * src, unsigned offset, unsigned len)
{ {
ulong newsize = offset + len; ulong newsize = offset + len;
...@@ -82,8 +83,7 @@ store_block (uchar * src, unsigned offset, unsigned len) ...@@ -82,8 +83,7 @@ store_block (uchar * src, unsigned offset, unsigned len)
rc = flash_write ((uchar *)src, (ulong)(load_addr+offset), len); rc = flash_write ((uchar *)src, (ulong)(load_addr+offset), len);
if (rc) { if (rc) {
flash_perror (rc); flash_perror (rc);
NetState = NETLOOP_FAIL; return -1;
return;
} }
} else } else
#endif /* CFG_DIRECT_FLASH_NFS */ #endif /* CFG_DIRECT_FLASH_NFS */
...@@ -93,6 +93,7 @@ store_block (uchar * src, unsigned offset, unsigned len) ...@@ -93,6 +93,7 @@ store_block (uchar * src, unsigned offset, unsigned len)
if (NetBootFileXferSize < (offset+len)) if (NetBootFileXferSize < (offset+len))
NetBootFileXferSize = newsize; NetBootFileXferSize = newsize;
return 0;
} }
static char* static char*
...@@ -573,7 +574,8 @@ nfs_read_reply (uchar *pkt, unsigned len) ...@@ -573,7 +574,8 @@ nfs_read_reply (uchar *pkt, unsigned len)
} }
rlen = ntohl(rpc_pkt.u.reply.data[18]); rlen = ntohl(rpc_pkt.u.reply.data[18]);
store_block ((uchar *)pkt+sizeof(rpc_pkt.u.reply), nfs_offset, rlen); if ( store_block ((uchar *)pkt+sizeof(rpc_pkt.u.reply), nfs_offset, rlen) )
return -9999;
return rlen; return rlen;
} }
...@@ -632,7 +634,7 @@ NfsHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len) ...@@ -632,7 +634,7 @@ NfsHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len)
NetState = NETLOOP_FAIL; NetState = NETLOOP_FAIL;
} else { } else {
puts ("\ndone\n"); puts ("\ndone\n");
NetState = NETLOOP_SUCCESS; NetState = NfsDownloadState;
} }
break; break;
...@@ -678,6 +680,7 @@ NfsHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len) ...@@ -678,6 +680,7 @@ NfsHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len)
NfsState = STATE_READLINK_REQ; NfsState = STATE_READLINK_REQ;
NfsSend (); NfsSend ();
} else { } else {
if ( ! rlen ) NfsDownloadState = NETLOOP_SUCCESS;
NfsState = STATE_UMOUNT_REQ; NfsState = STATE_UMOUNT_REQ;
NfsSend (); NfsSend ();
} }
...@@ -692,6 +695,7 @@ NfsStart (void) ...@@ -692,6 +695,7 @@ NfsStart (void)
#ifdef NFS_DEBUG #ifdef NFS_DEBUG
printf ("%s\n", __FUNCTION__); printf ("%s\n", __FUNCTION__);
#endif #endif
NfsDownloadState = NETLOOP_FAIL;
NfsServerIP = NetServerIP; NfsServerIP = NetServerIP;
nfs_path = (char *)nfs_path_buff; nfs_path = (char *)nfs_path_buff;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment