Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/tty.c
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Lines | |||||
#define TTYSUP_IFLAG (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK|ISTRIP|\ | #define TTYSUP_IFLAG (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK|ISTRIP|\ | ||||
INLCR|IGNCR|ICRNL|IXON|IXOFF|IXANY|IMAXBEL) | INLCR|IGNCR|ICRNL|IXON|IXOFF|IXANY|IMAXBEL) | ||||
#define TTYSUP_OFLAG (OPOST|ONLCR|TAB3|ONOEOT|OCRNL|ONOCR|ONLRET) | #define TTYSUP_OFLAG (OPOST|ONLCR|TAB3|ONOEOT|OCRNL|ONOCR|ONLRET) | ||||
#define TTYSUP_LFLAG (ECHOKE|ECHOE|ECHOK|ECHO|ECHONL|ECHOPRT|\ | #define TTYSUP_LFLAG (ECHOKE|ECHOE|ECHOK|ECHO|ECHONL|ECHOPRT|\ | ||||
ECHOCTL|ISIG|ICANON|ALTWERASE|IEXTEN|TOSTOP|\ | ECHOCTL|ISIG|ICANON|ALTWERASE|IEXTEN|TOSTOP|\ | ||||
FLUSHO|NOKERNINFO|NOFLSH) | FLUSHO|NOKERNINFO|NOFLSH) | ||||
#define TTYSUP_CFLAG (CIGNORE|CSIZE|CSTOPB|CREAD|PARENB|PARODD|\ | #define TTYSUP_CFLAG (CIGNORE|CSIZE|CSTOPB|CREAD|PARENB|PARODD|\ | ||||
HUPCL|CLOCAL|CCTS_OFLOW|CRTS_IFLOW|CDTR_IFLOW|\ | HUPCL|CLOCAL|CCTS_OFLOW|CRTS_IFLOW|CDTR_IFLOW|\ | ||||
CDSR_OFLOW|CCAR_OFLOW) | CDSR_OFLOW|CCAR_OFLOW|CNO_RTSDTR) | ||||
#define TTY_CALLOUT(tp,d) (dev2unit(d) & TTYUNIT_CALLOUT) | #define TTY_CALLOUT(tp,d) (dev2unit(d) & TTYUNIT_CALLOUT) | ||||
static int tty_drainwait = 5 * 60; | static int tty_drainwait = 5 * 60; | ||||
SYSCTL_INT(_kern, OID_AUTO, tty_drainwait, CTLFLAG_RWTUN, | SYSCTL_INT(_kern, OID_AUTO, tty_drainwait, CTLFLAG_RWTUN, | ||||
&tty_drainwait, 0, "Default output drain timeout in seconds"); | &tty_drainwait, 0, "Default output drain timeout in seconds"); | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 222 Lines • ▼ Show 20 Lines | if (TTY_CALLOUT(tp, dev)) | ||||
tp->t_termios = tp->t_termios_init_out; | tp->t_termios = tp->t_termios_init_out; | ||||
else | else | ||||
tp->t_termios = tp->t_termios_init_in; | tp->t_termios = tp->t_termios_init_in; | ||||
ttydevsw_param(tp, &tp->t_termios); | ttydevsw_param(tp, &tp->t_termios); | ||||
/* Prevent modem control on callout devices and /dev/console. */ | /* Prevent modem control on callout devices and /dev/console. */ | ||||
if (TTY_CALLOUT(tp, dev) || dev == dev_console) | if (TTY_CALLOUT(tp, dev) || dev == dev_console) | ||||
tp->t_termios.c_cflag |= CLOCAL; | tp->t_termios.c_cflag |= CLOCAL; | ||||
if ((tp->t_termios.c_cflag & CNO_RTSDTR) == 0) | |||||
ttydevsw_modem(tp, SER_DTR|SER_RTS, 0); | ttydevsw_modem(tp, SER_DTR|SER_RTS, 0); | ||||
error = ttydevsw_open(tp); | error = ttydevsw_open(tp); | ||||
if (error != 0) | if (error != 0) | ||||
goto done; | goto done; | ||||
ttydisc_open(tp); | ttydisc_open(tp); | ||||
error = tty_watermarks(tp); | error = tty_watermarks(tp); | ||||
if (error != 0) | if (error != 0) | ||||
▲ Show 20 Lines • Show All 2,014 Lines • Show Last 20 Lines |