e95b64da16e8fd557876b06bb853ea762f356bd2
[feed/routing.git] / batman-adv / files / compat-hacks.h
1 /* Please avoid adding hacks here - instead add it to mac80211/backports.git */
2
3 #include <linux/version.h> /* LINUX_VERSION_CODE */
4 #include <linux/types.h>
5
6 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0)
7
8 #define dev_get_iflink(_net_dev) ((_net_dev)->iflink)
9
10 #endif /* < KERNEL_VERSION(4, 1, 0) */
11
12 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 9, 0)
13
14 #include <linux/netdevice.h>
15
16 #define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info) ({\
17 BUILD_BUG_ON(upper_priv != NULL); \
18 BUILD_BUG_ON(upper_info != NULL); \
19 netdev_set_master(dev, upper_dev); \
20 })
21
22 #elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
23
24 #include <linux/netdevice.h>
25
26 #define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info) ({\
27 BUILD_BUG_ON(upper_priv != NULL); \
28 BUILD_BUG_ON(upper_info != NULL); \
29 netdev_master_upper_dev_link(dev, upper_dev); \
30 })
31
32 #endif /* < KERNEL_VERSION(4, 5, 0) */
33
34
35 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
36
37 #define IFF_NO_QUEUE 0; dev->tx_queue_len = 0
38
39 #endif /* < KERNEL_VERSION(4, 3, 0) */