[U-Boot] [PATCH RFC] tsec: do not print Speed: if using netconsole

Ed Swarthout Ed.Swarthout at freescale.com
Sat Jan 23 22:39:04 CET 2010


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 at 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
 	} else {
 		printf("%s: No link.\n", dev->name);
 	}
-- 
1.5.6.5



More information about the U-Boot mailing list