Lines Matching full:dir
156 size_t offset, size_t size, enum dma_data_direction dir, in dma_map_page_attrs() argument
162 BUG_ON(!valid_dma_direction(dir)); in dma_map_page_attrs()
169 addr = dma_direct_map_page(dev, page, offset, size, dir, attrs); in dma_map_page_attrs()
171 addr = iommu_dma_map_page(dev, page, offset, size, dir, attrs); in dma_map_page_attrs()
173 addr = ops->map_page(dev, page, offset, size, dir, attrs); in dma_map_page_attrs()
174 kmsan_handle_dma(page, offset, size, dir); in dma_map_page_attrs()
175 trace_dma_map_page(dev, page_to_phys(page) + offset, addr, size, dir, in dma_map_page_attrs()
177 debug_dma_map_page(dev, page, offset, size, dir, addr, attrs); in dma_map_page_attrs()
184 enum dma_data_direction dir, unsigned long attrs) in dma_unmap_page_attrs() argument
188 BUG_ON(!valid_dma_direction(dir)); in dma_unmap_page_attrs()
191 dma_direct_unmap_page(dev, addr, size, dir, attrs); in dma_unmap_page_attrs()
193 iommu_dma_unmap_page(dev, addr, size, dir, attrs); in dma_unmap_page_attrs()
195 ops->unmap_page(dev, addr, size, dir, attrs); in dma_unmap_page_attrs()
196 trace_dma_unmap_page(dev, addr, size, dir, attrs); in dma_unmap_page_attrs()
197 debug_dma_unmap_page(dev, addr, size, dir); in dma_unmap_page_attrs()
202 int nents, enum dma_data_direction dir, unsigned long attrs) in __dma_map_sg_attrs() argument
207 BUG_ON(!valid_dma_direction(dir)); in __dma_map_sg_attrs()
214 ents = dma_direct_map_sg(dev, sg, nents, dir, attrs); in __dma_map_sg_attrs()
216 ents = iommu_dma_map_sg(dev, sg, nents, dir, attrs); in __dma_map_sg_attrs()
218 ents = ops->map_sg(dev, sg, nents, dir, attrs); in __dma_map_sg_attrs()
221 kmsan_handle_dma_sg(sg, nents, dir); in __dma_map_sg_attrs()
222 trace_dma_map_sg(dev, sg, nents, ents, dir, attrs); in __dma_map_sg_attrs()
223 debug_dma_map_sg(dev, sg, nents, ents, dir, attrs); in __dma_map_sg_attrs()
237 * @dir: DMA direction
241 * nents segments for the @dir DMA operation by the @dev device.
250 int nents, enum dma_data_direction dir, unsigned long attrs) in dma_map_sg_attrs() argument
254 ret = __dma_map_sg_attrs(dev, sg, nents, dir, attrs); in dma_map_sg_attrs()
265 * @dir: DMA direction
269 * object for the @dir DMA operation by the @dev device. After success, the
289 enum dma_data_direction dir, unsigned long attrs) in dma_map_sgtable() argument
293 nents = __dma_map_sg_attrs(dev, sgt->sgl, sgt->orig_nents, dir, attrs); in dma_map_sgtable()
302 int nents, enum dma_data_direction dir, in dma_unmap_sg_attrs() argument
307 BUG_ON(!valid_dma_direction(dir)); in dma_unmap_sg_attrs()
308 trace_dma_unmap_sg(dev, sg, nents, dir, attrs); in dma_unmap_sg_attrs()
309 debug_dma_unmap_sg(dev, sg, nents, dir); in dma_unmap_sg_attrs()
312 dma_direct_unmap_sg(dev, sg, nents, dir, attrs); in dma_unmap_sg_attrs()
314 iommu_dma_unmap_sg(dev, sg, nents, dir, attrs); in dma_unmap_sg_attrs()
316 ops->unmap_sg(dev, sg, nents, dir, attrs); in dma_unmap_sg_attrs()
321 size_t size, enum dma_data_direction dir, unsigned long attrs) in dma_map_resource() argument
326 BUG_ON(!valid_dma_direction(dir)); in dma_map_resource()
332 addr = dma_direct_map_resource(dev, phys_addr, size, dir, attrs); in dma_map_resource()
334 addr = iommu_dma_map_resource(dev, phys_addr, size, dir, attrs); in dma_map_resource()
336 addr = ops->map_resource(dev, phys_addr, size, dir, attrs); in dma_map_resource()
338 trace_dma_map_resource(dev, phys_addr, addr, size, dir, attrs); in dma_map_resource()
339 debug_dma_map_resource(dev, phys_addr, size, dir, addr, attrs); in dma_map_resource()
345 enum dma_data_direction dir, unsigned long attrs) in dma_unmap_resource() argument
349 BUG_ON(!valid_dma_direction(dir)); in dma_unmap_resource()
353 iommu_dma_unmap_resource(dev, addr, size, dir, attrs); in dma_unmap_resource()
355 ops->unmap_resource(dev, addr, size, dir, attrs); in dma_unmap_resource()
356 trace_dma_unmap_resource(dev, addr, size, dir, attrs); in dma_unmap_resource()
357 debug_dma_unmap_resource(dev, addr, size, dir); in dma_unmap_resource()
363 enum dma_data_direction dir) in __dma_sync_single_for_cpu() argument
367 BUG_ON(!valid_dma_direction(dir)); in __dma_sync_single_for_cpu()
369 dma_direct_sync_single_for_cpu(dev, addr, size, dir); in __dma_sync_single_for_cpu()
371 iommu_dma_sync_single_for_cpu(dev, addr, size, dir); in __dma_sync_single_for_cpu()
373 ops->sync_single_for_cpu(dev, addr, size, dir); in __dma_sync_single_for_cpu()
374 trace_dma_sync_single_for_cpu(dev, addr, size, dir); in __dma_sync_single_for_cpu()
375 debug_dma_sync_single_for_cpu(dev, addr, size, dir); in __dma_sync_single_for_cpu()
380 size_t size, enum dma_data_direction dir) in __dma_sync_single_for_device() argument
384 BUG_ON(!valid_dma_direction(dir)); in __dma_sync_single_for_device()
386 dma_direct_sync_single_for_device(dev, addr, size, dir); in __dma_sync_single_for_device()
388 iommu_dma_sync_single_for_device(dev, addr, size, dir); in __dma_sync_single_for_device()
390 ops->sync_single_for_device(dev, addr, size, dir); in __dma_sync_single_for_device()
391 trace_dma_sync_single_for_device(dev, addr, size, dir); in __dma_sync_single_for_device()
392 debug_dma_sync_single_for_device(dev, addr, size, dir); in __dma_sync_single_for_device()
397 int nelems, enum dma_data_direction dir) in __dma_sync_sg_for_cpu() argument
401 BUG_ON(!valid_dma_direction(dir)); in __dma_sync_sg_for_cpu()
403 dma_direct_sync_sg_for_cpu(dev, sg, nelems, dir); in __dma_sync_sg_for_cpu()
405 iommu_dma_sync_sg_for_cpu(dev, sg, nelems, dir); in __dma_sync_sg_for_cpu()
407 ops->sync_sg_for_cpu(dev, sg, nelems, dir); in __dma_sync_sg_for_cpu()
408 trace_dma_sync_sg_for_cpu(dev, sg, nelems, dir); in __dma_sync_sg_for_cpu()
409 debug_dma_sync_sg_for_cpu(dev, sg, nelems, dir); in __dma_sync_sg_for_cpu()
414 int nelems, enum dma_data_direction dir) in __dma_sync_sg_for_device() argument
418 BUG_ON(!valid_dma_direction(dir)); in __dma_sync_sg_for_device()
420 dma_direct_sync_sg_for_device(dev, sg, nelems, dir); in __dma_sync_sg_for_device()
422 iommu_dma_sync_sg_for_device(dev, sg, nelems, dir); in __dma_sync_sg_for_device()
424 ops->sync_sg_for_device(dev, sg, nelems, dir); in __dma_sync_sg_for_device()
425 trace_dma_sync_sg_for_device(dev, sg, nelems, dir); in __dma_sync_sg_for_device()
426 debug_dma_sync_sg_for_device(dev, sg, nelems, dir); in __dma_sync_sg_for_device()
659 dma_addr_t *dma_handle, enum dma_data_direction dir, gfp_t gfp) in __dma_alloc_pages() argument
672 return dma_direct_alloc_pages(dev, size, dma_handle, dir, gfp); in __dma_alloc_pages()
674 return dma_common_alloc_pages(dev, size, dma_handle, dir, gfp); in __dma_alloc_pages()
677 return ops->alloc_pages_op(dev, size, dma_handle, dir, gfp); in __dma_alloc_pages()
681 dma_addr_t *dma_handle, enum dma_data_direction dir, gfp_t gfp) in dma_alloc_pages() argument
683 struct page *page = __dma_alloc_pages(dev, size, dma_handle, dir, gfp); in dma_alloc_pages()
687 dir, 0); in dma_alloc_pages()
688 debug_dma_map_page(dev, page, 0, size, dir, *dma_handle, 0); in dma_alloc_pages()
695 dma_addr_t dma_handle, enum dma_data_direction dir) in __dma_free_pages() argument
701 dma_direct_free_pages(dev, size, page, dma_handle, dir); in __dma_free_pages()
703 dma_common_free_pages(dev, size, page, dma_handle, dir); in __dma_free_pages()
705 ops->free_pages(dev, size, page, dma_handle, dir); in __dma_free_pages()
709 dma_addr_t dma_handle, enum dma_data_direction dir) in dma_free_pages() argument
711 trace_dma_unmap_page(dev, dma_handle, size, dir, 0); in dma_free_pages()
712 debug_dma_unmap_page(dev, dma_handle, size, dir); in dma_free_pages()
713 __dma_free_pages(dev, size, page, dma_handle, dir); in dma_free_pages()
731 enum dma_data_direction dir, gfp_t gfp) in alloc_single_sgt() argument
741 page = __dma_alloc_pages(dev, size, &sgt->sgl->dma_address, dir, gfp); in alloc_single_sgt()
755 enum dma_data_direction dir, gfp_t gfp, unsigned long attrs) in dma_alloc_noncontiguous() argument
765 sgt = iommu_dma_alloc_noncontiguous(dev, size, dir, gfp, attrs); in dma_alloc_noncontiguous()
767 sgt = alloc_single_sgt(dev, size, dir, gfp); in dma_alloc_noncontiguous()
771 trace_dma_map_sg(dev, sgt->sgl, sgt->orig_nents, 1, dir, attrs); in dma_alloc_noncontiguous()
772 debug_dma_map_sg(dev, sgt->sgl, sgt->orig_nents, 1, dir, attrs); in dma_alloc_noncontiguous()
779 struct sg_table *sgt, enum dma_data_direction dir) in free_single_sgt() argument
782 dir); in free_single_sgt()
788 struct sg_table *sgt, enum dma_data_direction dir) in dma_free_noncontiguous() argument
790 trace_dma_unmap_sg(dev, sgt->sgl, sgt->orig_nents, dir, 0); in dma_free_noncontiguous()
791 debug_dma_unmap_sg(dev, sgt->sgl, sgt->orig_nents, dir); in dma_free_noncontiguous()
794 iommu_dma_free_noncontiguous(dev, size, sgt, dir); in dma_free_noncontiguous()
796 free_single_sgt(dev, size, sgt, dir); in dma_free_noncontiguous()