patch-2.4.13 linux/include/asm-arm/pci.h
Next file: linux/include/asm-arm/pgtable.h
Previous file: linux/include/asm-arm/param.h
Back to the patch index
Back to the overall index
- Lines: 58
- Date:
Fri Oct 12 15:35:54 2001
- Orig file:
v2.4.12/linux/include/asm-arm/pci.h
- Orig date:
Mon Aug 27 12:41:47 2001
diff -u --recursive --new-file v2.4.12/linux/include/asm-arm/pci.h linux/include/asm-arm/pci.h
@@ -44,7 +44,6 @@
consistent_free(vaddr, size, dma_handle);
}
-#if !defined(CONFIG_SA1111)
/* Map a single buffer of the indicated size for DMA in streaming mode.
* The 32-bit bus address to use is returned.
*
@@ -54,6 +53,17 @@
static inline dma_addr_t
pci_map_single(struct pci_dev *hwdev, void *ptr, size_t size, int direction)
{
+#ifdef CONFIG_SA1111
+ extern dma_addr_t sa1111_map_single(struct pci_dev *, void *, size_t, int);
+
+ /*
+ * for SA1111 these functions are "magic" and relocate buffers. We
+ * only need to do these if hwdev is non-null; otherwise we expect
+ * the buffer to already be suitable for DMA.
+ */
+ if (hwdev != NULL)
+ return sa1111_map_single(hwdev, ptr, size, direction);
+#endif
consistent_sync(ptr, size, direction);
return virt_to_bus(ptr);
}
@@ -68,16 +78,14 @@
static inline void
pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr, size_t size, int direction)
{
+#ifdef CONFIG_SA1111
+ extern void sa1111_unmap_single(struct pci_dev *, dma_addr_t, size_t, int);
+
+ if (hwdev != NULL)
+ sa1111_unmap_single(hwdev, dma_addr, size, direction);
+#endif
/* nothing to do */
}
-#else
-/* for SA1111 these functions are "magic" and relocate buffers */
-extern dma_addr_t pci_map_single(struct pci_dev *hwdev,
- void *ptr, size_t size, int direction);
-extern void pci_unmap_single(struct pci_dev *hwdev,
- dma_addr_t dma_addr,
- size_t size, int direction);
-#endif
/* Map a set of buffers described by scatterlist in streaming
* mode for DMA. This is the scather-gather version of the
@@ -152,7 +160,7 @@
* only drive the low 24-bits during PCI bus mastering, then
* you would pass 0x00ffffff as the mask to this function.
*/
-static inline int pci_dma_supported(struct pci_dev *hwdev, dma_addr_t mask)
+static inline int pci_dma_supported(struct pci_dev *hwdev, u64 mask)
{
return 1;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)