summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-10-13 10:48:42 +0200
committerJohannes Berg <johannes.berg@intel.com>2017-10-13 15:29:30 +0200
commit8cdd85766293018fea01512959320a05269e97b4 (patch)
tree02ca6cd81d94ad738f6f144c94a0fe21b9d7b00b
parent988e2af4b7a0c1bc70188674cfde2bf8b2838bd7 (diff)
backports: add netdev_upper_dev_link() extack argument
But make it optional (using magic.h) to let this still work on kernels that didn't change the argument. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--backport/backport-include/linux/netdevice.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/backport/backport-include/linux/netdevice.h b/backport/backport-include/linux/netdevice.h
index 9c912285..d92c95ad 100644
--- a/backport/backport-include/linux/netdevice.h
+++ b/backport/backport-include/linux/netdevice.h
@@ -3,6 +3,7 @@
#include_next <linux/netdevice.h>
#include <linux/netdev_features.h>
#include <linux/version.h>
+#include <backport/magic.h>
/*
* This is declared implicitly in newer kernels by netdevice.h using
@@ -333,4 +334,18 @@ static inline void netif_trans_update(struct net_device *dev)
(_dev)->needs_free_netdev = true;
#endif
+#if LINUX_VERSION_IS_LESS(4,14,0)
+static inline int _bp_netdev_upper_dev_link(struct net_device *dev,
+ struct net_device *upper_dev)
+{
+ return netdev_upper_dev_link(dev, upper_dev);
+}
+#define netdev_upper_dev_link3(dev, upper, extack) \
+ netdev_upper_dev_link(dev, upper)
+#define netdev_upper_dev_link2(dev, upper) \
+ netdev_upper_dev_link(dev, upper)
+#define netdev_upper_dev_link(...) \
+ macro_dispatcher(netdev_upper_dev_link, __VA_ARGS__)(__VA_ARGS__)
+#endif
+
#endif /* __BACKPORT_NETDEVICE_H */