浏览代码

x86: add map_page and unmap_page to struct dma_mapping_ops

This patch adds map_page and unmap_page to struct dma_mapping_ops.

This is a preparation of struct dma_mapping_ops unification. We use
map_page and unmap_page instead of map_single and unmap_single.

We will remove map_single and unmap_single hooks in the last patch in
this patchset.

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
FUJITA Tomonori 16 年之前
父节点
当前提交
abe6602bf1
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      arch/x86/include/asm/dma-mapping.h

+ 8 - 0
arch/x86/include/asm/dma-mapping.h

@@ -7,6 +7,7 @@
  */
  */
 
 
 #include <linux/scatterlist.h>
 #include <linux/scatterlist.h>
+#include <linux/dma-attrs.h>
 #include <asm/io.h>
 #include <asm/io.h>
 #include <asm/swiotlb.h>
 #include <asm/swiotlb.h>
 #include <asm-generic/dma-coherent.h>
 #include <asm-generic/dma-coherent.h>
@@ -50,6 +51,13 @@ struct dma_mapping_ops {
 	void            (*unmap_sg)(struct device *hwdev,
 	void            (*unmap_sg)(struct device *hwdev,
 				struct scatterlist *sg, int nents,
 				struct scatterlist *sg, int nents,
 				int direction);
 				int direction);
+	dma_addr_t	(*map_page)(struct device *dev, struct page *page,
+				    unsigned long offset, size_t size,
+				    enum dma_data_direction dir,
+				    struct dma_attrs *attrs);
+	void 		(*unmap_page)(struct device *dev, dma_addr_t dma_handle,
+				      size_t size, enum dma_data_direction dir,
+				      struct dma_attrs *attrs);
 	int             (*dma_supported)(struct device *hwdev, u64 mask);
 	int             (*dma_supported)(struct device *hwdev, u64 mask);
 	int		is_phys;
 	int		is_phys;
 };
 };