Lines Matching full:dma
50 * @brief Allocate DMA memory
53 * @param dma dma memory area
58 oce_dma_alloc(POCE_SOFTC sc, bus_size_t size, POCE_DMA_MEM dma, int flags) in oce_dma_alloc() argument
62 memset(dma, 0, sizeof(OCE_DMA_MEM)); in oce_dma_alloc()
69 size, 1, size, 0, NULL, NULL, &dma->tag); in oce_dma_alloc()
72 rc = bus_dmamem_alloc(dma->tag, in oce_dma_alloc()
73 &dma->ptr, in oce_dma_alloc()
76 &dma->map); in oce_dma_alloc()
79 dma->paddr = 0; in oce_dma_alloc()
81 rc = bus_dmamap_load(dma->tag, in oce_dma_alloc()
82 dma->map, in oce_dma_alloc()
83 dma->ptr, in oce_dma_alloc()
86 &dma->paddr, flags | BUS_DMA_NOWAIT); in oce_dma_alloc()
87 if (dma->paddr == 0) in oce_dma_alloc()
92 oce_dma_free(sc, dma); in oce_dma_alloc()
98 * @brief Free DMA memory
100 * @param dma dma area to free
103 oce_dma_free(POCE_SOFTC sc, POCE_DMA_MEM dma) in oce_dma_free() argument
105 if (dma->tag == NULL) in oce_dma_free()
108 if (dma->paddr != 0) { in oce_dma_free()
109 bus_dmamap_sync(dma->tag, dma->map, in oce_dma_free()
111 bus_dmamap_unload(dma->tag, dma->map); in oce_dma_free()
112 dma->paddr = 0; in oce_dma_free()
115 if (dma->ptr != NULL) { in oce_dma_free()
116 bus_dmamem_free(dma->tag, dma->ptr, dma->map); in oce_dma_free()
117 dma->ptr = NULL; in oce_dma_free()
120 bus_dma_tag_destroy(dma->tag); in oce_dma_free()
121 dma->tag = NULL; in oce_dma_free()
127 * @brief Map DMA memory segment addresses
129 * @param segs dma memory segments
130 * @param nseg number of dma memory segments
153 oce_dma_free(sc, &ring->dma); in oce_destroy_ring_buffer()
177 size, 8, 4096, 0, NULL, NULL, &ring->dma.tag); in oce_create_ring_buffer()
181 rc = bus_dmamem_alloc(ring->dma.tag, in oce_create_ring_buffer()
182 &ring->dma.ptr, in oce_create_ring_buffer()
184 &ring->dma.map); in oce_create_ring_buffer()
188 bzero(ring->dma.ptr, size); in oce_create_ring_buffer()
189 bus_dmamap_sync(ring->dma.tag, ring->dma.map, in oce_create_ring_buffer()
191 ring->dma.paddr = 0; in oce_create_ring_buffer()
196 oce_dma_free(sc, &ring->dma); in oce_create_ring_buffer()
210 * @param arg dma map phyical address table pointer
211 * @param segs dma memory segments
212 * @param nseg number of dma memory segments
234 * @brief Load bus dma map for a ring buffer
248 bus_dmamap_load(ring->dma.tag, in oce_page_list()
249 ring->dma.map, in oce_page_list()
250 ring->dma.ptr, in oce_page_list()