summaryrefslogtreecommitdiff
path: root/sys/kern/tty_pty.c
diff options
context:
space:
mode:
authorStefan Fritsch <sf@cvs.openbsd.org>2016-01-14 09:44:09 +0000
committerStefan Fritsch <sf@cvs.openbsd.org>2016-01-14 09:44:09 +0000
commit760ace11e6ffc4748736f080e7b7ac0065399b1a (patch)
tree367387f9bf914bb1e225423a7902e4946d706f08 /sys/kern/tty_pty.c
parente3d0c036438f6732dd0fa4343e7817afec346363 (diff)
Increase buffer sizes and watermarks for tty and ppp
Use 115200 the default speed for buffer sizing in ttymalloc(). A lot of devices call ttymalloc(0) so this affects quite a few of them. Increases the buffer size for 9600 < baud <= 115200 from 1k to 4k. Make ppp use the lo/hi watermarks from the tty layer which are adjusted according to speed + buffer size. The previous fixed values of 100 and 400 were way too small Make pty call ttymalloc() with baud == 1000000, which is the common value used in the tree for "fast". ok deraadt@
Diffstat (limited to 'sys/kern/tty_pty.c')
-rw-r--r--sys/kern/tty_pty.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 40b2db29982..d94d91b1d15 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.74 2015/12/05 10:11:53 tedu Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.75 2016/01/14 09:44:08 sf Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -193,7 +193,7 @@ check_pty(int minor)
if (!pt_softc[minor]) {
pti = malloc(sizeof(struct pt_softc), M_DEVBUF,
M_WAITOK|M_ZERO);
- pti->pt_tty = ttymalloc(0);
+ pti->pt_tty = ttymalloc(1000000);
ptydevname(minor, pti);
pt_softc[minor] = pti;
}
@@ -235,7 +235,7 @@ ptsopen(dev_t dev, int flag, int devtype, struct proc *p)
pti = pt_softc[minor(dev)];
if (!pti->pt_tty) {
- tp = pti->pt_tty = ttymalloc(0);
+ tp = pti->pt_tty = ttymalloc(1000000);
} else
tp = pti->pt_tty;
if ((tp->t_state & TS_ISOPEN) == 0) {
@@ -245,7 +245,7 @@ ptsopen(dev_t dev, int flag, int devtype, struct proc *p)
tp->t_oflag = TTYDEF_OFLAG;
tp->t_lflag = TTYDEF_LFLAG;
tp->t_cflag = TTYDEF_CFLAG;
- tp->t_ispeed = tp->t_ospeed = TTYDEF_SPEED;
+ tp->t_ispeed = tp->t_ospeed = B115200;
ttsetwater(tp); /* would be done in xxparam() */
} else if (tp->t_state&TS_XCLUDE && suser(p, 0) != 0)
return (EBUSY);
@@ -412,7 +412,7 @@ ptcopen(dev_t dev, int flag, int devtype, struct proc *p)
pti = pt_softc[minor(dev)];
if (!pti->pt_tty) {
- tp = pti->pt_tty = ttymalloc(0);
+ tp = pti->pt_tty = ttymalloc(1000000);
} else
tp = pti->pt_tty;
if (tp->t_oproc)