From patchwork Wed Oct 16 16:54:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suriyan Ramasami X-Patchwork-Id: 284005 X-Patchwork-Delegate: trini@ti.com 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 088B52C0079 for ; Thu, 17 Oct 2013 03:54:56 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 83D024A09C; Wed, 16 Oct 2013 18:54:54 +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 Qr78p5s2vLfr; Wed, 16 Oct 2013 18:54:54 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 10F824A09D; Wed, 16 Oct 2013 18:54:49 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B82184A09D for ; Wed, 16 Oct 2013 18:54: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 q4WCTfnJcFv7 for ; Wed, 16 Oct 2013 18:54:37 +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 mail-qa0-f43.google.com (mail-qa0-f43.google.com [209.85.216.43]) by theia.denx.de (Postfix) with ESMTPS id 131324A09C for ; Wed, 16 Oct 2013 18:54:32 +0200 (CEST) Received: by mail-qa0-f43.google.com with SMTP id i13so4726695qae.9 for ; Wed, 16 Oct 2013 09:54:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=tccl0A4REkKHj5Ef2s4PU8VtlhVyhq4x/qVY92KznZ0=; b=XoUNkHy9zuPYhWS9AWeZcfMkM/PZ9CSPi3t0/WskuXyM+Bh/49vMn6nT105XVa/5WJ e/jo9lrAyjvC3lNFAbBtzoyAPQXvxe4fSPzeXxHLW+UDUXkGSx2nQ2C3neZo+1UOj8GM rQhKrMT8l8G3sbMOG9ryGKNsb6lL/bPgikv2GAzqamIDPMhtui9ACaQr5+r5LHzqXtXo vYmXutckw9adDU6eCPiWw258zjJHBtVeS2p+Jy8qWK2YGpVXxX8I6nFVHaTjU9aV67V7 /lWbw7MFPv7R6x/F3oIPnxasDddIUSiOMadFraFSCpd0P/vPkihggi4zCDJO5BPpF0UW ctbQ== X-Received: by 10.49.131.132 with SMTP id om4mr5379308qeb.2.1381942469748; Wed, 16 Oct 2013 09:54:29 -0700 (PDT) Received: from localhost.localdomain (75-101-50-252.dsl.static.sonic.net. [75.101.50.252]) by mx.google.com with ESMTPSA id h9sm53529212qaq.9.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 16 Oct 2013 09:54:29 -0700 (PDT) From: Suriyan Ramasami To: joe.hershberger@ni.com Date: Wed, 16 Oct 2013 09:54:24 -0700 Message-Id: <1381942464-7482-1-git-send-email-suriyan.r@gmail.com> X-Mailer: git-send-email 1.7.1 Cc: u-boot@lists.denx.de Subject: [U-Boot] [PATCH v1 1/1] netconsole loses 2nd character of input X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Netconsole loses the second character when used as input by either setenv stdin nc or setenv stdin serial,nc if using CONSOLE_CONSOLE_MUX Before a nc_send_packet() to echo the input, a check is done to see if nc_ether is valid. If its not, it waits for an arp request and then sends the packet (which contains the first character of line to be displayed as output). As part of reaping the arp request, the second character is consumed. We protect this by making the call to NetLoop(NETCONS) between input_recursion. Signed-off-by: Suriyan Ramasami Acked-by: Joe Hershberger --- drivers/net/netconsole.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index df8ab07..65c747e 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -184,7 +184,9 @@ static void nc_send_packet(const char *buf, int len) return; /* inside net loop */ output_packet = buf; output_packet_len = len; + input_recursion = 1; NetLoop(NETCONS); /* wait for arp reply and send packet */ + input_recursion = 0; output_packet_len = 0; return; }