1 #ifndef LINUX_4_1_COMPAT_H
2 #define LINUX_4_1_COMPAT_H
4 #include <linux/version.h>
6 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0))
7 #include "../../compat/config.h"
8 #include <linux/dma-mapping.h>
11 #define dma_rmb() rmb()
15 #define dma_wmb() wmb()
18 #include <linux/cpumask.h>
19 #include <linux/if_vlan.h>
21 #define cpumask_local_spread LINUX_BACKPORT(cpumask_local_spread)
24 static inline unsigned int cpumask_local_spread(unsigned int i, int node)
29 unsigned int cpumask_local_spread(unsigned int i, int node);
32 #ifndef HAVE_SKB_VLAN_TAGGED
34 * skb_vlan_tagged - check if skb is vlan tagged.
35 * @skb: skbuff to query
37 * Returns true if the skb is tagged, regardless of whether it is hardware
40 static inline bool skb_vlan_tagged(const struct sk_buff *skb)
42 if (!skb_vlan_tag_present(skb) &&
43 likely(skb->protocol != htons(ETH_P_8021Q) &&
44 skb->protocol != htons(ETH_P_8021AD)))
51 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)) */
53 #endif /* LINUX_4_1_COMPAT_H */