From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Stas Sergeev <stsp@list.ru>
Cc: Linux kernel <linux-kernel@vger.kernel.org>,
linux-serial@vger.kernel.org
Subject: Re: Q: how to control the TTY output queue in real time?
Date: Fri, 10 Aug 2012 20:33:55 +0100 [thread overview]
Message-ID: <20120810203355.224622cc@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <50255E31.8060904@list.ru>
> I am writing an app that needs to control the
> serial xmit in real-time. What I need is a notification
> that the TTY output queue fillup (returned by TIOCOUTQ
> ioctl) have dropped below the specified value.
Not a supported feature basically.
> I haven't found anything that can help implementing
> this. If I can't get an async notification, the sync
> notification will do too, like, for instance, the tcdrain()
> call, but with the argument to specify the needed fillup,
> below which the function will return.
> If there is nothing like this, then even the notification
> on every transmitted char will do.
> But I've found nothing of the above. :(
>
> Any suggestions how the real-time control can be
> implemented?
Bascially even on the hardware that knows with this degree of granularity
we don't propogate the information back in the manner you want.
I'm not sure its a total loss however. Currently all the code basically
does stuff in the tx path or tx irq handler along the line of
if (bytes_left < constant)
write_wakeup
and I suspect if you made that adjustable and turned off the fifo and any
other funnies you'd at least make it work for a sufficiently rigged demo.
We could in theory put it in the tty_port in future too if its general
purpose useful.
Alan
next prev parent reply other threads:[~2012-08-10 19:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-10 19:17 Q: how to control the TTY output queue in real time? Stas Sergeev
2012-08-10 19:33 ` Alan Cox [this message]
2012-08-10 19:54 ` Stas Sergeev
2012-08-10 20:15 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120810203355.224622cc@pyramind.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=stsp@list.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox