Lines Matching full:mem
361 * @mem: structure defining the DMA memory request
370 ice_alloc_dma_mem(struct ice_hw *hw, struct ice_dma_mem *mem, u64 size) in ice_alloc_dma_mem() argument
386 &mem->tag); in ice_alloc_dma_mem()
393 err = bus_dmamem_alloc(mem->tag, (void **)&mem->va, in ice_alloc_dma_mem()
394 BUS_DMA_NOWAIT | BUS_DMA_ZERO, &mem->map); in ice_alloc_dma_mem()
401 err = bus_dmamap_load(mem->tag, mem->map, mem->va, in ice_alloc_dma_mem()
404 &mem->pa, in ice_alloc_dma_mem()
412 mem->size = size; in ice_alloc_dma_mem()
413 bus_dmamap_sync(mem->tag, mem->map, in ice_alloc_dma_mem()
415 return (mem->va); in ice_alloc_dma_mem()
417 bus_dmamem_free(mem->tag, mem->va, mem->map); in ice_alloc_dma_mem()
419 bus_dma_tag_destroy(mem->tag); in ice_alloc_dma_mem()
421 mem->map = NULL; in ice_alloc_dma_mem()
422 mem->tag = NULL; in ice_alloc_dma_mem()
429 * @mem: DMA memory to free
435 ice_free_dma_mem(struct ice_hw __unused *hw, struct ice_dma_mem *mem) in ice_free_dma_mem() argument
437 bus_dmamap_sync(mem->tag, mem->map, in ice_free_dma_mem()
439 bus_dmamap_unload(mem->tag, mem->map); in ice_free_dma_mem()
440 bus_dmamem_free(mem->tag, mem->va, mem->map); in ice_free_dma_mem()
441 bus_dma_tag_destroy(mem->tag); in ice_free_dma_mem()
442 mem->map = NULL; in ice_free_dma_mem()
443 mem->tag = NULL; in ice_free_dma_mem()