zaptel-1.4: Compilefixes for 2.6.36
[openwrt/svn-archive/archive.git] / libs / zaptel-1.4.x / patches / 370-2.6.36.patch
1 ---
2 kernel/zaptel-base.c | 18 ++++++++++++++++++
3 1 file changed, 18 insertions(+)
4
5 --- zaptel-1.4.12.1.orig/kernel/zaptel-base.c
6 +++ zaptel-1.4.12.1/kernel/zaptel-base.c
7 @@ -5181,6 +5181,20 @@ static int zt_ioctl(struct inode *inode,
8 return zt_chan_ioctl(inode, file, cmd, data, unit);
9 }
10
11 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
12 +#include <linux/smp_lock.h>
13 +static long zt_ioctl_unlocked(struct file *file, unsigned int cmd, unsigned long data)
14 +{
15 + int ret;
16 +
17 + lock_kernel();
18 + ret = zt_ioctl(file->f_mapping->host, file, cmd, data);
19 + unlock_kernel();
20 +
21 + return ret;
22 +}
23 +#endif
24 +
25 int zt_register(struct zt_span *span, int prefmaster)
26 {
27 int x;
28 @@ -7632,7 +7646,11 @@ static struct file_operations zt_fops =
29 llseek: NULL,
30 open: zt_open,
31 release: zt_release,
32 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
33 + unlocked_ioctl: zt_ioctl_unlocked,
34 +#else
35 ioctl: zt_ioctl,
36 +#endif
37 read: zt_read,
38 write: zt_write,
39 poll: zt_poll,