From: Grant Edwards <grant.b.edwards@gmail.com>
To: linux-serial@vger.kernel.org
Subject: Re: tty loop-back device
Date: Mon, 30 Sep 2013 22:28:59 +0000 (UTC) [thread overview]
Message-ID: <l2ctvb$nd3$1@ger.gmane.org> (raw)
In-Reply-To: l28jnt$j67$1@ger.gmane.org
On 2013-09-29, Matwey V. Kornilov <matwey.kornilov@gmail.com> wrote:
> 29.09.2013 07:21, Grant Edwards ?????:
>> I was thinking about initially just creating a blocking ioctl() call
>> that the master can use to wait for either a termios configuration
>> change or a modem control line change. I admit that's not as elegent:
>> it would mean a master would need multiple threads in most cases (one
>> for data and one for config and modem status). But, it may be a less
>> intrusive change [I haven't looked at the poll implementation in any
>> detail, so perhaps the poll change isn't as bad as I fear.]
>
> The simplier way is to use master in 'packet mode' (see TIOCPKT). Then
> we can distinguish stream data from termios notification for every
> master's read. It either starts with '\0' and the following is the data
> to transmit or with control symbol and then master have to use ioctl to
> read new tty->termios.
I can't believe I didn't know about packet mode. That's exactly what
is needed. Defining two new bits (e.g. TIOCPKT_TERMIOS, TIOCPKT_MSET)
would pretty much take care of things. Just a single new bit to
notify of changes to either termios or modem lines would be good
enough.
> We need way more ioctls. Since every new slave pty is enumerated
> almost randomly (depends on how many sessions is opened, opening
> order, etc), we have to mark somehow the pty when the daemon creates
> it, then udev should be able to create appropriate symbolic link for
> client user-space application. Then user-space client may be
> configured to work with /dev/tty/by-name/uniqname for instance.
I've never looked at how pty slave side device nodes get named...
--
Grant Edwards grant.b.edwards Yow! I just forgot my whole
at philosophy of life!!!
gmail.com
prev parent reply other threads:[~2013-09-30 22:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-28 12:59 tty loop-back device Matwey V. Kornilov
2013-09-28 16:03 ` Grant Edwards
2013-09-28 17:15 ` Greg KH
2013-09-28 17:21 ` Matwey V. Kornilov
2013-09-28 20:41 ` Matwey V. Kornilov
2013-09-29 3:21 ` Grant Edwards
2013-09-29 7:09 ` Matwey V. Kornilov
2013-09-30 22:28 ` Grant Edwards [this message]
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='l2ctvb$nd3$1@ger.gmane.org' \
--to=grant.b.edwards@gmail.com \
--cc=linux-serial@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.