read for serial driver

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I am writing a serial driver on Linux 2.4.18-rmk7-pxa1. I was going
through the source code and I found that the device specific driver
does not implemen the 'read' function. The interrupt handler of the
device specific driver copies the character read in to
tty->flip.char_buf_ptr and then calls 'tty_flip_buffer_push' function.
I checked from the 'tty_read' function and it calles 'tty->ldisc.read'
function call.

My question is, when the user calls the 'read' call on say /dev/ttyS0
from which read function the character is actually read. If someone
could give me the function trace it would be great. Also, I could not
find out what is this 'tty->ldisc.read' function and from where is it
coming?

Any help in this area is highly appreciated.

Thanks,
Bhavin

Re: read for serial driver

Quoted text here. Click to load it

It's read from the tty layer's receive buffer.  That's where it
goes after you put it in the flip buffer and push it.

Quoted text here. Click to load it

Huh?  Function trace of what? The tty I/O module's read()
function?

Quoted text here. Click to load it

IIRC it's a pointer.  Look for places where it's set.  If
you're just writing a low-level serial driver, you don't need
to worry about it.  All you need to do is put the receive data
in the flip buffer.

--
Grant Edwards                   grante             Yow!  ... I want a COLOR
                                  at               T.V. and a VIBRATING BED!!!
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline