diff -Nru dahdi-linux-2.5.0.1+dfsg/debian/changelog dahdi-linux-2.5.0.1+dfsg/debian/changelog --- dahdi-linux-2.5.0.1+dfsg/debian/changelog 2014-11-14 10:03:21.000000000 +0000 +++ dahdi-linux-2.5.0.1+dfsg/debian/changelog 2014-12-09 19:26:07.000000000 +0000 @@ -1,3 +1,14 @@ +dahdi-linux (1:2.5.0.1+dfsg-1ubuntu2.2) precise; urgency=low + + * debian/dkms.conf.in: Expose the target kernel version in a variable that + is actually heeded by the make file. And also pass it in on every + invokation of make (LP: #790558). + * debian/patches/kernel-v3-11-compat.patch: Refreshed patch because it + broke building on 3.2 kernel which was missed because of the bug that + caused the build to be always for the running kernel (LP: #1336253). + + -- Stefan Bader Tue, 09 Dec 2014 18:47:52 +0100 + dahdi-linux (1:2.5.0.1+dfsg-1ubuntu2.1) precise; urgency=low * Cherry-picking compat patches to support kernel versions up to 3.13 diff -Nru dahdi-linux-2.5.0.1+dfsg/debian/dkms.conf.in dahdi-linux-2.5.0.1+dfsg/debian/dkms.conf.in --- dahdi-linux-2.5.0.1+dfsg/debian/dkms.conf.in 2011-10-27 22:51:28.000000000 +0000 +++ dahdi-linux-2.5.0.1+dfsg/debian/dkms.conf.in 2014-12-09 17:49:06.000000000 +0000 @@ -2,7 +2,7 @@ # Items below here should not have to change with each driver version PACKAGE_NAME="dahdi" -MAKE[0]="(make modules KERNVER=$kernelver MODULES_EXTRA='dahdi_dummy wcopenpci dahdi_echocan_oslec' SUBDIRS_EXTRA='../staging/echo zaphfc/' ;make;make firmware-loaders;echo : > drivers/dahdi/vpmadt032_loader/.vpmadt032_x86_32.o.cmd;echo : > drivers/dahdi/vpmadt032_loader/.vpmadt032_x86_64.o.cmd;make)" +MAKE[0]="(make modules KVERS=$kernelver MODULES_EXTRA='dahdi_dummy wcopenpci dahdi_echocan_oslec' SUBDIRS_EXTRA='../staging/echo zaphfc/'; make KVERS=$kernelver; make KVERS=$kernelver firmware-loaders;echo : > drivers/dahdi/vpmadt032_loader/.vpmadt032_x86_32.o.cmd; echo : > drivers/dahdi/vpmadt032_loader/.vpmadt032_x86_64.o.cmd; make KVERS=$kernelver)" #Do not make clean, because Sangoma drivers need Module.symvers CLEAN="/bin/true" #CLEAN="make KERNVER=$kernelver clean" diff -Nru dahdi-linux-2.5.0.1+dfsg/debian/patches/kernel-v3-11-compat.patch dahdi-linux-2.5.0.1+dfsg/debian/patches/kernel-v3-11-compat.patch --- dahdi-linux-2.5.0.1+dfsg/debian/patches/kernel-v3-11-compat.patch 2014-11-14 10:01:52.000000000 +0000 +++ dahdi-linux-2.5.0.1+dfsg/debian/patches/kernel-v3-11-compat.patch 2014-12-09 20:15:43.000000000 +0000 @@ -9,8 +9,8 @@ Index: dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/dahdi-base.c =================================================================== ---- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/dahdi-base.c 2011-07-21 17:26:31.000000000 +0100 -+++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/dahdi-base.c 2013-08-03 14:56:17.105260455 +0100 +--- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/dahdi-base.c 2014-12-09 20:20:44.233785860 +0100 ++++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/dahdi-base.c 2014-12-09 20:20:44.225785860 +0100 @@ -896,7 +896,11 @@ static int dahdi_seq_show(struct seq_fil static int dahdi_proc_open(struct inode *inode, struct file *file) @@ -61,8 +61,8 @@ span_sysfs_remove(span); Index: dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/dahdi_dynamic_ethmf.c =================================================================== ---- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/dahdi_dynamic_ethmf.c 2011-01-03 18:26:29.000000000 +0000 -+++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/dahdi_dynamic_ethmf.c 2013-08-03 15:36:48.157158324 +0100 +--- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/dahdi_dynamic_ethmf.c 2014-12-09 20:20:44.233785860 +0100 ++++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/dahdi_dynamic_ethmf.c 2014-12-09 20:20:44.225785860 +0100 @@ -722,6 +722,8 @@ static void timer_callback(unsigned long #ifdef USE_PROC_FS static struct proc_dir_entry *proc_entry; @@ -158,8 +158,8 @@ } Index: dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/wcb4xxp/base.c =================================================================== ---- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/wcb4xxp/base.c 2011-07-22 18:56:07.000000000 +0100 -+++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/wcb4xxp/base.c 2013-08-05 13:53:23.587048123 +0100 +--- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/wcb4xxp/base.c 2014-12-09 20:20:44.233785860 +0100 ++++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/wcb4xxp/base.c 2014-12-09 20:20:44.229785860 +0100 @@ -35,7 +35,10 @@ #include #include /* dev_err() */ @@ -173,8 +173,8 @@ #include /* timer_struct */ Index: dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/card_bri.c =================================================================== ---- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/card_bri.c 2011-07-04 15:05:19.000000000 +0100 -+++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/card_bri.c 2013-08-05 10:59:03.091487578 +0100 +--- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/card_bri.c 2014-12-09 20:20:44.233785860 +0100 ++++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/card_bri.c 2014-12-09 20:20:44.229785860 +0100 @@ -160,7 +160,27 @@ static int write_state_register(xpd_t *x static bool bri_packet_is_valid(xpacket_t *pack); static void bri_packet_dump(const char *msg, xpacket_t *pack); @@ -289,8 +289,8 @@ static DRIVER_ATTR_READER(dchan_hardhdlc_show, drv,buf) Index: dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/card_fxo.c =================================================================== ---- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/card_fxo.c 2011-06-28 19:23:00.000000000 +0100 -+++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/card_fxo.c 2013-08-05 11:35:30.675395676 +0100 +--- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/card_fxo.c 2014-12-09 20:20:44.233785860 +0100 ++++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/card_fxo.c 2014-12-09 20:20:44.229785860 +0100 @@ -86,11 +86,43 @@ enum fxo_leds { static bool fxo_packet_is_valid(xpacket_t *pack); static void fxo_packet_dump(const char *msg, xpacket_t *pack); @@ -371,11 +371,30 @@ static int proc_fxo_info_read(char *page, char **start, off_t off, int count, int *eof, void *data) { int len = 0; -@@ -1308,7 +1351,143 @@ static int proc_xpd_metering_read(char * +@@ -1260,7 +1303,7 @@ static int proc_fxo_info_read(char *page + for_each_line(xpd, i) { + len += sprintf(page + len, "%4d ", priv->metering_count[i]); + } +-#endif ++#endif /* WITH_METERING */ + len += sprintf(page + len, "\n"); + spin_unlock_irqrestore(&xpd->lock, flags); + if (len <= off+count) +@@ -1273,7 +1316,6 @@ static int proc_fxo_info_read(char *page + len = 0; + return len; + } +-#endif + + #ifdef WITH_METERING + static int proc_xpd_metering_read(char *page, char **start, off_t off, int count, int *eof, void *data) +@@ -1308,7 +1350,144 @@ static int proc_xpd_metering_read(char * priv->metering_count[i] = 0; return len; } -+#else +-#endif ++#endif /* WITH_METERING */ ++#else /* KERNEL_VERSION */ + +static int fxo_proc_read(struct seq_file *m, void *v) +{ @@ -479,7 +498,7 @@ + for_each_line(xpd, i) { + seq_printf(m, "%4d ", priv->metering_count[i]); + } - #endif ++#endif /* WITH_METERING */ + seq_printf(m, "\n"); + spin_unlock_irqrestore(&xpd->lock, flags); + return 0; @@ -517,9 +536,9 @@ { Index: dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/card_fxs.c =================================================================== ---- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/card_fxs.c 2013-08-03 13:48:31.000000000 +0100 -+++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/card_fxs.c 2013-08-05 11:58:05.539338756 +0100 -@@ -108,11 +108,42 @@ enum fxs_state { +--- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/card_fxs.c 2014-12-09 20:20:44.233785860 +0100 ++++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/card_fxs.c 2014-12-09 21:15:37.717753744 +0100 +@@ -108,11 +108,20 @@ enum fxs_state { static bool fxs_packet_is_valid(xpacket_t *pack); static void fxs_packet_dump(const char *msg, xpacket_t *pack); #ifdef CONFIG_PROC_FS @@ -532,38 +551,16 @@ +#else +#include + -+static int fxs_info_read(struct seq_file *m, void *v); -+ -+static int fxs_info_open(struct inode *inode, struct file *file) -+{ -+ return single_open(file, fxs_info_read, PDE_DATA(inode)); -+} -+static const struct file_operations fxs_info_fops = { -+ .open = fxs_info_open, -+ .read = seq_read, -+ .llseek = seq_lseek, -+ .release = seq_release, -+}; -+#if 0 -+static int fxs_metering_read(struct seq_file *m, void *v); -+ -+static int fxs_metering_open(struct inode *inode, struct file *file) -+{ -+ return single_open(file, fxs_metering_read, PDE_DATA(inode)); -+} -+static const struct file_operations fxs_metering_fops = { -+ .open = fxs_metering_open, -+ .read = seq_read, -+ .llseek = seq_lseek, -+ .release = seq_release, -+}; ++static const struct file_operations proc_fxs_info_ops; ++#ifdef WITH_METERING ++static const struct file_operations proc_xpd_metering_ops; +#endif /* WITH_METERING */ +#endif /* KERNEL_VERSION */ +#endif /* PROCFS */ static void start_stop_vm_led(xbus_t *xbus, xpd_t *xpd, lineno_t pos); #define PROC_REGISTER_FNAME "slics" -@@ -354,7 +385,13 @@ static int fxs_proc_create(xbus_t *xbus, +@@ -354,7 +363,13 @@ static int fxs_proc_create(xbus_t *xbus, #ifdef CONFIG_PROC_FS XPD_DBG(PROC, xpd, "Creating FXS_INFO file\n"); @@ -571,13 +568,41 @@ priv->fxs_info = create_proc_read_entry(PROC_FXS_INFO_FNAME, 0444, xpd->proc_xpd_dir, proc_fxs_info_read, xpd); +#else + priv->fxs_info = proc_create_data(PROC_FXS_INFO_FNAME, 0444, -+ xpd->proc_xpd_dir, &fxs_info_fops, -+ xpd); ++ xpd->proc_xpd_dir, ++ &proc_fxs_info_ops, xpd); +#endif if(!priv->fxs_info) { XPD_ERR(xpd, "Failed to create proc file '%s'\n", PROC_FXS_INFO_FNAME); fxs_proc_remove(xbus, xpd); -@@ -1490,6 +1527,7 @@ static void fxs_packet_dump(const char * +@@ -363,18 +378,26 @@ static int fxs_proc_create(xbus_t *xbus, + SET_PROC_DIRENTRY_OWNER(priv->fxs_info); + #ifdef WITH_METERING + XPD_DBG(PROC, xpd, "Creating Metering tone file\n"); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) + priv->meteringfile = create_proc_entry(PROC_METERING_FNAME, 0200, xpd->proc_xpd_dir); ++#else ++ priv->meteringfile = proc_create_data(PROC_METERING_FNAME, 0200, ++ xpd->proc_xpd_dir, ++ &proc_xpd_metering_ops, xpd); ++#endif + if(!priv->meteringfile) { + XPD_ERR(xpd, "Failed to create proc file '%s'\n", PROC_METERING_FNAME); + fxs_proc_remove(xbus, xpd); + return -EINVAL; + } ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) + SET_PROC_DIRENTRY_OWNER(priv->meteringfile); + priv->meteringfile->write_proc = proc_xpd_metering_write; + priv->meteringfile->read_proc = NULL; + priv->meteringfile->data = xpd; + #endif +-#endif ++#endif /* WITH_METERING */ ++#endif /* PROC_FS */ + return 0; + } + +@@ -1490,6 +1513,7 @@ static void fxs_packet_dump(const char * /*------------------------- SLIC Handling --------------------------*/ #ifdef CONFIG_PROC_FS @@ -585,15 +610,25 @@ static int proc_fxs_info_read(char *page, char **start, off_t off, int count, int *eof, void *data) { int len = 0; -@@ -1594,6 +1632,103 @@ static int proc_xpd_metering_write(struc +@@ -1558,7 +1582,6 @@ static int proc_fxs_info_read(char *page + len = 0; + return len; + } +-#endif + + #ifdef WITH_METERING + static int proc_xpd_metering_write(struct file *file, const char __user *buffer, unsigned long count, void *data) +@@ -1594,7 +1617,132 @@ static int proc_xpd_metering_write(struc } return count; } -+#else -+static int fxs_info_read(struct seq_file *m, void *v) +-#endif ++#endif /* WITH_METERING */ ++#else /* KERNEL_VERSION */ ++static int proc_fxs_info_show(struct seq_file *m, void *v) +{ + unsigned long flags; -+ xpd_t *xpd = v; ++ xpd_t *xpd = m->private; + struct FXS_priv_data *priv; + int i; + int led; @@ -649,50 +684,78 @@ + spin_unlock_irqrestore(&xpd->lock, flags); + return 0; +} ++ ++static int proc_fxs_info_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, proc_fxs_info_show, PDE_DATA(inode)); ++} ++ ++static const struct file_operations proc_fxs_info_ops = { ++ .owner = THIS_MODULE, ++ .open = proc_fxs_info_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = single_release, ++}; ++ +#ifdef WITH_METERING -+//static int fxs_metering_read(struct seq_file *m, void *v) -+static int proc_xpd_metering_write(struct file *file, const char __user *buffer, unsigned long count, void *data) ++static ssize_t proc_xpd_metering_write(struct file *file, ++ const char __user *buffer, size_t count, loff_t *offset) +{ -+ xpd_t *xpd = data; -+ char buf[MAX_PROC_WRITE]; -+ lineno_t chan; -+ int num; -+ int ret; ++ xpd_t *xpd = file->private_data; ++ char buf[MAX_PROC_WRITE]; ++ lineno_t chan; ++ int num; ++ int ret; + -+ if(!xpd) ++ if (!xpd) + return -ENODEV; -+ if(count >= MAX_PROC_WRITE - 1) { -+ XPD_ERR(xpd, "Metering string too long (%lu)\n", count); ++ if (count >= MAX_PROC_WRITE - 1) { ++ XPD_ERR(xpd, "Metering string too long (%zu)\n", count); + return -EINVAL; + } -+ if(copy_from_user(&buf, buffer, count)) ++ if (copy_from_user(&buf, buffer, count)) + return -EFAULT; + buf[count] = '\0'; + ret = sscanf(buf, "%d", &num); -+ if(ret != 1) { -+ XPD_ERR(xpd, "Metering value should be number. Got '%s'\n", buf); ++ if (ret != 1) { ++ XPD_ERR(xpd, "Metering value should be number. Got '%s'\n", ++ buf); + return -EINVAL; + } + chan = num; -+ if(chan != PORT_BROADCAST && chan > xpd->channels) { ++ if (chan != PORT_BROADCAST && chan > xpd->channels) { + XPD_ERR(xpd, "Metering tone: bad channel number %d\n", chan); + return -EINVAL; + } -+ if((ret = metering_gen(xpd, chan, 1)) < 0) { ++ if ((ret = metering_gen(xpd, chan, 1)) < 0) { + XPD_ERR(xpd, "Failed sending metering tone\n"); + return ret; + } + return count; +} -+#endif -+#endif - #endif ++ ++static int proc_xpd_metering_open(struct inode *inode, struct file *file) ++{ ++ file->private_data = PDE_DATA(inode); ++} ++ ++static const struct file_operations proc_xpd_metering_ops = { ++ .owner = THIS_MODULE, ++ .open = proc_xpd_metering_open, ++ .write = proc_xpd_metering_write, ++ .release = single_release, ++}; ++#endif /* WITH_METERING */ ++#endif /* KERNEL_VERSION */ ++#endif /* PROC_FS */ static int fxs_xpd_probe(struct device *dev) + { Index: dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/xbus-core.c =================================================================== ---- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/xbus-core.c 2011-07-20 17:49:53.000000000 +0100 -+++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/xbus-core.c 2013-08-05 13:24:49.599120129 +0100 +--- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/xbus-core.c 2014-12-09 20:20:44.233785860 +0100 ++++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/xbus-core.c 2014-12-09 20:20:44.229785860 +0100 @@ -52,7 +52,18 @@ static const char rcsid[] = "$Id: xbus-c #ifdef PROTOCOL_DEBUG #ifdef CONFIG_PROC_FS @@ -1024,8 +1087,8 @@ ret = -EFAULT; Index: dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/xpd.h =================================================================== ---- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/xpd.h 2011-06-28 19:23:00.000000000 +0100 -+++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/xpd.h 2013-08-05 10:06:03.675621148 +0100 +--- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/xpd.h 2014-12-09 20:20:44.233785860 +0100 ++++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/xpd.h 2014-12-09 20:20:44.229785860 +0100 @@ -31,6 +31,9 @@ #include #include @@ -1056,8 +1119,8 @@ type name = init; \ Index: dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/xpp_dahdi.c =================================================================== ---- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/xpp_dahdi.c 2011-07-12 19:08:42.000000000 +0100 -+++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/xpp_dahdi.c 2013-08-05 13:26:27.439116019 +0100 +--- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/xpp_dahdi.c 2014-12-09 20:20:44.233785860 +0100 ++++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/xpp_dahdi.c 2014-12-09 20:20:44.229785860 +0100 @@ -109,7 +109,25 @@ int total_registered_spans(void) } @@ -1219,8 +1282,8 @@ const char *xpd_statename(enum xpd_state st) Index: dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/xpp_usb.c =================================================================== ---- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/xpp_usb.c 2011-06-02 21:00:36.000000000 +0100 -+++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/xpp_usb.c 2013-08-05 13:36:42.635090174 +0100 +--- dahdi-linux-2.5.0.1+dfsg.orig/drivers/dahdi/xpp/xpp_usb.c 2014-12-09 20:20:44.233785860 +0100 ++++ dahdi-linux-2.5.0.1+dfsg/drivers/dahdi/xpp/xpp_usb.c 2014-12-09 20:20:44.229785860 +0100 @@ -266,7 +266,23 @@ static void xpp_receive_callback(USB_PAS static int xusb_probe (struct usb_interface *interface, const struct usb_device_id *id); static void xusb_disconnect (struct usb_interface *interface); @@ -1338,8 +1401,8 @@ Index: dahdi-linux-2.5.0.1+dfsg/include/dahdi/kernel.h =================================================================== ---- dahdi-linux-2.5.0.1+dfsg.orig/include/dahdi/kernel.h 2013-08-03 13:48:31.000000000 +0100 -+++ dahdi-linux-2.5.0.1+dfsg/include/dahdi/kernel.h 2013-08-03 15:49:22.621126628 +0100 +--- dahdi-linux-2.5.0.1+dfsg.orig/include/dahdi/kernel.h 2014-12-09 20:20:44.233785860 +0100 ++++ dahdi-linux-2.5.0.1+dfsg/include/dahdi/kernel.h 2014-12-09 20:20:44.229785860 +0100 @@ -58,6 +58,13 @@ #include