--- zzzz-none-000/linux-4.19.183/drivers/tty/serial/serial_core.c 2021-03-24 10:07:39.000000000 +0000 +++ bcm63-7530ax-756/linux-4.19.183/drivers/tty/serial/serial_core.c 2023-06-28 08:54:20.000000000 +0000 @@ -570,6 +570,37 @@ uart_start(tty); } +#if defined(CONFIG_AVM_ENHANCED) +/*----------------------------------------------------------------------------*\ + * keine Ausgaben auf der Console + * avm_console_enabled=1 schaltet die Ausgaben auf der Console ueber n_tty_write + * wieder frei beim Kunden beachtet niemand die Ausgaben auf der Console +\*----------------------------------------------------------------------------*/ +unsigned int avm_console_enabled; +EXPORT_SYMBOL(avm_console_enabled); + +static int uart_avm_console_enabled(struct tty_struct *tty) +{ + struct uart_state *state = tty->driver_data; + struct uart_port *port = state->uart_port; + + if (port->cons) { + if (port->cons->flags & (CON_ENABLED | CON_CONSDEV)) { + return avm_console_enabled; + } + } + return 1; +} + +static int setup_debug_console(char *p) +{ + avm_console_enabled = 1; + return 0; +} + +__setup("debug_console", setup_debug_console); +#endif + static int uart_write(struct tty_struct *tty, const unsigned char *buf, int count) { @@ -2450,6 +2481,9 @@ .poll_get_char = uart_poll_get_char, .poll_put_char = uart_poll_put_char, #endif +#if defined(CONFIG_AVM_ENHANCED) + .avm_console_enabled = uart_avm_console_enabled, +#endif }; static const struct tty_port_operations uart_port_ops = {