diff options
-rw-r--r-- | board/hymod/bsp.c | 2 | ||||
-rw-r--r-- | board/hymod/fetch.c | 2 | ||||
-rw-r--r-- | common/cmd_elf.c | 6 | ||||
-rw-r--r-- | common/cmd_net.c | 8 | ||||
-rw-r--r-- | common/update.c | 2 | ||||
-rw-r--r-- | include/net.h | 8 | ||||
-rw-r--r-- | net/net.c | 18 |
7 files changed, 23 insertions, 23 deletions
diff --git a/board/hymod/bsp.c b/board/hymod/bsp.c index 9a929413bd0..3a599a6a1d6 100644 --- a/board/hymod/bsp.c +++ b/board/hymod/bsp.c @@ -200,7 +200,7 @@ do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) load_addr = simple_strtoul (argv[3], NULL, 16); NetBootFileXferSize = 0; - if (NetLoop (TFTP) <= 0) { + if (NetLoop(TFTPGET) <= 0) { printf ("tftp transfer failed - aborting " "fgpa load\n"); return 1; diff --git a/board/hymod/fetch.c b/board/hymod/fetch.c index e121d5565e6..f5f9582e95b 100644 --- a/board/hymod/fetch.c +++ b/board/hymod/fetch.c @@ -55,7 +55,7 @@ fetch_and_parse (char *fn, ulong addr, int (*cback)(uchar *, uchar *)) load_addr = addr; NetBootFileXferSize = 0; - if (NetLoop (TFTP) == 0) { + if (NetLoop(TFTPGET) == 0) { printf ("tftp transfer of file '%s' failed\n", fn); return (0); } diff --git a/common/cmd_elf.c b/common/cmd_elf.c index bf3261256f3..11ffc1b8aa7 100644 --- a/common/cmd_elf.c +++ b/common/cmd_elf.c @@ -133,10 +133,10 @@ int do_bootvx (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) /* Check to see if we need to tftp the image ourselves before starting */ if ((argc == 2) && (strcmp (argv[1], "tftp") == 0)) { - if (NetLoop (TFTP) <= 0) + if (NetLoop(TFTPGET) <= 0) return 1; - printf ("Automatic boot of VxWorks image at address 0x%08lx ... \n", - addr); + printf("Automatic boot of VxWorks image at address 0x%08lx " + "...\n", addr); } #endif diff --git a/common/cmd_net.c b/common/cmd_net.c index ac06fac1cef..a6d28e5f5e3 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -28,7 +28,7 @@ #include <command.h> #include <net.h> -static int netboot_common (proto_t, cmd_tbl_t *, int , char * const []); +static int netboot_common(enum proto_t, cmd_tbl_t *, int, char * const []); int do_bootp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { @@ -46,7 +46,7 @@ int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) int ret; bootstage_mark(BOOTSTAGE_KERNELREAD_START, "tftp start"); - ret = netboot_common(TFTP, cmdtp, argc, argv); + ret = netboot_common(TFTPGET, cmdtp, argc, argv); bootstage_mark(BOOTSTAGE_KERNELREAD_STOP, "tftp done"); return ret; } @@ -172,8 +172,8 @@ static void netboot_update_env (void) #endif } -static int -netboot_common (proto_t proto, cmd_tbl_t *cmdtp, int argc, char * const argv[]) +static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc, + char * const argv[]) { char *s; char *end; diff --git a/common/update.c b/common/update.c index 75284748734..8f9e9319c51 100644 --- a/common/update.c +++ b/common/update.c @@ -86,7 +86,7 @@ static int update_load(char *filename, ulong msec_max, int cnt_max, ulong addr) /* download the update file */ load_addr = addr; copy_filename(BootFile, filename, sizeof(BootFile)); - size = NetLoop(TFTP); + size = NetLoop(TFTPGET); if (size < 0) rv = 1; diff --git a/include/net.h b/include/net.h index 9e3a8f5f4d0..c5a1c65fbc2 100644 --- a/include/net.h +++ b/include/net.h @@ -383,8 +383,10 @@ extern int NetState; /* Network loop state */ extern int NetRestartWrap; /* Tried all network devices */ #endif -typedef enum { BOOTP, RARP, ARP, TFTP, DHCP, PING, DNS, NFS, CDP, NETCONS, SNTP, - TFTPSRV } proto_t; +enum proto_t { + BOOTP, RARP, ARP, TFTPGET, DHCP, PING, DNS, NFS, CDP, NETCONS, SNTP, + TFTPSRV +}; /* from net/net.c */ extern char BootFile[128]; /* Boot File name */ @@ -410,7 +412,7 @@ extern int NetTimeOffset; /* offset time from UTC */ #endif /* Initialize the network adapter */ -extern int NetLoop(proto_t); +extern int NetLoop(enum proto_t); /* Shutdown adapters and cleanup */ extern void NetStop(void); diff --git a/net/net.c b/net/net.c index 5eaf5333550..8990e987e07 100644 --- a/net/net.c +++ b/net/net.c @@ -227,7 +227,7 @@ static ulong timeDelta; /* THE transmit packet */ volatile uchar *NetTxPacket; -static int net_check_prereq(proto_t protocol); +static int net_check_prereq(enum proto_t protocol); static int NetTryCount; @@ -313,8 +313,7 @@ void ArpTimeoutCheck(void) } } -static void -NetInitLoop(proto_t protocol) +static void NetInitLoop(enum proto_t protocol) { static int env_changed_id; bd_t *bd = gd->bd; @@ -343,8 +342,7 @@ NetInitLoop(proto_t protocol) * Main network processing loop. */ -int -NetLoop(proto_t protocol) +int NetLoop(enum proto_t protocol) { bd_t *bd = gd->bd; int ret = -1; @@ -422,10 +420,11 @@ restart: #ifdef CONFIG_NET_MULTI NetDevExists = 1; #endif + NetBootFileXferSize = 0; switch (protocol) { - case TFTP: + case TFTPGET: /* always use ARP to get server ethernet address */ - TftpStart(); + TftpStart(protocol); break; #ifdef CONFIG_CMD_TFTPSRV case TFTPSRV: @@ -487,7 +486,6 @@ restart: break; } - NetBootFileXferSize = 0; break; } @@ -1790,7 +1788,7 @@ NetReceive(volatile uchar *inpkt, int len) /**********************************************************************/ -static int net_check_prereq(proto_t protocol) +static int net_check_prereq(enum proto_t protocol) { switch (protocol) { /* Fall through */ @@ -1821,7 +1819,7 @@ static int net_check_prereq(proto_t protocol) #if defined(CONFIG_CMD_NFS) case NFS: #endif - case TFTP: + case TFTPGET: if (NetServerIP == 0) { puts("*** ERROR: `serverip' not set\n"); return 1; |