Lines Matching refs:sg
266 assume it doesn't support sg mapping, and, since we tried to
269 printk_once(KERN_WARNING "pci_map_single: no HW sg\n");
296 DBGA2("pci_map_single: [%p,%zx] np %ld -> sg %llx from %ps\n",
402 DBGA2("pci_unmap_single: sg [%llx,%zx] np %ld from %ps\n",
428 with vmalloc and sg if we can't find contiguous memory. */
481 sg_classify(struct device *dev, struct scatterlist *sg, struct scatterlist *end,
489 leader = sg;
494 /* we will not marge sg without device. */
496 for (++sg; sg < end; ++sg) {
498 addr = SG_ENT_PHYS_ADDRESS(sg);
499 len = sg->length;
505 sg->dma_address = -1;
508 sg->dma_address = -2;
515 leader = sg;
537 struct scatterlist *sg;
588 DBGA(" sg_fill: [%p,%lx] -> sg %llx np %ld\n",
594 sg = leader;
597 struct scatterlist *last_sg = sg;
600 size = sg->length;
601 paddr = SG_ENT_PHYS_ADDRESS(sg);
603 while (sg+1 < end && (int) sg[1].dma_address == -1) {
604 size += sg[1].length;
605 sg = sg_next(sg);
618 while (++last_sg <= sg) {
624 } while (++sg < end && (int) sg->dma_address < 0);
629 static int alpha_pci_map_sg(struct device *dev, struct scatterlist *sg,
646 sg->dma_length = sg->length;
647 sg->dma_address
648 = pci_map_single_1(pdev, SG_ENT_VIRT_ADDRESS(sg),
649 sg->length, dac_allowed);
650 if (sg->dma_address == DMA_MAPPING_ERROR)
655 start = sg;
656 end = sg + nents;
659 sg_classify(dev, sg, end, alpha_mv.mv_pci_tbi != 0);
676 for (out = sg; sg < end; ++sg) {
677 if ((int) sg->dma_address < 0)
679 if (sg_fill(dev, sg, end, out, arena, max_dma, dac_allowed) < 0)
711 static void alpha_pci_unmap_sg(struct device *dev, struct scatterlist *sg,
738 for (end = sg + nents; sg < end; ++sg) {
744 addr = sg->dma_address;
745 size = sg->dma_length;
752 sg - end + nents, addr, size);
760 sg - end + nents, addr, size);
764 DBGA(" (%ld) sg [%llx,%zx]\n",
765 sg - end + nents, addr, size);
784 DBGA("pci_unmap_sg: %ld entries\n", nents - (end - sg));