Do you have a question? Post it now! No Registration Necessary
- Bhavin Shah
March 5, 2004, 11:23 am

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
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

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!!!
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
- » U-Boot on MPC860.....
- — Next thread in » Embedded Linux
-
- » 2D graphics on compulab ARM sbc under linux - advice please
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » Slow (industrial?) SD cards
- — The site's Newest Thread. Posted in » Embedded Programming
-