summaryrefslogtreecommitdiff
path: root/drivers/net/netconsole.c
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2012-05-23 08:01:04 +0000
committerJoe Hershberger <joe.hershberger@ni.com>2012-05-23 17:53:08 -0500
commit4ef8d53caadbab5585ccb4df2d087183b1383b86 (patch)
tree5e4aeca8a2c86a983f08d573405594c68691db7e /drivers/net/netconsole.c
parentc697576262be11ddab48e1890428495e2fef1751 (diff)
downloadu-boot-imx-4ef8d53caadbab5585ccb4df2d087183b1383b86.zip
u-boot-imx-4ef8d53caadbab5585ccb4df2d087183b1383b86.tar.gz
u-boot-imx-4ef8d53caadbab5585ccb4df2d087183b1383b86.tar.bz2
net: Allow filtering on debug traces in the net subsystem
Add several levels of DEBUG prints so that you can limit the noise to the severety of your problem. DEBUG_LL_STATE = Link local state machine changes DEBUG_DEV_PKT = Packets or info directed to the device DEBUG_NET_PKT = Packets on info on the network at large DEBUG_INT_STATE = Internal network state changes Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net/netconsole.c')
-rw-r--r--drivers/net/netconsole.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 19e563e..14243b8 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -83,6 +83,8 @@ int nc_input_packet(uchar *pkt, unsigned dest, unsigned src, unsigned len)
if (dest != nc_port || !len)
return 0; /* not for us */
+ debug_cond(DEBUG_DEV_PKT, "input: \"%*.*s\"\n", len, len, pkt);
+
if (input_size == sizeof(input_buffer))
return 1; /* no space */
if (len > sizeof(input_buffer) - input_size)
@@ -112,6 +114,8 @@ static void nc_send_packet(const char *buf, int len)
uchar *ether;
IPaddr_t ip;
+ debug_cond(DEBUG_DEV_PKT, "output: \"%*.*s\"\n", len, len, buf);
+
eth = eth_get_dev();
if (eth == NULL)
return;