From: Michael Walle Date: Sat, 8 Oct 2011 00:27:50 +0200 Subject: [U-Boot] [PATCH v2] netconsole: support packets longer than 512 bytes Message-ID: <1318026470-21476-1-git-send-email-michael@walle.cc> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- drivers/net/netconsole.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index e40efb8..56ba64f 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; } -- 1.7.2.5