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:
parent
20d0f352f4
commit
aedb89e6c0
@ -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. */
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user