diff mbox

[U-Boot,v2,4/6] TFTP: rename STATE_RRQ to STATE_SEND_RRQ

Message ID 1303143594-5345-5-git-send-email-luca.ceresoli@comelit.it
State Superseded
Headers show

Commit Message

Luca Ceresoli April 18, 2011, 4:19 p.m. UTC
With the upcoming TFTP server implementation, requests can be either
outgoing or incoming, so avoid ambiguities.

Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it>
Cc: Wolfgang Denk <wd@denx.de>
---
Changes in v2: none.

 net/tftp.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

Comments

Detlev Zundel April 19, 2011, 2:22 p.m. UTC | #1
Hi Luca,

> With the upcoming TFTP server implementation, requests can be either
> outgoing or incoming, so avoid ambiguities.
>
> Signed-off-by: Luca Ceresoli <luca.ceresoli@comelit.it>
> Cc: Wolfgang Denk <wd@denx.de>
> ---
> Changes in v2: none.

Acked-by: Detlev Zundel <dzu@denx.de>
diff mbox

Patch

diff --git a/net/tftp.c b/net/tftp.c
index da545c6..e166a63 100644
--- a/net/tftp.c
+++ b/net/tftp.c
@@ -69,7 +69,7 @@  static int	TftpTsize;	/* The file size reported by the server */
 static short	TftpNumchars;	/* The number of hashes we printed      */
 #endif
 
-#define STATE_RRQ	1
+#define STATE_SEND_RRQ	1
 #define STATE_DATA	2
 #define STATE_TOO_LARGE	3
 #define STATE_BAD_MAGIC	4
@@ -200,7 +200,7 @@  TftpSend (void)
 
 	switch (TftpState) {
 
-	case STATE_RRQ:
+	case STATE_SEND_RRQ:
 		xp = pkt;
 		s = (ushort *)pkt;
 		*s++ = htons(TFTP_RRQ);
@@ -293,7 +293,7 @@  TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
 #endif
 		return;
 	}
-	if (TftpState != STATE_RRQ && src != TftpRemotePort)
+	if (TftpState != STATE_SEND_RRQ && src != TftpRemotePort)
 		return;
 
 	if (len < 2) {
@@ -380,10 +380,10 @@  TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src,
 			}
 		}
 
-		if (TftpState == STATE_RRQ)
+		if (TftpState == STATE_SEND_RRQ)
 			debug("Server did not acknowledge timeout option!\n");
 
-		if (TftpState == STATE_RRQ || TftpState == STATE_OACK) {
+		if (TftpState == STATE_SEND_RRQ || TftpState == STATE_OACK) {
 			/* first block received */
 			TftpState = STATE_DATA;
 			TftpRemotePort = src;
@@ -610,7 +610,7 @@  TftpStart (void)
 
 	TftpRemotePort = WELL_KNOWN_PORT;
 	TftpTimeoutCount = 0;
-	TftpState = STATE_RRQ;
+	TftpState = STATE_SEND_RRQ;
 	/* Use a pseudo-random port unless a specific port is set */
 	TftpOurPort = 1024 + (get_timer(0) % 3072);