Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/uart/uart_tty.c
Show First 20 Lines • Show All 279 Lines • ▼ Show 20 Lines | uart_tty_param(struct tty *tp, struct termios *t) | ||||
stopbits = (t->c_cflag & CSTOPB) ? 2 : 1; | stopbits = (t->c_cflag & CSTOPB) ? 2 : 1; | ||||
if (t->c_cflag & PARENB) | if (t->c_cflag & PARENB) | ||||
parity = (t->c_cflag & PARODD) ? UART_PARITY_ODD : | parity = (t->c_cflag & PARODD) ? UART_PARITY_ODD : | ||||
UART_PARITY_EVEN; | UART_PARITY_EVEN; | ||||
else | else | ||||
parity = UART_PARITY_NONE; | parity = UART_PARITY_NONE; | ||||
if (UART_PARAM(sc, t->c_ospeed, databits, stopbits, parity) != 0) | if (UART_PARAM(sc, t->c_ospeed, databits, stopbits, parity) != 0) | ||||
return (EINVAL); | return (EINVAL); | ||||
if ((t->c_cflag & CNO_RTSDTR) == 0) | |||||
UART_SETSIG(sc, SER_DDTR | SER_DTR); | UART_SETSIG(sc, SER_DDTR | SER_DTR); | ||||
/* Set input flow control state. */ | /* Set input flow control state. */ | ||||
if (!sc->sc_hwiflow) { | if (!sc->sc_hwiflow) { | ||||
if ((t->c_cflag & CRTS_IFLOW) && sc->sc_isquelch) | if ((t->c_cflag & CRTS_IFLOW) && sc->sc_isquelch) | ||||
UART_SETSIG(sc, SER_DRTS); | UART_SETSIG(sc, SER_DRTS); | ||||
else | else { | ||||
if ((t->c_cflag & CNO_RTSDTR) == 0) | |||||
UART_SETSIG(sc, SER_DRTS | SER_RTS); | UART_SETSIG(sc, SER_DRTS | SER_RTS); | ||||
} | |||||
} else | } else | ||||
UART_IOCTL(sc, UART_IOCTL_IFLOW, (t->c_cflag & CRTS_IFLOW)); | UART_IOCTL(sc, UART_IOCTL_IFLOW, (t->c_cflag & CRTS_IFLOW)); | ||||
/* Set output flow control state. */ | /* Set output flow control state. */ | ||||
if (sc->sc_hwoflow) | if (sc->sc_hwoflow) | ||||
UART_IOCTL(sc, UART_IOCTL_OFLOW, (t->c_cflag & CCTS_OFLOW)); | UART_IOCTL(sc, UART_IOCTL_OFLOW, (t->c_cflag & CCTS_OFLOW)); | ||||
return (0); | return (0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines |