diff options
author | Johannes Berg <johannes.berg@intel.com> | 2017-02-07 23:04:11 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2017-02-09 14:52:26 +0100 |
commit | e13e44d9a81da4bf77d9869db5b4764fc0811d9f (patch) | |
tree | c610ae2b0f634df75fe88f65a047e5c741c9b0af /backport/backport-include/linux/netdevice.h | |
parent | 46939c43903da6b202c95a0fcb24acce55fd63c0 (diff) |
backports: always use new version compare macros
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'backport/backport-include/linux/netdevice.h')
-rw-r--r-- | backport/backport-include/linux/netdevice.h | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h index 4f64227b..06230b53 100644 --- a/backport/backport-include/linux/netdevice.h +++ b/backport/backport-include/linux/netdevice.h @@ -20,7 +20,7 @@ struct inet6_dev; */ #include <linux/hardirq.h> -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) +#if LINUX_VERSION_IS_LESS(3,14,0) /* * Backports note: if in-kernel support is provided we could then just * take the kernel's implementation of __dev_kfree_skb_irq() as it requires @@ -96,15 +96,15 @@ struct pcpu_sw_netstats { #else #define netdev_tstats(dev) dev->tstats #define netdev_assign_tstats(dev, e) dev->tstats = (e); -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) */ +#endif /* LINUX_VERSION_IS_LESS(3,14,0) */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,8) +#if LINUX_VERSION_IS_LESS(3,7,8) #define netdev_set_default_ethtool_ops LINUX_BACKPORT(netdev_set_default_ethtool_ops) extern void netdev_set_default_ethtool_ops(struct net_device *dev, const struct ethtool_ops *ops); #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) +#if LINUX_VERSION_IS_LESS(3,3,0) /* * BQL was added as of v3.3 but some Linux distributions * have backported BQL to their v3.2 kernels or older. To @@ -152,11 +152,11 @@ static inline void netdev_reset_queue(struct net_device *dev_queue) #define NETDEV_PRE_UP 0x000D #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0) +#if LINUX_VERSION_IS_LESS(3,11,0) #define netdev_notifier_info_to_dev(ndev) ndev #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) +#if LINUX_VERSION_IS_LESS(3,7,0) #define netdev_notify_peers(dev) netif_notify_peers(dev) #define napi_gro_flush(napi, old) napi_gro_flush(napi) #endif @@ -178,7 +178,7 @@ static inline void netdev_reset_queue(struct net_device *dev_queue) #define __QUEUE_STATE_STACK_XOFF __QUEUE_STATE_XOFF #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) +#if LINUX_VERSION_IS_LESS(3,17,0) #ifndef NET_NAME_UNKNOWN #define NET_NAME_UNKNOWN 0 #endif @@ -206,22 +206,22 @@ static inline void netdev_reset_queue(struct net_device *dev_queue) #define alloc_netdev_mq(sizeof_priv, name, name_assign_type, setup, count) \ alloc_netdev_mqs(sizeof_priv, name, name_assign_type, setup, count, \ count) -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) */ +#endif /* LINUX_VERSION_IS_LESS(3,17,0) */ /* * This backports this commit from upstream: * commit 87757a917b0b3c0787e0563c679762152be81312 * net: force a list_del() in unregister_netdevice_many() */ -#if (!(LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,45) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(3,11,0)) && \ - !(LINUX_VERSION_CODE >= KERNEL_VERSION(3,12,23) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0)) && \ - !(LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,9) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(3,15,0)) && \ - !(LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,2) && \ - LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)) && \ - (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))) +#if (!(LINUX_VERSION_IS_GEQ(3,10,45) && \ + LINUX_VERSION_IS_LESS(3,11,0)) && \ + !(LINUX_VERSION_IS_GEQ(3,12,23) && \ + LINUX_VERSION_IS_LESS(3,13,0)) && \ + !(LINUX_VERSION_IS_GEQ(3,14,9) && \ + LINUX_VERSION_IS_LESS(3,15,0)) && \ + !(LINUX_VERSION_IS_GEQ(3,15,2) && \ + LINUX_VERSION_IS_LESS(3,16,0)) && \ + LINUX_VERSION_IS_LESS(3,16,0)) static inline void backport_unregister_netdevice_many(struct list_head *head) { unregister_netdevice_many(head); @@ -232,35 +232,35 @@ static inline void backport_unregister_netdevice_many(struct list_head *head) #define unregister_netdevice_many LINUX_BACKPORT(unregister_netdevice_many) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +#if LINUX_VERSION_IS_LESS(3,19,0) #define napi_alloc_frag(fragsz) netdev_alloc_frag(fragsz) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +#if LINUX_VERSION_IS_LESS(3,19,0) /* RSS keys are 40 or 52 bytes long */ #define NETDEV_RSS_KEY_LEN 52 #define netdev_rss_key_fill LINUX_BACKPORT(netdev_rss_key_fill) void netdev_rss_key_fill(void *buffer, size_t len); -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) */ +#endif /* LINUX_VERSION_IS_LESS(3,19,0) */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +#if LINUX_VERSION_IS_LESS(3,19,0) #define napi_alloc_skb LINUX_BACKPORT(napi_alloc_skb) static inline struct sk_buff *napi_alloc_skb(struct napi_struct *napi, unsigned int length) { return netdev_alloc_skb_ip_align(napi->dev, length); } -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) */ +#endif /* LINUX_VERSION_IS_LESS(3,19,0) */ #ifndef IFF_TX_SKB_SHARING #define IFF_TX_SKB_SHARING 0 #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) +#if LINUX_VERSION_IS_LESS(4,1,0) netdev_features_t passthru_features_check(struct sk_buff *skb, struct net_device *dev, netdev_features_t features); -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0) */ +#endif /* LINUX_VERSION_IS_LESS(4,1,0) */ #ifndef netdev_alloc_pcpu_stats #define netdev_alloc_pcpu_stats(type) \ @@ -278,7 +278,7 @@ netdev_features_t passthru_features_check(struct sk_buff *skb, }) #endif /* netdev_alloc_pcpu_stats */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) +#if LINUX_VERSION_IS_LESS(3,19,0) #define napi_complete_done LINUX_BACKPORT(napi_complete_done) static inline void napi_complete_done(struct napi_struct *n, int work_done) { @@ -286,7 +286,7 @@ static inline void napi_complete_done(struct napi_struct *n, int work_done) } #endif /* < 3.19 */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,5,0) +#if LINUX_VERSION_IS_LESS(4,5,0) #define netif_tx_napi_add LINUX_BACKPORT(netif_tx_napi_add) /** * netif_tx_napi_add - initialize a napi context @@ -312,7 +312,7 @@ static inline void netif_tx_napi_add(struct net_device *dev, #define NETIF_F_CSUM_MASK NETIF_F_ALL_CSUM #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0) +#if LINUX_VERSION_IS_LESS(4,7,0) #define netif_trans_update LINUX_BACKPORT(netif_trans_update) static inline void netif_trans_update(struct net_device *dev) { |