question wrt /drivers/char/tty_io.c in pre 2.6.16 code

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Denis Joseph Barrow
Date: Wednesday, August 27, 2008 - 8:55 am

Hi all,
In kernels prior to 2.6.16 it appears to me have
no mechanism for finding out if the tty recieve buffers
are full. This is important for me in implementing
flow control in the hso serial driver I'm developing
I don't want to lose characters.

The snippet from allesandro rubini's book
doesn't will just blindly flip buffers
& overrun if data is pushed in too quickly
into the tty layer. 

for (i = 0; i < data_size; ++i) {
if (tty->flip.count >= TTY_FLIPBUF_SIZE)
tty_flip_buffer_push(tty);
tty_insert_flip_char(tty, data[i], TTY_NORMAL);
}
tty_flip_buffer_push(tty);

The new tty_insert_flip_string returns the
number of bytes successfully copied to tty recieve buffers
how do I implement this functionality in pre 2.6.16 code,
can it be done?

Thank you,
D.J. Barrow
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/02] 2 more hso.c patches, greg, (Tue Aug 19, 6:07 pm)
[patch 01/02] hso: icon 322 detection fix, greg, (Tue Aug 19, 6:07 pm)
[patch 02/02] hso: dev_kfree_skb crash fix, greg, (Tue Aug 19, 6:07 pm)
Re: [patch 01/02] hso: icon 322 detection fix, Jeff Garzik, (Wed Aug 27, 2:37 am)
Re: hso driver dropping characters on serial port &amp; hacky fix , Denis Joseph Barrow, (Wed Aug 27, 3:54 am)
question wrt /drivers/char/tty_io.c in pre 2.6.16 code, Denis Joseph Barrow, (Wed Aug 27, 8:55 am)
Re: question wrt /drivers/char/tty_io.c in pre 2.6.16 code, Denis Joseph Barrow, (Thu Aug 28, 12:47 am)