From patchwork Tue May 17 10:03:38 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Ceresoli X-Patchwork-Id: 95897 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 8FFE11007D1 for ; Tue, 17 May 2011 20:04:46 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 405B8280EF; Tue, 17 May 2011 12:04:42 +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 uOdCYmQnLSJZ; Tue, 17 May 2011 12:04:42 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 74A63280C7; Tue, 17 May 2011 12:04:31 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9BD3A280F4 for ; Tue, 17 May 2011 12:04:29 +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 ipYcmDp-hYf0 for ; Tue, 17 May 2011 12:04:29 +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 relayer.comelit.it (mail.comelit.it [217.56.59.218]) by theia.denx.de (Postfix) with ESMTP id 8221B280C5 for ; Tue, 17 May 2011 12:04:19 +0200 (CEST) Received: from com-exc-01.comelit.it ([172.24.0.31]) by relayer.comelit.it with Microsoft SMTPSVC(6.0.3790.1830); Tue, 17 May 2011 12:02:17 +0200 Received: from wallace.comelit.it ([172.20.0.35]) by com-exc-01.comelit.it with Microsoft SMTPSVC(6.0.3790.4675); Tue, 17 May 2011 12:04:18 +0200 From: Luca Ceresoli To: u-boot@lists.denx.de Date: Tue, 17 May 2011 12:03:38 +0200 Message-Id: <1305626621-15008-3-git-send-email-luca.ceresoli@comelit.it> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1303143594-5345-1-git-send-email-luca.ceresoli@comelit.it> References: <1303143594-5345-1-git-send-email-luca.ceresoli@comelit.it> X-OriginalArrivalTime: 17 May 2011 10:04:18.0495 (UTC) FILETIME=[C92204F0:01CC1479] X-TM-AS-Product-Ver: SMEX-8.6.0.1168-6.500.1024-18140.005 X-TM-AS-Result: No--7.762600-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No Cc: Luca Ceresoli Subject: [U-Boot] [PATCH v3 2/5] 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. Changes in v3: - rebased on top of the net/tftp.c cleanup. net/tftp.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/net/tftp.c b/net/tftp.c index b9d0f3b..6386740 100644 --- a/net/tftp.c +++ b/net/tftp.c @@ -80,7 +80,7 @@ static int TftpTsize; static short TftpNumchars; #endif -#define STATE_RRQ 1 +#define STATE_SEND_RRQ 1 #define STATE_DATA 2 #define STATE_TOO_LARGE 3 #define STATE_BAD_MAGIC 4 @@ -215,7 +215,7 @@ TftpSend(void) switch (TftpState) { - case STATE_RRQ: + case STATE_SEND_RRQ: xp = pkt; s = (ushort *)pkt; *s++ = htons(TFTP_RRQ); @@ -309,7 +309,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) @@ -399,10 +399,10 @@ TftpHandler(uchar *pkt, unsigned dest, IPaddr_t sip, unsigned src, puts("\n\t "); } - 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; @@ -632,7 +632,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);