]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
netconsole: support packets longer than 512 bytes
authorMichael Walle <michael@walle.cc>
Fri, 7 Oct 2011 12:27:50 +0000 (12:27 +0000)
committerWolfgang Denk <wd@denx.de>
Sun, 9 Oct 2011 21:24:48 +0000 (23:24 +0200)
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>
drivers/net/netconsole.c

index e40efb826bb13973a621584afedaf3c00886ee7d..56ba64fbb030121e0e6f1ec2d2613fe93e6cc235 100644 (file)
@@ -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;
 }