Lines Matching refs:sg
33 #define SG_ENT_VIRT_ADDRESS(sg) ((sg)->address ? (sg)->address \ argument
34 : page_address((sg)->page) + (sg)->offset)
418 swiotlb_map_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction) in swiotlb_map_sg() argument
425 for (i = 0; i < nelems; i++, sg++) { in swiotlb_map_sg()
426 void * virt_address = SG_ENT_VIRT_ADDRESS(sg); in swiotlb_map_sg()
429 sg->dma_length = sg->length; in swiotlb_map_sg()
431 sg->dma_address = virt_to_phys(map_single(hwdev, in swiotlb_map_sg()
433 sg->length, in swiotlb_map_sg()
436 sg->dma_address = phys_address; in swiotlb_map_sg()
446 swiotlb_unmap_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction) in swiotlb_unmap_sg() argument
453 for (i = 0; i < nelems; i++, sg++) in swiotlb_unmap_sg()
454 if (sg->dma_address != virt_to_phys(SG_ENT_VIRT_ADDRESS(sg))) { in swiotlb_unmap_sg()
455 unmap_single(hwdev, phys_to_virt(sg->dma_address), in swiotlb_unmap_sg()
456 sg->dma_length, direction); in swiotlb_unmap_sg()
458 mark_clean(SG_ENT_VIRT_ADDRESS(sg), sg->length); in swiotlb_unmap_sg()
469 swiotlb_sync_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nelems, int direction) in swiotlb_sync_sg() argument
476 for (i = 0; i < nelems; i++, sg++) in swiotlb_sync_sg()
477 if (sg->dma_address != virt_to_phys(SG_ENT_VIRT_ADDRESS(sg))) in swiotlb_sync_sg()
478 sync_single(hwdev, phys_to_virt(sg->dma_address), in swiotlb_sync_sg()
479 sg->dma_length, direction); in swiotlb_sync_sg()