Lines Matching refs:sg

483 sg_classify(struct device *dev, struct scatterlist *sg, struct scatterlist *end,  in sg_classify()  argument
491 leader = sg; in sg_classify()
498 for (++sg; sg < end; ++sg) { in sg_classify()
500 addr = SG_ENT_PHYS_ADDRESS(sg); in sg_classify()
501 len = sg->length; in sg_classify()
507 sg->dma_address = -1; in sg_classify()
510 sg->dma_address = -2; in sg_classify()
517 leader = sg; in sg_classify()
539 struct scatterlist *sg; in sg_fill() local
596 sg = leader; in sg_fill()
599 struct scatterlist *last_sg = sg; in sg_fill()
602 size = sg->length; in sg_fill()
603 paddr = SG_ENT_PHYS_ADDRESS(sg); in sg_fill()
605 while (sg+1 < end && (int) sg[1].dma_address == -1) { in sg_fill()
606 size += sg[1].length; in sg_fill()
607 sg = sg_next(sg); in sg_fill()
620 while (++last_sg <= sg) { in sg_fill()
626 } while (++sg < end && (int) sg->dma_address < 0); in sg_fill()
631 static int alpha_pci_map_sg(struct device *dev, struct scatterlist *sg, in alpha_pci_map_sg() argument
648 sg->dma_length = sg->length; in alpha_pci_map_sg()
649 sg->dma_address in alpha_pci_map_sg()
650 = pci_map_single_1(pdev, SG_ENT_VIRT_ADDRESS(sg), in alpha_pci_map_sg()
651 sg->length, dac_allowed); in alpha_pci_map_sg()
652 if (sg->dma_address == DMA_MAPPING_ERROR) in alpha_pci_map_sg()
657 start = sg; in alpha_pci_map_sg()
658 end = sg + nents; in alpha_pci_map_sg()
661 sg_classify(dev, sg, end, alpha_mv.mv_pci_tbi != 0); in alpha_pci_map_sg()
678 for (out = sg; sg < end; ++sg) { in alpha_pci_map_sg()
679 if ((int) sg->dma_address < 0) in alpha_pci_map_sg()
681 if (sg_fill(dev, sg, end, out, arena, max_dma, dac_allowed) < 0) in alpha_pci_map_sg()
713 static void alpha_pci_unmap_sg(struct device *dev, struct scatterlist *sg, in alpha_pci_unmap_sg() argument
740 for (end = sg + nents; sg < end; ++sg) { in alpha_pci_unmap_sg()
746 addr = sg->dma_address; in alpha_pci_unmap_sg()
747 size = sg->dma_length; in alpha_pci_unmap_sg()
754 sg - end + nents, addr, size); in alpha_pci_unmap_sg()
762 sg - end + nents, addr, size); in alpha_pci_unmap_sg()
767 sg - end + nents, addr, size); in alpha_pci_unmap_sg()
786 DBGA("pci_unmap_sg: %ld entries\n", nents - (end - sg)); in alpha_pci_unmap_sg()