I’m trying to create a DMA technique using a wdf driver that does not have hardware scatter gather capabilities. The problem is I can chain two transactions together to increase my transfer size but how do I get the two sizes into the driver. Ideally I would like to use a single DeviceIOControl( ) call. Initializing the DMA request creates a scatter gather list one deep as far as I know. I would like to initialize this request as a single block so that the the software scatter gather sees it as a contiguous block of map registers. When I actually program my device I would like to have two sizes so that I can break this into two contiguous pieces. I can’t think of any way to get these two sizes into my driver with only a single buffer.
Simply, I would like to pass in a buffer and its size but also an additional parameter. Normally I would just use the input buffer to hold an array of data but I’m using WdfDmaTransactionInitializeUsingRequest to create a scatter gather list from this data.
The only solution I know will work is to have a DeviceIOControl call write data into my context area with this additional parameter before I call my DMA DeviceIOControl.
How can I do this in one step? I can think of other solutions. I’m just curious if there is a way to get this extra parameter into the driver at the same time.
I’m confused by your description. Are you saying that your device can
actually process two discrete DMA requests at a time? If so, why not
simply claim that it is a scatter-gather DMA device and call
WdfDmaEnablerSetMaximumScatterGatherElements with MaximumFragments set
to ‘2’?
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.com
Sent: Thursday, October 18, 2007 2:14 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Dma chaining
I’m trying to create a DMA technique using a wdf driver that does not
have hardware scatter gather capabilities. The problem is I can chain
two transactions together to increase my transfer size but how do I get
the two sizes into the driver. Ideally I would like to use a single
DeviceIOControl( ) call. Initializing the DMA request creates a scatter
gather list one deep as far as I know. I would like to initialize this
request as a single block so that the the software scatter gather sees
it as a contiguous block of map registers. When I actually program my
device I would like to have two sizes so that I can break this into two
contiguous pieces. I can’t think of any way to get these two sizes into
my driver with only a single buffer.
Simply, I would like to pass in a buffer and its size but also an
additional parameter. Normally I would just use the input buffer to
hold an array of data but I’m using
WdfDmaTransactionInitializeUsingRequest to create a scatter gather list
from this data.
The only solution I know will work is to have a DeviceIOControl call
write data into my context area with this additional parameter before I
call my DMA DeviceIOControl.
How can I do this in one step? I can think of other solutions. I’m
just curious if there is a way to get this extra parameter into the
driver at the same time.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer
Sorry if my description is chaotic. My understanding of DMA is limited still.
My device has 64 channels that can each be set up to do a DMA transaction. These channels can be chained such that once one transaction finishes the next will start. The size of each transaction is determined by a 32 bit register split into two 16 bit numbers, A and B. I can do a single transfer of size A or I can do a 2D transfer of size A* B. The only problem is if I do a 2D transfer my number may be prime and I can’t create the number as a product, if larger than A. In this case I must do two transfers chained together.
I would like to have this seen as one contiguous region using the software scatter gather capability of the WDF framework. Normally I would just pass in the size and buffer and get my SGL list as one deep since I’m not using hardware SGL. My problem is that I don’t know a way to create a SLG that is two deep but actually mapped as one contiguous block, via the map registers. I could do it as one region and split the number in the driver. I would like to split the region in software but I don’t know if it is possible to get an extra parameter into the driver in the same call or create the SGL as 2 elements but still contiguous. Maybe this is simple and I just don’t see it.
My understanding is that I must pass in a single buffer a single size that is then mapped as a contiguous block via map registers with WdfDmaTransactionInitializeUsingRequest ( ). What if I want this split into two sub regions using one DeviceIOControl call? Is there a way to do this? If I could tell the driver how big each region is it would be easy.
Otherwise I can split my 32 bit number(size) in the driver. Would this be easier?