Skip to content
Snippets Groups Projects
Commit 2c8fe512 authored by Joe Hershberger's avatar Joe Hershberger
Browse files

net: Make the netconsole buffer size configurable


Allow a board to configure a larger buffer for netconsole, but leave
the default.

Signed-off-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
parent dcd5a593
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,8 @@ serial and network input/output devices by adjusting the 'stdin' and ...@@ -6,6 +6,8 @@ serial and network input/output devices by adjusting the 'stdin' and
set either of these variables to "nc". Input and output can be set either of these variables to "nc". Input and output can be
switched independently. switched independently.
CONFIG_NETCONSOLE_BUFFER_SIZE - Override the default buffer size
We use an environment variable 'ncip' to set the IP address and the We use an environment variable 'ncip' to set the IP address and the
port of the destination. The format is <ip_addr>:<port>. If <port> is port of the destination. The format is <ip_addr>:<port>. If <port> is
omitted, the value of 6666 is used. If the env var doesn't exist, the omitted, the value of 6666 is used. If the env var doesn't exist, the
......
...@@ -28,7 +28,11 @@ ...@@ -28,7 +28,11 @@
DECLARE_GLOBAL_DATA_PTR; 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_size; /* char count in input buffer */
static int input_offset; /* offset to valid chars in input buffer */ static int input_offset; /* offset to valid chars in input buffer */
static int input_recursion; static int input_recursion;
...@@ -214,7 +218,7 @@ static void nc_puts(const char *s) ...@@ -214,7 +218,7 @@ static void nc_puts(const char *s)
len = strlen(s); len = strlen(s);
while (len) { while (len) {
int send_len = min(len, 512); int send_len = min(len, sizeof(input_buffer));
nc_send_packet(s, send_len); nc_send_packet(s, send_len);
len -= send_len; len -= send_len;
s += send_len; s += send_len;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment