]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
net: tftpput: Support selecting get/put for tftp
authorSimon Glass <sjg@chromium.org>
Mon, 24 Oct 2011 18:00:05 +0000 (18:00 +0000)
committerWolfgang Denk <wd@denx.de>
Wed, 26 Oct 2011 19:34:44 +0000 (21:34 +0200)
TftpStart should support starting either a get or a put.

Signed-off-by: Simon Glass <sjg@chromium.org>
include/net.h
net/bootp.c
net/tftp.c
net/tftp.h

index 495f60e72bd30fe76c97227b15a566d193efb485..b408dea666073259afceb833b469aff92aa04e55 100644 (file)
@@ -367,7 +367,7 @@ extern int          NetRestartWrap;         /* Tried all network devices    */
 
 enum proto_t {
        BOOTP, RARP, ARP, TFTPGET, DHCP, PING, DNS, NFS, CDP, NETCONS, SNTP,
-       TFTPSRV
+       TFTPSRV, TFTPPUT
 };
 
 /* from net/net.c */
index 73470f2d46fc66942b65e39a975be89e43329f4a..b703f428ca4bbc5ee27f90ce12e372d4774ee7b7 100644 (file)
@@ -165,7 +165,7 @@ static void auto_load(void)
                }
 #endif
        }
-       TftpStart();
+       TftpStart(TFTPGET);
 }
 
 #if !defined(CONFIG_CMD_DHCP)
index 6d46bbbe7c7e85f103b989b167208d1c666e751d..7e3bb3dc24a5cf1b0f48877adead7566f464b1f0 100644 (file)
@@ -595,8 +595,7 @@ TftpTimeout(void)
 }
 
 
-void
-TftpStart(void)
+void TftpStart(enum proto_t protocol)
 {
        char *ep;             /* Environment pointer */
 
index 3abdf7bc267f3b7219f4af7512eb13d077cfcbbf..c51aa253c4707fdb476442c843a9b85cbef2e461 100644 (file)
@@ -16,7 +16,7 @@
  */
 
 /* tftp.c */
-extern void    TftpStart (void);       /* Begin TFTP get */
+void TftpStart(enum proto_t protocol); /* Begin TFTP get/put */
 
 #ifdef CONFIG_CMD_TFTPSRV
 extern void    TftpStartServer(void);  /* Wait for incoming TFTP put */