--- zzzz-none-000/linux-2.6.28.10/drivers/serial/serial_core.c 2009-05-02 18:54:43.000000000 +0000 +++ fusiv-7390-686/linux-2.6.28.10/drivers/serial/serial_core.c 2016-02-10 17:16:55.000000000 +0000 @@ -113,6 +113,8 @@ static void uart_tasklet_action(unsigned long data) { struct uart_state *state = (struct uart_state *)data; + /*--- printk(KERN_ERR "[%d:%s/%d] tty_wakeup %s\n", ---*/ + /*--- smp_processor_id(), __FUNCTION__, __LINE__, state->info->port.tty->name); ---*/ tty_wakeup(state->info->port.tty); } @@ -487,6 +489,23 @@ uart_start(tty); } +unsigned int enable_avm_console; +static int uart_avm_console(struct tty_struct *tty) { + + struct uart_state *state = tty->driver_data; + struct uart_port *port = state->port; + + if (port->cons) { + if (port->cons->flags & (CON_ENABLED | CON_CONSDEV)) { + if (enable_avm_console) + return 0; + else + return 1; + } + } + return 0; +} + static int uart_write(struct tty_struct *tty, const unsigned char *buf, int count) { @@ -2272,12 +2291,20 @@ struct uart_driver *drv = driver->driver_state; struct uart_state *state = drv->state + line; struct uart_port *port; + int ch; if (!state || !state->port) return -1; port = state->port; - return port->ops->poll_get_char(port); + ch = port->ops->poll_get_char(port); + + if (port->cons->flags & (CON_ENABLED | CON_CONSDEV)) { + if (ch == 0xD) { + enable_avm_console = 1; + } + } + return ch; } static void uart_poll_put_char(struct tty_driver *driver, int line, char ch) @@ -2324,6 +2351,7 @@ .poll_get_char = uart_poll_get_char, .poll_put_char = uart_poll_put_char, #endif + .is_avm_console = uart_avm_console, }; /**