4 /*#define __NO_VERSION__*/
5 /*#include <linux/module.h>*/
7 #include <linux/version.h>
8 #include <linux/wait.h>
9 #include <linux/list.h>
11 #include <linux/ioport.h>
12 #include <linux/delay.h>
13 #include <linux/sched.h>
14 #include <linux/interrupt.h>
15 #include <asm/errno.h>
17 #include <asm/atomic.h>
19 #include <asm/uaccess.h>
21 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
22 #include <linux/malloc.h>
24 #include <linux/slab.h>
28 /* Next is not sctrictly correct, because of 2.3.0, 2.3.1, 2.3.2
29 kernels need next definitions too */
30 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,19)) /* may need correction */
31 #define wait_queue_head_t struct wait_queue *
32 #define wait_queue_t struct wait_queue
33 #define init_waitqueue_head(queue_head) (*queue_head=NULL)
34 #define init_waitqueue_entry(qentry,qtask) \
35 (qentry->next=NULL,qentry->task=qtask)
36 #define DECLARE_WAIT_QUEUE_HEAD(name) \
37 struct wait_queue * name=NULL
38 #define DECLARE_WAITQUEUE(wait, current) \
39 struct wait_queue wait = { current, NULL }
40 #define init_MUTEX(sem) (*sem=MUTEX)
41 #define DECLARE_MUTEX(name) struct semaphore name=MUTEX
45 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,7)) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
48 (MINOR(file->f_dentry->d_inode->i_rdev))
50 #else /* Linux kernel < 2.5.7 or >= 2.6.0 */
53 (minor(file->f_dentry->d_inode->i_rdev))
55 #endif /* Linux kernel < 2.5.7 or >= 2.6.0 */
58 #if ((LINUX_VERSION_CODE < KERNEL_VERSION(2,5,68)) && !defined(IRQ_RETVAL))
59 typedef void irqreturn_t;
65 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,33))
66 #define can_synchronize_irq(irqnum) synchronize_irq()
68 #define can_synchronize_irq synchronize_irq
71 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
72 #define del_timer_sync del_timer
75 #define CAN_ENABLE_KERN_FASYNC
79 #define can_spinlock_t spinlock_t
80 #define can_spin_irqflags_t unsigned long
81 #define can_spin_lock spin_lock
82 #define can_spin_unlock spin_unlock
83 #define can_spin_lock_irqsave spin_lock_irqsave
84 #define can_spin_unlock_irqrestore spin_unlock_irqrestore
85 #define can_spin_lock_init spin_lock_init
87 #else /*CAN_WITH_RTL*/
89 #define can_spinlock_t rtl_spinlock_t
90 #define can_spin_irqflags_t unsigned long
91 #define can_spin_lock rtl_spin_lock
92 #define can_spin_unlock rtl_spin_unlock
93 #define can_spin_lock_irqsave rtl_spin_lock_irqsave
94 #define can_spin_unlock_irqrestore rtl_spin_unlock_irqrestore
95 #define can_spin_lock_init rtl_spin_lock_init
97 #endif /*CAN_WITH_RTL*/
99 #endif /*_CAN_SYSDEP_H*/