[SERIAL] kernel console should send CRLF not LFCR
Glen Turner reported that writing LFCR rather than the more traditional CRLF causes issues with some terminals. Since this aflicts many serial drivers, extract the common code to a library function (uart_console_write) and arrange for each driver to supply a "putchar" function. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Este cometimento está contido em:

cometido por
Russell King

ascendente
7705a8792b
cometimento
d358788f3f
@@ -674,11 +674,12 @@ static void dz_reset(struct dz_port *dport)
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SERIAL_DZ_CONSOLE
|
||||
static void dz_console_put_char(struct dz_port *dport, unsigned char ch)
|
||||
static void dz_console_putchar(struct uart_port *port, int ch)
|
||||
{
|
||||
struct dz_port *dport = (struct dz_port *)uport;
|
||||
unsigned long flags;
|
||||
int loops = 2500;
|
||||
unsigned short tmp = ch;
|
||||
unsigned short tmp = (unsigned char)ch;
|
||||
/* this code sends stuff out to serial device - spinning its
|
||||
wheels and waiting. */
|
||||
|
||||
@@ -694,6 +695,7 @@ static void dz_console_put_char(struct dz_port *dport, unsigned char ch)
|
||||
|
||||
spin_unlock_irqrestore(&dport->port.lock, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* -------------------------------------------------------------------
|
||||
* dz_console_print ()
|
||||
@@ -710,11 +712,7 @@ static void dz_console_print(struct console *cons,
|
||||
#ifdef DEBUG_DZ
|
||||
prom_printf((char *) str);
|
||||
#endif
|
||||
while (count--) {
|
||||
if (*str == '\n')
|
||||
dz_console_put_char(dport, '\r');
|
||||
dz_console_put_char(dport, *str++);
|
||||
}
|
||||
uart_console_write(&dport->port, str, count, dz_console_putchar);
|
||||
}
|
||||
|
||||
static int __init dz_console_setup(struct console *co, char *options)
|
||||
|
Criar uma nova questão referindo esta
Bloquear um utilizador