net: Make the netconsole buffer size configurable
[oweals/u-boot.git] / drivers / net / netconsole.c
index 86f5301141a9c6a03301dbd3fa14817f0aa96dd0..8fcf31c4e9bb612e900bbcf20a9d9641afb27568 100644 (file)
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static char input_buffer[512];
+#ifndef CONFIG_NETCONSOLE_BUFFER_SIZE
+#define CONFIG_NETCONSOLE_BUFFER_SIZE 512
+#endif
+
+static char input_buffer[CONFIG_NETCONSOLE_BUFFER_SIZE];
 static int input_size; /* char count in input buffer */
 static int input_offset; /* offset to valid chars in input buffer */
 static int input_recursion;
@@ -214,7 +218,7 @@ static void nc_puts(const char *s)
 
        len = strlen(s);
        while (len) {
-               int send_len = min(len, 512);
+               int send_len = min(len, sizeof(input_buffer));
                nc_send_packet(s, send_len);
                len -= send_len;
                s += send_len;