patch-2.4.26 linux-2.4.26/include/asm-x86_64/pci.h

Next file: linux-2.4.26/include/asm-x86_64/pgtable.h
Previous file: linux-2.4.26/include/asm-x86_64/pci-direct.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.25/include/asm-x86_64/pci.h linux-2.4.26/include/asm-x86_64/pci.h
@@ -65,6 +65,18 @@
 extern void pci_free_consistent(struct pci_dev *hwdev, size_t size,
 				void *vaddr, dma_addr_t dma_handle);
 
+#ifdef CONFIG_SWIOTLB
+extern int swiotlb; 
+extern dma_addr_t swiotlb_map_single (struct pci_dev *hwdev, void *ptr, size_t size, 
+                                     int dir);
+extern void swiotlb_unmap_single (struct pci_dev *hwdev, dma_addr_t dev_addr,
+                                 size_t size, int dir);
+extern void swiotlb_sync_single (struct pci_dev *hwdev, dma_addr_t dev_addr, 
+                                size_t size, int dir);
+extern void swiotlb_sync_sg (struct pci_dev *hwdev, struct scatterlist *sg, int nelems, 
+                            int dir);
+#endif
+
 #ifdef CONFIG_GART_IOMMU
 
 /* Map a single buffer of the indicated size for DMA in streaming mode.
@@ -105,6 +117,10 @@
 				       dma_addr_t dma_handle,
 				       size_t size, int direction)
 {
+#ifdef CONFIG_SWIOTLB
+       if (swiotlb)
+               return swiotlb_sync_single(hwdev,dma_handle,size,direction);
+#endif
 	BUG_ON(direction == PCI_DMA_NONE); 
 } 
 
@@ -113,6 +129,10 @@
 				   int nelems, int direction)
 { 
 	BUG_ON(direction == PCI_DMA_NONE); 
+#ifdef CONFIG_SWIOTLB
+       if (swiotlb)
+               return swiotlb_sync_sg(hwdev,sg,nelems,direction);
+#endif
 } 
 
 /* The PCI address space does equal the physical memory

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)