Import from old repository commit 61ef2b42a9c4ba8e1600f15bb0236765edc2ad45.
[sliver-openvswitch.git] / datapath / linux-2.6 / compat-2.6 / compat26.h
1 #ifndef __COMPAT26_H
2 #define __COMPAT26_H 1
3
4 #include <linux/version.h>
5
6 #if defined(CONFIG_PREEMPT) && LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,21)
7 #error "CONFIG_PREEMPT is broken with 2.6.x before 2.6.21--see commit 4498121ca3, \"[NET]: Handle disabled preemption in gfp_any()\""
8 #endif
9
10 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,23)
11 /*----------------------------------------------------------------------------
12  * In 2.6.24, a namespace argument became required for dev_get_by_name. */
13
14 #define dev_get_by_name(net, name) \
15                 dev_get_by_name((name))
16
17 #define dev_get_by_index(net, ifindex) \
18                 dev_get_by_index((ifindex))
19
20 #define __dev_get_by_name(net, name) \
21                 __dev_get_by_name((name))
22
23 #define __dev_get_by_index(net, ifindex) \
24                 __dev_get_by_index((ifindex))
25
26 #endif /* linux kernel <= 2.6.23 */
27
28
29 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,22)
30 /*----------------------------------------------------------------------------
31  * In 2.6.23, the last argument was dropped from kmem_cache_create. */
32 #define kmem_cache_create(n, s, a, f, c) \
33                 kmem_cache_create((n), (s), (a), (f), (c), NULL)
34
35 #endif /* linux kernel <= 2.6.22 */
36
37 #endif /* compat26.h */