make zaptel compile with kernels >2.6.25
authorHans Zandbelt <hans.zandbelt@gmail.com>
Thu, 18 Dec 2008 19:38:32 +0000 (19:38 +0000)
committerHans Zandbelt <hans.zandbelt@gmail.com>
Thu, 18 Dec 2008 19:38:32 +0000 (19:38 +0000)
SVN-Revision: 13684

libs/zaptel-1.4.x/Makefile
libs/zaptel-1.4.x/patches/305-class_device_removed.patch
libs/zaptel-1.4.x/patches/320-zap-sema.patch [new file with mode: 0644]

index ec9af57..6ebefa8 100644 (file)
@@ -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) \
index dfeb481..c9647a2 100644 (file)
@@ -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 (file)
index 0000000..709b859
--- /dev/null
@@ -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 <linux/interrupt.h>
+ #include <linux/workqueue.h>
+ #include <linux/delay.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++#include <linux/semaphore.h>
++#else
+ #include <asm/semaphore.h>
++#endif
+ #ifdef LINUX26
+ #include <linux/moduleparam.h>
+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 <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++#include <linux/semaphore.h>
++#else
+ #include <asm/semaphore.h>
++#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 <linux/version.h>
+ #include <linux/delay.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++#include <linux/semaphore.h>
++#else
+ #include <asm/semaphore.h>
++#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 <linux/delay.h>
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++#include <linux/semaphore.h>
++#else
+ #include <asm/semaphore.h>
++#endif
+ #include <linux/pci.h> 
+ #include <linux/firmware.h> 
+ #include <linux/list.h> 
+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 <linux/kernel.h>
+ #include <linux/device.h>
++#include <linux/version.h>
+ #include <asm/atomic.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
++#include <linux/semaphore.h>
++#else
+ #include <asm/semaphore.h>
++#endif
+ #include <linux/moduleparam.h>
+ #ifdef        XPP_DEBUGFS
+ #ifndef       CONFIG_DEBUG_FS