summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-10-27 06:24:29 +0000
committerWolfgang Denk <wd@denx.de>2011-10-27 23:53:58 +0200
commit8c6914f10f317af06012f038565270e356fddadd (patch)
tree3da569ea9cbc46119899358dfb47fb3aedd18122 /net
parent165099e753aeb3a734edbdad887f964277d11ab8 (diff)
net: Add more #ifdefs for tftpput to reduce code size
If CONFIG_CMD_TFTPPUT is not enabled, we want minimal code size impact on the tftp code. This introduces a few more #ifdefs. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'net')
-rw-r--r--net/tftp.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/net/tftp.c b/net/tftp.c
index 81f9af430e5..49997073872 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -332,8 +332,12 @@ TftpSend(void)
case STATE_SEND_WRQ:
xp = pkt;
s = (ushort *)pkt;
+#ifdef CONFIG_CMD_TFTPPUT
*s++ = htons(TftpState == STATE_SEND_RRQ ? TFTP_RRQ :
TFTP_WRQ);
+#else
+ *s++ = htons(TFTP_RRQ);
+#endif
pkt = (uchar *)s;
strcpy((char *)pkt, tftp_filename);
pkt += strlen(tftp_filename) + 1;
@@ -730,7 +734,12 @@ void TftpStart(enum proto_t protocol)
printf("Using %s device\n", eth_get_name());
printf("TFTP %s server %pI4; our IP address is %pI4",
- protocol == TFTPPUT ? "to" : "from", &TftpRemoteIP, &NetOurIP);
+#ifdef CONFIG_CMD_TFTPPUT
+ protocol == TFTPPUT ? "to" : "from",
+#else
+ "from",
+#endif
+ &TftpRemoteIP, &NetOurIP);
/* Check if we need to send across this subnet */
if (NetOurGatewayIP && NetOurSubnetMask) {