From patchwork Mon Feb 15 09:40:35 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Zaidman X-Patchwork-Id: 71727 X-Patchwork-Delegate: afleming@freescale.com Return-Path: X-Original-To: wd@gemini.denx.de Delivered-To: wd@gemini.denx.de Received: from diddl.denx.de (diddl.denx.de [10.0.0.6]) by gemini.denx.de (Postfix) with ESMTP id 1579EE73028 for ; Mon, 15 Feb 2010 09:48:24 +0100 (CET) Received: from diddl.denx.de (localhost.localdomain [127.0.0.1]) by diddl.denx.de (Postfix) with ESMTP id 0987AC7FA5C0 for ; Mon, 15 Feb 2010 09:48:24 +0100 (CET) Received: from pop.mnet-online.de by diddl.denx.de with POP3 (fetchmail-6.3.9) for (single-drop); Mon, 15 Feb 2010 09:48:24 +0100 (CET) Received: from murder (svr19.m-online.net [192.168.3.147]) by backend2 (Cyrus v2.2.12) with LMTPA; Mon, 15 Feb 2010 09:45:28 +0100 X-Sieve: CMU Sieve 2.2 Received: from mail.m-online.net (localhost [127.0.0.1]) by frontend3.pop.m-online.net (Cyrus v2.2.13) with LMTPA; Mon, 15 Feb 2010 09:45:27 +0100 Received: from scanner-2.m-online.net (unknown [192.168.8.166]) by mail.m-online.net (Postfix) with ESMTP id 3420D2000AB; Mon, 15 Feb 2010 09:45:27 +0100 (CET) Received: from mxin-1.m-online.net ([192.168.6.164]) by scanner-2.m-online.net (scanner-2.m-online.net [192.168.8.166]) (amavisd-new, port 10026) with ESMTP id 13474-02-10; Mon, 15 Feb 2010 09:45:25 +0100 (CET) Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by mxin-1.m-online.net (Postfix) with ESMTP id E7BAC46C0A5; Mon, 15 Feb 2010 09:45:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 893A928094; Mon, 15 Feb 2010 09:45:21 +0100 (CET) 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 BW9X8przEKrC; Mon, 15 Feb 2010 09:45:21 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BFA9328097; Mon, 15 Feb 2010 09:45:14 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1041128090 for ; Mon, 15 Feb 2010 09:45:11 +0100 (CET) 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 dFV1-p1e7b8l for ; Mon, 15 Feb 2010 09:45:09 +0100 (CET) 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 smtp1.kodak.com (smtp1.kodak.com [192.232.121.200]) by theia.denx.de (Postfix) with ESMTP id 04C042808F for ; Mon, 15 Feb 2010 09:45:07 +0100 (CET) Received: from roc-us-ewsa.kodak.com (roc-us-ewsa.kodak.com [192.232.121.193]) by smtp1.kodak.com (8.11.3/8.11.1) with SMTP id o1F8j5T04836; Mon, 15 Feb 2010 03:45:05 -0500 (EST) Received: from (unknown [150.248.240.107]) by blade04 with smtp id 1377_aaee_688db60e_1a0e_11df_be88_001f29c63f5e; Mon, 15 Feb 2010 08:45:05 +0000 From: Michael Zaidman To: u-boot@lists.denx.de Date: Mon, 15 Feb 2010 11:40:35 +0200 Message-Id: <1266226835-29444-1-git-send-email-michael.zaidman@gmail.com> X-Mailer: git-send-email 1.6.3.3 Subject: [U-Boot] [PATCH] tsec.c bug: Every key typing in netconsole prints the Eth link mode 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 X-Virus-Scanned: by amavisd-new at m-online.net The problem description: The Ethernet link operation mode printing (such as "Speed: 1000, full duplex") accomplishes every key typing when communicating via netconsole to the mpc834x based board. The string is printed by adjust_link() routine of tsec.c, which in turn is part of the eth_init routine called at every netloop entry. The solution: Do not print the string when compiled with CONFIG_NETCONSOLE and stdin or stdout is set to "nc" Signed-off-by: Michael Zaidman --- drivers/net/tsec.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 3f74118..87093e6 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -847,10 +847,12 @@ static void adjust_link(struct eth_device *dev) printf("%s: Speed was bad\n", dev->name); break; } - - printf("Speed: %d, %s duplex\n", priv->speed, - (priv->duplexity) ? "full" : "half"); - +#ifdef CONFIG_NETCONSOLE + if ((strcmp(getenv("stdin"),"nc") != 0) && + (strcmp(getenv("stdout"),"nc") != 0)) +#endif + printf("Speed: %d, %s duplex\n", priv->speed, + (priv->duplexity) ? "full" : "half"); } else { printf("%s: No link.\n", dev->name); }