]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
netconsole loses 2nd character of input
authorSuriyan Ramasami <suriyan.r@gmail.com>
Wed, 16 Oct 2013 16:54:24 +0000 (09:54 -0700)
committerTom Rini <trini@ti.com>
Fri, 8 Nov 2013 20:25:14 +0000 (15:25 -0500)
Netconsole loses the second character when used as input by
either setenv stdin nc or setenv stdin serial,nc if using CONSOLE_CONSOLE_MUX

Before a nc_send_packet() to echo the input, a check is done to see if
nc_ether is valid. If its not, it waits for an arp request and then sends
the packet (which contains the first character of line to be displayed as
output). As part of reaping the arp request, the second character is consumed.
We protect this by making the call to NetLoop(NETCONS) between
input_recursion.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/netconsole.c

index df8ab07b945f6c317308cc516359d7b3e72994fd..65c747e14b774ce502bdd6184a2c3fde307a4ea7 100644 (file)
@@ -184,7 +184,9 @@ static void nc_send_packet(const char *buf, int len)
                        return; /* inside net loop */
                output_packet = buf;
                output_packet_len = len;
+               input_recursion = 1;
                NetLoop(NETCONS); /* wait for arp reply and send packet */
+               input_recursion = 0;
                output_packet_len = 0;
                return;
        }