mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 00:21:17 +00:00
[SERIAL] Clean up and fix tty transmission start/stoping
The start_tx and stop_tx methods were passed a flag to indicate whether the start/stop was from the tty start/stop callbacks, and some drivers used this flag to decide whether to ask the UART to immediately stop transmission (where the UART supports such a feature.) There are other cases when we wish this to occur - when CTS is lowered, or if we change from soft to hard flow control and CTS is inactive. In these cases, this flag was false, and we would allow the transmitter to drain before stopping. There is really only one case where we want to let the transmitter drain before disabling, and that's when we run out of characters to send. Hence, re-jig the start_tx and stop_tx methods to eliminate this flag, and introduce new functions for the special "disable and allow transmitter to drain" case. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
commit
b129a8ccd5
34 changed files with 149 additions and 158 deletions
|
@ -142,8 +142,8 @@ struct uart_ops {
|
|||
unsigned int (*tx_empty)(struct uart_port *);
|
||||
void (*set_mctrl)(struct uart_port *, unsigned int mctrl);
|
||||
unsigned int (*get_mctrl)(struct uart_port *);
|
||||
void (*stop_tx)(struct uart_port *, unsigned int tty_stop);
|
||||
void (*start_tx)(struct uart_port *, unsigned int tty_start);
|
||||
void (*stop_tx)(struct uart_port *);
|
||||
void (*start_tx)(struct uart_port *);
|
||||
void (*send_xchar)(struct uart_port *, char ch);
|
||||
void (*stop_rx)(struct uart_port *);
|
||||
void (*enable_ms)(struct uart_port *);
|
||||
|
@ -468,13 +468,13 @@ uart_handle_cts_change(struct uart_port *port, unsigned int status)
|
|||
if (tty->hw_stopped) {
|
||||
if (status) {
|
||||
tty->hw_stopped = 0;
|
||||
port->ops->start_tx(port, 0);
|
||||
port->ops->start_tx(port);
|
||||
uart_write_wakeup(port);
|
||||
}
|
||||
} else {
|
||||
if (!status) {
|
||||
tty->hw_stopped = 1;
|
||||
port->ops->stop_tx(port, 0);
|
||||
port->ops->stop_tx(port);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue