Re: Device Driver Newbie Question

From: A V Naga Muni Reddy (nmreddy@sasi.com)
Date: Mon May 08 2000 - 03:46:57 EST


On 8 May 2000, John Ronan wrote:
>
> Hi,
> I mailed something similiar last night, I didn't see it on the list so
> Apologies if this is a repeat.
>
> I have a PCI Board with the following
> DMA CHannel 0 -> 48K Fifo -> Backend Application -> 48K Fifo Dma Channel 1.
> From what I've read, I can only use memory returned by get_free_pages as DMA
> memory. Maximum being an order of 5. Currently I have a 48K input and
> outputbuffer. Is it correct behaviour to put the writing
> application to sleep when it fills the input buffer, or should I use a more
> elaborate memory management scheme to allow the user write large chunks (ie 1MB
> 2MB or so) before putting them to sleep? What is the convention?

        fragment the 48K buffer to smaller buffers of size say 4k.
( better to keep this variable as configurable via a ioctl ). Issue
after a fragment of data is filled up. Wait for atleat one fragment is
free, while writing. This is a general procedure followed
in sound card drivers. check /usr/src/drivers/sound.

        calculate the optimum fragment size
( don't ask me how to do it )

>
> Cheers
> John
>
>
> -

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon May 15 2000 - 21:00:10 EST