Re: Linux tty layer hackery: Heads up and RFC

From: Mark Underwood
Date: Tue Jul 26 2005 - 04:58:59 EST


Hi Rogier,

Having just written a DMA UART driver I can say this
is good news :-). Here are some things to think about:

What my driver would like to do is to handle its own
input buffers. It would pass the buffer to the tty
layer when it is full and the tty layer would pass the
buffer back once it has drained the data from it.
The problem is that I don't always receive a block
worth of characters so I also need to pass the tty
layer a buffer (which I'm still DMAing into) with a
count of how many chars there are in the buffer and a
offset of where to start from. If I can't do this then
I have to stop the DMA transfer, pass you a mostly
empty buffer with a char count, and setup DMA transfer
into another buffer. If during this I get a burst of
data I could well lose it :-(.

Best Regards,

Mark

--- Rogier Wolff <R.E.Wolff@xxxxxxxxxxxx> wrote:

> On Thu, Jul 21, 2005 at 06:46:32PM +0100, Alan Cox
> wrote:
> > int tty_prepare_flip_string(tty, strptr, len)
> >
> > Adjust the buffer to allow len characters to be
> added. Returns a buffer
> > pointer in strptr and the length available. This
> allows for hardware
> > that needs to use functions like insl or
> mencpy_fromio.
>
> Ok, So then I start copying characters into the
> flipstring, but how do
> I say I'm done?
>
> Or is there a race between that I call
> tty_prepare_flip_string, and
> other processes start pulling my not-yet-filled
> string from the
> buffer? (Surely not!)
>
> Roger.
>
> --
> ** R.E.Wolff@xxxxxxxxxxxx **
> http://www.BitWizard.nl/ ** +31-15-2600998 **
> *-- BitWizard writes Linux device drivers for any
> device you may have! --*
> Q: It doesn't work. A: Look buddy, doesn't work is
> an ambiguous statement.
> Does it sit on the couch all day? Is it unemployed?
> Please be specific!
> Define 'it' and what it isn't doing. ---------
> Adapted from lxrbot FAQ
> -
> To unsubscribe from this list: send the line
> "unsubscribe linux-kernel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>






___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/