1 #ifndef LINUX_3_16_COMPAT_H
2 #define LINUX_3_16_COMPAT_H
4 #include <linux/version.h>
6 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
8 #include <linux/cpumask.h>
10 #define cpumask_set_cpu_local_first LINUX_BACKPORT(cpumask_set_cpu_local_first)
13 static inline int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp)
15 set_bit(0, cpumask_bits(dstp));
20 int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp);
23 #include <linux/ktime.h>
25 #ifndef smp_mb__after_atomic
26 #define smp_mb__after_atomic() smp_mb()
29 #ifndef smp_mb__before_atomic
30 #define smp_mb__before_atomic() smp_mb()
33 #define RPC_CWNDSHIFT (8U)
34 #define RPC_CWNDSCALE (1U << RPC_CWNDSHIFT)
35 #define RPC_INITCWND RPC_CWNDSCALE
36 #define RPC_MAXCWND(xprt) ((xprt)->max_reqs << RPC_CWNDSHIFT)
37 #define RPCXPRT_CONGESTED(xprt) ((xprt)->cong >= (xprt)->cwnd)
39 #include <linux/netdev_features.h>
41 #ifndef NETIF_F_GSO_UDP_TUNNEL_CSUM
42 #define NETIF_F_GSO_UDP_TUNNEL_CSUM 0
45 #if !defined(HAVE___DEV_UC_SYNC) && !defined(HAVE___DEV_MC_SYNC)
47 #include <linux/netdevice.h>
49 #define __hw_addr_sync_dev LINUX_BACKPORT(__hw_addr_sync_dev)
50 int __hw_addr_sync_dev(struct netdev_hw_addr_list *list,
51 struct net_device *dev,
52 int (*sync)(struct net_device *, const unsigned char *),
53 int (*unsync)(struct net_device *,
54 const unsigned char *));
57 * __dev_uc_sync - Synchonize device's unicast list
58 * @dev: device to sync
59 * @sync: function to call if address should be added
60 * @unsync: function to call if address should be removed
62 * Add newly added addresses to the interface, and release
63 * addresses that have been deleted.
65 #define __dev_uc_sync LINUX_BACKPORT(__dev_uc_sync)
66 static inline int __dev_uc_sync(struct net_device *dev,
67 int (*sync)(struct net_device *,
68 const unsigned char *),
69 int (*unsync)(struct net_device *,
70 const unsigned char *))
72 return __hw_addr_sync_dev(&dev->uc, dev, sync, unsync);
76 * __dev_mc_sync - Synchonize device's multicast list
77 * @dev: device to sync
78 * @sync: function to call if address should be added
79 * @unsync: function to call if address should be removed
81 * Add newly added addresses to the interface, and release
82 * addresses that have been deleted.
84 #define __dev_mc_sync LINUX_BACKPORT(__dev_mc_sync)
85 static inline int __dev_mc_sync(struct net_device *dev,
86 int (*sync)(struct net_device *,
87 const unsigned char *),
88 int (*unsync)(struct net_device *,
89 const unsigned char *))
91 return __hw_addr_sync_dev(&dev->mc, dev, sync, unsync);
95 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) */
97 #endif /* LINUX_3_16_COMPAT_H */