Performing both 32-bit and 64-bit DMA

Hi everyone,

At this article [http://www.mombu.com/microsoft/windows-programmer-nt-kernel-mode/t-device-descriptiondma64bitaddresses-and-dma-operationsallocatecommonbuffer-1488070.html] I read the following by Maxim Shatskih:

Maybe creating 2 adapter objects - one 32bit for common buffer, other 64bit for
MDLs - is a good idea.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Although the source is very respectable I would like to cross-check that my understanding of this is correct.

Does the above mean that my loaded driver instance can call IoGetDmaAdapter function sometimes passing a DEVICE_DESCRIPTION structure that has Dma32BitAddresses==TRUE and sometimes Dma64BitAddresses==TRUE? Does this and its KMDF equivalent actually work?

Our issue has to do with partially upgrading a chip spec to optionally support 64-bit DMA in its performance critical operations, while leaving the low traffic stuff running at 32-bit DMA.
So if Mm64BitPhysicalAddress==FALSE the adapter will run using 32-bit DMA in all cases, while if Mm64BitPhysicalAddress==TRUE then it will do a mix of 32-bit and 64-bit DMA in order to improve performance.

Warm Regards,
Dimitrios Staikos

IIRC the usb host controller driver does this. I see no reason why it would not work in a kmdf driver.

d

dent from a phpne with no keynoard

-----Original Message-----
From: xxxxx@staikos.name
Sent: October 11, 2010 4:14 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Performing both 32-bit and 64-bit DMA

Hi everyone,

At this article [http://www.mombu.com/microsoft/windows-programmer-nt-kernel-mode/t-device-descriptiondma64bitaddresses-and-dma-operationsallocatecommonbuffer-1488070.html] I read the following by Maxim Shatskih:

>Maybe creating 2 adapter objects - one 32bit for common buffer, other 64bit for
>MDLs - is a good idea.
>
>–
>Maxim Shatskih, Windows DDK MVP
>StorageCraft Corporation
>xxxxx@storagecraft.com
>http://www.storagecraft.com

Although the source is very respectable I would like to cross-check that my understanding of this is correct.

Does the above mean that my loaded driver instance can call IoGetDmaAdapter function sometimes passing a DEVICE_DESCRIPTION structure that has Dma32BitAddresses==TRUE and sometimes Dma64BitAddresses==TRUE? Does this and its KMDF equivalent actually work?

Our issue has to do with partially upgrading a chip spec to optionally support 64-bit DMA in its performance critical operations, while leaving the low traffic stuff running at 32-bit DMA.
So if Mm64BitPhysicalAddress==FALSE the adapter will run using 32-bit DMA in all cases, while if Mm64BitPhysicalAddress==TRUE then it will do a mix of 32-bit and 64-bit DMA in order to improve performance.

Warm Regards,
Dimitrios Staikos


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

>> IIRC the usb host controller driver does this. I see no reason why it would not

> work in a kmdf driver.

In Windows 7 USBPORT.SYS will call IoGetDmaAdapter() twice if an EHCI host controller is 64-bit DMA address capable. Once with Dma64BitAddresses TRUE for an adapter object to use with GetScatterGatherList() when mapping transfer buffer addresses into transfer descriptors, and once with Dma32BitAddresses TRUE for an adapter object to use with AllocateCommonBuffer() to allocate common buffer for use as the queue heads and transfer descriptors.

-Glen