Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/uart/uart_core.c
Show First 20 Lines • Show All 327 Lines • ▼ Show 20 Lines | uart_intr_overrun(void *arg) | ||||
struct uart_softc *sc = arg; | struct uart_softc *sc = arg; | ||||
if (sc->sc_opened) { | if (sc->sc_opened) { | ||||
UART_RECEIVE(sc); | UART_RECEIVE(sc); | ||||
if (uart_rx_put(sc, UART_STAT_OVERRUN)) | if (uart_rx_put(sc, UART_STAT_OVERRUN)) | ||||
sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; | sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; | ||||
uart_sched_softih(sc, SER_INT_RXREADY); | uart_sched_softih(sc, SER_INT_RXREADY); | ||||
} | } | ||||
sc->sc_rxoverruns++; | |||||
UART_FLUSH(sc, UART_FLUSH_RECEIVER); | UART_FLUSH(sc, UART_FLUSH_RECEIVER); | ||||
return (0); | return (0); | ||||
} | } | ||||
/* | /* | ||||
* Received data ready. | * Received data ready. | ||||
*/ | */ | ||||
static __inline int | static __inline int | ||||
▲ Show 20 Lines • Show All 391 Lines • ▼ Show 20 Lines | uart_bus_attach(device_t dev) | ||||
} else { | } else { | ||||
if ((error = uart_tty_attach(sc)) != 0) | if ((error = uart_tty_attach(sc)) != 0) | ||||
goto fail; | goto fail; | ||||
uart_pps_init(sc); | uart_pps_init(sc); | ||||
} | } | ||||
if (sc->sc_sysdev != NULL) | if (sc->sc_sysdev != NULL) | ||||
sc->sc_sysdev->hwmtx = sc->sc_hwmtx; | sc->sc_sysdev->hwmtx = sc->sc_hwmtx; | ||||
if (sc->sc_rxfifosz > 1) | |||||
SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), | |||||
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, | |||||
"rx_overruns", CTLFLAG_RD, &sc->sc_rxoverruns, 0, | |||||
"Receive overruns"); | |||||
return (0); | return (0); | ||||
fail: | fail: | ||||
free(sc->sc_txbuf, M_UART); | free(sc->sc_txbuf, M_UART); | ||||
free(sc->sc_rxbuf, M_UART); | free(sc->sc_rxbuf, M_UART); | ||||
if (sc->sc_ires != NULL) { | if (sc->sc_ires != NULL) { | ||||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |