From: "Ice Cold" <iscsiet@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: DMA remap_pfn_range VM_IO pci_map_sg
Date: Wed, 3 May 2006 14:18:56 -0700 [thread overview]
Message-ID: <ae59f9ef0605031418o38b8c227le87e2906effb08c3@mail.gmail.com> (raw)
In-Reply-To: <1146690339.515246.155630@u72g2000cwu.googlegroups.com>
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
parent reply other threads:[~2006-05-03 21:18 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <1146690339.515246.155630@u72g2000cwu.googlegroups.com>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ae59f9ef0605031418o38b8c227le87e2906effb08c3@mail.gmail.com \
--to=iscsiet@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®