From: Peter Tyser <ptyser@xes-inc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH RFC] tsec: do not print Speed: if using netconsole
Date: Tue, 26 Jan 2010 10:53:23 -0600 [thread overview]
Message-ID: <1264524803.26441.37.camel@localhost.localdomain> (raw)
In-Reply-To: <1264282744-25607-1-git-send-email-Ed.Swarthout@freescale.com>
Hi Ed,
On Sat, 2010-01-23 at 15:39 -0600, Ed Swarthout wrote:
> CONFIG_NETCONSOLE on the p2020ds is functional with the tsec driver.
> But the printf in adjust_link() which is called by startup_tsec()
> called by tsec_init() in tsec.c is making it impossible to use.
>
> For example typing 12345 on the netconsole causes the message to be
> printed for every character:
>
> => Speed: 1000, full duplex
> 1Speed: 1000, full duplex
> 2Speed: 1000, full duplex
> 3Speed: 1000, full duplex
> 4Speed: 1000, full duplex
> 5Speed: 1000, full duplex
>
> Unknown command '12345' - try 'help'
> => Speed: 1000, full duplex
>
> Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
> ---
>
> Since the Speed message is useful, I don't particularly like this fix.
>
> drivers/net/tsec.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c
> index d8b6619..23e4622 100644
> --- a/drivers/net/tsec.c
> +++ b/drivers/net/tsec.c
> @@ -846,10 +846,10 @@ static void adjust_link(struct eth_device *dev)
> printf("%s: Speed was bad\n", dev->name);
> break;
> }
> -
> +#ifndef CONFIG_NETCONSOLE
> printf("Speed: %d, %s duplex\n", priv->speed,
> (priv->duplexity) ? "full" : "half");
> -
> +#endif
What if you changed the conditional to "strcmp(getenv("stdout"), nc)" so
the message still gets printed when not using a netconsole?
On a similar note, doesn't it seem a bit crazy that an ethernet
interface it brought up and down every time a packet is sent? I would
have thought that the interface needed to be constantly enabled to
support receiving incoming packets. If so, wouldn't the proper fix be
to not bring the interface up/down during netconsole use?
Best,
Peter
next prev parent reply other threads:[~2010-01-26 16:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-23 21:39 [U-Boot] [PATCH RFC] tsec: do not print Speed: if using netconsole Ed Swarthout
2010-01-26 16:53 ` Peter Tyser [this message]
2010-01-28 22:38 ` [U-Boot] [PATCH v2] " Ed Swarthout
2010-02-01 6:49 ` Ben Warren
2010-02-01 10:23 ` [U-Boot] [PATCH V3 for NET] " Ed Swarthout
2010-02-01 11:36 ` Wolfgang Denk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1264524803.26441.37.camel@localhost.localdomain \
--to=ptyser@xes-inc.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox