mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* DMA remap_pfn_range VM_IO pci_map_sg
       [not found] <1146690339.515246.155630@u72g2000cwu.googlegroups.com>
@ 2006-05-03 21:18 ` Ice Cold
  0 siblings, 0 replies; only message in thread
From: Ice Cold @ 2006-05-03 21:18 UTC (permalink / raw)
  To: linux-kernel

Hi Group,


I have a few fundamental DMA questions which i need help with. These
are all relating to kernel 2.6+.


I have 40 megs of memory set aside for DMA. (This is an embedded device
so i can afford to do this). This memory is set aaside using the mem= option
on the boot line. I need to DMA data to parts of this memory. The DMA card
is a PCI based card with no addressing limitations. I want to make use of
the 2.6DMA API.


The reserved memory is given to anyone who requests it via the MMAP
call, internally it uses remap_pfn_range to fix up the page tables.


Call sequence.
1. Userspace mmaps a large chuck on this memory, and then breaks it up
intoa chunk, and wants to DMA data from the imaging device to this chunck.

2. It fires an IOCTL to my driver passing a start pointer to this chunk
and the len.


In the driver, i want to be able to
1. Create a scatter gather list for this chunk.
2. use pci_map_sg to map these pages.
3. use sg_address and sg_len to get the bus addresses.
4. using the bus address i want to populate the datastructures for this
card and start the DMA.


Questions.
1. To generate the scatter gather list, i need to get a list of pages
for the memory region passed to me? How do i do that? i know
get_user_pages cannot be called since it does not work on VM_IO
regions and remap_pfn_range marks the vma as VM_IO.
2. Is there any sample driver you know of which does similar stuff?


I'm open to suggestions and ideas.


rcn

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-05-03 21:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1146690339.515246.155630@u72g2000cwu.googlegroups.com>
2006-05-03 21:18 ` DMA remap_pfn_range VM_IO pci_map_sg Ice Cold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®