02.08.2013 Views

P4080 PCIe Adapter SDK User Guide Production Release

P4080 PCIe Adapter SDK User Guide Production Release

P4080 PCIe Adapter SDK User Guide Production Release

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Freescale Semiconductor<br />

* a software descriptor at the head of the DMA chain, updates the<br />

* fields of that descriptor. Removes EOLN flag on previous link<br />

* descriptor and triggers DMA channel start or continue<br />

*<br />

* @dring – Pointer to the DMA ring of type “struct dma_ring”<br />

* @src_addr – Physical address of the source memory location.<br />

* @dst_addr – Physical address of the destination memory location<br />

* @len – Size of DMA transfer<br />

* @op – Operation to be executed at the end of this DMA transfer<br />

* @p4080_fd – Reference to the FD that triggered this DMA transfer<br />

* @ring_ptr – Pointer to Host or <strong>P4080</strong> FD ring<br />

* @pi – Ring index on the FD ring<br />

* @hw_fn_id – Hardware Function identifier<br />

*<br />

* @return – 0 on DMA enqueue success, -1 when DMA ring FULL<br />

*/<br />

The prototype of this API is as follows.<br />

int dma_ring_enq(struct dma_ring *dring, u64 src_addr, u64 dst_addr, int len, int op, void<br />

*p4080_fd, void *ring_ptr, u64 pi, int hw_fn_id);<br />

/**<br />

* API: dma_ring_used_desc – Computes number of DMA descriptors used<br />

* for DMA operation<br />

*<br />

* dring – Pointer to the DMA ring context<br />

*<br />

* @return – Number of used DMA descriptors<br />

*/<br />

The prototype of this API is as follows.<br />

inline int dma_ring_used_desc(struct dma_ring *dring);<br />

/**<br />

* API: dma_ring_free_desc – Computes number of DMA descriptors available<br />

* for DMA operation<br />

*<br />

* dring – Pointer to the DMA ring context<br />

*<br />

* @return – Number of free DMA descriptors<br />

*/<br />

The prototype of this API is as follows.<br />

inline int dma_ring_free_desc(struct dma_ring *dring);<br />

© Freescale Semiconductor, Inc., 2011. All rights reserved.<br />

Freescale Confidential Proprietary Page 65

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!