Skip to content

Commit

Permalink
backports: Remove support for kernel smaller than 4.10
Browse files Browse the repository at this point in the history
This removes all the code which is needed to support kernel 4.9.

Signed-off-by: Hauke Mehrtens <[email protected]>
  • Loading branch information
hauke committed Feb 6, 2024
1 parent 1418d11 commit 50aae17
Show file tree
Hide file tree
Showing 19 changed files with 4 additions and 547 deletions.
1 change: 0 additions & 1 deletion .github/workflows/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ jobs:
strategy:
matrix:
kernel: [
"4.9",
"4.10",
"4.11",
"4.12",
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ down to older kernels. It currently backports the following subsystems:
* WWAN

This package provides the latest Linux kernel subsystem enhancements
for kernels 4.9 and above.
for kernels 4.10 and above.

# Documentation

Expand Down
3 changes: 1 addition & 2 deletions backport/backport-include/linux/bits.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#include <linux/version.h>

#if LINUX_VERSION_IS_GEQ(4,19,0) || \
LINUX_VERSION_IN_RANGE(4,14,119, 4,15,0) || \
LINUX_VERSION_IN_RANGE(4,9,176, 4,10,0)
LINUX_VERSION_IN_RANGE(4,14,119, 4,15,0)
#include_next <linux/bits.h>
#else
#include <linux/bitops.h>
Expand Down
25 changes: 0 additions & 25 deletions backport/backport-include/linux/gfp.h

This file was deleted.

40 changes: 0 additions & 40 deletions backport/backport-include/linux/interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,6 @@
#define _BP_LINUX_INTERRUPT_H
#include <linux/version.h>
#include_next <linux/interrupt.h>
#include <linux/ktime.h>

#if LINUX_VERSION_IS_LESS(4,10,0)

/* Forward a hrtimer so it expires after now: */
static inline u64
backport_hrtimer_forward(struct hrtimer *timer, ktime_t now, s64 interval)
{
ktime_t _interval = { .tv64 = interval };

return hrtimer_forward(timer, now, _interval);
}
#define hrtimer_forward LINUX_BACKPORT(hrtimer_forward)

static inline u64
backport_hrtimer_forward_now(struct hrtimer *timer, s64 interval)
{
ktime_t _interval = { .tv64 = interval };

return hrtimer_forward_now(timer, _interval);
}
#define hrtimer_forward_now LINUX_BACKPORT(hrtimer_forward_now)

static inline s64 backport_ns_to_ktime(u64 ns)
{
ktime_t _time = ns_to_ktime(ns);

return _time.tv64;
}
#define ns_to_ktime LINUX_BACKPORT(ns_to_ktime)

static inline void backport_hrtimer_start(struct hrtimer *timer, s64 time,
const enum hrtimer_mode mode)
{
ktime_t _time = { .tv64 = time };
hrtimer_start(timer, _time, mode);
}
#define hrtimer_start LINUX_BACKPORT(hrtimer_start)

#endif

#if LINUX_VERSION_IS_LESS(5,9,0)

Expand Down
14 changes: 0 additions & 14 deletions backport/backport-include/linux/mii.h

This file was deleted.

22 changes: 0 additions & 22 deletions backport/backport-include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,6 @@
#include <backport/magic.h>


#if LINUX_VERSION_IS_LESS(4,10,0)
static inline bool backport_napi_complete_done(struct napi_struct *n, int work_done)
{
if (unlikely(test_bit(NAPI_STATE_NPSVC, &n->state)))
return false;

napi_complete_done(n, work_done);
return true;
}

static inline bool backport_napi_complete(struct napi_struct *n)
{
return backport_napi_complete_done(n, 0);
}
#define napi_complete_done LINUX_BACKPORT(napi_complete_done)
#define napi_complete LINUX_BACKPORT(napi_complete)
#endif /* < 4.10 */

#ifndef NETIF_F_CSUM_MASK
#define NETIF_F_CSUM_MASK NETIF_F_ALL_CSUM
#endif

#if LINUX_VERSION_IS_LESS(4,11,9)
#define netdev_set_priv_destructor(_dev, _destructor) \
(_dev)->destructor = __ ## _destructor
Expand Down
3 changes: 1 addition & 2 deletions backport/backport-include/linux/nospec.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
#define _BACKPORT_LINUX_NOSPEC_H

#if LINUX_VERSION_IS_GEQ(4,15,2) || \
LINUX_VERSION_IN_RANGE(4,14,18, 4,15,0) || \
LINUX_VERSION_IN_RANGE(4,9,81, 4,10,0)
LINUX_VERSION_IN_RANGE(4,14,18, 4,15,0)
#include_next <linux/nospec.h>
#else
#define array_index_nospec(index, size) (index)
Expand Down
3 changes: 1 addition & 2 deletions backport/backport-include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ static inline void nf_reset_ct(struct sk_buff *skb)
#if LINUX_VERSION_IS_LESS(5,6,0) && \
!LINUX_VERSION_IN_RANGE(5,4,69, 5,5,0) && \
!LINUX_VERSION_IN_RANGE(4,19,149, 4,20,0) && \
!LINUX_VERSION_IN_RANGE(4,14,200, 4,15,0) && \
!LINUX_VERSION_IN_RANGE(4,9,238, 4,10,0)
!LINUX_VERSION_IN_RANGE(4,14,200, 4,15,0)
/**
* skb_queue_len_lockless - get queue length
* @list_: list to measure
Expand Down
4 changes: 0 additions & 4 deletions backport/backport-include/linux/virtio_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ struct irq_affinity;
static inline
int virtio_find_vqs(struct virtio_device *vdev, unsigned nvqs,
struct virtqueue *vqs[], vq_callback_t *callbacks[],
#if LINUX_VERSION_IS_LESS(4,10,0)
const char * const names[],
#else
const char *names[],
#endif
struct irq_affinity *desc)
{
#if LINUX_VERSION_IS_LESS(4,11,0)
Expand Down
6 changes: 0 additions & 6 deletions backport/backport-include/net/genetlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ static inline void *genl_info_userhdr(struct genl_info *info)
return (u8 *)info->genlhdr + GENL_HDRLEN;
}

#if LINUX_VERSION_IS_LESS(4,10,0)
#define __genl_ro_after_init
#else
#define __genl_ro_after_init __ro_after_init
#endif

#if LINUX_VERSION_IS_LESS(4,15,0)
#define genlmsg_nlhdr LINUX_BACKPORT(genlmsg_nlhdr)
static inline struct nlmsghdr *genlmsg_nlhdr(void *user_hdr)
Expand Down
13 changes: 0 additions & 13 deletions backport/backport-include/net/netlink.h
Original file line number Diff line number Diff line change
Expand Up @@ -435,19 +435,6 @@ static inline int _nla_parse_nested4(struct nlattr *tb[], int maxtype,
macro_dispatcher(_nla_parse_nested, __VA_ARGS__)(__VA_ARGS__)
#endif /* LINUX_VERSION_IS_LESS(4,12,0) */

#if LINUX_VERSION_IS_LESS(4,10,0)
/**
* nla_memdup - duplicate attribute memory (kmemdup)
* @src: netlink attribute to duplicate from
* @gfp: GFP mask
*/
#define nla_memdump LINUX_BACKPORT(nla_memdup)
static inline void *nla_memdup(const struct nlattr *src, gfp_t gfp)
{
return kmemdup(nla_data(src), nla_len(src), gfp);
}
#endif /* < 4.9 */

#ifndef NLA_POLICY_MIN_LEN
#define NLA_POLICY_MIN_LEN(_len) { \
.type = NLA_BINARY \
Expand Down
1 change: 0 additions & 1 deletion backport/compat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ endif
compat-y += main.o

# Kernel backport compatibility code
compat-$(CPTCFG_KERNEL_4_10) += backport-4.10.o
compat-$(CPTCFG_KERNEL_4_11) += backport-4.11.o
compat-$(CPTCFG_KERNEL_4_12) += backport-4.12.o
compat-$(CPTCFG_KERNEL_4_18) += backport-4.18.o
Expand Down
Loading

0 comments on commit 50aae17

Please sign in to comment.