summaryrefslogtreecommitdiffstats
path: root/sys/dev/uart/uart_dev_ns8250.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2006-04-02 21:45:54 +0000
committermarcel <marcel@FreeBSD.org>2006-04-02 21:45:54 +0000
commitaedb89e6c06a1c4a2f003f777de42a9d05b5b4a8 (patch)
treeeb31ca7499d49c1a5e87b5bf5d5c653178dd3417 /sys/dev/uart/uart_dev_ns8250.c
parent20d0f352f4e624e4a02018ab9f879774a7575bed (diff)
downloadFreeBSD-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/uart_dev_ns8250.c')
-rw-r--r--sys/dev/uart/uart_dev_ns8250.c6
1 files changed, 3 insertions, 3 deletions
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);
}
OpenPOWER on IntegriCloud