2016-05-03 29 views
0

了FPGA的PCIe我的設備驅動程序是基於7600.16385.1的\ src \一般\ PLX9x5x不限於以分散NumberOfElements /收集列表

在ReadFile的應用程序,PLxEvtIoRead被稱爲:

// 
// Initialize this new DmaTransaction. 
// 
status = WdfDmaTransactionInitializeUsingRequest(
               devExt->ReadDmaTransaction, 
               Request, 
               PLxEvtProgramReadDma, 
               WdfDmaDirectionReadFromDevice); 

// 
// Execute this DmaTransaction. 
// 

status = WdfDmaTransactionExecute(devExt->ReadDmaTransaction, 
              WDF_NO_CONTEXT); 

.... 

Upon calling to WdfDmaTransactionExecute, PLxEvtProgramReadDma is called. 

BOOLEAN 
PLxEvtProgramReadDma(
    IN WDFDMATRANSACTION  Transaction, 
    IN WDFDEVICE    Device, 
    IN WDFCONTEXT    Context, 
    IN WDF_DMA_DIRECTION  Direction, 
    IN PSCATTER_GATHER_LIST SgList 
    ) 
{ 
    KdPrint ((???SgList->NumberOfElements = %d\n???,SgList->NumberOfElements)); 

} 

問題: 我想通過這個Scatter/Gather列表(大約1 GB)傳輸大量數據,但似乎NumberOfElements受某些東西的限制,不知何故大數據傳輸是1MB(列表中的255個元素,每個4k )。我改變MaximumTransfecrLength在下面的函數500MB:

WDF_DMA_ENABLER_CONFIG_INIT(&dmaConfig, 
         WdfDmaProfileScatterGatherDuplex, 
         deviceContext->MaximumTransferLength); 

但仍然我不能傳輸超過1MB。 限制NumberOfElements以及我如何解決它的事情是什麼?

回答

0

我需要將WDF_DMA_ENABLER_CONFIG_INIT函數中的第二個參數更改爲WdfDmaProfileScatterGather64,當然我們必須確保硬件(FPGA或PCIE端點另一端的任何東西)可以支持64位尋址模式。

我只是改變我的代碼如下:

WDF_DMA_ENABLER_CONFIG_INIT(&dmaConfig, 
      WdfDmaProfileScatterGather64, 
      deviceContext->MaximumTransferLength);