Remove compatibility for 2.0 and 2.2
authorDavid Schleef <ds@schleef.org>
Fri, 7 Oct 2005 05:04:04 +0000 (05:04 +0000)
committerDavid Schleef <ds@schleef.org>
Fri, 7 Oct 2005 05:04:04 +0000 (05:04 +0000)
22 files changed:
comedi/comedi_fops.c
comedi/comedi_ksyms.c
comedi/drivers.c
comedi/proc.c
include/linux/config.h
include/linux/fs.h [deleted file]
include/linux/highmem.h [deleted file]
include/linux/init.h [deleted file]
include/linux/ioport.h [deleted file]
include/linux/isapnp.h [deleted file]
include/linux/kdev_t.h [deleted file]
include/linux/kmod.h [deleted file]
include/linux/mm.h
include/linux/module.h
include/linux/pci.h
include/linux/poll.h [deleted file]
include/linux/sched.h
include/linux/slab.h [deleted file]
include/linux/spinlock.h [deleted file]
include/linux/timer.h [deleted file]
include/linux/vmalloc.h [deleted file]
include/linux/wait.h [deleted file]

index c8dc9b9ab80ed5d168cc26fa55ba4fbf56e383fb..8db0b10d629c806c88da36a1710a923347b62ea9 100644 (file)
@@ -78,9 +78,7 @@ static int do_poll_ioctl(comedi_device *dev,unsigned int subd,void *file);
 void do_become_nonbusy(comedi_device *dev,comedi_subdevice *s);
 static int do_cancel(comedi_device *dev,comedi_subdevice *s);
 
-#if LINUX_VERSION_CODE >= 0x020100
 static int comedi_fasync (int fd, struct file *file, int on);
-#endif
 static void init_async_buf( comedi_async *async );
 
 static int comedi_ioctl(struct inode * inode,struct file * file,
@@ -1240,22 +1238,13 @@ static int do_cancel(comedi_device *dev,comedi_subdevice *s)
 }
 
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)  /* XXX */
-#define RDEV_OF_FILE(x)        ((x)->f_inode->i_rdev)
-#else
 #define RDEV_OF_FILE(x)        ((x)->f_dentry->d_inode->i_rdev)
-#endif
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0)
 void comedi_unmap(struct vm_area_struct *area)
 {
        comedi_async *async;
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,17)
-       async = (void *)area->vm_pte;
-#else
        async = area->vm_private_data;
-#endif
 
        async->mmap_count--;
 }
@@ -1263,14 +1252,8 @@ void comedi_unmap(struct vm_area_struct *area)
 static struct vm_operations_struct comedi_vm_ops={
        close:          comedi_unmap,
 };
-/*
-   comedi_mmap_v22
- */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,17)
-#define page_address(x) x
-#endif
 
-static int comedi_mmap_v22(struct file * file, struct vm_area_struct *vma)
+static int comedi_mmap(struct file * file, struct vm_area_struct *vma)
 {
        unsigned int minor=MINOR(RDEV_OF_FILE(file));
        comedi_device *dev=comedi_get_device_by_minor(minor);
@@ -1295,17 +1278,10 @@ static int comedi_mmap_v22(struct file * file, struct vm_area_struct *vma)
                return -EINVAL;
        }
 
-#if LINUX_VERSION_CODE < 0x020300
-       if(vma->vm_offset != 0){
-               DPRINTK("comedi: mmap() offset must be 0.\n");
-               return -EINVAL;
-       }
-#else
        if(vma->vm_pgoff != 0){
                DPRINTK("comedi: mmap() offset must be 0.\n");
                return -EINVAL;
        }
-#endif
 
        size = vma->vm_end - vma->vm_start;
        if(size>async->prealloc_bufsz)
@@ -1323,21 +1299,15 @@ static int comedi_mmap_v22(struct file * file, struct vm_area_struct *vma)
        }
 
        vma->vm_ops = &comedi_vm_ops;
-#if LINUX_VERSION_CODE < 0x020300
-       (void *)vma->vm_pte = async;
-#else
        vma->vm_private_data = async;
-#endif
 
        async->mmap_count++;
 
        return 0;
 }
-#endif
 
-#if LINUX_VERSION_CODE >= 0x020100
 
-static unsigned int comedi_poll_v22(struct file *file, poll_table * wait)
+static unsigned int comedi_poll(struct file *file, poll_table * wait)
 {
        comedi_device *dev;
        comedi_subdevice *s;
@@ -1376,9 +1346,8 @@ static unsigned int comedi_poll_v22(struct file *file, poll_table * wait)
 
        return mask;
 }
-#endif
 
-static ssize_t comedi_write_v22(struct file *file,const char *buf,size_t nbytes,loff_t *offset)
+static ssize_t comedi_write(struct file *file,const char *buf,size_t nbytes,loff_t *offset)
 {
        comedi_device *dev;
        comedi_subdevice *s;
@@ -1464,7 +1433,7 @@ static ssize_t comedi_write_v22(struct file *file,const char *buf,size_t nbytes,
 }
 
 
-static ssize_t comedi_read_v22(struct file * file,char *buf,size_t nbytes,loff_t *offset)
+static ssize_t comedi_read(struct file * file,char *buf,size_t nbytes,loff_t *offset)
 {
        comedi_device *dev;
        comedi_subdevice *s;
@@ -1585,7 +1554,7 @@ void do_become_nonbusy(comedi_device *dev,comedi_subdevice *s)
 #define SEEK_CUR 1
 #define SEEK_END 2
 
-static loff_t comedi_lseek_v22(struct file *file,loff_t offset,int origin)
+static loff_t comedi_lseek(struct file *file,loff_t offset,int origin)
 {
        comedi_device *dev;
        loff_t new_offset;
@@ -1611,7 +1580,7 @@ static loff_t comedi_lseek_v22(struct file *file,loff_t offset,int origin)
        return file->f_pos=new_offset;
 }
 
-static int comedi_fop_open(struct inode *inode,struct file *file)
+static int comedi_open(struct inode *inode,struct file *file)
 {
        unsigned int minor=MINOR(inode->i_rdev);
        comedi_device *dev;
@@ -1675,7 +1644,7 @@ ok:
        return 0;
 }
 
-static int comedi_close_v22(struct inode *inode,struct file *file)
+static int comedi_close(struct inode *inode,struct file *file)
 {
        comedi_device *dev=comedi_get_device_by_minor(MINOR(inode->i_rdev));
        comedi_subdevice *s = NULL;
@@ -1705,84 +1674,33 @@ static int comedi_close_v22(struct inode *inode,struct file *file)
 
        dev->use_count--;
 
-#if LINUX_VERSION_CODE >= 0x020100
        if(file->f_flags & FASYNC){
                comedi_fasync(-1,file,0);
        }
-#endif
 
        return 0;
 }
 
-#if LINUX_VERSION_CODE >= 0x020100
 static int comedi_fasync (int fd, struct file *file, int on)
 {
        comedi_device *dev=comedi_get_device_by_minor(MINOR(RDEV_OF_FILE(file)));
 
        return fasync_helper(fd,file,on,&dev->async_queue);
 }
-#endif
-
-/*
-       kernel compatibility
-*/
-
-#if LINUX_VERSION_CODE < 0x020100
-
-static int comedi_write_v20(struct inode *inode,struct file *file,const char *buf,int nbytes)
-{
-       return comedi_write_v22(file,buf,nbytes,NULL);
-}
-
-static int comedi_read_v20(struct inode *inode,struct file *file,char *buf,int nbytes)
-{
-       return comedi_read_v22(file,buf,nbytes,NULL);
-}
-
-static int comedi_lseek_v20(struct inode * inode,struct file *file,off_t offset,int origin)
-{
-       return comedi_lseek_v22(file,offset,origin);
-}
-
-static void comedi_close_v20(struct inode *inode,struct file *file)
-{
-       comedi_close_v22(inode,file);
-}
 
-#define comedi_ioctl_v20 comedi_ioctl
-#define comedi_open_v20 comedi_fop_open
 
 static struct file_operations comedi_fops={
-       lseek           : comedi_lseek_v20,
-       ioctl           : comedi_ioctl_v20,
-       open            : comedi_open_v20,
-       release         : comedi_close_v20,
-       read            : comedi_read_v20,
-       write           : comedi_write_v20,
-};
-
-#endif
-
-#if LINUX_VERSION_CODE >= 0x020200
-
-#define comedi_ioctl_v22 comedi_ioctl
-#define comedi_open_v22 comedi_fop_open
-
-static struct file_operations comedi_fops={
-#if LINUX_VERSION_CODE >= 0x020400
        owner           : THIS_MODULE,
-#endif
-       llseek          : comedi_lseek_v22,
-       ioctl           : comedi_ioctl_v22,
-       open            : comedi_open_v22,
-       release         : comedi_close_v22,
-       read            : comedi_read_v22,
-       write           : comedi_write_v22,
-       mmap            : comedi_mmap_v22,
-       poll            : comedi_poll_v22,
+       llseek          : comedi_lseek,
+       ioctl           : comedi_ioctl,
+       open            : comedi_open,
+       release         : comedi_close,
+       read            : comedi_read,
+       write           : comedi_write,
+       mmap            : comedi_mmap,
+       poll            : comedi_poll,
        fasync          : comedi_fasync,
 };
-#endif
 
 static struct class *comedi_class;
 
@@ -1907,11 +1825,11 @@ void comedi_event(comedi_device *dev,comedi_subdevice *s, unsigned int mask)
                        }else{
                                if(s==dev->read_subdev){
                                        wake_up_interruptible(&dev->read_wait);
-                                       KILL_FASYNC(dev->async_queue, SIGIO, POLL_IN);
+                                       kill_fasync(&dev->async_queue, SIGIO, POLL_IN);
                                }
                                if(s==dev->write_subdev){
                                        wake_up_interruptible(&dev->write_wait);
-                                       KILL_FASYNC(dev->async_queue, SIGIO, POLL_OUT);
+                                       kill_fasync(&dev->async_queue, SIGIO, POLL_OUT);
                                }
                        }
                }else{
index f84c0fe5538582052b91a3bd1c4b8d3da7c6e806..fb9f07aef2c7d3f9e8d622f270aab2ae660b87dd 100644 (file)
@@ -32,8 +32,6 @@
 
 
 
-#if LINUX_VERSION_CODE >= 0x020200
-
 /* for drivers */
 EXPORT_SYMBOL(comedi_driver_register);
 EXPORT_SYMBOL(comedi_driver_unregister);
@@ -77,7 +75,6 @@ EXPORT_SYMBOL(comedi_buf_write_alloc);
 EXPORT_SYMBOL(comedi_buf_read_free);
 EXPORT_SYMBOL(comedi_buf_memcpy_to);
 EXPORT_SYMBOL(comedi_buf_memcpy_from);
-#endif
 
 
 
index 8ed325be605124ca4879a45eda94fcbfd869abf7..b1fa9d86daf769971416bce1ac6fe9a83f7bac95 100644 (file)
@@ -414,7 +414,7 @@ static inline unsigned long kvirt_to_kva(unsigned long adr)
 {
        unsigned long va, kva;
 
-       va = VMALLOC_VMADDR(adr);
+       va = adr;
        kva = uvirt_to_kva(pgd_offset_k(va), va);
 
        return kva;
index 8c53af036b9023931bd9a391d1c443d18e7f92fa..657df6fb02362bccc124acf8294e565c965716be 100644 (file)
 //#include <linux/string.h>
 
 
-#if LINUX_VERSION_CODE < 0x020100
-int comedi_read_procmem(char *buf,char **start,off_t offset,int len,int unused);
-
-struct proc_dir_entry comedi_proc_entry =
-{
-       0,
-       6, "comedi",
-       S_IFREG | S_IRUGO,
-       1, 0, 0,
-       0, NULL,
-       &comedi_read_procmem,
-};
-
-#else
 int comedi_read_procmem(char *buf,char **start,off_t offset,int len,int *eof,void *data);
 
 
-
-#endif
-
 extern comedi_driver *comedi_drivers;
 
-#if LINUX_VERSION_CODE < 0x020100
-int comedi_read_procmem(char *buf,char **start,off_t offset,int len,int unused)
-#else
 int comedi_read_procmem(char *buf,char **start,off_t offset,int len,int *eof,void *data)
-#endif
 {
        int i;
        int devices_q=0;
@@ -108,24 +87,16 @@ int comedi_read_procmem(char *buf,char **start,off_t offset,int len,int *eof,voi
 
 void comedi_proc_init(void)
 {
-#if LINUX_VERSION_CODE < 0x020100
-       proc_register_dynamic(&proc_root,&comedi_proc_entry);
-#else
        struct proc_dir_entry *comedi_proc;
        
        comedi_proc = create_proc_entry("comedi",S_IFREG | S_IRUGO,0);
        if(comedi_proc)
                comedi_proc->read_proc = comedi_read_procmem;
-#endif
 }
 
 void comedi_proc_cleanup(void)
 {
-#if LINUX_VERSION_CODE < 0x020100
-       proc_unregister(&proc_root,comedi_proc_entry.low_ino);
-#else
        remove_proc_entry("comedi",0);
-#endif
 }
 
 
index acae24c764324c79478c53c14d11d098a4703317..730550f0251c3f6c0035ce9ffcf98760c1443c39 100644 (file)
@@ -2,9 +2,6 @@
 #define __MULTI_CONFIG_H_
 
 #include <config.h>
-#ifdef CONFIG_COMEDI_RTAI
-//#include <modbuild/config.h>
-#endif
 #include_next <linux/config.h>
 
 #endif
diff --git a/include/linux/fs.h b/include/linux/fs.h
deleted file mode 100644 (file)
index d75090a..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * linux/fs.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_FS_H_
-#define __COMPAT_LINUX_FS_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-/* no fasync */
-#define KILL_FASYNC(a,b,c)
-#else
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
-#define KILL_FASYNC(a,b,c)     kill_fasync((a),(c))
-#else
-#define KILL_FASYNC(a,b,c)     kill_fasync(&(a),(b),(c))
-#endif
-#endif
-
-#include_next <linux/fs.h>
-
-#endif
-
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
deleted file mode 100644 (file)
index 59ce466..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-
-/*
- * linux/highmem.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_DEVFS_FS_KERNEL_H_
-#define __COMPAT_LINUX_DEVFS_FS_KERNEL_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0)
-#else
-#include_next <linux/highmem.h>
-#endif
-
-#endif
-
diff --git a/include/linux/init.h b/include/linux/init.h
deleted file mode 100644 (file)
index b57dc86..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * linux/init.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_INIT_H_
-#define __COMPAT_LINUX_INIT_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
-#define __devinitdata __initdata
-#define __exit
-#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-#define __init
-#else
-#include_next <linux/init.h>
-#endif
-
-#endif
-
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
deleted file mode 100644 (file)
index 28af404..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-// linux/ioport.h compatibility header
-
-#ifndef _COMPAT_IOPORT_H
-#define _COMPAT_IOPORT_H
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,20)
-
-#define request_mem_region(start,n,name) ((void*) 1)
-#define release_mem_region(start,n)
-
-#endif
-
-#include_next <linux/ioport.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,11)
-
-/* 'struct resource' not defined.  Define a dummy version. */
-struct resource {
-       int dummy;
-};
-
-/* Define a compatible version of request_region that returns a pointer
- * to a non-NULL value on success.  */
-static inline struct resource *compat__request_region(unsigned long from,
-               unsigned long extent, const char *name)
-{
-       if (check_region(from, extent) < 0) {
-               return (struct resource *)0;
-       }
-       request_region(from, extent, name);
-       return ((struct resource *)0 + 1);      /* Should be non-NULL */
-}
-
-/* Replace existing request_region macro/function. */
-#undef request_region
-#define request_region(f,e,n)  compat__request_region(f,e,n)
-
-#endif
-
-#endif // _COMPAT_IOPORT_H
-
diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h
deleted file mode 100644 (file)
index 475138a..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * linux/fisapnp.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_ISAPNP_H_
-#define __COMPAT_LINUX_ISAPNP_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
-#include_next <linux/isapnp.h>
-#else
-#include <linux/pci.h>
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,0)
-/* FIXME drivers are broken with __ISAPNP__ in 2.6. */
-#undef __ISAPNP__
-#endif
-
-#endif
-
diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h
deleted file mode 100644 (file)
index 3513fa8..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-    linux/kdev_t.h compatibility header
-
-    This program is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef __COMPAT_LINUX_KDEV_T_H_
-#define __COMPAT_LINUX_KDEV_T_H_
-
-#include <linux/version.h>
-#include_next <linux/kdev_t.h>
-
-#if 0
-
-#ifndef major
-#define major(x) MAJOR(x)
-#endif
-#ifndef minor
-#define minor(x) MINOR(x)
-#endif
-
-#endif
-
-#endif /* __COMPAT_LINUX_KDEV_T_H_ */
-
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
deleted file mode 100644 (file)
index e8862e9..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * linux/kmod.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_KMOD_H_
-#define __COMPAT_LINUX_KMOD_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-
-#else
-#include_next <linux/kmod.h>
-#endif
-
-#endif
-
index 1bde4dbf7086465be948fe540e2426ed95bc5dd5..233c2e949fa4cb95accc5b46943a0ac5decfb3df 100644 (file)
@@ -7,13 +7,6 @@
 
 #include <linux/version.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
-#define VM_OFFSET(a)   ((a)->vm_offset)
-#define page_address(page) page
-#else
-#define VM_OFFSET(a)   ((a)->vm_pgoff * PAGE_SIZE)
-#endif
-
 #include_next <linux/mm.h>
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,10) \
index 935daca999adb3b87652e6acf182c6a502c363d5..661f34ee3f609678bd75b00767071eda231596a9 100644 (file)
@@ -8,12 +8,6 @@
 #include <linux/version.h>
 
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,19)
-#define MODULE_AUTHOR(a)
-#define MODULE_DESCRIPTION(a)
-#define MODULE_PARM(a,b)
-#endif
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,10)
 #define MODULE_LICENSE(x)
 #endif
 #define EXPORT_SYMBOL_GPL(x) EXPORT_SYMBOL(x)
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)                /* ? */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)
-  #ifdef MODULE
-    /* don't ask.  It works. */
-    #define THIS_MODULE                        ((struct module *)&mod_use_count_)
-  #else
-    #define THIS_MODULE        NULL
-  #endif
-  #define __MOD_INC_USE_COUNT(x)       ((*(long *)(x))++, (*(long *)(x)) |= MOD_VISITED)
-  #define __MOD_DEC_USE_COUNT(x)       ((*(long *)(x))--, (*(long *)(x)) |= MOD_VISITED)
-  #define EXPORT_SYMBOL(x)
-#else
-  #ifdef MODULE
-    #define THIS_MODULE        &__this_module
-  #else
-    #define THIS_MODULE        NULL
-  #endif
-#endif
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)                /* ? */
-  typedef int (*__init_module_func_t)(void);
-  typedef void (*__cleanup_module_func_t)(void);
-  #define module_init(x) \
-       int init_module(void) __attribute__((alias(#x))); \
-       static inline __init_module_func_t __init_module_inline(void) \
-       { return x; }
-  #define module_exit(x) \
-       void cleanup_module(void) __attribute__((alias(#x))); \
-       static inline __cleanup_module_func_t __cleanup_module_inline(void) \
-       { return x; }
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
-#define MODULE_DEVICE_TABLE(a,b) struct pci_device_id *module_device_table_unused = (b)
-#endif
-
 #include_next <linux/module.h>
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
index ea1f41944539b4bdf3c7866445f870164638f87d..19e71e42456aa733a27c49c5bdee0864cc1341ee 100644 (file)
@@ -7,180 +7,7 @@
 
 #include <linux/version.h>
 
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,55)
-#include <linux/bios32.h>
-#define PCI_SUPPORT_VER1
-#else
 #include_next <linux/pci.h>
-#define PCI_SUPPORT_VER2
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) /* XXX */
-
-struct pci_driver {
-       struct list_head node;
-       char *name;
-       const struct pci_device_id *id_table;   /* must be non-NULL for probe to be called */
-       int  (*probe)  (struct pci_dev *dev, const struct pci_device_id *id);   /* New device inserted */
-       void (*remove) (struct pci_dev *dev);   /* Device removed (NULL if not a hot-plug capable driver) */
-       int  (*save_state) (struct pci_dev *dev, u32 state);    /* Save Device Context */
-       int  (*suspend) (struct pci_dev *dev, u32 state);       /* Device suspended */
-       int  (*resume) (struct pci_dev *dev);                   /* Device woken up */
-       int  (*enable_wake) (struct pci_dev *dev, u32 state, int enable);   /* Enable wake event */
-};
-static inline int pci_module_init(struct pci_driver *drv) { return 0; }
-static inline void pci_unregister_driver(struct pci_driver *) { return; }
-
-static inline int pci_enable_device(struct pci_dev *dev){return 0;}
-#define pci_disable_device(x)
-
-#define PCI_ANY_ID (~0)
-
-struct pci_device_id {
-       unsigned int vendor, device;
-       unsigned int subvendor, subdevice;
-       unsigned int class, class_mask;
-       unsigned long driver_data;
-};
-
-// stuff for allocating pci dma buffers
-#include <asm/io.h>
-#include <linux/malloc.h>
-#include <linux/ioport.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 *ret;
-        int gfp = GFP_KERNEL;
-
-        if (hwdev == NULL)
-                gfp |= GFP_DMA;
-        ret = (void *) __get_free_pages(gfp, get_order(size));
-
-        if (ret != NULL)
-       {
-                memset(ret, 0, size);
-                *dma_handle = virt_to_bus(ret);
-        }
-        return ret;
-}
-
-static inline void pci_free_consistent(struct pci_dev *hwdev, size_t size,
-       void *vaddr, dma_addr_t dma_handle)
-{
-       free_pages((unsigned long)vaddr, get_order(size));
-}
-
-#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)
-
-// for getting base addresses
-static inline unsigned long pci_resource_start(struct pci_dev *dev, unsigned int bar)
-{
-       if(dev->base_address[bar] & PCI_BASE_ADDRESS_SPACE_IO)
-               return dev->base_address[bar] & PCI_BASE_ADDRESS_IO_MASK;
-       return dev->base_address[bar] & PCI_BASE_ADDRESS_MEM_MASK;
-}
-
-static inline unsigned long pci_resource_end(struct pci_dev *dev, unsigned int bar)
-{
-       return pci_resource_start(dev, bar);
-}
-
-static inline int pci_request_regions(struct pci_dev *dev, char *name)
-{
-       const int max_num_base_addr = 6;
-       static const int fake_length = 1;
-       int i;
-       int retval = 0;
-
-       for(i = 0; i < max_num_base_addr; i++)
-       {
-               if(dev->base_address[i])
-               {
-                       if(dev->base_address[i] & PCI_BASE_ADDRESS_SPACE_IO)
-                               if(!request_region(pci_resource_start(dev, i),
-                                       fake_length, name))
-                               {
-                                       retval = -EBUSY;
-                                       break;
-                               }
-               }
-       }
-
-       if(retval)
-       {
-               while(--i >= 0)
-               {
-                       if(dev->base_address[i] & PCI_BASE_ADDRESS_SPACE_IO)
-                               release_region(pci_resource_start(dev, i),
-                                       fake_length);
-               }
-       }
-
-       return retval;
-}
-
-static inline void pci_release_regions(struct pci_dev *dev)
-{
-       static const int max_num_base_addr = 6;
-       static const int fake_length = 1;
-       int i;
-
-       for(i = 0; i < max_num_base_addr; i++)
-       {
-               if(dev->base_address[i])
-               {
-                       if(dev->base_address[i] & PCI_BASE_ADDRESS_SPACE_IO)
-                               release_region(pci_resource_start(dev, i),
-                                       fake_length);
-               }
-       }
-}
-
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,15)
-static inline struct pci_dev* pci_find_subsys( unsigned int vendor, unsigned int device,
-       unsigned int ss_vendor, unsigned int ss_device,
-       const struct pci_dev *from)
-{
-       struct pci_dev *dev = (struct pci_dev *)from;   /* ignore const */
-
-       while((dev=pci_find_device(vendor,device,dev))!=NULL){
-               if(ss_vendor!=PCI_ANY_ID){
-                       u16 temp;
-                       pci_read_config_word(dev,PCI_SUBSYSTEM_VENDOR_ID,&temp);
-                       if(ss_vendor!=temp){
-                               continue;
-                       }
-               }
-               if(ss_device!=PCI_ANY_ID){
-                       u16 temp;
-                       pci_read_config_word(dev,PCI_SUBSYSTEM_ID,&temp);
-                       if(ss_device!=temp){
-                               continue;
-                       }
-               }
-               break;  /* match */
-       }
-       return dev;
-}
-#endif // <2.3.15
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,14)
-static inline void pci_set_master(struct pci_dev *dev)
-{ return; }
-#endif // 2.2.14
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
-static inline unsigned long pci_resource_len (struct pci_dev *dev, int n_base)
-{ return 0; }
-#endif // 2.2.18
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
 #define pci_get_device pci_find_device
@@ -189,8 +16,6 @@ static inline unsigned long pci_resource_len (struct pci_dev *dev, int n_base)
 #define pci_dev_put(x)
 #endif
 
-#endif
-
 #endif /* _COMPAT_PCI_H */
 
 
diff --git a/include/linux/poll.h b/include/linux/poll.h
deleted file mode 100644 (file)
index 7f2bf9b..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * linux/poll.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_POLL_H_
-#define __COMPAT_LINUX_POLL_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-
-#else
-#include_next <linux/poll.h>
-#endif
-
-#endif
-
index 82bd7223564d3169e9758e5c2685363cc0a64799..c10cc3ec92b9e9be684e01b4c5b66295b07acba7 100644 (file)
@@ -7,66 +7,6 @@
 
 #include <linux/version.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-#define signal_pending(x)      (((x)->signal) & (~(x)->blocked))
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,3)
-#define __wait_event(wq, condition)                                    \
-do {                                                                   \
-       struct wait_queue __wait;                                       \
-                                                                       \
-       __wait.task = current;                                          \
-       add_wait_queue(&wq, &__wait);                                   \
-       for (;;) {                                                      \
-               current->state = TASK_UNINTERRUPTIBLE;                  \
-               mb();                                                   \
-               if (condition)                                          \
-                       break;                                          \
-               schedule();                                             \
-       }                                                               \
-       current->state = TASK_RUNNING;                                  \
-       remove_wait_queue(&wq, &__wait);                                \
-} while (0)
-
-#define wait_event(wq, condition)                                      \
-do {                                                                   \
-       if (condition)                                                  \
-               break;                                                  \
-       __wait_event(wq, condition);                                    \
-} while (0)
-
-#define __wait_event_interruptible(wq, condition, ret)                 \
-do {                                                                   \
-       struct wait_queue __wait;                                       \
-                                                                       \
-       __wait.task = current;                                          \
-       add_wait_queue(&wq, &__wait);                                   \
-       for (;;) {                                                      \
-               current->state = TASK_INTERRUPTIBLE;                    \
-               mb();                                                   \
-               if (condition)                                          \
-                       break;                                          \
-               if (!signal_pending(current)) {                         \
-                       schedule();                                     \
-                       continue;                                       \
-               }                                                       \
-               ret = -ERESTARTSYS;                                     \
-               break;                                                  \
-       }                                                               \
-       current->state = TASK_RUNNING;                                  \
-       remove_wait_queue(&wq, &__wait);                                \
-} while (0)
-       
-#define wait_event_interruptible(wq, condition)                                \
-({                                                                     \
-       int __ret = 0;                                                  \
-       if (!(condition))                                               \
-               __wait_event_interruptible(wq, condition, __ret);       \
-       __ret;                                                          \
-})
-#endif
-
 #include_next <linux/sched.h>
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)
diff --git a/include/linux/slab.h b/include/linux/slab.h
deleted file mode 100644 (file)
index 8f0befc..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-/*
- * linux/slab.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_SLAB_H_
-#define __COMPAT_LINUX_SLAB_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-#include <linux/malloc.h>
-#else
-#include_next <linux/slab.h>
-#endif
-
-#endif
-
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
deleted file mode 100644 (file)
index 4c3e650..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * linux/spinlock.h compatibility header
- */
-
-#ifndef _COMPAT_SPINLOCK_H
-#define _COMPAT_SPINLOCK_H
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)
-/* no spinlocks */
-typedef int spinlock_t;
-
-#define spin_lock_init(lock)    do { } while(0)
-#define spin_lock(lock)         (void)(lock) /* Not "unused variable". */
-#define spin_trylock(lock)      (1)
-#define spin_unlock_wait(lock)  do { } while(0)
-#define spin_unlock(lock)       do { } while(0)
-#define spin_lock_irq(lock)     cli()
-#define spin_unlock_irq(lock)   sti()
-
-#define spin_lock_irqsave(lock, flags) \
-       do { save_flags(flags); cli(); } while (0)
-#define spin_unlock_irqrestore(lock, flags) \
-       restore_flags(flags)
-
-#define SPIN_LOCK_UNLOCKED 0
-
-#else
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
-#include <asm/spinlock.h>
-#else
-#include_next <linux/spinlock.h>
-#endif
-#endif
-
-
-#endif /* _COMPAT_SPINLOCK_H */
-
-
-
-
diff --git a/include/linux/timer.h b/include/linux/timer.h
deleted file mode 100644 (file)
index e32f050..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * linux/timer.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_TIMER_H_
-#define __COMPAT_LINUX_TIMER_H_
-
-#include <linux/version.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-
-#define mod_timer(a,b) do{del_timer((a));(a)->expires=(b);add_timer((a));}while(0)
-#endif
-
-#include_next <linux/timer.h>
-
-#endif
-
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
deleted file mode 100644 (file)
index 0da835a..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * linux/vmalloc.h compatibility header
- */
-
-#ifndef __COMPAT_LINUX_VMALLOC_H_
-#define __COMPAT_LINUX_VMALLOC_H_
-
-#include <linux/version.h>
-
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)
-
-#else
-#include_next <linux/vmalloc.h>
-#endif
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18)
-extern inline void * vmalloc_32(unsigned long size)
-{
-        return vmalloc(size);
-}
-#endif // 2.2.18
-
-#ifndef VMALLOC_VMADDR
-#define VMALLOC_VMADDR(x) ((unsigned long)(x))
-#endif
-
-#endif
-
diff --git a/include/linux/wait.h b/include/linux/wait.h
deleted file mode 100644 (file)
index 43a378c..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-
-#ifndef __COMPAT_LINUX_WAIT_H
-#define __COMPAT_LINUX_WAIT_H
-
-#include <linux/version.h>
-
-#include_next <linux/wait.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
-typedef struct wait_queue *wait_queue_head_t;
-#define DECLARE_WAITQUEUE(x,y) struct wait_queue x={y,NULL}
-#define init_waitqueue_head(x)
-#endif
-
-#endif
-