diff options
author | Jerome Forissier <jerome.forissier@linaro.org> | 2025-03-06 15:32:22 +0100 |
---|---|---|
committer | Jerome Forissier <jerome.forissier@linaro.org> | 2025-03-11 14:16:03 +0100 |
commit | 64ce9bfc6d53423d4f6d382837a33c3dffb152af (patch) | |
tree | 32ad86f956b966ad016af988c5525d3d23c6220c /net/lwip/net-lwip.c | |
parent | 1728fa23494ccb7175bf56b4ab639976b8bcff37 (diff) |
net: lwip: add CONFIG_LWIP_DEBUG_RXTX
Add Kconfig symbol LWIP_DEBUG_RXTX to dump the incoming and outgoing
packets when NET_LWIP=y.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'net/lwip/net-lwip.c')
-rw-r--r-- | net/lwip/net-lwip.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/net/lwip/net-lwip.c b/net/lwip/net-lwip.c index 5a2a86686f4..c00a7fe97cd 100644 --- a/net/lwip/net-lwip.c +++ b/net/lwip/net-lwip.c @@ -5,6 +5,7 @@ #include <command.h> #include <dm/device.h> #include <dm/uclass.h> +#include <hexdump.h> #include <lwip/ip4_addr.h> #include <lwip/err.h> #include <lwip/netif.h> @@ -36,6 +37,12 @@ static err_t net_lwip_tx(struct netif *netif, struct pbuf *p) void *pp = NULL; int err; + if (CONFIG_IS_ENABLED(LWIP_DEBUG_RXTX)) { + printf("net_lwip_tx: %u bytes, udev %s\n", p->len, udev->name); + print_hex_dump("net_lwip_tx: ", 0, 16, 1, p->payload, p->len, + true); + } + if ((unsigned long)p->payload % PKTALIGN) { /* * Some net drivers have strict alignment requirements and may @@ -265,6 +272,13 @@ int net_lwip_rx(struct udevice *udev, struct netif *netif) flags = 0; if (len > 0) { + if (CONFIG_IS_ENABLED(LWIP_DEBUG_RXTX)) { + printf("net_lwip_tx: %u bytes, udev %s \n", len, + udev->name); + print_hex_dump("net_lwip_rx: ", 0, 16, 1, + packet, len, true); + } + pbuf = alloc_pbuf_and_copy(packet, len); if (pbuf) netif->input(pbuf, netif); |