summaryrefslogtreecommitdiffstats
path: root/sys/sys/ttyqueue.h
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2009-10-19 07:17:37 +0000
committered <ed@FreeBSD.org>2009-10-19 07:17:37 +0000
commitd92da0f1c09a2f4ad0c89cde70730ba61a90c4e1 (patch)
treee5b553b26bb78eec8b8bd6b72dd2d03c7da28716 /sys/sys/ttyqueue.h
parentdc93fde3ad5398c4dda4df4aa39db70ffbf4e889 (diff)
downloadFreeBSD-src-d92da0f1c09a2f4ad0c89cde70730ba61a90c4e1.zip
FreeBSD-src-d92da0f1c09a2f4ad0c89cde70730ba61a90c4e1.tar.gz
Properly set the low watermarks when reducing the baud rate.
Now that buffers are deallocated lazily, we should not use tty*q_getsize() to obtain the buffer size to calculate the low watermarks. Doing this may cause the watermark to be placed outside the typical buffer size. This caused some regressions after my previous commit to the TTY code, which allows pseudo-devices to resize the buffers as well. Reported by: yongari, dougb MFC after: 1 week
Diffstat (limited to 'sys/sys/ttyqueue.h')
-rw-r--r--sys/sys/ttyqueue.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/sys/ttyqueue.h b/sys/sys/ttyqueue.h
index aac6b3c..2d1a565 100644
--- a/sys/sys/ttyqueue.h
+++ b/sys/sys/ttyqueue.h
@@ -93,6 +93,13 @@ ttyinq_getsize(struct ttyinq *ti)
}
static __inline size_t
+ttyinq_getallocatedsize(struct ttyinq *ti)
+{
+
+ return (ti->ti_quota * TTYINQ_DATASIZE);
+}
+
+static __inline size_t
ttyinq_bytesleft(struct ttyinq *ti)
{
size_t len;
@@ -143,6 +150,13 @@ ttyoutq_getsize(struct ttyoutq *to)
}
static __inline size_t
+ttyoutq_getallocatedsize(struct ttyoutq *to)
+{
+
+ return (to->to_quota * TTYOUTQ_DATASIZE);
+}
+
+static __inline size_t
ttyoutq_bytesleft(struct ttyoutq *to)
{
size_t len;
OpenPOWER on IntegriCloud