Scatter/gather DMA to a kernel buffer
- From: Alex <viszont_latasra_@xxxxxxxxxxxxx>
- Date: 12 May 2008 20:42:18 GMT
Hi,
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);
if(MDLForDma == NULL)
{
Status = STATUS_INSUFFICIENT_RESOURCES;
return Status;
}
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?
Bye
Alex
.
- Follow-Ups:
- Re: Scatter/gather DMA to a kernel buffer
- From: Tim Roberts
- Re: Scatter/gather DMA to a kernel buffer
- Prev by Date: DiskPerfDeviceControl () of diskperf in wdk;
- Next by Date: Re: user mode to kernel mode I/O via named pipes
- Previous by thread: DiskPerfDeviceControl () of diskperf in wdk;
- Next by thread: Re: Scatter/gather DMA to a kernel buffer
- Index(es):
Relevant Pages
|