Skip to contentSkip to conversation

batman-adv: Drop support for Linux < 4.4

PATCH Sven Eckelmann 1 participant 1 message Jun 20, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

The Linux Kernel 3.16 reached its end of life [1] after 6 years. Instead it is recommended to use at least kernel 4.4. It is also already over 4 years old but still maintained by the stable kernel team. All older kernels (v3.16 - v4.3) should therefore be dropped to reduce the support overhead.

[1] https://lkml.kernel.org/r/[email protected]

Makefile +0 -2
index b518db1fbfee64bd2771402a13dd4e09219665ec..afdbc03c368e5ea267c325090dc2a14f5e6a95f0 100644
@@ -49,8 +49,6 @@ ifneq ($(REVISION),)
 NOSTDINC_FLAGS += -DBATADV_SOURCE_VERSION=\"$(REVISION)\"
 endif
 
-include $(PWD)/compat-sources/Makefile
-
 obj-y += net/batman-adv/
 
 export batman-adv-y
README.external.rst +1 -1
index d8465aa836529f7a6bb277a720c0f58c64b778c3..b4d07e64fbeca95c58b4d436c8d08e0767ceba72 100644
@@ -12,7 +12,7 @@ and as external module. The external  module   allows   to    get
 new    features without  upgrading  to  a  newer  kernel  version
 and to get batman-adv specific bugfixes  for  kernels  that   are
 not   supported   anymore.  It compiles  against  and should work
-with Linux 3.16  -  5.7.  Supporting  older   versions   is   not
+with  Linux 4.4  -  5.7.  Supporting  older   versions   is   not
 planned,  but it's probably easy to backport it. If you work on a
 backport, feel free to contact us.  :-)
 
compat-include/linux/average.h +0 -3
index 046e9cb5161ae1abefb0da933656027a361e352a..347fdeae5af0058c8ff45ccdf4871c367310b44a 100644
@@ -10,16 +10,13 @@
 #ifndef _NET_BATMAN_ADV_COMPAT_LINUX_AVERAGE_H
 #define _NET_BATMAN_ADV_COMPAT_LINUX_AVERAGE_H
 
-#include <linux/version.h>
 #include_next <linux/average.h>
 
 #include <linux/bug.h>
 #include <linux/compiler.h>
 #include <linux/log2.h>
 
-#if LINUX_VERSION_IS_GEQ(4, 3, 0)
 #undef DECLARE_EWMA
-#endif /* LINUX_VERSION_IS_LESS(4, 3, 0) */
 
 /*
  * Exponentially weighted moving average (EWMA)
compat-include/linux/compiler.h +0 -15
index 89ed29299ba3cc4e78270d408a37a3c9f9fefa8e..43e12a788ad17a4537c35797b267c95edfd734f1 100644
@@ -13,21 +13,6 @@
 #include <linux/version.h>
 #include_next <linux/compiler.h>
 
-#if LINUX_VERSION_IS_LESS(3, 19, 0)
-
-#ifndef READ_ONCE
-#define READ_ONCE(x) ACCESS_ONCE(x)
-#endif
-
-#ifndef WRITE_ONCE
-#define WRITE_ONCE(x, val) ({ \
-	ACCESS_ONCE(x) = (val); \
-})
-#endif
-
-#endif /* LINUX_VERSION_IS_LESS(3, 19, 0) */
-
-
 #if LINUX_VERSION_IS_LESS(5, 4, 0)
 
 #ifndef fallthrough
compat-include/linux/if_bridge.h deleted +0 -77

77 lines not on this page · raw message

compat-include/linux/igmp.h +2 -6
index 9875d6d4e7392c23faf8fec73d059bbc87c57e22..cea5bfe9f5f03617608672bf6eceec4bf6a04b83 100644
@@ -13,11 +13,7 @@
 #include <linux/version.h>
 #include_next <linux/igmp.h>
 
-#if LINUX_VERSION_IS_LESS(4, 2, 0)
-
-int ip_mc_check_igmp(struct sk_buff *skb);
-
-#elif LINUX_VERSION_IS_LESS(5, 1, 0)
+#if LINUX_VERSION_IS_LESS(5, 1, 0)
 
 static inline int batadv_ip_mc_check_igmp(struct sk_buff *skb)
 {
@@ -27,6 +23,6 @@ static inline int batadv_ip_mc_check_igmp(struct sk_buff *skb)
 #define ip_mc_check_igmp(skb) \
 	batadv_ip_mc_check_igmp(skb)
 
-#endif /* LINUX_VERSION_IS_LESS(4, 2, 0) */
+#endif /* LINUX_VERSION_IS_LESS(5, 1, 0) */
 
 #endif	/* _NET_BATMAN_ADV_COMPAT_LINUX_IGMP_H_ */
compat-include/linux/list.h deleted +0 -31
deleted file mode 100644
index 1bd85d0d73d99700fd491c7f5830cfad6f976cbe..0000000000000000000000000000000000000000
@@ -1,31 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2020  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_LIST_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_LIST_H_
-
-#include <linux/version.h>
-#include_next <linux/list.h>
-
-#if LINUX_VERSION_IS_LESS(3, 17, 0)
-
-#define hlist_add_behind(n, prev) hlist_add_after(prev, n)
-
-#endif /* LINUX_VERSION_IS_LESS(3, 17, 0) */
-
-#if LINUX_VERSION_IS_LESS(4, 3, 0)
-
-static inline bool hlist_fake(struct hlist_node *h)
-{
-	return h->pprev == &h->next;
-}
-
-#endif /* LINUX_VERSION_IS_LESS(4, 3, 0) */
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_LINUX_LIST_H_ */
compat-include/linux/netdevice.h +0 -15
index ae7fb906833e04dcb93952c7e73f37b3584a2f54..5dd273412d60cd0b77086ee6d810784626407ec6 100644
@@ -13,21 +13,6 @@
 #include <linux/version.h>
 #include_next <linux/netdevice.h>
 
-#if LINUX_VERSION_IS_LESS(3, 17, 0)
-
-/* alloc_netdev() was defined differently before 2.6.38 */
-#undef alloc_netdev
-#define alloc_netdev(sizeof_priv, name, name_assign_type, setup) \
-	alloc_netdev_mqs(sizeof_priv, name, setup, 1, 1)
-
-#endif /* LINUX_VERSION_IS_LESS(3, 17, 0) */
-
-#if LINUX_VERSION_IS_LESS(4, 1, 0)
-
-#define dev_get_iflink(_net_dev) ((_net_dev)->iflink)
-
-#endif /* LINUX_VERSION_IS_LESS(3, 19, 0) */
-
 #if LINUX_VERSION_IS_LESS(4, 5, 0)
 
 #define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info, extack) \
compat-include/linux/nl80211.h deleted +0 -23
deleted file mode 100644
index bea92d1b73768ae2236bb67a0d554e341ad722ac..0000000000000000000000000000000000000000
@@ -1,23 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2020  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_NL80211_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_NL80211_H_
-
-#include <linux/version.h>
-#include_next <linux/nl80211.h>
-
-#if LINUX_VERSION_IS_LESS(3, 16, 0)
-
-/* Linux 3.15 misses the uapi include.... */
-#include <uapi/linux/nl80211.h>
-
-#endif /* LINUX_VERSION_IS_LESS(3, 16, 0) */
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_LINUX_NL80211_H_ */
compat-include/linux/seq_file.h deleted +0 -25
deleted file mode 100644
index 74854f563c7025628ef8df05258a9fbb93137c11..0000000000000000000000000000000000000000
@@ -1,25 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2020  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_LINUX_SEQ_FILE_H_
-#define _NET_BATMAN_ADV_COMPAT_LINUX_SEQ_FILE_H_
-
-#include <linux/version.h>
-#include_next <linux/seq_file.h>
-
-#if LINUX_VERSION_IS_LESS(3, 19, 0)
-
-static inline bool seq_has_overflowed(struct seq_file *m)
-{
-	return m->count == m->size;
-}
-
-#endif /* LINUX_VERSION_IS_LESS(3, 19, 0) */
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_LINUX_SEQ_FILE_H_ */
compat-include/linux/skbuff.h +0 -20
index e92f3422a45c6c7bc0a2ffc4a5661bc25b160fc7..0d3631d2cf426692bbd20e0be039453acaf24c98 100644
@@ -13,26 +13,6 @@
 #include <linux/version.h>
 #include_next <linux/skbuff.h>
 
-#if LINUX_VERSION_IS_LESS(3, 16, 0)
-
-#define pskb_copy_for_clone pskb_copy
-
-__sum16 skb_checksum_simple_validate(struct sk_buff *skb);
-
-__sum16
-skb_checksum_validate(struct sk_buff *skb, int proto,
-		      __wsum (*compute_pseudo)(struct sk_buff *skb, int proto));
-
-#endif /* LINUX_VERSION_IS_LESS(3, 16, 0) */
-
-#if LINUX_VERSION_IS_LESS(4, 2, 0)
-
-struct sk_buff *skb_checksum_trimmed(struct sk_buff *skb,
-				     unsigned int transport_len,
-				     __sum16(*skb_chkf)(struct sk_buff *skb));
-
-#endif /* LINUX_VERSION_IS_LESS(4, 2, 0) */
-
 #if LINUX_VERSION_IS_LESS(4, 5, 0)
 
 static inline void batadv_skb_postpush_rcsum(struct sk_buff *skb,
compat-include/linux/string.h deleted +0 -51

51 lines not on this page · raw message

compat-include/net/addrconf.h +2 -6
index 5430811a25e8007d2c985e6252f99fcba4ab6791..8914a66b0f30d813dfd716c94e147a185a667e7c 100644
@@ -13,11 +13,7 @@
 #include <linux/version.h>
 #include_next <net/addrconf.h>
 
-#if LINUX_VERSION_IS_LESS(4, 2, 0)
-
-int ipv6_mc_check_mld(struct sk_buff *skb);
-
-#elif LINUX_VERSION_IS_LESS(5, 1, 0)
+#if LINUX_VERSION_IS_LESS(5, 1, 0)
 
 static inline int batadv_ipv6_mc_check_mld(struct sk_buff *skb)
 {
@@ -27,6 +23,6 @@ static inline int batadv_ipv6_mc_check_mld(struct sk_buff *skb)
 #define ipv6_mc_check_mld(skb) \
 	batadv_ipv6_mc_check_mld(skb)
 
-#endif /* LINUX_VERSION_IS_LESS(4, 2, 0) */
+#endif /* LINUX_VERSION_IS_LESS(5, 1, 0) */
 
 #endif	/* _NET_BATMAN_ADV_COMPAT_NET_ADDRCONF_H_ */
compat-include/net/cfg80211.h +0 -19
index 241f44e060f977231f6d3e7ab07b407264dbb26c..288c1be132f64f13b7888cd72923e7813afecbf1 100644
@@ -13,25 +13,6 @@
 #include <linux/version.h>
 #include_next <net/cfg80211.h>
 
-#if LINUX_VERSION_IS_LESS(3, 16, 0)
-
-static inline int cfg80211_get_station(struct net_device *dev,
-				       const u8 *mac_addr,
-				       struct station_info *sinfo)
-{
-	pr_warn_once("cfg80211 based throughput metric is only supported with Linux 3.16+\n");
-	return -ENOENT;
-}
-
-/* The following define substitutes the expected_throughput field with a random
- * one existing in the station_info struct. It can be random because due to the
- * function above it will never be used. Only needed to make the code compile
- */
-#define expected_throughput filled
-
-#endif /* LINUX_VERSION_IS_LESS(3, 16, 0) */
-
-
 #if LINUX_VERSION_IS_LESS(4, 8, 0)
 
 #if !IS_ENABLED(CONFIG_CFG80211) && \
compat-include/net/ip6_checksum.h deleted +0 -27
deleted file mode 100644
index 8997cbf9e6db9cbb3ad4b5d6f71eb0956c29f517..0000000000000000000000000000000000000000
@@ -1,27 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2020  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_NET_IP6_CHECKSUM_H_
-#define _NET_BATMAN_ADV_COMPAT_NET_IP6_CHECKSUM_H_
-
-#include <linux/version.h>
-#include_next <net/ip6_checksum.h>
-
-#if LINUX_VERSION_IS_LESS(3, 16, 0)
-
-static inline __wsum ip6_compute_pseudo(struct sk_buff *skb, int proto)
-{
-	return ~csum_unfold(csum_ipv6_magic(&ipv6_hdr(skb)->saddr,
-					    &ipv6_hdr(skb)->daddr,
-					    skb->len, proto, 0));
-}
-
-#endif /* LINUX_VERSION_IS_LESS(3, 16, 0) */
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_NET_IP6_CHECKSUM_H_ */
compat-include/net/netlink.h deleted +0 -28
deleted file mode 100644
index c7419e155daf0a31576b67e07aca28cc4fc1ad88..0000000000000000000000000000000000000000
@@ -1,28 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2020  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_NET_NETLINK_H_
-#define _NET_BATMAN_ADV_COMPAT_NET_NETLINK_H_
-
-#include <linux/version.h>
-#include_next <net/netlink.h>
-
-#if LINUX_VERSION_IS_LESS(4, 1, 0)
-
-static inline int nla_put_in_addr(struct sk_buff *skb, int attrtype,
-				  __be32 addr)
-{
-	__be32 tmp = addr;
-
-	return nla_put_be32(skb, attrtype, tmp);
-}
-
-#endif /* LINUX_VERSION_IS_LESS(4, 1, 0) */
-
-#endif /* _NET_BATMAN_ADV_COMPAT_NET_NETLINK_H_ */
compat-include/uapi/linux/nl80211.h deleted +0 -25
deleted file mode 100644
index dff0dd5c6f2f43d46162d46a041f91cb3696c178..0000000000000000000000000000000000000000
@@ -1,25 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/* Copyright (C) 2007-2020  B.A.T.M.A.N. contributors:
- *
- * Marek Lindner, Simon Wunderlich
- *
- * This file contains macros for maintaining compatibility with older versions
- * of the Linux kernel.
- */
-
-#ifndef _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_NL80211_H_
-#define _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_NL80211_H_
-
-#include <linux/version.h>
-#include_next <uapi/linux/nl80211.h>
-
-#if LINUX_VERSION_IS_LESS(4, 0, 0)
-
-/* for batadv_v_elp_get_throughput which would have used
- * STATION_INFO_EXPECTED_THROUGHPUT in Linux 4.0.0
- */
-#define NL80211_STA_INFO_EXPECTED_THROUGHPUT    28
-
-#endif /* LINUX_VERSION_IS_LESS(4, 0, 0) */
-
-#endif	/* _NET_BATMAN_ADV_COMPAT_UAPI_LINUX_NL80211_H_ */
compat-sources/Makefile deleted +0 -8
deleted file mode 100644
index fd2fce8f4f3d46b197f780d519e333cd3b049556..0000000000000000000000000000000000000000
@@ -1,8 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0
-# Copyright (C) 2007-2020  B.A.T.M.A.N. contributors:
-#
-# Marek Lindner, Simon Wunderlich
-
-batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += ../../compat-sources/net/core/skbuff.o
-batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += ../../compat-sources/net/ipv4/igmp.o
-batman-adv-$(CONFIG_BATMAN_ADV_MCAST) += ../../compat-sources/net/ipv6/mcast_snoop.o
compat-sources/net/core/skbuff.c deleted +0 -195

195 lines not on this page · raw message

compat-sources/net/ipv4/igmp.c deleted +0 -223

223 lines not on this page · raw message

compat-sources/net/ipv6/mcast_snoop.c deleted +0 -189

189 lines not on this page · raw message

compat.h +0 -13
index 21bacc5d3b6d029560c66c67decb7b00c3ddc2aa..e3220e396411d2cb97ca432599a1bf5933da463a 100644
@@ -15,19 +15,6 @@
 
 #include "compat-autoconf.h"
 
-#if LINUX_VERSION_IS_LESS(4, 0, 0)
-
-/* wild hack for batadv_getlink_net only */
-#define get_link_net get_xstats_size || 1 ? fallback_net : (struct net*)netdev->rtnl_link_ops->get_xstats_size
-
-#endif /* LINUX_VERSION_IS_LESS(4, 0, 0) */
-
-#if LINUX_VERSION_IS_LESS(4, 3, 0)
-
-#define IFF_NO_QUEUE	0; dev->tx_queue_len = 0
-
-#endif /* LINUX_VERSION_IS_LESS(4, 3, 0) */
-
 #if LINUX_VERSION_IS_LESS(4, 15, 0)
 
 #define batadv_softif_slave_add(__dev, __slave_dev, __extack) \