Merge branch 'iommu/fixes-2.6.29' of git://git.kernel.org/pub/scm/linux/kernel/git...
authorIngo Molnar <mingo@elte.hu>
Thu, 5 Mar 2009 11:47:34 +0000 (12:47 +0100)
committerIngo Molnar <mingo@elte.hu>
Thu, 5 Mar 2009 11:47:34 +0000 (12:47 +0100)
1  2 
arch/x86/kernel/amd_iommu.c

  #include <linux/bitops.h>
  #include <linux/debugfs.h>
  #include <linux/scatterlist.h>
 +#include <linux/dma-mapping.h>
  #include <linux/iommu-helper.h>
- #ifdef CONFIG_IOMMU_API
  #include <linux/iommu.h>
- #endif
  #include <asm/proto.h>
  #include <asm/iommu.h>
  #include <asm/gart.h>
@@@ -1298,10 -1295,8 +1296,10 @@@ static void __unmap_single(struct amd_i
  /*
   * The exported map_single function for dma_ops.
   */
 -static dma_addr_t map_single(struct device *dev, phys_addr_t paddr,
 -                           size_t size, int dir)
 +static 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)
  {
        unsigned long flags;
        struct amd_iommu *iommu;
        u16 devid;
        dma_addr_t addr;
        u64 dma_mask;
 +      phys_addr_t paddr = page_to_phys(page) + offset;
  
        INC_STATS_COUNTER(cnt_map_single);
  
@@@ -1344,8 -1338,8 +1342,8 @@@ out
  /*
   * The exported unmap_single function for dma_ops.
   */
 -static void unmap_single(struct device *dev, dma_addr_t dma_addr,
 -                       size_t size, int dir)
 +static void unmap_page(struct device *dev, dma_addr_t dma_addr, size_t size,
 +                     enum dma_data_direction dir, struct dma_attrs *attrs)
  {
        unsigned long flags;
        struct amd_iommu *iommu;
@@@ -1394,8 -1388,7 +1392,8 @@@ static int map_sg_no_iommu(struct devic
   * lists).
   */
  static int map_sg(struct device *dev, struct scatterlist *sglist,
 -                int nelems, int dir)
 +                int nelems, enum dma_data_direction dir,
 +                struct dma_attrs *attrs)
  {
        unsigned long flags;
        struct amd_iommu *iommu;
@@@ -1462,8 -1455,7 +1460,8 @@@ unmap
   * lists).
   */
  static void unmap_sg(struct device *dev, struct scatterlist *sglist,
 -                   int nelems, int dir)
 +                   int nelems, enum dma_data_direction dir,
 +                   struct dma_attrs *attrs)
  {
        unsigned long flags;
        struct amd_iommu *iommu;
@@@ -1650,11 -1642,11 +1648,11 @@@ static void prealloc_protection_domains
        }
  }
  
 -static struct dma_mapping_ops amd_iommu_dma_ops = {
 +static struct dma_map_ops amd_iommu_dma_ops = {
        .alloc_coherent = alloc_coherent,
        .free_coherent = free_coherent,
 -      .map_single = map_single,
 -      .unmap_single = unmap_single,
 +      .map_page = map_page,
 +      .unmap_page = unmap_page,
        .map_sg = map_sg,
        .unmap_sg = unmap_sg,
        .dma_supported = amd_iommu_dma_supported,