SCCS-vsn: sys/kern/tty_compat.c 7.7
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)tty_compat.c 7.6 (Berkeley) %G%
+ * @(#)tty_compat.c 7.7 (Berkeley) %G%
-/* XXX - fold these two tables into one */
static struct speedtab compatspeeds[] = {
38400, 15,
19200, 14,
static struct speedtab compatspeeds[] = {
38400, 15,
19200, 14,
1800, 2400, 4800, 9600, 19200, 38400,
};
1800, 2400, 4800, 9600, 19200, 38400,
};
+ttspeedtab(speed, table)
+ register struct speedtab *table;
+{
+
+ for ( ; table->sp_speed != -1; table++)
+ if (table->sp_speed == speed)
+ return (table->sp_code);
+ return (-1);
+}
+
/*ARGSUSED*/
ttcompat(tp, com, data, flag)
register struct tty *tp;
caddr_t data;
{
/*ARGSUSED*/
ttcompat(tp, com, data, flag)
register struct tty *tp;
caddr_t data;
{
case TIOCGETP: {
register struct sgttyb *sg = (struct sgttyb *)data;
register u_char *cc = tp->t_cc;
case TIOCGETP: {
register struct sgttyb *sg = (struct sgttyb *)data;
register u_char *cc = tp->t_cc;
term.c_ospeed = compatspcodes[speed];
term.c_cc[VERASE] = sg->sg_erase;
term.c_cc[VKILL] = sg->sg_kill;
term.c_ospeed = compatspcodes[speed];
term.c_cc[VERASE] = sg->sg_erase;
term.c_cc[VKILL] = sg->sg_kill;
- tp->t_flags = (tp->t_flags&0xffff0000) | sg->sg_flags;
+ tp->t_flags = tp->t_flags&0xffff0000 | sg->sg_flags&0xffff;
ttcompatsetflags(tp, &term);
return (ttioctl(tp, com == TIOCSETP ? TIOCSETAF : TIOCSETA,
&term, flag));
ttcompatsetflags(tp, &term);
return (ttioctl(tp, com == TIOCSETP ? TIOCSETAF : TIOCSETA,
&term, flag));
case OTIOCSETD: {
int ldisczero = 0;
case OTIOCSETD: {
int ldisczero = 0;
- return(ttioctl(tp, TIOCSETD,
+ return (ttioctl(tp, TIOCSETD,
*(int *)data == 2 ? (caddr_t)&ldisczero : data, flag));
*(int *)data == 2 ? (caddr_t)&ldisczero : data, flag));
case OTIOCCONS:
*(int *)data = 1;
case OTIOCCONS:
*(int *)data = 1;
- return(ttioctl(tp, TIOCCONS, data, flag));
- }
+ return (ttioctl(tp, TIOCCONS, data, flag));
} else {
iflag |= BRKINT|IXON|IMAXBEL;
oflag |= OPOST;
} else {
iflag |= BRKINT|IXON|IMAXBEL;
oflag |= OPOST;
+ lflag |= ISIG|IEXTEN|ECHOCTL; /* XXX was echoctl on ? */
if (flags & XTABS)
oflag |= OXTABS;
else
if (flags & XTABS)
oflag |= OXTABS;
else
cflag |= CS8;
if ((flags&(RAW|PASS8)) == 0)
iflag |= ISTRIP;
cflag |= CS8;
if ((flags&(RAW|PASS8)) == 0)
iflag |= ISTRIP;
+ else
+ iflag &= ~ISTRIP;
} else {
cflag &= ~CSIZE;
cflag |= CS7|PARENB;
} else {
cflag &= ~CSIZE;
cflag |= CS7|PARENB;
}
if ((flags&(EVENP|ODDP)) == EVENP) {
iflag |= INPCK;
}
if ((flags&(EVENP|ODDP)) == EVENP) {
iflag |= INPCK;