Lines Matching refs:hwdev

277 xen_swiotlb_alloc_coherent(struct device *hwdev, size_t size,  in xen_swiotlb_alloc_coherent()  argument
303 ret = xen_alloc_coherent_pages(hwdev, size, dma_handle, flags, attrs); in xen_swiotlb_alloc_coherent()
308 if (hwdev && hwdev->coherent_dma_mask) in xen_swiotlb_alloc_coherent()
309 dma_mask = hwdev->coherent_dma_mask; in xen_swiotlb_alloc_coherent()
315 phys = dma_to_phys(hwdev, *dma_handle); in xen_swiotlb_alloc_coherent()
316 dev_addr = xen_phys_to_dma(hwdev, phys); in xen_swiotlb_alloc_coherent()
323 xen_free_coherent_pages(hwdev, size, ret, (dma_addr_t)phys, attrs); in xen_swiotlb_alloc_coherent()
326 *dma_handle = phys_to_dma(hwdev, *dma_handle); in xen_swiotlb_alloc_coherent()
334 xen_swiotlb_free_coherent(struct device *hwdev, size_t size, void *vaddr, in xen_swiotlb_free_coherent() argument
342 if (hwdev && hwdev->coherent_dma_mask) in xen_swiotlb_free_coherent()
343 dma_mask = hwdev->coherent_dma_mask; in xen_swiotlb_free_coherent()
347 phys = xen_dma_to_phys(hwdev, dev_addr); in xen_swiotlb_free_coherent()
362 xen_free_coherent_pages(hwdev, size, vaddr, phys_to_dma(hwdev, phys), in xen_swiotlb_free_coherent()
432 static void xen_swiotlb_unmap_page(struct device *hwdev, dma_addr_t dev_addr, in xen_swiotlb_unmap_page() argument
435 phys_addr_t paddr = xen_dma_to_phys(hwdev, dev_addr); in xen_swiotlb_unmap_page()
439 if (!dev_is_dma_coherent(hwdev) && !(attrs & DMA_ATTR_SKIP_CPU_SYNC)) { in xen_swiotlb_unmap_page()
440 if (pfn_valid(PFN_DOWN(dma_to_phys(hwdev, dev_addr)))) in xen_swiotlb_unmap_page()
443 xen_dma_sync_for_cpu(hwdev, dev_addr, size, dir); in xen_swiotlb_unmap_page()
447 if (is_xen_swiotlb_buffer(hwdev, dev_addr)) in xen_swiotlb_unmap_page()
448 swiotlb_tbl_unmap_single(hwdev, paddr, size, size, dir, attrs); in xen_swiotlb_unmap_page()
490 xen_swiotlb_unmap_sg(struct device *hwdev, struct scatterlist *sgl, int nelems, in xen_swiotlb_unmap_sg() argument
499 xen_swiotlb_unmap_page(hwdev, sg->dma_address, sg_dma_len(sg), in xen_swiotlb_unmap_sg()
561 xen_swiotlb_dma_supported(struct device *hwdev, u64 mask) in xen_swiotlb_dma_supported() argument
563 return xen_virt_to_bus(hwdev, xen_io_tlb_end - 1) <= mask; in xen_swiotlb_dma_supported()