Changes for U-Boot 1.1.3:
======================================================================
+* Fix return code of NFS command
+ Patch by Hiroshi Ito, 11 Dec 2004
+
* Fix typo
* Fix compiler warnings in cpu/ppc4xx/usbdev.c
static char dirfh[NFS_FHSIZE]; /* file handle of directory */
static char filefh[NFS_FHSIZE]; /* file handle of kernel image */
+static int NfsDownloadState;
static IPaddr_t NfsServerIP;
static int NfsSrvMountPort;
static int NfsSrvNfsPort;
static char *nfs_path;
static char nfs_path_buff[2048];
-static __inline__ void
+static __inline__ int
store_block (uchar * src, unsigned offset, unsigned len)
{
ulong newsize = offset + len;
rc = flash_write ((uchar *)src, (ulong)(load_addr+offset), len);
if (rc) {
flash_perror (rc);
- NetState = NETLOOP_FAIL;
- return;
+ return -1;
}
} else
#endif /* CFG_DIRECT_FLASH_NFS */
if (NetBootFileXferSize < (offset+len))
NetBootFileXferSize = newsize;
+ return 0;
}
static char*
}
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;
}
NetState = NETLOOP_FAIL;
} else {
puts ("\ndone\n");
- NetState = NETLOOP_SUCCESS;
+ NetState = NfsDownloadState;
}
break;
NfsState = STATE_READLINK_REQ;
NfsSend ();
} else {
+ if ( ! rlen ) NfsDownloadState = NETLOOP_SUCCESS;
NfsState = STATE_UMOUNT_REQ;
NfsSend ();
}
#ifdef NFS_DEBUG
printf ("%s\n", __FUNCTION__);
#endif
+ NfsDownloadState = NETLOOP_FAIL;
NfsServerIP = NetServerIP;
nfs_path = (char *)nfs_path_buff;