From: Michael Walle Date: Fri, 7 Oct 2011 12:27:50 +0000 (+0000) Subject: netconsole: support packets longer than 512 bytes X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=1a9845b4f00a2930b2c06dabd6cf9bee4ca1437c;p=u-boot.git netconsole: support packets longer than 512 bytes Esp. while printing the environment the output is usually longer than 512 bytes. Instead of cutting the message, send multiple 512 bytes packets. Signed-off-by: Michael Walle Acked-by: Mike Frysinger --- diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index e40efb826b..56ba64fbb0 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -189,10 +189,13 @@ static void nc_puts(const char *s) return; output_recursion = 1; - if ((len = strlen (s)) > 512) - len = 512; - - nc_send_packet (s, len); + len = strlen(s); + while (len) { + int send_len = min(len, 512); + nc_send_packet(s, send_len); + len -= send_len; + s += send_len; + } output_recursion = 0; }