aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Walle <michael@walle.cc>2011-10-07 12:27:50 +0000
committerWolfgang Denk <wd@denx.de>2011-10-09 23:24:48 +0200
commit1a9845b4f00a2930b2c06dabd6cf9bee4ca1437c (patch)
tree352f3209fb9576c67686a1b7d50c8a3eaebf441b
parentca366d0e382bed14c7914e2327c6460ecdddcffd (diff)
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 <michael@walle.cc> Acked-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--drivers/net/netconsole.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index e40efb826..56ba64fbb 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;
}