• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/arch/arm/plat-omap/

Lines Matching refs:sgt

64 static size_t sgtable_len(const struct sg_table *sgt)
69 if (!sgt)
72 for_each_sg(sgt->sgl, sg, sgt->nents, i) {
122 struct sg_table *sgt;
137 sgt = kzalloc(sizeof(*sgt), GFP_KERNEL);
138 if (!sgt)
141 err = sg_alloc_table(sgt, nr_entries, GFP_KERNEL);
143 kfree(sgt);
147 pr_debug("%s: sgt:%p(%d entries)\n", __func__, sgt, nr_entries);
149 return sgt;
153 static void sgtable_free(struct sg_table *sgt)
155 if (!sgt)
158 sg_free_table(sgt);
159 kfree(sgt);
161 pr_debug("%s: sgt:%p\n", __func__, sgt);
165 static void *vmap_sg(const struct sg_table *sgt)
178 total = sgtable_len(sgt);
187 for_each_sg(sgt->sgl, sg, sgt->nents, i) {
378 static void sgtable_fill_vmalloc(struct sg_table *sgt, void *_va)
385 for_each_sg(sgt->sgl, sg, sgt->nents, i) {
402 static inline void sgtable_drain_vmalloc(struct sg_table *sgt)
408 BUG_ON(!sgt);
411 static void sgtable_fill_kmalloc(struct sg_table *sgt, u32 pa, size_t len)
419 for_each_sg(sgt->sgl, sg, sgt->nents, i) {
436 static inline void sgtable_drain_kmalloc(struct sg_table *sgt)
442 BUG_ON(!sgt);
445 /* create 'da' <-> 'pa' mapping from 'sgt' */
447 const struct sg_table *sgt, u32 flags)
454 if (!obj || !sgt)
457 BUG_ON(!sgtable_ok(sgt));
459 for_each_sg(sgt->sgl, sg, sgt->nents, i) {
489 for_each_sg(sgt->sgl, sg, i, j) {
532 struct sg_table *sgt = NULL;
553 sgt = (struct sg_table *)area->sgt;
567 return sgt;
571 const struct sg_table *sgt, void *va, size_t bytes, u32 flags)
584 new->sgt = sgt;
586 if (map_iovm_area(obj, new, sgt, new->flags))
604 const struct sg_table *sgt, void *va, size_t bytes, u32 flags)
606 return map_iommu_region(obj, da, sgt, va, bytes, flags);
612 * @sgt: address of scatter gather table
615 * Creates 1-n-1 mapping with given @sgt and returns @da.
616 * All @sgt element must be io page size aligned.
618 u32 iommu_vmap(struct iommu *obj, u32 da, const struct sg_table *sgt,
624 if (!obj || !obj->dev || !sgt)
627 bytes = sgtable_len(sgt);
633 va = vmap_sg(sgt);
643 da = __iommu_vmap(obj, da, sgt, va, bytes, flags);
661 struct sg_table *sgt;
663 * 'sgt' is allocated before 'iommu_vmalloc()' is called.
664 * Just returns 'sgt' to the caller to free
666 sgt = unmap_vm_area(obj, da, vunmap_sg, IOVMF_DISCONT | IOVMF_MMIO);
667 if (!sgt)
668 dev_dbg(obj->dev, "%s: No sgt\n", __func__);
669 return sgt;
686 struct sg_table *sgt;
697 sgt = sgtable_alloc(bytes, flags);
698 if (IS_ERR(sgt)) {
699 da = PTR_ERR(sgt);
702 sgtable_fill_vmalloc(sgt, va);
709 da = __iommu_vmap(obj, da, sgt, va, bytes, flags);
716 sgtable_drain_vmalloc(sgt);
717 sgtable_free(sgt);
734 struct sg_table *sgt;
736 sgt = unmap_vm_area(obj, da, vfree, IOVMF_DISCONT | IOVMF_ALLOC);
737 if (!sgt)
738 dev_dbg(obj->dev, "%s: No sgt\n", __func__);
739 sgtable_free(sgt);
746 struct sg_table *sgt;
748 sgt = sgtable_alloc(bytes, flags);
749 if (IS_ERR(sgt))
750 return PTR_ERR(sgt);
752 sgtable_fill_kmalloc(sgt, pa, bytes);
754 da = map_iommu_region(obj, da, sgt, va, bytes, flags);
756 sgtable_drain_kmalloc(sgt);
757 sgtable_free(sgt);
810 struct sg_table *sgt;
813 sgt = unmap_vm_area(obj, da, (func_t)__iounmap,
815 if (!sgt)
816 dev_dbg(obj->dev, "%s: No sgt\n", __func__);
817 sgtable_free(sgt);
869 struct sg_table *sgt;
871 sgt = unmap_vm_area(obj, da, kfree, IOVMF_LINEAR | IOVMF_ALLOC);
872 if (!sgt)
873 dev_dbg(obj->dev, "%s: No sgt\n", __func__);
874 sgtable_free(sgt);