Lines Matching full:sg

270 	   assume it doesn't support sg mapping, and, since we tried to  in pci_map_single_1()
273 printk_once(KERN_WARNING "pci_map_single: no HW sg\n"); in pci_map_single_1()
300 DBGA2("pci_map_single: [%p,%zx] np %ld -> sg %llx from %ps\n", in pci_map_single_1()
406 DBGA2("pci_unmap_single: sg [%llx,%zx] np %ld from %ps\n", in alpha_pci_unmap_page()
432 with vmalloc and sg if we can't find contiguous memory. */ in alpha_pci_alloc_coherent()
481 #define SG_ENT_VIRT_ADDRESS(SG) (sg_virt((SG))) argument
482 #define SG_ENT_PHYS_ADDRESS(SG) __pa(SG_ENT_VIRT_ADDRESS(SG)) argument
485 sg_classify(struct device *dev, struct scatterlist *sg, struct scatterlist *end, in sg_classify() argument
493 leader = sg; in sg_classify()
498 /* we will not marge sg without device. */ in sg_classify()
500 for (++sg; sg < end; ++sg) { in sg_classify()
502 addr = SG_ENT_PHYS_ADDRESS(sg); in sg_classify()
503 len = sg->length; in sg_classify()
509 sg->dma_address = -1; in sg_classify()
512 sg->dma_address = -2; in sg_classify()
519 leader = sg; in sg_classify()
541 struct scatterlist *sg; in sg_fill() local
592 DBGA(" sg_fill: [%p,%lx] -> sg %llx np %ld\n", in sg_fill()
598 sg = leader; in sg_fill()
601 struct scatterlist *last_sg = sg; in sg_fill()
604 size = sg->length; in sg_fill()
605 paddr = SG_ENT_PHYS_ADDRESS(sg); in sg_fill()
607 while (sg+1 < end && (int) sg[1].dma_address == -1) { in sg_fill()
608 size += sg[1].length; in sg_fill()
609 sg = sg_next(sg); in sg_fill()
622 while (++last_sg <= sg) { in sg_fill()
628 } while (++sg < end && (int) sg->dma_address < 0); in sg_fill()
633 static int alpha_pci_map_sg(struct device *dev, struct scatterlist *sg, in alpha_pci_map_sg() argument
650 sg->dma_length = sg->length; in alpha_pci_map_sg()
651 sg->dma_address in alpha_pci_map_sg()
652 = pci_map_single_1(pdev, SG_ENT_VIRT_ADDRESS(sg), in alpha_pci_map_sg()
653 sg->length, dac_allowed); in alpha_pci_map_sg()
654 if (sg->dma_address == DMA_MAPPING_ERROR) in alpha_pci_map_sg()
659 start = sg; in alpha_pci_map_sg()
660 end = sg + nents; in alpha_pci_map_sg()
663 sg_classify(dev, sg, end, alpha_mv.mv_pci_tbi != 0); in alpha_pci_map_sg()
680 for (out = sg; sg < end; ++sg) { in alpha_pci_map_sg()
681 if ((int) sg->dma_address < 0) in alpha_pci_map_sg()
683 if (sg_fill(dev, sg, end, out, arena, max_dma, dac_allowed) < 0) in alpha_pci_map_sg()
715 static void alpha_pci_unmap_sg(struct device *dev, struct scatterlist *sg, in alpha_pci_unmap_sg() argument
742 for (end = sg + nents; sg < end; ++sg) { in alpha_pci_unmap_sg()
748 addr = sg->dma_address; in alpha_pci_unmap_sg()
749 size = sg->dma_length; in alpha_pci_unmap_sg()
756 sg - end + nents, addr, size); in alpha_pci_unmap_sg()
764 sg - end + nents, addr, size); in alpha_pci_unmap_sg()
768 DBGA(" (%ld) sg [%llx,%zx]\n", in alpha_pci_unmap_sg()
769 sg - end + nents, addr, size); in alpha_pci_unmap_sg()
788 DBGA("pci_unmap_sg: %ld entries\n", nents - (end - sg)); in alpha_pci_unmap_sg()