---- a/kernel/ztdummy.c
-+++ b/kernel/ztdummy.c
-@@ -55,7 +55,7 @@
+---
+ kernel/ztdummy.c | 18 +++++++++++++++---
+ 1 file changed, 15 insertions(+), 3 deletions(-)
+
+--- zaptel-1.4.12.1.orig/kernel/ztdummy.c
++++ zaptel-1.4.12.1/kernel/ztdummy.c
+@@ -54,7 +54,7 @@
* the #define USE_RTC should be commented out.
*/
#if defined(__i386__) || defined(__x86_64__)
/* The symbol hrtimer_forward is only exported as of 2.6.22: */
#if defined(CONFIG_HIGH_RES_TIMERS) && LINUX_VERSION_CODE >= VERSION_CODE(2,6,22)
#define USE_HIGHRESTIMER
-@@ -91,6 +91,18 @@
+@@ -90,6 +90,18 @@
#endif
#include "ztdummy.h"
static struct ztdummy *ztd;
-@@ -200,7 +212,7 @@ static enum hrtimer_restart ztdummy_hr_i
+@@ -199,7 +211,7 @@ static enum hrtimer_restart ztdummy_hr_i
* expired.
* We should worry if overrun is 2 or more; then we really missed
* a tick */
ktime_set(0, ZAPTEL_TIME_NS));
if(overrun > 1) {
if(printk_ratelimit())
-@@ -223,7 +235,7 @@ static enum hrtimer_restart ztdummy_hr_i
+@@ -222,7 +234,7 @@ static enum hrtimer_restart ztdummy_hr_i
/* use kernel system tick timer if PC architecture RTC is not available */
static void ztdummy_timer(unsigned long param)
{
---- a/kernel/ztdummy.c
-+++ b/kernel/ztdummy.c
-@@ -54,7 +54,6 @@
+---
+ kernel/ztdummy.c | 2 --
+ 1 file changed, 2 deletions(-)
+
+--- zaptel-1.4.12.1.orig/kernel/ztdummy.c
++++ zaptel-1.4.12.1/kernel/ztdummy.c
+@@ -53,7 +53,6 @@
* If using an i386 architecture without a PC real-time clock,
* the #define USE_RTC should be commented out.
*/
#if LINUX_VERSION_CODE >= VERSION_CODE(2,6,15)
/* The symbol hrtimer_forward is only exported as of 2.6.22: */
#if defined(CONFIG_HIGH_RES_TIMERS) && LINUX_VERSION_CODE >= VERSION_CODE(2,6,22)
-@@ -67,7 +66,6 @@
+@@ -66,7 +65,6 @@
#define USE_RTC
#endif
#endif
---- zaptel-1.4.6.org/Makefile 2007-09-20 20:42:35.000000000 +0200
-+++ zaptel-1.4.6/Makefile 2007-11-10 18:07:07.000000000 +0100
-@@ -10,6 +10,7 @@
- ifeq ($(MAKELEVEL),0)
+---
+ Makefile | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- zaptel-1.4.12.1.orig/Makefile
++++ zaptel-1.4.12.1/Makefile
+@@ -18,6 +18,7 @@ ifeq ($(MAKELEVEL),0)
PWD:=$(shell pwd)
+ export PWD
endif
+PWD:=`pwd`
+ ifeq ($(ARCH),)
ARCH:=$(shell uname -m | sed -e s/i.86/i386/)
-
-diff -urN zaptel-1.4.9.2/Makefile zaptel-1.4.9.2.new/Makefile
---- zaptel-1.4.9.2/Makefile 2008-02-22 01:31:47.000000000 +0100
-+++ zaptel-1.4.9.2.new/Makefile 2009-02-03 15:24:16.000000000 +0100
-@@ -21,7 +21,7 @@
- ARCH:=$(shell uname -m | sed -e s/i.86/i386/)
+---
+ Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- zaptel-1.4.12.1.orig/Makefile
++++ zaptel-1.4.12.1/Makefile
+@@ -25,7 +25,7 @@ ARCH:=$(shell uname -m | sed -e s/i.86/i
+ endif
ifeq ($(DEB_HOST_GNU_TYPE),)
-UNAME_M:=$(shell uname -m)
-diff --git a/kernel/zaptel-base.c b/kernel/zaptel-base.c
-index dbd6588..d4fc584 100644
---- a/kernel/zaptel-base.c
-+++ b/kernel/zaptel-base.c
-@@ -60,6 +60,9 @@
+---
+ kernel/zaptel-base.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- zaptel-1.4.12.1.orig/kernel/zaptel-base.c
++++ zaptel-1.4.12.1/kernel/zaptel-base.c
+@@ -59,6 +59,9 @@
#include <linux/if_ppp.h>
#endif
#include <asm/atomic.h>
--- /dev/null
+---
+ kernel/zaptel-base.c | 18 ++++++++++++++++++
+ 1 file changed, 18 insertions(+)
+
+--- zaptel-1.4.12.1.orig/kernel/zaptel-base.c
++++ zaptel-1.4.12.1/kernel/zaptel-base.c
+@@ -5181,6 +5181,20 @@ static int zt_ioctl(struct inode *inode,
+ return zt_chan_ioctl(inode, file, cmd, data, unit);
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
++#include <linux/smp_lock.h>
++static long zt_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long data)
++{
++ int ret;
++
++ lock_kernel();
++ ret = zt_ioctl(file->f_mapping->host, file, cmd, data);
++ unlock_kernel();
++
++ return ret;
++}
++#endif
++
+ int zt_register(struct zt_span *span, int prefmaster)
+ {
+ int x;
+@@ -7632,7 +7646,11 @@ static struct file_operations zt_fops =
+ llseek: NULL,
+ open: zt_open,
+ release: zt_release,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
++ unlocked_ioctl: zt_ioctl_unlocked,
++#else
+ ioctl: zt_ioctl,
++#endif
+ read: zt_read,
+ write: zt_write,
+ poll: zt_poll,