Update of /cvsroot/alsa/alsa-driver/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24264/include

Modified Files:
        adriver.h compat_22.h 
Log Message:
- clean up the DMA code.  added the wrapper for 2.2/2.4 kernels.
- don't include unneeded header files for 2.6 kernels.
- always export pci_alloc_consistent() wrapper for 2.2 kernels.
  it's used for ISA buffer allocation now.
- added the missing header files.


Index: adriver.h
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/include/adriver.h,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- adriver.h   5 Mar 2004 11:54:05 -0000       1.75
+++ adriver.h   6 Mar 2004 16:55:12 -0000       1.76
@@ -57,14 +57,14 @@
 #define request_module(name, args...) snd_compat_request_module(name, ##args)
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
 #include <linux/compiler.h>
 #ifndef __user
 #define __user
 #endif
 
-#ifdef CONFIG_PCI
+/* for compat layer */
 #include <linux/pci.h>
-#endif
 
 #ifdef LINUX_2_2
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 18)
@@ -175,6 +175,8 @@
 #define MODULE_LICENSE(license)
 #endif
 
+#endif /* < 2.6.0 */
+
 #ifndef CONFIG_HAVE_STRLCPY
 size_t snd_compat_strlcpy(char *dest, const char *src, size_t size);
 #define strlcpy(dest, src, size) snd_compat_strlcpy(dest, src, size)
@@ -207,8 +209,9 @@
 #define writeq(v, a) do { __writeq((v),(a)); mb(); } while(0)
 #endif
 
-#include <linux/interrupt.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 28)
+#include <linux/interrupt.h>
 static inline void synchronize_irq_wrapper(unsigned int irq) { synchronize_irq(); }
 #undef synchronize_irq
 #define synchronize_irq(irq)   synchronize_irq_wrapper(irq)
@@ -219,6 +222,7 @@
 #define IRQ_RETVAL(x)  /*void*/
 typedef void irqreturn_t;
 #endif
+#endif /* < 2.6.0 */
 
 #ifndef min
 /*
@@ -241,6 +245,7 @@
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
 #include <linux/devfs_fs_kernel.h>
 #ifdef CONFIG_DEVFS_FS
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 29)
@@ -252,7 +257,7 @@
 #undef devfs_remove
 void snd_compat_devfs_remove(const char *fmt, ...);
 #define devfs_remove snd_compat_devfs_remove
-#endif
+#endif /* < 2.5.29 */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 67)
 #undef devfs_mk_dir
 int snd_compat_devfs_mk_dir(const char *dir, ...);
@@ -260,7 +265,7 @@
 #undef devfs_mk_cdev
 int snd_compat_devfs_mk_cdev(dev_t dev, umode_t mode, const char *fmt, ...);
 #define devfs_mk_cdev snd_compat_devfs_mk_cdev
-#endif
+#endif /* < 2.5.67 */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0)
 static inline void devfs_find_and_unregister (devfs_handle_t dir, const char *name,
                                              unsigned int major, unsigned int minor,
@@ -289,6 +294,7 @@
 #undef devfs_mk_cdev
 #define devfs_mk_cdev(dev, mode, fmt, args...) do { (void)(dev); } while (0)
 #endif /* CONFIG_DEVFS_FS */
+#endif /* < 2.6.0 */
 
 /* workarounds for USB API */
 #if defined(SND_NEED_USB_WRAPPER) && (defined(CONFIG_USB) || 
defined(CONFIG_USB_MODULE))
@@ -353,6 +359,7 @@
 #endif /* SND_NEED_USB_WRAPPER && CONFIG_USB */
 
 /* workqueue-alike; 2.5.45 */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0)
 #include <linux/workqueue.h>
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 45) && !defined(__WORK_INITIALIZER)
 struct work_struct {
@@ -372,7 +379,8 @@
        struct work_struct n = __WORK_INITIALIZER(n, f, d)
 int snd_compat_schedule_work(struct work_struct *work);
 #define schedule_work(w) snd_compat_schedule_work(w)
-#endif /* 2.5.45 */
+#endif /* < 2.5.45 */
+#endif /* < 2.6.0 */
 
 /* 2.5 new modules */
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
@@ -438,12 +446,10 @@
 #endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)
-struct device {
-       struct {
-               struct pci_dev *pci;
-       } d;
-       u64 *dma_mask;
-};
+#define snd_dma_pci_data(pci)  ((struct device *)(pci))
+#define snd_dma_isa_data()     NULL
+#define snd_dma_sbus_data(sbus)        ((struct device *)(sbus))
+#define snd_dma_continuous_data(x)     ((struct device *)(unsigned long)(x))
 #endif
 
 #endif /* __SOUND_LOCAL_DRIVER_H */

Index: compat_22.h
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/include/compat_22.h,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- compat_22.h 26 Jan 2004 14:01:29 -0000      1.55
+++ compat_22.h 6 Mar 2004 16:55:12 -0000       1.56
@@ -196,6 +196,14 @@
 struct resource *snd_compat_request_region(unsigned long start, unsigned long size, 
const char *name, int is_memory);
 int snd_compat_release_resource(struct resource *resource);
 
+/* these functions are used for ISA buffer allocation, too, so they stay
+ * outside of CONFIG_PCI
+ */
+#define pci_alloc_consistent snd_pci_compat_alloc_consistent
+#define pci_free_consistent snd_pci_compat_free_consistent
+void *snd_pci_compat_alloc_consistent(struct pci_dev *, long, dma_addr_t *);
+void snd_pci_compat_free_consistent(struct pci_dev *, long, void *, dma_addr_t);
+
 #ifdef CONFIG_PCI
 
 /* New-style probing supporting hot-pluggable devices */
@@ -217,8 +225,6 @@
 #define pci_unregister_driver snd_pci_compat_unregister_driver
 #define pci_set_power_state snd_pci_compat_set_power_state
 
-#define pci_alloc_consistent snd_pci_compat_alloc_consistent
-#define pci_free_consistent snd_pci_compat_free_consistent
 #define pci_dma_supported snd_pci_compat_dma_supported
 
 #define pci_dev_g(n) list_entry(n, struct pci_dev, global_list)
@@ -282,8 +288,6 @@
 int snd_pci_compat_enable_device(struct pci_dev *dev);
 void snd_pci_compat_disable_device(struct pci_dev *dev);
 int snd_pci_compat_find_capability(struct pci_dev *dev, int cap);
-void *snd_pci_compat_alloc_consistent(struct pci_dev *, long, dma_addr_t *);
-void snd_pci_compat_free_consistent(struct pci_dev *, long, void *, dma_addr_t);
 int snd_pci_compat_dma_supported(struct pci_dev *, dma_addr_t mask);
 unsigned long snd_pci_compat_get_dma_mask(struct pci_dev *);
 int snd_pci_compat_set_dma_mask(struct pci_dev *, unsigned long mask);



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to