[U-Boot] [PATCH v2 08/11] net: tftpput: Support selecting get/put for tftp

Simon Glass sjg at chromium.org
Tue Oct 25 06:00:05 CEST 2011


TftpStart should support starting either a get or a put.

Signed-off-by: Simon Glass <sjg at chromium.org>
---
 include/net.h |    2 +-
 net/bootp.c   |    2 +-
 net/tftp.c    |    3 +--
 net/tftp.h    |    2 +-
 4 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/include/net.h b/include/net.h
index 495f60e..b408dea 100644
--- a/include/net.h
+++ b/include/net.h
@@ -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 */
diff --git a/net/bootp.c b/net/bootp.c
index 73470f2..b703f42 100644
--- a/net/bootp.c
+++ b/net/bootp.c
@@ -165,7 +165,7 @@ static void auto_load(void)
 		}
 #endif
 	}
-	TftpStart();
+	TftpStart(TFTPGET);
 }
 
 #if !defined(CONFIG_CMD_DHCP)
diff --git a/net/tftp.c b/net/tftp.c
index 6d46bbb..7e3bb3d 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -595,8 +595,7 @@ TftpTimeout(void)
 }
 
 
-void
-TftpStart(void)
+void TftpStart(enum proto_t protocol)
 {
 	char *ep;             /* Environment pointer */
 
diff --git a/net/tftp.h b/net/tftp.h
index 3abdf7b..c51aa25 100644
--- a/net/tftp.h
+++ b/net/tftp.h
@@ -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 */
-- 
1.7.3.1



More information about the U-Boot mailing list