]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/x86/kernel/pci-nommu.c
Merge branch 'iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip...
[linux-2.6-omap-h63xx.git] / arch / x86 / kernel / pci-nommu.c
index 8b02a3936d4280ede99fd907e3f87e7a8845ae2e..c6d703b393261c2e5f45002b188b4d56638bc530 100644 (file)
@@ -25,19 +25,19 @@ check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size)
        return 1;
 }
 
-static dma_addr_t
-nommu_map_single(struct device *hwdev, phys_addr_t paddr, size_t size,
-              int direction)
+static dma_addr_t nommu_map_page(struct device *dev, struct page *page,
+                                unsigned long offset, size_t size,
+                                enum dma_data_direction dir,
+                                struct dma_attrs *attrs)
 {
-       dma_addr_t bus = paddr;
+       dma_addr_t bus = page_to_phys(page) + offset;
        WARN_ON(size == 0);
-       if (!check_addr("map_single", hwdev, bus, size))
-                               return bad_dma_address;
+       if (!check_addr("map_single", dev, bus, size))
+               return bad_dma_address;
        flush_write_buffers();
        return bus;
 }
 
-
 /* Map a set of buffers described by scatterlist in streaming
  * mode for DMA.  This is the scatter-gather version of the
  * above pci_map_single interface.  Here the scatter gather list
@@ -54,7 +54,8 @@ nommu_map_single(struct device *hwdev, phys_addr_t paddr, size_t size,
  * the same here.
  */
 static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg,
-              int nents, int direction)
+                       int nents, enum dma_data_direction dir,
+                       struct dma_attrs *attrs)
 {
        struct scatterlist *s;
        int i;
@@ -78,11 +79,11 @@ static void nommu_free_coherent(struct device *dev, size_t size, void *vaddr,
        free_pages((unsigned long)vaddr, get_order(size));
 }
 
-struct dma_mapping_ops nommu_dma_ops = {
+struct dma_map_ops nommu_dma_ops = {
        .alloc_coherent = dma_generic_alloc_coherent,
        .free_coherent  = nommu_free_coherent,
-       .map_single     = nommu_map_single,
        .map_sg         = nommu_map_sg,
+       .map_page       = nommu_map_page,
        .is_phys        = 1,
 };