MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mtk_uart_bus_getsig

Function mtk_uart_bus_getsig

freebsd/mips/mediatek/uart_dev_mtk.c:345–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345static int
346mtk_uart_bus_getsig(struct uart_softc *sc)
347{
348 uint32_t new, old, sig;
349 uint8_t bes;
350
351 return(0);
352 do {
353 old = sc->sc_hwsig;
354 sig = old;
355 uart_lock(sc->sc_hwmtx);
356 bes = uart_getreg(&sc->sc_bas, UART_MSR_REG);
357 uart_unlock(sc->sc_hwmtx);
358 /* XXX: chip can show delta */
359 SIGCHG(bes & UART_MSR_CTS, sig, SER_CTS, SER_DCTS);
360 SIGCHG(bes & UART_MSR_DCD, sig, SER_DCD, SER_DDCD);
361 SIGCHG(bes & UART_MSR_DSR, sig, SER_DSR, SER_DDSR);
362 new = sig & ~SER_MASK_DELTA;
363 } while (!atomic_cmpset_32(&sc->sc_hwsig, old, new));
364
365 return (sig);
366}
367
368static int
369mtk_uart_bus_ioctl(struct uart_softc *sc, int request, intptr_t data)

Callers 1

mtk_uart_bus_attachFunction · 0.85

Calls 1

atomic_cmpset_32Function · 0.50

Tested by

no test coverage detected