2007-02-17 14:47:01

by Mockern

[permalink] [raw]
Subject: line discipline and tty driver

I have a question regarding line discipline:

in http://www.linux.it/~rubini/docs/serial/serial.html is shown data flow for Linux tty driver.

When it's necessary to use line discipline in tty driver (to call ldisc.write(), ldisc.read(), ldisc.receive_buf()) and when I can ignore line discipline in my tty driver?

Thanks


2007-02-17 15:03:56

by Paul Fulghum

[permalink] [raw]
Subject: Re: line discipline and tty driver

Mockern wrote:
> When it's necessary to use line discipline in tty driver
> (to call ldisc.write(), ldisc.read(), ldisc.receive_buf())
> and when I can ignore line discipline in my tty driver?

You should not call any of these from your driver.

transmit data is sent first to the line discipline
ldisc.write() which then calls into your driver write() method

your driver passes receive data to the ldisc through
the tty flip buffer functions.

--
Paul