From c32bbe1c7a48581d0d71b6e5bb433a4ca6d9cdb0 Mon Sep 17 00:00:00 2001 From: zandbelt Date: Thu, 18 Dec 2008 19:38:32 +0000 Subject: [PATCH] make zaptel compile with kernels >2.6.25 --- libs/zaptel-1.4.x/Makefile | 1 - .../patches/305-class_device_removed.patch | 23 +++--- libs/zaptel-1.4.x/patches/320-zap-sema.patch | 78 +++++++++++++++++++ 3 files changed, 91 insertions(+), 11 deletions(-) create mode 100644 libs/zaptel-1.4.x/patches/320-zap-sema.patch diff --git a/libs/zaptel-1.4.x/Makefile b/libs/zaptel-1.4.x/Makefile index ec9af57..6ebefa8 100644 --- a/libs/zaptel-1.4.x/Makefile +++ b/libs/zaptel-1.4.x/Makefile @@ -27,7 +27,6 @@ endef define KernelPackage/zaptel14 SUBMENU:=Other modules $(call Package/zaptel14/Default) - DEPENDS:=@!LINUX_2_6_27 TITLE+= (kernel module) VERSION:=$(LINUX_VERSION)-$(PKG_VERSION)-$(BOARD)-$(PKG_RELEASE) FILES:=$(PKG_BUILD_DIR)/kernel/zaptel.$(LINUX_KMOD_SUFFIX) \ diff --git a/libs/zaptel-1.4.x/patches/305-class_device_removed.patch b/libs/zaptel-1.4.x/patches/305-class_device_removed.patch index dfeb481..c9647a2 100644 --- a/libs/zaptel-1.4.x/patches/305-class_device_removed.patch +++ b/libs/zaptel-1.4.x/patches/305-class_device_removed.patch @@ -1,12 +1,15 @@ ---- zaptel-1.4.x/kernel/zaptel-base.c.orig 2008-08-18 12:55:48.000000000 +0200 -+++ zaptel-1.4.x/kernel/zaptel-base.c 2008-08-18 12:49:25.000000000 +0200 -@@ -163,13 +163,29 @@ - +diff -Nru zaptel-1.4.9.2.org/kernel/zaptel-base.c zaptel-1.4.9.2/kernel/zaptel-base.c +--- zaptel-1.4.9.2.org/kernel/zaptel-base.c 2008-02-28 20:00:47.000000000 +0100 ++++ zaptel-1.4.9.2/kernel/zaptel-base.c 2008-11-29 16:01:23.000000000 +0100 +@@ -163,12 +163,32 @@ /* udev necessary data structures. Yeah! */ #ifdef CONFIG_ZAP_UDEV -- + -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) ++#define CLASS_DEV_CREATE(class, devt, device, name) \ ++ device_create(class, device, devt, NULL, "%s", name) ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) +#define CLASS_DEV_CREATE(class, devt, device, name) \ + device_create(class, device, devt, name) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) @@ -33,7 +36,7 @@ #endif #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13) -@@ -178,8 +194,6 @@ +@@ -177,8 +197,6 @@ static struct class_simple *zap_class = NULL; #define class_create class_simple_create #define class_destroy class_simple_destroy @@ -42,7 +45,7 @@ #endif #endif /* CONFIG_ZAP_UDEV */ -@@ -5337,7 +5351,7 @@ +@@ -4973,7 +4991,7 @@ #ifdef CONFIG_ZAP_UDEV for (x = 0; x < span->channels; x++) { if (span->chans[x].channo < 250) @@ -51,7 +54,7 @@ } #endif /* CONFIG_ZAP_UDEV */ -@@ -7825,7 +7839,7 @@ +@@ -7355,7 +7373,7 @@ int zt_unregister_chardev(struct zt_chardev *dev) { #ifdef CONFIG_ZAP_UDEV @@ -60,7 +63,7 @@ #endif /* CONFIG_ZAP_UDEV */ #ifdef CONFIG_DEVFS_FS -@@ -7904,10 +7918,10 @@ +@@ -7434,10 +7452,10 @@ devfs_unregister_chrdev(ZT_MAJOR, "zaptel"); #else #ifdef CONFIG_ZAP_UDEV diff --git a/libs/zaptel-1.4.x/patches/320-zap-sema.patch b/libs/zaptel-1.4.x/patches/320-zap-sema.patch new file mode 100644 index 0000000..709b859 --- /dev/null +++ b/libs/zaptel-1.4.x/patches/320-zap-sema.patch @@ -0,0 +1,78 @@ +diff -Nru zaptel-1.4.9.2.org/kernel/wctdm24xxp/base.c zaptel-1.4.9.2/kernel/wctdm24xxp/base.c +--- zaptel-1.4.9.2.org/kernel/wctdm24xxp/base.c 2008-02-05 00:00:48.000000000 +0100 ++++ zaptel-1.4.9.2/kernel/wctdm24xxp/base.c 2008-11-29 15:55:17.000000000 +0100 +@@ -44,7 +44,11 @@ + #include + #include + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) ++#include ++#else + #include ++#endif + + #ifdef LINUX26 + #include +diff -Nru zaptel-1.4.9.2.org/kernel/wctdm24xxp/GpakApi.c zaptel-1.4.9.2/kernel/wctdm24xxp/GpakApi.c +--- zaptel-1.4.9.2.org/kernel/wctdm24xxp/GpakApi.c 2008-02-05 00:00:48.000000000 +0100 ++++ zaptel-1.4.9.2/kernel/wctdm24xxp/GpakApi.c 2008-11-29 15:55:17.000000000 +0100 +@@ -34,7 +34,11 @@ + */ + + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) ++#include ++#else + #include ++#endif + + #include "zaptel.h" + +diff -Nru zaptel-1.4.9.2.org/kernel/wctdm24xxp/GpakCust.c zaptel-1.4.9.2/kernel/wctdm24xxp/GpakCust.c +--- zaptel-1.4.9.2.org/kernel/wctdm24xxp/GpakCust.c 2008-02-05 00:00:48.000000000 +0100 ++++ zaptel-1.4.9.2/kernel/wctdm24xxp/GpakCust.c 2008-11-29 15:55:17.000000000 +0100 +@@ -37,7 +37,11 @@ + + #include + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) ++#include ++#else + #include ++#endif + + #include "zaptel.h" + #include "wctdm24xxp.h" +diff -Nru zaptel-1.4.9.2.org/kernel/wcte12xp/vpmadt032.c zaptel-1.4.9.2/kernel/wcte12xp/vpmadt032.c +--- zaptel-1.4.9.2.org/kernel/wcte12xp/vpmadt032.c 2008-02-05 00:00:48.000000000 +0100 ++++ zaptel-1.4.9.2/kernel/wcte12xp/vpmadt032.c 2008-11-29 15:55:17.000000000 +0100 +@@ -29,7 +29,12 @@ + */ + + #include ++#include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) ++#include ++#else + #include ++#endif + #include + #include + #include +diff -Nru zaptel-1.4.9.2.org/kernel/xpp/xpd.h zaptel-1.4.9.2/kernel/xpp/xpd.h +--- zaptel-1.4.9.2.org/kernel/xpp/xpd.h 2008-02-05 00:00:48.000000000 +0100 ++++ zaptel-1.4.9.2/kernel/xpp/xpd.h 2008-11-29 15:55:17.000000000 +0100 +@@ -29,8 +29,13 @@ + #ifdef __KERNEL__ + #include + #include ++#include + #include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) ++#include ++#else + #include ++#endif + #include + #ifdef XPP_DEBUGFS + #ifndef CONFIG_DEBUG_FS -- 2.30.2