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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Freescale Semiconductor<br />

int dma_ring_init(struct dma_ring *dring, struct dma_channel *dma_chan, itn count);<br />

struct dma_ring {<br />

};<br />

u32 head;<br />

u32 tail;<br />

u32 free;<br />

u32 count;<br />

u8 *ring_mem;<br />

u32 ring_memsize;<br />

struct dma_channel *dma_chan;<br />

struct dma_sw_desc *ring_base;<br />

head – Head index to the DMA descriptor ring.<br />

tail – Tail index to the DMA descriptor ring.<br />

free – Index representing first free DMA descriptor<br />

count – Maximum number of DMA descriptors in the DMA ring.<br />

ring_mem – Pointer to the allocated physical memory for DMA ring<br />

ring_memsize – Total memory of the DMA ring<br />

dma_chan – CCSR reference to DMA channel<br />

ring_base – Aligned start address from “ring_mem”<br />

struct dma_channel {<br />

u32 mr;<br />

u32 sr;<br />

u32 eclndar;<br />

u32 clndar;<br />

u32 satr;<br />

u32 sar;<br />

u32 datr;<br />

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

Freescale Confidential Proprietary Page 61

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

Saved successfully!

Ooh no, something went wrong!