none
Any equivalent call in windows as PCI_ALLOC_CONSISTENT() in Linux ? RRS feed

  • Question

  • Hi,

    I try to allocate memory for DMA descriptor table. In Linux, it describes as coherently-cached memory for descriptor table using pci_alloc_consistent(). it seems that the function returns two pointers to the memory location, one as table_virt, virtual address and the other as table_bus, (bus address?).

    Table_virt=pci_alloc_consistent(DEV, SIZE, &table_bus);

    What is the equivalent call in Windows 7 WINDDK, especially how to convert to table_bus address?

    Thank you,

    Tiger

    Tuesday, May 12, 2015 8:50 PM

Answers

  • Trying to directly map Linux functions to a Windows driver is a REALLY BAD IDEA.  Windows has its own functions for DMA. 

    Hopefully you are using WDF for the driver, if not start over with WDF.  Take a look at the samples AMCC5933, PCIDRV, and PLX9x5x for examples of WDF DMA support.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Tuesday, May 12, 2015 9:04 PM
  • See WdfCommonBufferCreate and read all the docs around and related to that interface.

    Mark Roddy Windows Driver and OS consultant www.hollistech.com

    Tuesday, May 12, 2015 9:28 PM
    Moderator

All replies

  • Trying to directly map Linux functions to a Windows driver is a REALLY BAD IDEA.  Windows has its own functions for DMA. 

    Hopefully you are using WDF for the driver, if not start over with WDF.  Take a look at the samples AMCC5933, PCIDRV, and PLX9x5x for examples of WDF DMA support.


    Don Burn Windows Driver Consulting Website: http://www.windrvr.com

    Tuesday, May 12, 2015 9:04 PM
  • See WdfCommonBufferCreate and read all the docs around and related to that interface.

    Mark Roddy Windows Driver and OS consultant www.hollistech.com

    Tuesday, May 12, 2015 9:28 PM
    Moderator
  • I am using Linux as reference, not as a baseline for driver. The driver framework is based on the WDF. Mainly only the descriptor table setup referenced.

    Thank you Don and Doron.

    Tiger

    Wednesday, May 13, 2015 12:31 PM