diff options
author | marcel <marcel@FreeBSD.org> | 2006-04-02 21:45:54 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2006-04-02 21:45:54 +0000 |
commit | aedb89e6c06a1c4a2f003f777de42a9d05b5b4a8 (patch) | |
tree | eb31ca7499d49c1a5e87b5bf5d5c653178dd3417 /sys/dev/uart | |
parent | 20d0f352f4e624e4a02018ab9f879774a7575bed (diff) | |
download | FreeBSD-src-aedb89e6c06a1c4a2f003f777de42a9d05b5b4a8.zip FreeBSD-src-aedb89e6c06a1c4a2f003f777de42a9d05b5b4a8.tar.gz |
Eliminate the sc_hasfifo flag from the softc. It was only used by
the NS8250 class driver. The UART has FIFOs if sc_rxfifosz>1, so
test for that instead.
While here properly initialize sc_rxfifosz and sc_txfifosz in the
case the UART doesn't have FIFOs.
Diffstat (limited to 'sys/dev/uart')
-rw-r--r-- | sys/dev/uart/uart_bus.h | 1 | ||||
-rw-r--r-- | sys/dev/uart/uart_dev_ns8250.c | 6 |
2 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/uart/uart_bus.h b/sys/dev/uart/uart_bus.h index 7c5f47a..19ceab0 100644 --- a/sys/dev/uart/uart_bus.h +++ b/sys/dev/uart/uart_bus.h @@ -93,7 +93,6 @@ struct uart_softc { int sc_callout:1; /* This UART is opened for callout. */ int sc_fastintr:1; /* This UART uses fast interrupts. */ - int sc_hasfifo:1; /* This UART has FIFOs. */ int sc_hwiflow:1; /* This UART has HW input flow ctl. */ int sc_hwoflow:1; /* This UART has HW output flow ctl. */ int sc_leaving:1; /* This UART is going away. */ diff --git a/sys/dev/uart/uart_dev_ns8250.c b/sys/dev/uart/uart_dev_ns8250.c index adb4502..968f3d7 100644 --- a/sys/dev/uart/uart_dev_ns8250.c +++ b/sys/dev/uart/uart_dev_ns8250.c @@ -443,7 +443,7 @@ ns8250_bus_flush(struct uart_softc *sc, int what) bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); - if (sc->sc_hasfifo) { + if (sc->sc_rxfifosz > 1) { ns8250_flush(bas, what); uart_setreg(bas, REG_FCR, ns8250->fcr); uart_barrier(bas); @@ -635,14 +635,14 @@ ns8250_bus_probe(struct uart_softc *sc) */ uart_setreg(bas, REG_FCR, FCR_ENABLE); uart_barrier(bas); - sc->sc_hasfifo = (uart_getreg(bas, REG_IIR) & IIR_FIFO_MASK) ? 1 : 0; - if (!sc->sc_hasfifo) { + if (!(uart_getreg(bas, REG_IIR) & IIR_FIFO_MASK)) { /* * NS16450 or INS8250. We don't bother to differentiate * between them. They're too old to be interesting. */ uart_setreg(bas, REG_MCR, mcr); uart_barrier(bas); + sc->sc_rxfifosz = sc->sc_txfifosz = 1; device_set_desc(sc->sc_dev, "8250 or 16450 or compatible"); return (0); } |