diff -Nru dahdi-linux-2.5.0.1+dfsg/debian/changelog dahdi-linux-2.5.0.1+dfsg/debian/changelog --- dahdi-linux-2.5.0.1+dfsg/debian/changelog 2013-08-05 14:40:06.000000000 +0200 +++ dahdi-linux-2.5.0.1+dfsg/debian/changelog 2014-11-14 10:58:55.000000000 +0100 @@ -1,3 +1,10 @@ +dahdi-linux (1:2.5.0.1+dfsg-1ubuntu4~14.04.1) trusty; urgency=low + + * Cherry-picking compat patches to support kernel versions up to 3.16 + (LP: #1336253) + + -- Stefan Bader Fri, 14 Nov 2014 10:55:58 +0100 + dahdi-linux (1:2.5.0.1+dfsg-1ubuntu3) saucy; urgency=low * Fix compile issues with 3.11 kernel diff -Nru dahdi-linux-2.5.0.1+dfsg/debian/patches/kernel-v3-13-compat.patch dahdi-linux-2.5.0.1+dfsg/debian/patches/kernel-v3-13-compat.patch --- dahdi-linux-2.5.0.1+dfsg/debian/patches/kernel-v3-13-compat.patch 1970-01-01 01:00:00.000000000 +0100 +++ dahdi-linux-2.5.0.1+dfsg/debian/patches/kernel-v3-13-compat.patch 2014-11-14 10:55:29.000000000 +0100 @@ -0,0 +1,46 @@ +From: Stefan Bader +Date: Wed, 12 Nov 2014 12:21:39 +0100 +Subject: Fix driver compile for 3.13 kernels + +With 3.13 the drv_attrs attribute was removed from the bus_type +structure. Add compat code to use drv_groups instead. + +Signed-off-by: Stefan Bader + +Index: dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/xbus-sysfs.c +=================================================================== +--- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/xbus-sysfs.c 2011-06-28 20:23:00.000000000 +0200 ++++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/xbus-sysfs.c 2014-11-12 12:02:11.698506106 +0100 +@@ -58,10 +58,20 @@ static ssize_t sync_store(struct device_ + return exec_sync_command(buf, count); + } + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) ++static DRIVER_ATTR(sync, S_IRUGO | S_IWUSR, sync_show, sync_store); ++ ++static struct attribute *xbus_drv_attrs[] = { ++ &driver_attr_sync.attr, ++ NULL, ++}; ++ATTRIBUTE_GROUPS(xbus_drv); ++#else + static struct driver_attribute xpp_attrs[] = { + __ATTR(sync, S_IRUGO | S_IWUSR, sync_show, sync_store), + __ATTR_NULL, + }; ++#endif + + /*--------- Sysfs Bus handling ----*/ + static DEVICE_ATTR_READER(xbus_state_show, dev, buf) +@@ -457,7 +467,11 @@ static struct bus_type toplevel_bus_type + .uevent = astribank_uevent, + #endif + .dev_attrs = xbus_dev_attrs, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) ++ .drv_groups = xbus_drv_groups, ++#else + .drv_attrs = xpp_attrs, ++#endif + }; + + static int astribank_probe(struct device *dev) diff -Nru dahdi-linux-2.5.0.1+dfsg/debian/patches/kernel-v3-15-compat.patch dahdi-linux-2.5.0.1+dfsg/debian/patches/kernel-v3-15-compat.patch --- dahdi-linux-2.5.0.1+dfsg/debian/patches/kernel-v3-15-compat.patch 1970-01-01 01:00:00.000000000 +0100 +++ dahdi-linux-2.5.0.1+dfsg/debian/patches/kernel-v3-15-compat.patch 2014-11-14 10:55:35.000000000 +0100 @@ -0,0 +1,36 @@ +From: Stefan Bader +Date: Wed, 12 Nov 2014 14:21:48 +0100 +Subject: Fix build with v3.15 kernels + +With v3.15 interruptible_sleep_on_timeout got removed. Add a replacement +inline function to pciradio.c. + +Signed-off-by: Stefan Bader + +Index: dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/pciradio.c +=================================================================== +--- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/pciradio.c 2011-01-03 19:26:24.000000000 +0100 ++++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/pciradio.c 2014-11-12 14:33:44.478365915 +0100 +@@ -56,6 +56,22 @@ With driver: 303826 (1.5 %) + + #include + ++/* ++ * interruptible_sleep_on_timeout was deprecated for a while and got removed ++ * in v3.15. ++ */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) ++static inline long ++interruptible_sleep_on_timeout(wait_queue_head_t *q, long timeout) ++{ ++ DEFINE_WAIT(wait); ++ prepare_to_wait(q, &wait, TASK_INTERRUPTIBLE); ++ timeout = schedule_timeout(timeout); ++ finish_wait(q, &wait); ++ return timeout; ++} ++#endif ++ + #define RAD_MAX_IFACES 128 + + #define NUM_CODES 15 diff -Nru dahdi-linux-2.5.0.1+dfsg/debian/patches/series dahdi-linux-2.5.0.1+dfsg/debian/patches/series --- dahdi-linux-2.5.0.1+dfsg/debian/patches/series 2013-08-03 15:26:01.000000000 +0200 +++ dahdi-linux-2.5.0.1+dfsg/debian/patches/series 2014-11-14 10:55:43.000000000 +0100 @@ -9,3 +9,5 @@ missing_modules.h.diff ndo_set_multicast_list.diff kernel-v3-11-compat.patch +kernel-v3-13-compat.patch +kernel-v3-15-compat.patch