From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com>
To: linux-serial@vger.kernel.org
Subject: Re: tty loop-back device
Date: Sun, 29 Sep 2013 11:09:58 +0400 [thread overview]
Message-ID: <l28jnt$j67$1@ger.gmane.org> (raw)
In-Reply-To: <l286bm$239$1@ger.gmane.org>
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.
> Having to use multiple threads in a master sounds ugly at first, but
> it's still orders of magnitude easier than implementing a serial
> driver in kernel space that uses network I/O to communicate with the
> physical UART.
For sure.
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-09-29 7:10 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 [this message]
2013-09-30 22:28 ` Grant Edwards
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='l28jnt$j67$1@ger.gmane.org' \
--to=matwey.kornilov@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.