[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-serial
Subject:    Re: tty loop-back device
From:       Grant Edwards <grant.b.edwards () gmail ! com>
Date:       2013-09-30 22:28:59
Message-ID: l2ctvb$nd3$1 () ger ! gmane ! org
[Download RAW message or body]

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            

--
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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic