read this:
78 static void uart_stop(struct tty_struct *tty) 79 { 80 struct uart_state *state = tty->driver_data; 81 struct uart_port *port = state->uart_port; 82 unsigned long flags; 83 84 spin_lock_irqsave(&port->lock, flags); 85 port->ops->stop_tx(port); 86 spin_unlock_irqrestore(&port->lock, flags); 87 } 88From above, u can see stop_tx() can be called, looking further into 8250.c:
static void serial8250_stop_tx(struct uart_port *port){struct uart_8250_port *up =container_of(port, struct uart_8250_port, port);__stop_tx(up);/** We really want to stop the transmitter from sending.*/if (up->port.type == PORT_16C950) {up->acr |= UART_ACR_TXDIS;serial_icr_write(up, UART_ACR, up->acr);}}And referring further to definition:/** The 16C950 Additional Control Register*/#define UART_ACR_RXDIS 0x01 /* Receiver disable */#define UART_ACR_TXDIS 0x02 /* Transmitter disable */So perhaps writing UART_ACR_XXX_DIS will disable the input/output:drivers/tty/serial/8250.c: up->acr |= UART_ACR_TXDIS;drivers/tty/serial/8250.c: up->acr &= ~UART_ACR_TXDIS;Experiment first....I am just guessing....
Hi, all~
I'm studying in an embedded Linux board with only one uart, which is
set default as the console display. Now as I try to develop uart
driver, I want to shutdown this console redirection temporarily. But I
don't know how? I search the Internet, but there's only the tutorial
for setting this redirection rather than shutdown it. Is there anyone
can help? Thank you very much.
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies