summaryrefslogtreecommitdiff
path: root/net/nfs.c
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2012-05-23 07:59:14 +0000
committerJoe Hershberger <joe.hershberger@ni.com>2012-05-23 17:46:21 -0500
commit22f6e99d5b0c54758646334c1153737a5585bd57 (patch)
treee70b3679ff62e93345fc0f7e3960d37582cea612 /net/nfs.c
parentadf5d93e441eb3eacd8c0430d6064b35d47ad2a5 (diff)
downloadu-boot-imx-22f6e99d5b0c54758646334c1153737a5585bd57.zip
u-boot-imx-22f6e99d5b0c54758646334c1153737a5585bd57.tar.gz
u-boot-imx-22f6e99d5b0c54758646334c1153737a5585bd57.tar.bz2
net: Refactor to protect access to the NetState variable
Changes to NetState now go through an accessor function called net_set_state() Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'net/nfs.c')
-rw-r--r--net/nfs.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/nfs.c b/net/nfs.c
index b6188fe..db73e93 100644
--- a/net/nfs.c
+++ b/net/nfs.c
@@ -41,7 +41,7 @@ static int nfs_len;
static char dirfh[NFS_FHSIZE]; /* file handle of directory */
static char filefh[NFS_FHSIZE]; /* file handle of kernel image */
-static int NfsDownloadState;
+static enum net_loop_state nfs_download_state;
static IPaddr_t NfsServerIP;
static int NfsSrvMountPort;
static int NfsSrvNfsPort;
@@ -613,10 +613,10 @@ NfsHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, unsigned len)
case STATE_UMOUNT_REQ:
if (nfs_umountall_reply(pkt, len)) {
puts("*** ERROR: Cannot umount\n");
- NetState = NETLOOP_FAIL;
+ net_set_state(NETLOOP_FAIL);
} else {
puts("\ndone\n");
- NetState = NfsDownloadState;
+ net_set_state(nfs_download_state);
}
break;
@@ -660,7 +660,7 @@ NfsHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, unsigned len)
NfsSend();
} else {
if (!rlen)
- NfsDownloadState = NETLOOP_SUCCESS;
+ nfs_download_state = NETLOOP_SUCCESS;
NfsState = STATE_UMOUNT_REQ;
NfsSend();
}
@@ -673,13 +673,13 @@ void
NfsStart(void)
{
debug("%s\n", __func__);
- NfsDownloadState = NETLOOP_FAIL;
+ nfs_download_state = NETLOOP_FAIL;
NfsServerIP = NetServerIP;
nfs_path = (char *)nfs_path_buff;
if (nfs_path == NULL) {
- NetState = NETLOOP_FAIL;
+ net_set_state(NETLOOP_FAIL);
puts("*** ERROR: Fail allocate memory\n");
return;
}