aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/uart/uart_bus.h
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2009-10-10 18:24:54 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2009-10-10 18:24:54 +0000
commit879632020a655570c2e441380ea9d800f95e7620 (patch)
tree8d39bcd322933d3d82170b66751908ab4c0269fd /sys/dev/uart/uart_bus.h
parent225cdb4e6cf78145df80ed46ab4955d47e44dcfb (diff)
Notes
Diffstat (limited to 'sys/dev/uart/uart_bus.h')
-rw-r--r--sys/dev/uart/uart_bus.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/sys/dev/uart/uart_bus.h b/sys/dev/uart/uart_bus.h
index 7154d859026a..b1498f5f0a99 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;