DMA remap_pfn_range VM_IO pci_map_sg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux