]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
net: tftpput: Rename TFTP to TFTPGET
authorSimon Glass <sjg@chromium.org>
Mon, 24 Oct 2011 18:00:02 +0000 (18:00 +0000)
committerWolfgang Denk <wd@denx.de>
Wed, 26 Oct 2011 19:33:42 +0000 (21:33 +0200)
This is a better name for this protocol. Also remove the typedef to keep
checkpatch happy, and move zeroing of NetBootFileXferSize a little
earlier since TFTPPUT will need to change this.

Signed-off-by: Simon Glass <sjg@chromium.org>
board/hymod/bsp.c
board/hymod/fetch.c
common/cmd_elf.c
common/cmd_net.c
common/update.c
include/net.h
net/net.c

index 2cd3707d72cf0f227aeb842e9b84d1797be40078..cd9c4e2076524a80c6c76c9dd6936a4f82e7fc54 100644 (file)
@@ -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;
index e121d5565e68e854d72491f518083f82e3af96ed..f5f9582e95b517e5247d381a29c1045836d876a2 100644 (file)
@@ -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);
        }
index bf3261256f32c95af740d0916bfe6dabfc587cad..11ffc1b8aa7dee46dee62f25f44170f3dcf40d61 100644 (file)
@@ -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
 
index 872f4a69c827f1e15ad448596bce10ea412ddc04..f610385b5d885421049d54fb3aa93c7a4162686a 100644 (file)
@@ -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[])
 {
@@ -43,7 +43,7 @@ U_BOOT_CMD(
 
 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(
@@ -167,8 +167,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;
index a19f136647d083f38f567db0633b82217db8a1ef..5b1a064c29cba71d2337504eb30fd0a6811d8ecd 100644 (file)
@@ -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;
index d7ff0687ccacc49812fc58b7299e219c1cf26785..495f60e72bd30fe76c97227b15a566d193efb485 100644 (file)
@@ -365,8 +365,10 @@ extern int         NetState;               /* Network loop state           */
 
 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               */
@@ -392,7 +394,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);
index f6afb6439624133e8a1d5125849d22ce0c0a5e16..c778a8065619ac2a2e68c75b617102c1869d9a98 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -225,7 +225,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;
 
@@ -311,8 +311,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;
@@ -341,8 +340,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;
@@ -407,10 +405,11 @@ restart:
 
        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:
@@ -472,7 +471,6 @@ restart:
                        break;
                }
 
-               NetBootFileXferSize = 0;
                break;
        }
 
@@ -1764,7 +1762,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 */
@@ -1795,7 +1793,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;