added some compatibility macros for pci-dma buffer related functions, stolen
authorFrank Mori Hess <fmhess@speakeasy.net>
Wed, 12 Sep 2001 00:05:09 +0000 (00:05 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Wed, 12 Sep 2001 00:05:09 +0000 (00:05 +0000)
from Donald Becker's starfire.c driver

include/linux/ioport.h
include/linux/pci.h

index b94600a152ef3084b19d6bb19327eaa840f08ca4..12ae3bc8f28103317346169dd060cbeaa0eeb804 100644 (file)
@@ -8,7 +8,7 @@
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,17)
 
 #define check_mem_region(start,n) 0
-#define request_mem_region(start,n,name) 0
+#define request_mem_region(start,n,name) ((void*) 0)
 #define release_mem_region(start,n)
 
 #endif
index 27ac793b7fd3174b277227978a08acff5cc5b308..f685854adc8d58679da965a2bdcca59d455d6fb1 100644 (file)
@@ -23,7 +23,7 @@
 #define pci_enable_device(x) 0
 
 #define PCI_ANY_ID (~0)
-#define __devinitdata
+#define __devinitdata  __initdata
 
 struct pci_device_id {
        unsigned int vendor, device;
@@ -32,11 +32,29 @@ struct pci_device_id {
        unsigned long driver_data;
 };
 
+// stuff for allocating pci dma buffers
+#include <asm/io.h>
+#define PCI_DMA_FROMDEVICE              0
+#define PCI_DMA_TODEVICE                0
+static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
+                                         dma_addr_t *dma_handle)
+{
+        void *virt_ptr;
+
+        virt_ptr = kmalloc(size, GFP_KERNEL);
+        *dma_handle = virt_to_bus(virt_ptr);
+        return virt_ptr;
+}
+#define pci_free_consistent(cookie, size, ptr, dma_ptr) kfree(ptr)
+#define pci_map_single(cookie, address, size, dir)      virt_to_bus(address)
+#define pci_unmap_single(cookie, address, size, dir)
+#define pci_dma_sync_single(cookie, address, size, dir)
+
 #else
 
 #endif
-#endif
 
+#endif
 
 #endif /* _COMPAT_PCI_H */