diff options
Diffstat (limited to 'arch/sparc/kernel/iommu.c')
| -rw-r--r-- | arch/sparc/kernel/iommu.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/sparc/kernel/iommu.c b/arch/sparc/kernel/iommu.c index 0aeaefe696b9..7690cc219ecc 100644 --- a/arch/sparc/kernel/iommu.c +++ b/arch/sparc/kernel/iommu.c | |||
| @@ -353,7 +353,8 @@ static void dma_4u_free_coherent(struct device *dev, size_t size, | |||
| 353 | 353 | ||
| 354 | static dma_addr_t dma_4u_map_page(struct device *dev, struct page *page, | 354 | static dma_addr_t dma_4u_map_page(struct device *dev, struct page *page, |
| 355 | unsigned long offset, size_t sz, | 355 | unsigned long offset, size_t sz, |
| 356 | enum dma_data_direction direction) | 356 | enum dma_data_direction direction, |
| 357 | struct dma_attrs *attrs) | ||
| 357 | { | 358 | { |
| 358 | struct iommu *iommu; | 359 | struct iommu *iommu; |
| 359 | struct strbuf *strbuf; | 360 | struct strbuf *strbuf; |
| @@ -474,7 +475,8 @@ do_flush_sync: | |||
| 474 | } | 475 | } |
| 475 | 476 | ||
| 476 | static void dma_4u_unmap_page(struct device *dev, dma_addr_t bus_addr, | 477 | static void dma_4u_unmap_page(struct device *dev, dma_addr_t bus_addr, |
| 477 | size_t sz, enum dma_data_direction direction) | 478 | size_t sz, enum dma_data_direction direction, |
| 479 | struct dma_attrs *attrs) | ||
| 478 | { | 480 | { |
| 479 | struct iommu *iommu; | 481 | struct iommu *iommu; |
| 480 | struct strbuf *strbuf; | 482 | struct strbuf *strbuf; |
| @@ -520,7 +522,8 @@ static void dma_4u_unmap_page(struct device *dev, dma_addr_t bus_addr, | |||
| 520 | } | 522 | } |
| 521 | 523 | ||
| 522 | static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist, | 524 | static int dma_4u_map_sg(struct device *dev, struct scatterlist *sglist, |
| 523 | int nelems, enum dma_data_direction direction) | 525 | int nelems, enum dma_data_direction direction, |
| 526 | struct dma_attrs *attrs) | ||
| 524 | { | 527 | { |
| 525 | struct scatterlist *s, *outs, *segstart; | 528 | struct scatterlist *s, *outs, *segstart; |
| 526 | unsigned long flags, handle, prot, ctx; | 529 | unsigned long flags, handle, prot, ctx; |
| @@ -691,7 +694,8 @@ static unsigned long fetch_sg_ctx(struct iommu *iommu, struct scatterlist *sg) | |||
| 691 | } | 694 | } |
| 692 | 695 | ||
| 693 | static void dma_4u_unmap_sg(struct device *dev, struct scatterlist *sglist, | 696 | static void dma_4u_unmap_sg(struct device *dev, struct scatterlist *sglist, |
| 694 | int nelems, enum dma_data_direction direction) | 697 | int nelems, enum dma_data_direction direction, |
| 698 | struct dma_attrs *attrs) | ||
| 695 | { | 699 | { |
| 696 | unsigned long flags, ctx; | 700 | unsigned long flags, ctx; |
| 697 | struct scatterlist *sg; | 701 | struct scatterlist *sg; |
| @@ -822,7 +826,7 @@ static void dma_4u_sync_sg_for_cpu(struct device *dev, | |||
| 822 | spin_unlock_irqrestore(&iommu->lock, flags); | 826 | spin_unlock_irqrestore(&iommu->lock, flags); |
| 823 | } | 827 | } |
| 824 | 828 | ||
| 825 | static const struct dma_ops sun4u_dma_ops = { | 829 | static struct dma_map_ops sun4u_dma_ops = { |
| 826 | .alloc_coherent = dma_4u_alloc_coherent, | 830 | .alloc_coherent = dma_4u_alloc_coherent, |
| 827 | .free_coherent = dma_4u_free_coherent, | 831 | .free_coherent = dma_4u_free_coherent, |
| 828 | .map_page = dma_4u_map_page, | 832 | .map_page = dma_4u_map_page, |
| @@ -833,9 +837,11 @@ static const struct dma_ops sun4u_dma_ops = { | |||
| 833 | .sync_sg_for_cpu = dma_4u_sync_sg_for_cpu, | 837 | .sync_sg_for_cpu = dma_4u_sync_sg_for_cpu, |
| 834 | }; | 838 | }; |
| 835 | 839 | ||
| 836 | const struct dma_ops *dma_ops = &sun4u_dma_ops; | 840 | struct dma_map_ops *dma_ops = &sun4u_dma_ops; |
| 837 | EXPORT_SYMBOL(dma_ops); | 841 | EXPORT_SYMBOL(dma_ops); |
| 838 | 842 | ||
| 843 | extern int pci64_dma_supported(struct pci_dev *pdev, u64 device_mask); | ||
| 844 | |||
| 839 | int dma_supported(struct device *dev, u64 device_mask) | 845 | int dma_supported(struct device *dev, u64 device_mask) |
| 840 | { | 846 | { |
| 841 | struct iommu *iommu = dev->archdata.iommu; | 847 | struct iommu *iommu = dev->archdata.iommu; |
| @@ -849,7 +855,7 @@ int dma_supported(struct device *dev, u64 device_mask) | |||
| 849 | 855 | ||
| 850 | #ifdef CONFIG_PCI | 856 | #ifdef CONFIG_PCI |
| 851 | if (dev->bus == &pci_bus_type) | 857 | if (dev->bus == &pci_bus_type) |
| 852 | return pci_dma_supported(to_pci_dev(dev), device_mask); | 858 | return pci64_dma_supported(to_pci_dev(dev), device_mask); |
| 853 | #endif | 859 | #endif |
| 854 | 860 | ||
| 855 | return 0; | 861 | return 0; |
