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;
 
        load_addr = addr;
        NetBootFileXferSize = 0;
 
-       if (NetLoop (TFTP) == 0) {
+       if (NetLoop(TFTPGET) == 0) {
                printf ("tftp transfer of file '%s' failed\n", fn);
                return (0);
        }
 
        /* 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
 
 
 #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[])
 {
 
 int do_tftpb (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-       return netboot_common (TFTP, cmdtp, argc, argv);
+       return netboot_common(TFTPGET, cmdtp, argc, argv);
 }
 
 U_BOOT_CMD(
 #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;
 
        /* download the update file */
        load_addr = addr;
        copy_filename(BootFile, filename, sizeof(BootFile));
-       size = NetLoop(TFTP);
+       size = NetLoop(TFTPGET);
 
        if (size < 0)
                rv = 1;
 
 
 extern int             NetRestartWrap;         /* Tried all network devices    */
 
-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               */
 #endif
 
 /* Initialize the network adapter */
-extern int     NetLoop(proto_t);
+extern int NetLoop(enum proto_t);
 
 /* Shutdown adapters and cleanup */
 extern void    NetStop(void);
 
 /* 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;
 
        }
 }
 
-static void
-NetInitLoop(proto_t protocol)
+static void NetInitLoop(enum proto_t protocol)
 {
        static int env_changed_id;
        bd_t *bd = gd->bd;
  *     Main network processing loop.
  */
 
-int
-NetLoop(proto_t protocol)
+int NetLoop(enum proto_t protocol)
 {
        bd_t *bd = gd->bd;
        int ret = -1;
 
        case 0:
                NetDevExists = 1;
+               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:
                        break;
                }
 
-               NetBootFileXferSize = 0;
                break;
        }
 
 
 /**********************************************************************/
 
-static int net_check_prereq(proto_t protocol)
+static int net_check_prereq(enum proto_t protocol)
 {
        switch (protocol) {
                /* Fall through */
 #if defined(CONFIG_CMD_NFS)
        case NFS:
 #endif
-       case TFTP:
+       case TFTPGET:
                if (NetServerIP == 0) {
                        puts("*** ERROR: `serverip' not set\n");
                        return 1;