From patchwork Thu Apr 14 15:52:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 91258 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 9E8681007D1 for ; Fri, 15 Apr 2011 01:55:34 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1A2B728384; Thu, 14 Apr 2011 17:55:33 +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 t+XTjMk-9QeN; Thu, 14 Apr 2011 17:55:32 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9EECE2838A; Thu, 14 Apr 2011 17:55:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 629782838A for ; Thu, 14 Apr 2011 17:55: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 Kdd99s4mLbVp for ; Thu, 14 Apr 2011 17:55:26 +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 adserver.comelit.it (mail.comelit.it [217.56.59.218]) by theia.denx.de (Postfix) with ESMTP id 64FCC28388 for ; Thu, 14 Apr 2011 17:55:26 +0200 (CEST) Received: from com-exc-01.comelit.it ([172.24.0.31]) by adserver.comelit.it with Microsoft SMTPSVC(6.0.3790.1830); Thu, 14 Apr 2011 17:55:10 +0200 Received: from wallace.comelit.it ([172.20.0.53]) by com-exc-01.comelit.it with Microsoft SMTPSVC(6.0.3790.4675); Thu, 14 Apr 2011 17:53:38 +0200 From: Luca Ceresoli To: u-boot@lists.denx.de Date: Thu, 14 Apr 2011 17:52:55 +0200 Message-Id: <1302796377-3321-5-git-send-email-luca.ceresoli@comelit.it> X-Mailer: git-send-email 1.7.1 In-Reply-To: <4DA5682A.8040203@comelit.it> References: <4DA5682A.8040203@comelit.it> X-OriginalArrivalTime: 14 Apr 2011 15:53:38.0209 (UTC) FILETIME=[1E76D110:01CBFABC] X-TM-AS-Product-Ver: SMEX-8.6.0.1168-6.500.1024-18072.005 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 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 --- net/tftp.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/net/tftp.c b/net/tftp.c index 42469e7..2c96358 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);