Subject: ptys and linesw.l_start
To: None <tech-kern@netbsd.org>
From: None <kpneal@pobox.com>
List: tech-kern
Date: 03/22/2003 20:39:12
/sys/net/ppp_tty.c has this little snippit in it:

    /* 
     * This timeout is needed for operation on a pseudo-tty,
     * because the pty code doesn't call pppstart after it has
     * drained the t_outq.
     */ 
    if (!idle && (sc->sc_flags & SC_TIMEOUT) == 0) {
        callout_reset(&sc->sc_timo_ch, 1, ppp_timeout, sc); 
        sc->sc_flags |= SC_TIMEOUT;
    }   

This is true? So, what is a reasonable way for a line discipline to
find out that it's pty has finished sending out the data? 

Can/should a line discipline call ttywait() to wait on the pty
to drain? Is that correct?

How exactly is t_oproc supposed to be used? Is this the function
called by the line discipline when it has placed data in the
output buffers and wants the tty/pty to transmit it? Did I
get that right? Is there any other time when t_oproc should
be called?

How can a line discipline know if it has a tty or a pty? Should
it know this? It seems kinda wrong for a line discipline to
have to know about this. 

BTW, am I the only one who gets confused when reading through the
ppp and tty/pty source code? Both sets of code refer to "reading"
and "writing" but I get the impression they have different perspectives.
One side's reading isn't the other sides reading, or something. 
-- 
Kevin P. Neal                                http://www.pobox.com/~kpn/

"It sounded pretty good, but it's hard to tell how it will work out
in practice." -- Dennis Ritchie, ~1977, "Summary of a DEC 32-bit machine"