From: Frank Mori Hess Date: Wed, 12 Sep 2001 00:05:09 +0000 (+0000) Subject: added some compatibility macros for pci-dma buffer related functions, stolen X-Git-Tag: r0_7_61~106 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6984cb8783f8a6c0a91670f03a40f579f418b251;p=comedi.git added some compatibility macros for pci-dma buffer related functions, stolen from Donald Becker's starfire.c driver --- diff --git a/include/linux/ioport.h b/include/linux/ioport.h index b94600a1..12ae3bc8 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h @@ -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 diff --git a/include/linux/pci.h b/include/linux/pci.h index 27ac793b..f685854a 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -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 +#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 */