Re: TTY Flip buffers

Linux Lists (lists@cyclades.com)
Mon, 29 Nov 1999 14:07:18 -0800 (PST)


On Mon, 29 Nov 1999 tytso@mit.edu wrote:

> I guess you didn't understand my answer. :-)

Perhaps ... ;)

> If the number of bytes passed to ldisc.receive_buf is bigger than the
> number of available bytes in the tty buffer, the execess characters are
> dropped by the line discpline. They're dropped on the floor.

Ok.

> One more question: if the driver is supposed to know this limit
> beforehand, where can it get this information (i.e., info about how many
> bytes are available in the TTY Rx buffer) ?? I don't see any check of this
> kind in the Rocketport driver ...
>
> The driver doesn't need to know this limit beforehand, because there's
> nothing it can do with the data. It's the responsibility of the
> high-level tty driver code to monitor the space in the tty buffer, and
> as I've explained earlier, it sends the driver a flow control signal
> when the buffer starts getting full, and gives the other device 768
> character times to stop sending characters. If the other side ignores
> flow control, all you can do is drop data on the floor.

The other side does not ignore flow control in the specific case I'm
thinking of (i.e., hardware flow control is enabled and will be used if
needed). However, the on-board buffers on the Z are bigger than the kernel
TTY buffers (8KB for reception against the 4KB TTY buffer), and I want to
make sure that when I call the line discipline's receive function
directly I'm not dropping characters unnecessarily.

Anyhow, what's this flow control signal the tty driver sends to the serial
driver when the buffer starts getting full?? Is this a flag that stays
there until the condition change back to normal, or is it a one-time
signal??

> So the driver, doesn't need to know this in advance. The line discpline
> simply processes as much data as it can, and it drops the rest. It
> can't do anything else, and it doesn't make sense for it to try anything
> else.

But it does make sense for the driver to pass as much data as the TTY
driver can handle, _and just that_.

Regards,
Ivan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/