From: mdaljeet@in.ibm.com
To: Gerd Knorr <kraxel@bytesex.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: mmap
Date: Mon, 2 Jul 2001 19:30:44 +0530 [thread overview]
Message-ID: <CA256A7D.004D2B0F.00@d73mta01.au.ibm.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1313 bytes --]
I use the 'map_user_kiobuf' and 'lock_kiovec' kernel routines in a module
for 'user space memory'. After that if I pass the
'(iobuf->maplist[0])-mem_map) << PAGE_SHIFT)' to the hardware for DMA
operations and it works fine for Intel platforms. Now how can I use the
'iobuf' struct obtained after lock_kiovec operation to get a PCI bus
address that I can pass to hardware for DMA operations on my Apple
machine.?
thanks,
Daljeet.
|--------+----------------------->
| | Gerd Knorr |
| | <kraxel@bytes|
| | ex.org> |
| | |
| | 05/15/01 |
| | 01:03 PM |
| | Please |
| | respond to |
| | Gerd Knorr |
| | |
|--------+----------------------->
>-----------------------------------------------------------------------|
| |
| To: linux-kernel@vger.kernel.org |
| cc: (bcc: Daljeet Maini/India/IBM) |
| Subject: Re: mmap |
>-----------------------------------------------------------------------|
[-- Attachment #2: Type: text/plain, Size: 1125 bytes --]
mdaljeet@in.ibm.com wrote:
> I am doing the following:
>
> malloc some memory is user space
> pass its pointer to some kernel module
> in the kernel module...do a pci_alloc_consistent so that i get a
memory
> region for PCI DMA operations
Wrong approach, you can use kiobufs if you want DMA to the malloc()ed
userspace memory:
* lock down the user memory using map_user_kiobuf() + lock_kiovec()
(see linux/iobuf.h).
* translate the iobuf->maplist into a scatterlist [1]
* feed pci_map_sg() with the scatterlist to get DMA addresses.
you can pass to the hardware.
And the reverse to free everything when you are done of course.
Gerd
[1] IMHO it would be more useful if iobufs would use a scatterlist
instead of an struct page* array.
--
Gerd Knorr <kraxel@bytesex.org> -- SuSE Labs, Außenstelle Berlin
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
next reply other threads:[~2001-07-02 14:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-02 14:00 mdaljeet [this message]
2001-07-03 17:47 ` mmap Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2011-12-02 12:20 mmap Sébastien Paumier
2011-12-02 14:45 ` mmap Eric Dumazet
2001-05-15 10:08 mmap mdaljeet
2001-05-15 6:47 mmap mdaljeet
2001-05-15 7:33 ` mmap Gerd Knorr
2001-05-15 9:42 ` mmap Alan Cox
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=CA256A7D.004D2B0F.00@d73mta01.au.ibm.com \
--to=mdaljeet@in.ibm.com \
--cc=kraxel@bytesex.org \
--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®