1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28#ifndef __DGAP_KCOMPAT_H
29#define __DGAP_KCOMPAT_H
30
31# ifndef KERNEL_VERSION
32# define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
33# endif
34
35
36#if !defined(TTY_FLIPBUF_SIZE)
37# define TTY_FLIPBUF_SIZE 512
38#endif
39
40
41
42# ifndef __user
43# define __user
44# define __kernel
45# define __safe
46# define __force
47# define __chk_user_ptr(x) (void)0
48# endif
49
50
51# define PARM_STR(VAR, INIT, PERM, DESC) \
52 static char *VAR = INIT; \
53 char *dgap_##VAR; \
54 module_param(VAR, charp, PERM); \
55 MODULE_PARM_DESC(VAR, DESC);
56
57# define PARM_INT(VAR, INIT, PERM, DESC) \
58 static int VAR = INIT; \
59 int dgap_##VAR; \
60 module_param(VAR, int, PERM); \
61 MODULE_PARM_DESC(VAR, DESC);
62
63# define PARM_ULONG(VAR, INIT, PERM, DESC) \
64 static ulong VAR = INIT; \
65 ulong dgap_##VAR; \
66 module_param(VAR, long, PERM); \
67 MODULE_PARM_DESC(VAR, DESC);
68
69
70
71
72
73#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
74
75
76
77
78
79
80
81
82
83# else
84
85
86
87# error "this driver does not support anything below the 2.6.27 kernel series."
88
89
90
91# endif
92
93#endif
94