Browse Source

net: tftpput: Support selecting get/put for tftp

TftpStart should support starting either a get or a put.

Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass 13 years ago
parent
commit
58f317d182
4 changed files with 4 additions and 5 deletions
  1. 1 1
      include/net.h
  2. 1 1
      net/bootp.c
  3. 1 2
      net/tftp.c
  4. 1 1
      net/tftp.h

+ 1 - 1
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 */

+ 1 - 1
net/bootp.c

@@ -165,7 +165,7 @@ static void auto_load(void)
 		}
 #endif
 	}
-	TftpStart();
+	TftpStart(TFTPGET);
 }
 
 #if !defined(CONFIG_CMD_DHCP)

+ 1 - 2
net/tftp.c

@@ -595,8 +595,7 @@ TftpTimeout(void)
 }
 
 
-void
-TftpStart(void)
+void TftpStart(enum proto_t protocol)
 {
 	char *ep;             /* Environment pointer */
 

+ 1 - 1
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 */