Re: Scatter/gather DMA to a kernel buffer
- From: Tim Roberts <timr@xxxxxxxxx>
- Date: Tue, 13 May 2008 22:18:15 -0700
Alex <viszont_latasra_@xxxxxxxxxxxxx> wrote:
I have to start a DMA scatter/gather transfer from a device to a kernel
mode buffer (allocated in nonpageable pool). I wanted to use
GetScatterGatherList(), but I haven't got any IRP to get the MDL from, so
I tried using IoAllocateMdl() to allocate a custom MDL mapping my buffer.
The code I use is the following:
MDLForDma = IoAllocateMdl((PVOID)(MyBuffer->BufferHead), Length, FALSE,
FALSE, NULL);
...
The allocation goes fine, but when I afterwards call GetScatterGatherList
what should I put into CurrentVa parameter?
Peeking inside the MDLForDma that IoAllocateMdl() returns I noticed that
StartVa is 0, and I guess that 0 is not a valid virtual address. Is there
something I'm doing wrong?
Umm, since you allocated the buffer, don't you HAVE the virtual address?
Specifically, MyBuffer->BufferHead?
--
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.
- References:
- Scatter/gather DMA to a kernel buffer
- From: Alex
- Scatter/gather DMA to a kernel buffer
- Prev by Date: Re: WDM USB driver trouble under vista
- Next by Date: Re: RemoveHeadList crashes system
- Previous by thread: Scatter/gather DMA to a kernel buffer
- Next by thread: Deallocating memory
- Index(es):
Relevant Pages
|