batman-adv: Drop support for Linux < 4.4
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]
Signed-off-by Sven Eckelmann <[email protected]>
Makefile +0 -2
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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) \