Source: osmocom-dahdi-linux Version: 0.0~git20241003.b2ea348-4 Severity: normal Tags: patch
Hi, I'm attaching two patches to synchronize the -dkms package with src:dahdi-linux s.t. both support the same range of kernel versions. Andreas
>From a224d0512d73a1d72136d3ddf4fbdfd32fcd89ee Mon Sep 17 00:00:00 2001 From: Andreas Beckmann <a...@debian.org> Date: Sat, 5 Apr 2025 00:14:54 +0200 Subject: [PATCH 1/2] import 1190-timer_setup.patch from src:dahdi-linux --- debian/patches/1190-timer_setup.patch | 41 +++++++++++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 42 insertions(+) create mode 100644 debian/patches/1190-timer_setup.patch diff --git a/debian/patches/1190-timer_setup.patch b/debian/patches/1190-timer_setup.patch new file mode 100644 index 0000000..23875d9 --- /dev/null +++ b/debian/patches/1190-timer_setup.patch @@ -0,0 +1,41 @@ +Author: Andreas Beckmann <a...@debian.org> +Description: timer_setup() was introduced in Linux v4.14 + +--- a/include/dahdi/kernel.h ++++ b/include/dahdi/kernel.h +@@ -1410,7 +1410,16 @@ static inline short dahdi_txtone_nextsam + #define TIMER_DATA_TYPE unsigned long + #endif + +-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 0) ++ ++/* timer_setup and friends in 4.14 had a slightly different interface than in 4.15+ */ ++#define timer_setup(timer, callback, flags) __setup_timer((timer), (TIMER_FUNC_TYPE)(callback), (TIMER_DATA_TYPE)(timer), (flags)) ++#undef from_timer ++#define from_timer(var, callback_timer, timer_fieldname) \ ++ container_of((struct timer_list *)(callback_timer), \ ++ typeof(*var), timer_fieldname) ++ ++#else + + #ifdef RHEL_RELEASE_VERSION + #if RHEL_RELEASE_CODE > RHEL_RELEASE_VERSION(7, 5) +@@ -1422,7 +1431,7 @@ static inline short dahdi_txtone_nextsam + + #ifndef DAHDI_HAVE_TIMER_SETUP + /** +- * timer_setup - Added in 4.13.0. We can make a direct translation to the ++ * timer_setup - Added in 4.14.0. We can make a direct translation to the + * setup_timer interface since DAHDI does not pass any flags to any of the + * timer_setup functions. + * +@@ -1513,7 +1522,7 @@ static inline void *PDE_DATA(const struc + #endif /* 4.0.0 */ + #endif /* 4.10.0 */ + #endif /* 4.11.0 */ +-#endif /* 4.13.0 */ ++#endif /* 4.14.0 */ + #else /* >= 4.15.0 */ + + #ifndef TIMER_DATA_TYPE diff --git a/debian/patches/series b/debian/patches/series index 5e32499..7076dd7 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,3 +1,4 @@ #dahdi_dummy_removed_comment.patch no_firmware_download.patch recode-to-utf8.patch +1190-timer_setup.patch -- 2.39.5
>From 4649c0b62be36717cff2771eac6381af38c37330 Mon Sep 17 00:00:00 2001 From: Andreas Beckmann <a...@debian.org> Date: Sat, 5 Apr 2025 00:15:25 +0200 Subject: [PATCH 2/2] dkms.conf: relax to BUILD_EXCLUSIVE_KERNEL_MIN="4.3" --- debian/osmocom-dahdi-dkms.dkms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/osmocom-dahdi-dkms.dkms b/debian/osmocom-dahdi-dkms.dkms index aabda02..f1523d6 100644 --- a/debian/osmocom-dahdi-dkms.dkms +++ b/debian/osmocom-dahdi-dkms.dkms @@ -1,8 +1,8 @@ PACKAGE_NAME="osmocom-dahdi" PACKAGE_VERSION="#MODULE_VERSION#" -# the API of timer_setup() and friends -BUILD_EXCLUSIVE_KERNEL_MIN="4.15" +# strscpy() was introduced in Linux v4.3 +BUILD_EXCLUSIVE_KERNEL_MIN="4.3" # CONFIG_DAHDI_PPP is enabled unconditionally # hdlc_open() and friends are used unconditionally -- 2.39.5