Lines Matching refs:sg
701 struct scatterlist *sg;
704 for_each_sg(sgt.sgl, sg, sgt.orig_nents, i) arch_dma_prep_coherent(sg_page(sg), sg->length);
774 struct scatterlist *sg;
781 for_each_sg(sgl, sg, nelems, i) arch_sync_dma_for_cpu(sg_phys(sg), sg->length, dir);
787 struct scatterlist *sg;
794 for_each_sg(sgl, sg, nelems, i) arch_sync_dma_for_device(sg_phys(sg), sg->length, dir);
828 static int finalise_sg_ext(struct device *dev, struct scatterlist *sg, int nents, dma_addr_t dma_addr)
830 struct scatterlist *s, *cur = sg;
835 for_each_sg(sg, s, nents, i)
882 static void invalidate_sg_ext(struct scatterlist *sg, int nents)
887 for_each_sg(sg, s, nents, i)
907 static int iommu_dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir,
925 iommu_dma_sync_sg_for_device(dev, sg, nents, dir);
934 for_each_sg(sg, s, nents, i)
977 if (iommu_map_sg_atomic(domain, iova, sg, nents, prot) < iova_len) {
981 return finalise_sg_ext(dev, sg, nents, iova);
986 invalidate_sg_ext(sg, nents);
990 static void iommu_dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, enum dma_data_direction dir,
998 iommu_dma_sync_sg_for_cpu(dev, sg, nents, dir);
1005 start = sg_dma_address(sg);
1006 for_each_sg(sg_next(sg), tmp, nents - 1, i)
1011 sg = tmp;
1013 end = sg_dma_address(sg) + sg_dma_len(sg);