* Patch by Masami Komiya, 24 Feb 2004:

Update NetBootFileXferSize in NFS code

* Patch by Scott McNutt, 24 Feb 2004:
  fix packet length in NFS code
This commit is contained in:
wdenk 2004-02-24 22:33:21 +00:00
parent 5cfbab3d82
commit a084f7da88
2 changed files with 12 additions and 6 deletions

View File

@ -2,6 +2,12 @@
Changes for U-Boot 1.0.2: Changes for U-Boot 1.0.2:
====================================================================== ======================================================================
* Patch by Masami Komiya, 24 Feb 2004:
Update NetBootFileXferSize in NFS code
* Patch by Scott McNutt, 24 Feb 2004:
fix packet length in NFS code
* Patch by Masami Komiy, 22 Feb 2004: * Patch by Masami Komiy, 22 Feb 2004:
Add support for NFS for file download Add support for NFS for file download

View File

@ -66,6 +66,7 @@ static char nfs_path_buff[2048];
static __inline__ void static __inline__ void
store_block (uchar * src, unsigned offset, unsigned len) store_block (uchar * src, unsigned offset, unsigned len)
{ {
ulong newsize = offset + len;
#ifdef CFG_DIRECT_FLASH_NFS #ifdef CFG_DIRECT_FLASH_NFS
int i, rc = 0; int i, rc = 0;
@ -86,10 +87,12 @@ store_block (uchar * src, unsigned offset, unsigned len)
} }
} else } else
#endif /* CFG_DIRECT_FLASH_NFS */ #endif /* CFG_DIRECT_FLASH_NFS */
{ {
(void)memcpy ((void *)(load_addr + offset), src, len); (void)memcpy ((void *)(load_addr + offset), src, len);
} }
if (NetBootFileXferSize < (offset+len))
NetBootFileXferSize = newsize;
} }
static char* static char*
@ -539,8 +542,7 @@ nfs_read_reply (uchar *pkt, unsigned len)
printf ("%s\n", __FUNCTION__); printf ("%s\n", __FUNCTION__);
#endif #endif
rlen = (uchar *)&(rpc_pkt.u.reply.data[19]) - (uchar *)&(rpc_pkt.u.reply.id); memcpy ((uchar *)&rpc_pkt, pkt, len);
memcpy ((uchar *)&rpc_pkt, pkt, rlen);
if (rpc_pkt.u.reply.rstatus || if (rpc_pkt.u.reply.rstatus ||
rpc_pkt.u.reply.verifier || rpc_pkt.u.reply.verifier ||
@ -613,6 +615,7 @@ NfsHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len)
puts ("*** ERROR: Cannot umount\n"); puts ("*** ERROR: Cannot umount\n");
NetState = NETLOOP_FAIL; NetState = NETLOOP_FAIL;
} else { } else {
puts ("\ndone\n");
NetState = NETLOOP_SUCCESS; NetState = NETLOOP_SUCCESS;
} }
break; break;
@ -658,9 +661,6 @@ NfsHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len)
NfsState = STATE_READLINK_REQ; NfsState = STATE_READLINK_REQ;
NfsSend (); NfsSend ();
} else { } else {
puts ("\ndone\n");
printf ("Bytes transferred = %d (%x hex)\n",
nfs_offset, nfs_offset);
NfsState = STATE_UMOUNT_REQ; NfsState = STATE_UMOUNT_REQ;
NfsSend (); NfsSend ();
} }