Subject: Re: mmap() from kernel to user
To: None <kamalp@acm.org>
From: Matthew Orgass <darkstar@city-net.com>
List: tech-kern
Date: 11/22/2004 18:33:12
On 2004-11-22 kamalp@kprasad.org wrote:

> Yes -I do want to use mmap(). Since driver and userland library are in
> different address spaces, I do not know how to give userland  ref to the
>   block of memory. The only way I am aware of is to give the filename of
> the mmap()'ed file i.e. not using anon_map, but that would mean using
> the filesystem -which I want to avoid.

  One possibility is allocate two page-size USB buffers and copyout one
while the other is transfering (this could easily fall back on smaller
buffers if necessary).  Presumably the controller will be OHCI or UHCI,
so it needs DMAable memory for the buffer anyway.  Copyout of a page at a
time should be quite efficient and easier than correctly dealing with mmap
for what isn't really a memory region.

Matthew Orgass
darkstar@city-net.com