[19/22] x86: Calgary: Add map_peer_resource stub
diff mbox

Message ID 1442337067-22964-20-git-send-email-wdavis@nvidia.com
State New, archived
Headers show

Commit Message

wdavis@nvidia.com Sept. 15, 2015, 5:11 p.m. UTC
Return DMA_ERROR_CODE to indicate no support.

Signed-off-by: Will Davis <wdavis@nvidia.com>
---
 arch/x86/kernel/pci-calgary_64.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Patch
diff mbox

diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c
index 0497f71..ec3d998 100644
--- a/arch/x86/kernel/pci-calgary_64.c
+++ b/arch/x86/kernel/pci-calgary_64.c
@@ -431,6 +431,19 @@  static void calgary_unmap_page(struct device *dev, dma_addr_t dma_addr,
 	iommu_free(tbl, dma_addr, npages);
 }
 
+#ifdef CONFIG_HAS_DMA_P2P
+static dma_peer_addr_t calgary_map_peer_resource(struct device *dev,
+						 struct device *peer,
+						 struct resource *res,
+						 unsigned long offset,
+						 size_t size,
+						 enum dma_data_direction dir,
+						 struct dma_attrs *attrs)
+{
+	return DMA_ERROR_CODE;
+}
+#endif
+
 static void* calgary_alloc_coherent(struct device *dev, size_t size,
 	dma_addr_t *dma_handle, gfp_t flag, struct dma_attrs *attrs)
 {
@@ -485,6 +498,9 @@  static struct dma_map_ops calgary_dma_ops = {
 	.unmap_sg = calgary_unmap_sg,
 	.map_page = calgary_map_page,
 	.unmap_page = calgary_unmap_page,
+#ifdef CONFIG_HAS_DMA_P2P
+	.map_peer_resource = calgary_map_peer_resource,
+#endif
 };
 
 static inline void __iomem * busno_to_bbar(unsigned char num)