diff options
author | marcel <marcel@FreeBSD.org> | 2009-10-02 22:30:44 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2009-10-02 22:30:44 +0000 |
commit | 6a8474f5b04346fb12ab646b3e74f79cb3e9d791 (patch) | |
tree | c6fe318664ecc37270ff8564c51d113fe9d87934 /sys/dev/uart/uart_bus.h | |
parent | 86b3bcad7dc713b1ee5da3749b9f6e8662a9f6ba (diff) | |
download | FreeBSD-src-6a8474f5b04346fb12ab646b3e74f79cb3e9d791.zip FreeBSD-src-6a8474f5b04346fb12ab646b3e74f79cb3e9d791.tar.gz |
Fix RTS/CTS flow control, broken by the TTY overhaul. The new TTY
interface is fairly simple WRT dealing with flow control, but
needed 2 new RX buffer functions with "get-char-from-buf" separated
from "advance-buf-pointer" so that the pointer could be advanced
only when ttydisc_rint() succeeded.
MFC after: 1 week
Diffstat (limited to 'sys/dev/uart/uart_bus.h')
-rw-r--r-- | sys/dev/uart/uart_bus.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/dev/uart/uart_bus.h b/sys/dev/uart/uart_bus.h index 7154d85..b1498f5 100644 --- a/sys/dev/uart/uart_bus.h +++ b/sys/dev/uart/uart_bus.h @@ -96,6 +96,7 @@ struct uart_softc { int sc_opened:1; /* This UART is open for business. */ int sc_polled:1; /* This UART has no interrupts. */ int sc_txbusy:1; /* This UART is transmitting. */ + int sc_isquelch:1; /* This UART has input squelched. */ struct uart_devinfo *sc_sysdev; /* System device (or NULL). */ @@ -141,6 +142,8 @@ int uart_bus_ipend(device_t dev); int uart_bus_probe(device_t dev, int regshft, int rclk, int rid, int chan); int uart_bus_sysdev(device_t dev); +void uart_sched_softih(struct uart_softc *, uint32_t); + int uart_tty_attach(struct uart_softc *); int uart_tty_detach(struct uart_softc *); void uart_tty_intr(void *arg); @@ -175,6 +178,28 @@ uart_rx_get(struct uart_softc *sc) } static __inline int +uart_rx_next(struct uart_softc *sc) +{ + int ptr; + + ptr = sc->sc_rxget; + if (ptr == sc->sc_rxput) + return (-1); + ptr += 1; + sc->sc_rxget = (ptr < sc->sc_rxbufsz) ? ptr : 0; + return (0); +} + +static __inline int +uart_rx_peek(struct uart_softc *sc) +{ + int ptr; + + ptr = sc->sc_rxget; + return ((ptr == sc->sc_rxput) ? -1 : sc->sc_rxbuf[ptr]); +} + +static __inline int uart_rx_put(struct uart_softc *sc, int xc) { int ptr; |