projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ppc4xx: Add "ecctest" command to test/simulate ECC errors
[oweals/u-boot.git]
/
net
/
nfs.c
diff --git
a/net/nfs.c
b/net/nfs.c
index 01016290283aacfad5d966773ffc50b72c3148f6..d11bb4c15fb87803eb252c764616ed814571262a 100644
(file)
--- a/
net/nfs.c
+++ b/
net/nfs.c
@@
-29,10
+29,6
@@
#include "nfs.h"
#include "bootp.h"
#include "nfs.h"
#include "bootp.h"
-/*#define NFS_DEBUG*/
-
-#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
#define HASHES_PER_LINE 65 /* Number of "loading" hashes per line */
#define NFS_RETRY_COUNT 30
#define NFS_TIMEOUT 2000UL
@@
-357,9
+353,7
@@
RPC request dispatcher
static void
NfsSend (void)
{
static void
NfsSend (void)
{
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
switch (NfsState) {
case STATE_PRCLOOKUP_PROG_MOUNT_REQ:
switch (NfsState) {
case STATE_PRCLOOKUP_PROG_MOUNT_REQ:
@@
-397,9
+391,7
@@
rpc_lookup_reply (int prog, uchar *pkt, unsigned len)
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
if (ntohl(rpc_pkt.u.reply.id) != rpc_id)
return -1;
if (ntohl(rpc_pkt.u.reply.id) != rpc_id)
return -1;
@@
-427,9
+419,7
@@
nfs_mount_reply (uchar *pkt, unsigned len)
{
struct rpc_t rpc_pkt;
{
struct rpc_t rpc_pkt;
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
@@
-454,9
+444,7
@@
nfs_umountall_reply (uchar *pkt, unsigned len)
{
struct rpc_t rpc_pkt;
{
struct rpc_t rpc_pkt;
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
@@
-480,9
+468,7
@@
nfs_lookup_reply (uchar *pkt, unsigned len)
{
struct rpc_t rpc_pkt;
{
struct rpc_t rpc_pkt;
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
@@
-507,9
+493,7
@@
nfs_readlink_reply (uchar *pkt, unsigned len)
struct rpc_t rpc_pkt;
int rlen;
struct rpc_t rpc_pkt;
int rlen;
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
memcpy ((unsigned char *)&rpc_pkt, pkt, len);
@@
-530,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);
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;
} else {
memcpy (nfs_path, (uchar *)&(rpc_pkt.u.reply.data[2]), rlen);
nfs_path[rlen] = 0;
@@
-544,9
+528,7
@@
nfs_read_reply (uchar *pkt, unsigned len)
struct rpc_t rpc_pkt;
int rlen;
struct rpc_t rpc_pkt;
int rlen;
-#ifdef NFS_DEBUG_nop
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
memcpy ((uchar *)&rpc_pkt, pkt, sizeof(rpc_pkt.u.reply));
memcpy ((uchar *)&rpc_pkt, pkt, sizeof(rpc_pkt.u.reply));
@@
-587,13
+569,14
@@
Interfaces of U-BOOT
static void
NfsTimeout (void)
{
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 ();
NfsSend ();
- return;
}
}
- puts ("Timeout\n");
- NetState = NETLOOP_FAIL;
- return;
}
static void
}
static void
@@
-601,9
+584,7
@@
NfsHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len)
{
int rlen;
{
int rlen;
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
if (dest != NfsOurPort) return;
if (dest != NfsOurPort) return;
@@
-661,9
+642,7
@@
NfsHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len)
NfsState = STATE_UMOUNT_REQ;
NfsSend ();
} else {
NfsState = STATE_UMOUNT_REQ;
NfsSend ();
} else {
-#ifdef NFS_DEBUG
- printf ("Symlink --> %s\n", nfs_path);
-#endif
+ debug("Symlink --> %s\n", nfs_path);
nfs_filename = basename (nfs_path);
nfs_path = dirname (nfs_path);
nfs_filename = basename (nfs_path);
nfs_path = dirname (nfs_path);
@@
-696,9
+675,7
@@
NfsHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len)
void
NfsStart (void)
{
void
NfsStart (void)
{
-#ifdef NFS_DEBUG
- printf ("%s\n", __FUNCTION__);
-#endif
+ debug("%s\n", __func__);
NfsDownloadState = NETLOOP_FAIL;
NfsServerIP = NetServerIP;
NfsDownloadState = NETLOOP_FAIL;
NfsServerIP = NetServerIP;
@@
-776,5
+753,3
@@
NfsStart (void)
NfsSend ();
}
NfsSend ();
}
-
-#endif