[packages/dahdi-linux] - added fix for kernel 4.11 - rel 1

baggins baggins at pld-linux.org
Tue May 9 20:56:34 CEST 2017


commit 6a1e6d9fb2e17a2f46b044cfaed42a0d1b289564
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Tue May 9 20:56:14 2017 +0200

    - added fix for kernel 4.11
    - rel 1

 dahdi-linux.spec  |   4 +-
 kernel-4.11.patch | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 144 insertions(+), 1 deletion(-)
---
diff --git a/dahdi-linux.spec b/dahdi-linux.spec
index cefad36..15bf918 100644
--- a/dahdi-linux.spec
+++ b/dahdi-linux.spec
@@ -35,7 +35,7 @@ exit 1
 %define		_enable_debug_packages	0
 %endif
 
-%define		rel	0.1
+%define		rel	1
 %define		pname	dahdi-linux
 %define		FIRMWARE_URL http://downloads.digium.com/pub/telephony/firmware/releases
 Summary:	DAHDI telephony device support
@@ -57,6 +57,7 @@ Source6:	%{FIRMWARE_URL}/dahdi-fw-tc400m-MR6.12.tar.gz
 # Source6-md5:	2ea860bb8a9d8ede2858b9557b74ee3c
 Source7:	%{FIRMWARE_URL}/dahdi-fw-hx8-2.06.tar.gz
 # Source7-md5:	a7f3886942bb3e9fed349a41b3390c9f
+Patch0:		kernel-4.11.patch
 URL:		http://www.asterisk.org/
 %{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
 BuildRequires:	perl-base
@@ -156,6 +157,7 @@ cd ../..\
 
 %prep
 %setup -q -n %{pname}-%{version}
+%patch0 -p1
 
 for a in %{SOURCE3} %{SOURCE4} %{SOURCE5} %{SOURCE6} %{SOURCE7}; do
 	ln -s $a drivers/dahdi/firmware
diff --git a/kernel-4.11.patch b/kernel-4.11.patch
new file mode 100644
index 0000000..2a8cb60
--- /dev/null
+++ b/kernel-4.11.patch
@@ -0,0 +1,141 @@
+diff -ur dahdi-linux-2.11.1/drivers/dahdi/dahdi-base.c dahdi-linux-2.11.1-4.11/drivers/dahdi/dahdi-base.c
+--- dahdi-linux-2.11.1/drivers/dahdi/dahdi-base.c	2016-03-01 23:03:59.000000000 +0100
++++ dahdi-linux-2.11.1-4.11/drivers/dahdi/dahdi-base.c	2017-05-09 20:34:45.170079849 +0200
+@@ -47,6 +47,9 @@
+ #include <linux/kmod.h>
+ #include <linux/moduleparam.h>
+ #include <linux/sched.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
++#include <linux/sched/signal.h>
++#endif
+ #include <linux/list.h>
+ #include <linux/delay.h>
+ #include <linux/mutex.h>
+diff -ur dahdi-linux-2.11.1/drivers/dahdi/dahdi_dynamic.c dahdi-linux-2.11.1-4.11/drivers/dahdi/dahdi_dynamic.c
+--- dahdi-linux-2.11.1/drivers/dahdi/dahdi_dynamic.c	2016-03-01 23:03:59.000000000 +0100
++++ dahdi-linux-2.11.1-4.11/drivers/dahdi/dahdi_dynamic.c	2017-05-09 20:38:03.809649973 +0200
+@@ -467,7 +467,11 @@
+ 
+ 	/* We shouldn't have more than the two references at this point.  If
+ 	 * we do, there are probably channels that are still opened. */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
+ 	if (atomic_read(&d->kref.refcount) > 2) {
++#else
++	if (kref_read(&d->kref) > 2) {
++#endif
+ 		dynamic_put(d);
+ 		return -EBUSY;
+ 	}
+diff -ur dahdi-linux-2.11.1/drivers/dahdi/wcaxx-base.c dahdi-linux-2.11.1-4.11/drivers/dahdi/wcaxx-base.c
+--- dahdi-linux-2.11.1/drivers/dahdi/wcaxx-base.c	2016-03-01 23:03:59.000000000 +0100
++++ dahdi-linux-2.11.1-4.11/drivers/dahdi/wcaxx-base.c	2017-05-09 20:39:05.690553708 +0200
+@@ -28,6 +28,9 @@
+ #include <linux/init.h>
+ #include <linux/pci.h>
+ #include <linux/sched.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
++#include <linux/sched/signal.h>
++#endif
+ #include <linux/workqueue.h>
+ #include <linux/delay.h>
+ #include <linux/moduleparam.h>
+diff -ur dahdi-linux-2.11.1/drivers/dahdi/wctc4xxp/base.c dahdi-linux-2.11.1-4.11/drivers/dahdi/wctc4xxp/base.c
+--- dahdi-linux-2.11.1/drivers/dahdi/wctc4xxp/base.c	2016-03-01 23:03:59.000000000 +0100
++++ dahdi-linux-2.11.1-4.11/drivers/dahdi/wctc4xxp/base.c	2017-05-09 20:40:14.041864392 +0200
+@@ -26,6 +26,10 @@
+ #include <linux/slab.h>
+ #include <linux/kmod.h>
+ #include <linux/sched.h>
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
++#include <linux/sched/signal.h>
++#endif
+ #include <linux/pci.h>
+ #include <linux/interrupt.h>
+ #include <linux/delay.h>
+diff -ur dahdi-linux-2.11.1/drivers/dahdi/wctdm24xxp/base.c dahdi-linux-2.11.1-4.11/drivers/dahdi/wctdm24xxp/base.c
+--- dahdi-linux-2.11.1/drivers/dahdi/wctdm24xxp/base.c	2016-03-01 23:03:59.000000000 +0100
++++ dahdi-linux-2.11.1-4.11/drivers/dahdi/wctdm24xxp/base.c	2017-05-09 20:39:47.343067209 +0200
+@@ -44,6 +44,9 @@
+ #include <linux/init.h>
+ #include <linux/pci.h>
+ #include <linux/sched.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
++#include <linux/sched/signal.h>
++#endif
+ #include <linux/interrupt.h>
+ #include <linux/workqueue.h>
+ #include <linux/delay.h>
+diff -ur dahdi-linux-2.11.1/drivers/dahdi/wcte12xp/base.c dahdi-linux-2.11.1-4.11/drivers/dahdi/wcte12xp/base.c
+--- dahdi-linux-2.11.1/drivers/dahdi/wcte12xp/base.c	2016-03-01 23:03:59.000000000 +0100
++++ dahdi-linux-2.11.1-4.11/drivers/dahdi/wcte12xp/base.c	2017-05-09 20:40:31.216160114 +0200
+@@ -40,6 +40,10 @@
+ #include <linux/workqueue.h>
+ #include <linux/delay.h>
+ #include <linux/sched.h>
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
++#include <linux/sched/signal.h>
++#endif
+ #include <linux/slab.h>
+ 
+ #include <stdbool.h>
+diff -ur dahdi-linux-2.11.1/drivers/dahdi/wcte43x-base.c dahdi-linux-2.11.1-4.11/drivers/dahdi/wcte43x-base.c
+--- dahdi-linux-2.11.1/drivers/dahdi/wcte43x-base.c	2016-03-01 23:03:59.000000000 +0100
++++ dahdi-linux-2.11.1-4.11/drivers/dahdi/wcte43x-base.c	2017-05-09 20:38:38.996830549 +0200
+@@ -33,6 +33,10 @@
+ #include <linux/workqueue.h>
+ #include <linux/delay.h>
+ #include <linux/sched.h>
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)
++#include <linux/sched/signal.h>
++#endif
+ #include <linux/crc32.h>
+ #include <linux/slab.h>
+ 
+diff -ur dahdi-linux-2.11.1/drivers/dahdi/xpp/xbus-core.c dahdi-linux-2.11.1-4.11/drivers/dahdi/xpp/xbus-core.c
+--- dahdi-linux-2.11.1/drivers/dahdi/xpp/xbus-core.c	2016-03-01 23:03:59.000000000 +0100
++++ dahdi-linux-2.11.1-4.11/drivers/dahdi/xpp/xbus-core.c	2017-05-09 20:41:27.973007253 +0200
+@@ -244,7 +244,11 @@
+ {
+ 	struct kref *kref = &xbus->kref;
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
+ 	return atomic_read(&kref->refcount);
++#else
++	return kref_read(kref);
++#endif
+ }
+ 
+ /*------------------------- Frame  Handling ------------------------*/
+diff -ur dahdi-linux-2.11.1/drivers/dahdi/xpp/xbus-sysfs.c dahdi-linux-2.11.1-4.11/drivers/dahdi/xpp/xbus-sysfs.c
+--- dahdi-linux-2.11.1/drivers/dahdi/xpp/xbus-sysfs.c	2016-03-01 23:03:59.000000000 +0100
++++ dahdi-linux-2.11.1-4.11/drivers/dahdi/xpp/xbus-sysfs.c	2017-05-09 20:42:09.972886067 +0200
+@@ -974,7 +974,11 @@
+ 		return;
+ 	}
+ 	XBUS_DBG(DEVICES, xbus, "going to unregister: refcount=%d\n",
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
+ 		atomic_read(&astribank->kobj.kref.refcount));
++#else
++		kref_read(&astribank->kobj.kref));
++#endif
+ 	BUG_ON(dev_get_drvdata(astribank) != xbus);
+ 	device_unregister(astribank);
+ 	dev_set_drvdata(astribank, NULL);
+diff -ur dahdi-linux-2.11.1/drivers/dahdi/xpp/xpp_dahdi.c dahdi-linux-2.11.1-4.11/drivers/dahdi/xpp/xpp_dahdi.c
+--- dahdi-linux-2.11.1/drivers/dahdi/xpp/xpp_dahdi.c	2016-03-01 23:03:59.000000000 +0100
++++ dahdi-linux-2.11.1-4.11/drivers/dahdi/xpp/xpp_dahdi.c	2017-05-09 20:42:55.336485638 +0200
+@@ -124,7 +124,11 @@
+ {
+ 	struct kref *kref = &xpd->kref;
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,11,0)
+ 	return atomic_read(&kref->refcount);
++#else
++	return kref_read(kref);
++#endif
+ }
+ 
+ xpd_t *get_xpd(const char *msg, xpd_t *xpd)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/dahdi-linux.git/commitdiff/6a1e6d9fb2e17a2f46b044cfaed42a0d1b289564



More information about the pld-cvs-commit mailing list