blob: 24cc5a94748a3f6dc406eefa706597f387f53e95 (
plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
|
/**
*
* @file compat.h
* @author Michael Stapelberg
* @date 2009-04-05
* @brief Contains compatibility definitions for the different linux kernel versions to avoid
* putting ifdefs all over the driver code.
*
*/
#ifndef _COMPAT_H
#define _COMPAT_H
#include <linux/version.h>
/* Check macros and kernel version first */
#ifndef KERNEL_VERSION
# error "No KERNEL_VERSION macro! Stopping."
#endif
#ifndef LINUX_VERSION_CODE
# error "No LINUX_VERSION_CODE macro! Stopping."
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
# error "Linux 3.2 and latter are supported"
#endif
/* VM_RESERVED is removed in 3.7-rc1 */
#ifndef VM_RESERVED
# define VM_RESERVED (VM_DONTEXPAND | VM_DONTDUMP)
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)
# define __devinit
# define __devexit
# define __devinitdata
#endif
#endif
|