read for serial driver

Mar 05, 2004 1 Replies

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


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.

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

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!!! visi.com

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required