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.
This commit is contained in:
Marcel Moolenaar 2006-04-02 21:45:54 +00:00
parent 81eb3f0f5f
commit 8d1289fe6d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=157418
2 changed files with 3 additions and 4 deletions

View file

@ -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. */

View file

@ -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);
}