From patchwork Mon Apr 18 16:19:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 91800 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 67C0DB6FE0 for ; Tue, 19 Apr 2011 02:21:19 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 84FF1282B2; Mon, 18 Apr 2011 18:20:53 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nRSrfq7VCCk4; Mon, 18 Apr 2011 18:20:53 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E93EE28253; Mon, 18 Apr 2011 18:20:34 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A2A1628254 for ; Mon, 18 Apr 2011 18:20:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8jBebdhPd00W for ; Mon, 18 Apr 2011 18:20:25 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from com-exc-01.comelit.it (mail.comelit.it [217.56.59.218]) by theia.denx.de (Postfix) with ESMTP id 756A628213 for ; Mon, 18 Apr 2011 18:20:18 +0200 (CEST) Received: from wallace.comelit.it ([172.20.0.53]) by com-exc-01.comelit.it with Microsoft SMTPSVC(6.0.3790.4675); Mon, 18 Apr 2011 18:20:17 +0200 From: Luca Ceresoli To: u-boot@lists.denx.de Date: Mon, 18 Apr 2011 18:19:52 +0200 Message-Id: <1303143594-5345-5-git-send-email-luca.ceresoli@comelit.it> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1302796377-3321-1-git-send-email-luca.ceresoli@comelit.it> References: <1302796377-3321-1-git-send-email-luca.ceresoli@comelit.it> X-OriginalArrivalTime: 18 Apr 2011 16:20:17.0709 (UTC) FILETIME=[817E25D0:01CBFDE4] X-TM-AS-Product-Ver: SMEX-8.6.0.1168-6.500.1024-18080.006 X-TM-AS-Result: No--12.382700-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Cc: Luca Ceresoli Subject: [U-Boot] [PATCH v2 4/6] TFTP: rename STATE_RRQ to STATE_SEND_RRQ X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de With the upcoming TFTP server implementation, requests can be either outgoing or incoming, so avoid ambiguities. Signed-off-by: Luca Ceresoli Cc: Wolfgang Denk Acked-by: Detlev Zundel --- Changes in v2: none. net/tftp.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) 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);