Bug#510140: zaptel-source: Zaptel modules fail to build under etch-and-a-half

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sat Jan 10 20:06:08 UTC 2009


On Mon, Dec 29, 2008 at 12:29:57PM -0600, Karl Schmidt wrote:
> Package: zaptel-source
> Version: 1:1.4.11~dfsg-3
> Severity: important
> 
> I have a Wildcard X100P (uses wct1xxp module)  that has just stopped 
> working on upgrading the kernel to 2.6.24-etchnhalf.1-amd64
> 
> I updated to 2.6.24-etchnhalf.1-amd64 and would not build zaptel-source 
> 1:1.2.11.dfsg-1 (See build log below) , so I loaded 1:1.4.11~dfsg-3 
> which would build but still won't work as shown below.

OK. First set of patches. This goes as far as getting the modules
shipped with Zaptel built . We still need to extend those to the other
modules we ship.

All of them are rather trivial backports of upstream changes. But then
again I see that the size of my message is 23k .

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir
-------------- next part --------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## Makefile_clean.dpatch by Tzafrir Cohen <tzafrir.cohen at xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad zaptel-1.2.11.dfsg~/Makefile zaptel-1.2.11.dfsg/Makefile
--- zaptel-1.2.11.dfsg~/Makefile	2009-01-10 20:43:44.000000000 +0200
+++ zaptel-1.2.11.dfsg/Makefile	2009-01-10 20:44:33.000000000 +0200
@@ -182,7 +182,7 @@
 linux26: prereq $(BINS)
 	@echo $(KSRC)
 	@if [ -z "$(KSRC)" -o ! -d "$(KSRC)" ]; then echo "You do not appear to have the sources for the $(KVERS) kernel installed."; exit 1 ; fi
-	$(MAKE) -C $(KSRC) SUBDIRS=$(PWD) modules
+	$(KMAKE) modules
 
 version.h: FORCE
 	ZAPTELVERSION="${ZAPTELVERSION}" build_tools/make_version_h > $@.tmp
@@ -470,7 +470,7 @@
 	rm -f *.o ztcfg tzdriver sethdlc sethdlc-new
 	rm -f $(TZOBJS) $(LIBTONEZONE_SO) *.lo
 ifeq ($(BUILDVER),linux26)
-	$(MAKE) -C $(KSRC) SUBDIRS=$(PWD) clean
+	$(KMAKE) clean
 else
 	$(MAKE) -C wct4xxp clean
 endif
-------------- next part --------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## Makefile_cflags.dpatch by Tzafrir Cohen <tzafrir.cohen at xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: We shouldn't pass CFLAGS to Kbuild . And 2.6.24 even complains
## DP: about it.
## DP: Sadly the fix for that is too complex. So let's pretend this is
## DP: not a problem and hope for the best.
## DP: Also sets the actual required CFLAGS values in EXTRA_CFLAGS.

@DPATCH@
diff -urNad zaptel-1.2.11.dfsg~/Makefile zaptel-1.2.11.dfsg/Makefile
--- zaptel-1.2.11.dfsg~/Makefile	2009-01-10 21:00:09.000000000 +0200
+++ zaptel-1.2.11.dfsg/Makefile	2009-01-10 21:00:55.000000000 +0200
@@ -62,7 +62,8 @@
 
 KFLAGS+=-DSTANDALONE_ZAPATA
 CFLAGS+=-DSTANDALONE_ZAPATA
-KMAKE:= $(MAKE) -C $(KSRC) SUBDIRS=$(PWD)
+EXTRA_CFLAGS	:= -DSTANDALONE_ZAPATA
+KMAKE:= $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) KBUILD_NOPEDANTIC=yes
 KMAKE_INST:= $(KMAKE) INSTALL_MOD_PATH=$(INSTALL_PREFIX) INSTALL_MOD_DIR=misc modules_install
 
 CONFIG_FILE:=$(INSTALL_PREFIX)/etc/zaptel.conf
-------------- next part --------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## zapirq_2619.dpatch by Tzafrir Cohen <tzafrir.cohen at xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Adds a function type ZAP_IRQ_HANDLER to provide compatibilty
## DP: for changes in kernel 2.6.19 .
## DP:
## DP: Upstream: http://svn.digium.com/view/zaptel?view=revision&revision=1697

@DPATCH@
diff -urNad zaptel-1.2.11.dfsg~/pciradio.c zaptel-1.2.11.dfsg/pciradio.c
--- zaptel-1.2.11.dfsg~/pciradio.c	2009-01-10 21:11:34.000000000 +0200
+++ zaptel-1.2.11.dfsg/pciradio.c	2009-01-10 21:13:01.000000000 +0200
@@ -712,11 +712,7 @@
 static void pciradio_reset_serial(struct pciradio *rad);
 static void pciradio_restart_dma(struct pciradio *rad);
 
-#ifdef LINUX26
-static irqreturn_t pciradio_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#else
-static void pciradio_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#endif
+ZAP_IRQ_HANDLER(pciradio_interrupt)
 {
 	struct pciradio *rad = dev_id;
 	unsigned char ints,byte1,byte2,gotcor,gotctcss,gotslowctcss,ctcss;
diff -urNad zaptel-1.2.11.dfsg~/tor2.c zaptel-1.2.11.dfsg/tor2.c
--- zaptel-1.2.11.dfsg~/tor2.c	2009-01-10 21:11:34.000000000 +0200
+++ zaptel-1.2.11.dfsg/tor2.c	2009-01-10 21:13:01.000000000 +0200
@@ -190,12 +190,7 @@
 static int tor2_rbsbits(struct zt_chan *chan, int bits);
 static int tor2_maint(struct zt_span *span, int cmd);
 static int tor2_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data);
-#ifdef LINUX26
-static irqreturn_t tor2_intr(int irq, void *dev_id, struct pt_regs *regs);
-#else
-static void tor2_intr(int irq, void *dev_id, struct pt_regs *regs);
-#endif
-
+ZAP_IRQ_HANDLER(tor2_intr);
 
 /* translations of data channels for 24 channels in a 32 bit PCM highway */
 unsigned datxlt_t1[] = { 
@@ -1188,11 +1183,7 @@
 	return 0;
 }
 
-#ifdef LINUX26
-static irqreturn_t tor2_intr(int irq, void *dev_id, struct pt_regs *regs)
-#else
-static void tor2_intr(int irq, void *dev_id, struct pt_regs *regs)
-#endif
+ZAP_IRQ_HANDLER(tor2_intr)
 {
 	int n, i, j, k, syncsrc;
 	unsigned int rxword,txword;
diff -urNad zaptel-1.2.11.dfsg~/torisa.c zaptel-1.2.11.dfsg/torisa.c
--- zaptel-1.2.11.dfsg~/torisa.c	2009-01-10 21:11:34.000000000 +0200
+++ zaptel-1.2.11.dfsg/torisa.c	2009-01-10 21:13:01.000000000 +0200
@@ -744,11 +744,7 @@
 
 static int txerrors;
 
-#ifdef LINUX26
-static irqreturn_t torisa_intr(int irq, void *dev_id, struct pt_regs *regs)
-#else
-static void torisa_intr(int irq, void *dev_id, struct pt_regs *regs)
-#endif
+ZAP_IRQ_HANDLER(torisa_intr)
 {
 	static unsigned int passno = 0, mysynccnt = 0, lastsyncsrc = -1;
 	int n, n1, i, j, k, x, mysyncsrc, oldn;
diff -urNad zaptel-1.2.11.dfsg~/wcfxo.c zaptel-1.2.11.dfsg/wcfxo.c
--- zaptel-1.2.11.dfsg~/wcfxo.c	2009-01-10 21:11:34.000000000 +0200
+++ zaptel-1.2.11.dfsg/wcfxo.c	2009-01-10 21:13:01.000000000 +0200
@@ -396,11 +396,7 @@
 static void wcfxo_stop_dma(struct wcfxo *wc);
 static void wcfxo_restart_dma(struct wcfxo *wc);
 
-#ifdef LINUX26
-static irqreturn_t wcfxo_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#else
-static void wcfxo_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#endif
+ZAP_IRQ_HANDLER(wcfxo_interrupt)
 {
 	struct wcfxo *wc = dev_id;
 	unsigned char ints;
diff -urNad zaptel-1.2.11.dfsg~/wct1xxp.c zaptel-1.2.11.dfsg/wct1xxp.c
--- zaptel-1.2.11.dfsg~/wct1xxp.c	2009-01-10 21:11:34.000000000 +0200
+++ zaptel-1.2.11.dfsg/wct1xxp.c	2009-01-10 21:13:01.000000000 +0200
@@ -1126,11 +1126,7 @@
 	}
 }
 
-#ifdef LINUX26
-static irqreturn_t t1xxp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#else
-static void t1xxp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#endif
+ZAP_IRQ_HANDLER(t1xxp_interrupt)
 {
 	struct t1xxp *wc = dev_id;
 	unsigned char ints;
diff -urNad zaptel-1.2.11.dfsg~/wct4xxp/base.c zaptel-1.2.11.dfsg/wct4xxp/base.c
--- zaptel-1.2.11.dfsg~/wct4xxp/base.c	2009-01-10 21:11:34.000000000 +0200
+++ zaptel-1.2.11.dfsg/wct4xxp/base.c	2009-01-10 21:13:01.000000000 +0200
@@ -2238,11 +2238,7 @@
 }
 
 #ifdef SUPPORT_GEN1
-#ifdef LINUX26
-static irqreturn_t t4_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#else
-static void t4_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#endif
+ZAP_IRQ_HANDLER(t4_interrupt)
 {
 	struct t4 *wc = dev_id;
 	unsigned long flags;
@@ -2395,11 +2391,7 @@
 	}
 }
 
-#ifdef LINUX26
-static irqreturn_t t4_interrupt_gen2(int irq, void *dev_id, struct pt_regs *regs)
-#else
-static void t4_interrupt_gen2(int irq, void *dev_id, struct pt_regs *regs)
-#endif
+ZAP_IRQ_HANDLER(t4_interrupt_gen2)
 {
 	struct t4 *wc = dev_id;
 	unsigned long flags;
diff -urNad zaptel-1.2.11.dfsg~/wctdm.c zaptel-1.2.11.dfsg/wctdm.c
--- zaptel-1.2.11.dfsg~/wctdm.c	2009-01-10 21:11:34.000000000 +0200
+++ zaptel-1.2.11.dfsg/wctdm.c	2009-01-10 21:13:01.000000000 +0200
@@ -1024,11 +1024,7 @@
 	wc->mod[card].fxs.lastrxhook = hook;
 }
 
-#ifdef LINUX26
-static irqreturn_t wctdm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#else
-static void wctdm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#endif
+ZAP_IRQ_HANDLER(wctdm_interrupt)
 {
 	struct wctdm *wc = dev_id;
 	unsigned char ints;
diff -urNad zaptel-1.2.11.dfsg~/wctdm24xxp.c zaptel-1.2.11.dfsg/wctdm24xxp.c
--- zaptel-1.2.11.dfsg~/wctdm24xxp.c	2009-01-10 21:11:34.000000000 +0200
+++ zaptel-1.2.11.dfsg/wctdm24xxp.c	2009-01-10 21:13:01.000000000 +0200
@@ -1422,11 +1422,7 @@
 	}	
 }
 
-#ifdef LINUX26
-static irqreturn_t wctdm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#else
-static void wctdm_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#endif
+ZAP_IRQ_HANDLER(wctdm_interrupt)
 {
 	struct wctdm *wc = dev_id;
 	unsigned int ints;
diff -urNad zaptel-1.2.11.dfsg~/wcte11xp.c zaptel-1.2.11.dfsg/wcte11xp.c
--- zaptel-1.2.11.dfsg~/wcte11xp.c	2009-01-10 21:11:34.000000000 +0200
+++ zaptel-1.2.11.dfsg/wcte11xp.c	2009-01-10 21:13:01.000000000 +0200
@@ -1257,11 +1257,7 @@
 	}
 }
 
-#ifdef LINUX26
-static irqreturn_t t1xxp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#else
-static void t1xxp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
-#endif
+ZAP_IRQ_HANDLER(t1xxp_interrupt)
 {
 	struct t1 *wc = dev_id;
 	unsigned char ints;
diff -urNad zaptel-1.2.11.dfsg~/wcusb.c zaptel-1.2.11.dfsg/wcusb.c
--- zaptel-1.2.11.dfsg~/wcusb.c	2006-01-19 06:40:26.000000000 +0200
+++ zaptel-1.2.11.dfsg/wcusb.c	2009-01-10 21:13:01.000000000 +0200
@@ -184,7 +184,7 @@
 }					  
 
 #ifdef USB2420
-#ifdef LINUX26
+#if defined(LINUX26) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
 static int wcusb_async_read(struct wc_usb_pvt *p, unsigned char index, unsigned char *data, int len, int state, void (*complete)(struct urb *urb, struct pt_regs *regs));
 static int wcusb_async_write(struct wc_usb_pvt *p, unsigned char index, unsigned char *data, int len, int state, void (*complete)(struct urb *urb, struct pt_regs *regs));
 static void wcusb_async_control(struct urb *urb, struct pt_regs *regs);
@@ -220,7 +220,7 @@
 }
 
 #ifdef USB2420
-#ifdef LINUX26
+#if defined(LINUX26) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
 static void wcusb_async_control(struct urb *urb, struct pt_regs *regs)
 #else
 static void wcusb_async_control(struct urb *urb)
@@ -312,7 +312,7 @@
 }
 
 #ifdef USB2420
-#ifdef LINUX26
+#if defined(LINUX26) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
 static void keypad_check_done(struct urb *urb, struct pt_regs *regs)
 #else
 static void keypad_check_done(struct urb *urb)
@@ -429,7 +429,7 @@
 }
 
 #ifdef USB2420
-#ifdef LINUX26
+#if defined(LINUX26) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
 static int wcusb_async_read(struct wc_usb_pvt *p, unsigned char index, unsigned char *data, int len, int state, void (*complete)(struct urb *urb, struct pt_regs *regs))
 #else
 static int wcusb_async_read(struct wc_usb_pvt *p, unsigned char index, unsigned char *data, int len, int state, void (*complete)(struct urb *urb))
@@ -477,7 +477,7 @@
 }
 
 #ifdef USB2420
-#ifdef LINUX26
+#if defined(LINUX26) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
 static int wcusb_async_write(struct wc_usb_pvt *p, unsigned char index, unsigned char *data, int len, int state, void (*complete)(struct urb *urb, struct pt_regs *regs))
 #else
 static int wcusb_async_write(struct wc_usb_pvt *p, unsigned char index, unsigned char *data, int len, int state, void (*complete)(struct urb *urb))
@@ -883,7 +883,7 @@
 	return ZT_LIN2MU(linsample);
 }
 
-#ifdef LINUX26
+#if defined(LINUX26)  && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
 static void wcusb_read_complete(struct urb *q, struct pt_regs *regs)
 #else
 static void wcusb_read_complete(struct urb *q)
@@ -949,7 +949,7 @@
 	return;
 }
 
-#ifdef LINUX26
+#if defined(LINUX26) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19))
 static void wcusb_write_complete(struct urb *q, struct pt_regs *regs)
 #else
 static void wcusb_write_complete(struct urb *q)
diff -urNad zaptel-1.2.11.dfsg~/zaptel.h zaptel-1.2.11.dfsg/zaptel.h
--- zaptel-1.2.11.dfsg~/zaptel.h	2009-01-10 21:11:34.000000000 +0200
+++ zaptel-1.2.11.dfsg/zaptel.h	2009-01-10 21:13:01.000000000 +0200
@@ -66,6 +66,16 @@
 #define ZAP_IRQ_SHARED_DISABLED SA_SHIRQ | SA_INTERRUPT
 #endif
 
+#ifdef LINUX26
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
+#define ZAP_IRQ_HANDLER(a) static irqreturn_t a(int irq, void *dev_id)
+#else
+#define ZAP_IRQ_HANDLER(a) static irqreturn_t a(int irq, void *dev_id, struct pt_regs *regs)
+#endif
+#else
+#define ZAP_IRQ_HANDLER(a) static void a(int irq, void *dev_id, struct pt_regs *regs)
+#endif
+
 #include "ecdis.h"
 #include "fasthdlc.h"
 #endif
-------------- next part --------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## zapirq_2622.dpatch by Tzafrir Cohen <tzafrir.cohen at xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix compatibility issue with kernels >= 2.6.22: slightly
## DP: different interface to request_irq . The constants ZAP_IRQ_*
## DP: have been introduced to avoid duplicating ifdef-s all over.
## DP:
## DP: Upstream fix: 
## DP: http://svn.digium.com/view/zaptel?view=revision&revision=2756
## DP: (Patch to wctdm24xxp.c was slightly edited)

@DPATCH@
diff -urNad zaptel-1.2.11.dfsg~/pciradio.c zaptel-1.2.11.dfsg/pciradio.c
--- zaptel-1.2.11.dfsg~/pciradio.c	2006-09-08 06:17:16.000000000 +0300
+++ zaptel-1.2.11.dfsg/pciradio.c	2009-01-10 19:29:08.000000000 +0200
@@ -1715,7 +1715,7 @@
 
 			}
 
-			if (request_irq(pdev->irq, pciradio_interrupt, SA_SHIRQ, "pciradio", rad)) {
+			if (request_irq(pdev->irq, pciradio_interrupt, ZAP_IRQ_SHARED, "pciradio", rad)) {
 				printk("pciradio: Unable to request IRQ %d\n", pdev->irq);
 				if (rad->freeregion)
 					release_region(rad->ioaddr, 0xff);
diff -urNad zaptel-1.2.11.dfsg~/tor2.c zaptel-1.2.11.dfsg/tor2.c
--- zaptel-1.2.11.dfsg~/tor2.c	2005-11-29 20:42:08.000000000 +0200
+++ zaptel-1.2.11.dfsg/tor2.c	2009-01-10 19:29:08.000000000 +0200
@@ -541,7 +541,7 @@
 	for (x = 0; x < 256; x++) tor->mem32[x] = 0x7f7f7f7f;
 
 
-	if (request_irq(tor->irq, tor2_intr, SA_INTERRUPT | SA_SHIRQ, "tor2", tor)) {
+	if (request_irq(tor->irq, tor2_intr, ZAP_IRQ_SHARED_DISABLED, "tor2", tor)) {
 		printk(KERN_ERR "Unable to request tormenta IRQ %d\n", tor->irq);
 		goto err_out_release_all;
 	}
diff -urNad zaptel-1.2.11.dfsg~/torisa.c zaptel-1.2.11.dfsg/torisa.c
--- zaptel-1.2.11.dfsg~/torisa.c	2006-10-20 03:23:26.000000000 +0200
+++ zaptel-1.2.11.dfsg/torisa.c	2009-01-10 19:29:08.000000000 +0200
@@ -1074,7 +1074,7 @@
 		printk(KERN_ERR "No ISA tormenta card found at %05lx\n", base);
 		return -EIO;
 	}
-	if (request_irq(irq, torisa_intr, SA_INTERRUPT, "torisa", NULL)) {
+	if (request_irq(irq, torisa_intr, ZAP_IRQ_DISABLED, "torisa", NULL)) {
 		printk(KERN_ERR "Unable to request tormenta IRQ %d\n", irq);
 		return -EIO;
 	}
diff -urNad zaptel-1.2.11.dfsg~/wcfxo.c zaptel-1.2.11.dfsg/wcfxo.c
--- zaptel-1.2.11.dfsg~/wcfxo.c	2005-11-29 20:42:08.000000000 +0200
+++ zaptel-1.2.11.dfsg/wcfxo.c	2009-01-10 19:29:08.000000000 +0200
@@ -898,7 +898,7 @@
 			/* Keep track of which device we are */
 			pci_set_drvdata(pdev, wc);
 
-			if (request_irq(pdev->irq, wcfxo_interrupt, SA_SHIRQ, "wcfxo", wc)) {
+			if (request_irq(pdev->irq, wcfxo_interrupt, ZAP_IRQ_SHARED, "wcfxo", wc)) {
 				printk("wcfxo: Unable to request IRQ %d\n", pdev->irq);
 				if (wc->freeregion)
 					release_region(wc->ioaddr, 0xff);
diff -urNad zaptel-1.2.11.dfsg~/wct1xxp.c zaptel-1.2.11.dfsg/wct1xxp.c
--- zaptel-1.2.11.dfsg~/wct1xxp.c	2005-11-29 20:42:08.000000000 +0200
+++ zaptel-1.2.11.dfsg/wct1xxp.c	2009-01-10 19:29:08.000000000 +0200
@@ -1301,7 +1301,7 @@
 			/* Keep track of which device we are */
 			pci_set_drvdata(pdev, wc);
 
-			if (request_irq(pdev->irq, t1xxp_interrupt, SA_INTERRUPT | SA_SHIRQ, "t1xxp", wc)) {
+			if (request_irq(pdev->irq, t1xxp_interrupt, ZAP_IRQ_SHARED_DISABLED, "t1xxp", wc)) {
 				printk("t1xxp: Unable to request IRQ %d\n", pdev->irq);
 				kfree(wc);
 				return -EIO;
diff -urNad zaptel-1.2.11.dfsg~/wct1xxp.c.orig zaptel-1.2.11.dfsg/wct1xxp.c.orig
diff -urNad zaptel-1.2.11.dfsg~/wct4xxp/base.c zaptel-1.2.11.dfsg/wct4xxp/base.c
--- zaptel-1.2.11.dfsg~/wct4xxp/base.c	2006-11-09 01:04:33.000000000 +0200
+++ zaptel-1.2.11.dfsg/wct4xxp/base.c	2009-01-10 19:29:08.000000000 +0200
@@ -3188,14 +3188,14 @@
 
 
 #ifdef SUPPORT_GEN1
-			if (request_irq(pdev->irq, (dt->flags & FLAG_2NDGEN) ? t4_interrupt_gen2 :t4_interrupt, SA_INTERRUPT | SA_SHIRQ, (wc->numspans == 2) ? "wct2xxp" : "wct4xxp", wc)) 
+			if (request_irq(pdev->irq, (dt->flags & FLAG_2NDGEN) ? t4_interrupt_gen2 :t4_interrupt, ZAP_IRQ_SHARED_DISABLED, (wc->numspans == 2) ? "wct2xxp" : "wct4xxp", wc)) 
 #else
 			if (!(wc->tspans[0]->spanflags & FLAG_2NDGEN)) {
 				printk("This driver does not support 1st gen modules\n");
 				kfree(wc);
 				return -ENODEV;
 			}	
-			if (request_irq(pdev->irq, t4_interrupt_gen2, SA_INTERRUPT | SA_SHIRQ, "t4xxp", wc)) 
+			if (request_irq(pdev->irq, t4_interrupt_gen2, ZAP_IRQ_SHARED_DISABLED, "t4xxp", wc)) 
 #endif
 			{
 				printk("t4xxp: Unable to request IRQ %d\n", pdev->irq);
diff -urNad zaptel-1.2.11.dfsg~/wctdm.c zaptel-1.2.11.dfsg/wctdm.c
--- zaptel-1.2.11.dfsg~/wctdm.c	2006-10-26 01:54:41.000000000 +0200
+++ zaptel-1.2.11.dfsg/wctdm.c	2009-01-10 19:29:08.000000000 +0200
@@ -2239,7 +2239,7 @@
 			/* Keep track of which device we are */
 			pci_set_drvdata(pdev, wc);
 
-			if (request_irq(pdev->irq, wctdm_interrupt, SA_SHIRQ, "wctdm", wc)) {
+			if (request_irq(pdev->irq, wctdm_interrupt, ZAP_IRQ_SHARED, "wctdm", wc)) {
 				printk("wctdm: Unable to request IRQ %d\n", pdev->irq);
 				if (wc->freeregion)
 					release_region(wc->ioaddr, 0xff);
diff -urNad zaptel-1.2.11.dfsg~/wctdm24xxp.c zaptel-1.2.11.dfsg/wctdm24xxp.c
--- zaptel-1.2.11.dfsg~/wctdm24xxp.c	2006-10-26 02:00:31.000000000 +0200
+++ zaptel-1.2.11.dfsg/wctdm24xxp.c	2009-01-10 19:29:08.000000000 +0200
@@ -2748,7 +2748,7 @@
 			/* Keep track of which device we are */
 			pci_set_drvdata(pdev, wc);
 
-			if (request_irq(pdev->irq, wctdm_interrupt, SA_SHIRQ, "wctdm24xxp", wc)) {
+			if (request_irq(pdev->irq, wctdm_interrupt, ZAP_IRQ_SHARED, "wctdm24xxp", wc)) {
 				printk("wctdm: Unable to request IRQ %d\n", pdev->irq);
 				if (wc->freeregion)
 					release_region(wc->iobase, 0xff);
diff -urNad zaptel-1.2.11.dfsg~/wcte11xp.c zaptel-1.2.11.dfsg/wcte11xp.c
--- zaptel-1.2.11.dfsg~/wcte11xp.c	2006-11-09 01:04:33.000000000 +0200
+++ zaptel-1.2.11.dfsg/wcte11xp.c	2009-01-10 19:29:08.000000000 +0200
@@ -1456,7 +1456,7 @@
 			/* Keep track of which device we are */
 			pci_set_drvdata(pdev, wc);
 
-			if (request_irq(pdev->irq, t1xxp_interrupt, SA_INTERRUPT | SA_SHIRQ, "wcte11xp", wc)) {
+			if (request_irq(pdev->irq, t1xxp_interrupt, ZAP_IRQ_SHARED_DISABLED, "wcte11xp", wc)) {
 				printk("wcte11xp: Unable to request IRQ %d\n", pdev->irq);
 				kfree(wc);
 				return -EIO;
diff -urNad zaptel-1.2.11.dfsg~/zaptel.h zaptel-1.2.11.dfsg/zaptel.h
--- zaptel-1.2.11.dfsg~/zaptel.h	2009-01-10 19:17:00.000000000 +0200
+++ zaptel-1.2.11.dfsg/zaptel.h	2009-01-10 19:29:08.000000000 +0200
@@ -56,6 +56,16 @@
 #define zap_pci_module pci_module_init
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+#define ZAP_IRQ_SHARED IRQF_SHARED
+#define ZAP_IRQ_DISABLED IRQF_DISABLED
+#define ZAP_IRQ_SHARED_DISABLED IRQF_SHARED | IRQF_DISABLED
+#else
+#define ZAP_IRQ_SHARED SA_SHIRQ
+#define ZAP_IRQ_DISABLED SA_INTERRUPT
+#define ZAP_IRQ_SHARED_DISABLED SA_SHIRQ | SA_INTERRUPT
+#endif
+
 #include "ecdis.h"
 #include "fasthdlc.h"
 #endif
diff -urNad zaptel-1.2.11.dfsg~/ztdummy.c zaptel-1.2.11.dfsg/ztdummy.c
--- zaptel-1.2.11.dfsg~/ztdummy.c	2006-01-26 02:45:51.000000000 +0200
+++ zaptel-1.2.11.dfsg/ztdummy.c	2009-01-10 19:29:08.000000000 +0200
@@ -265,13 +265,13 @@
     irq=s->irq;
     spin_lock_irq(&mylock);
     free_irq(s->irq, s);	/* remove uhci_interrupt temporaly */
-    if (request_irq (irq, ztdummy_interrupt, SA_SHIRQ, "ztdummy", ztd)) {
+    if (request_irq (irq, ztdummy_interrupt, ZAP_IRQ_SHARED, "ztdummy", ztd)) {
     	spin_unlock_irq(&mylock);
 		err("Our request_irq %d failed!",irq);
 		kfree(ztd);
 		return -EIO;
     }		/* we add our handler first, to assure, that our handler gets called first */
-    if (request_irq (irq, uhci_interrupt, SA_SHIRQ, s->uhci_pci->driver->name, s)) {
+    if (request_irq (irq, uhci_interrupt, ZAP_IRQ_SHARED, s->uhci_pci->driver->name, s)) {
         spin_unlock_irq(&mylock);
 		err("Original request_irq %d failed!",irq);
     }
-------------- next part --------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## zapirq_wctdm24xxp.dpatch by Tzafrir Cohen <tzafrir.cohen at xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: wctdm24xxp.c accidentally missed using a compatibility macro.
## DP: Also fixed in upstream rev. 2765 .

@DPATCH@
diff -urNad zaptel-1.2.11.dfsg~/wctdm24xxp.c zaptel-1.2.11.dfsg/wctdm24xxp.c
--- zaptel-1.2.11.dfsg~/wctdm24xxp.c	2009-01-10 21:34:27.000000000 +0200
+++ zaptel-1.2.11.dfsg/wctdm24xxp.c	2009-01-10 21:35:36.000000000 +0200
@@ -2861,7 +2861,7 @@
 		return -ENODEV;
 	}
 
-	res = pci_module_init(&wctdm_driver);
+	res = zap_pci_module(&wctdm_driver);
 	if (res)
 		return -ENODEV;
 	return 0;
-------------- next part --------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## netdev_2622.dpatch by Tzafrir Cohen <tzafrir.cohen at xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix ztd-eth.c for network interface changes in 2.6.22.
## DP: Upstream: http://svn.digium.com/view/zaptel?view=revision&revision=2675

@DPATCH@
diff -urNad zaptel-1.2.11.dfsg~/ztd-eth.c zaptel-1.2.11.dfsg/ztd-eth.c
--- zaptel-1.2.11.dfsg~/ztd-eth.c	2005-11-29 20:42:08.000000000 +0200
+++ zaptel-1.2.11.dfsg/ztd-eth.c	2009-01-10 21:44:36.000000000 +0200
@@ -88,7 +88,11 @@
 {
 	struct zt_span *span;
 	struct ztdeth_header *zh;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+	zh = (struct ztdeth_header *)skb_network_header(skb);
+#else
 	zh = (struct ztdeth_header *)skb->nh.raw;
+#endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,9)
 	span = ztdeth_getspan(eth_hdr(skb)->h_source, zh->subaddr);
 #else
@@ -167,7 +171,11 @@
 
 			/* Setup protocol and such */
 			skb->protocol = __constant_htons(ETH_P_ZTDETH);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
+			skb_set_network_header(skb, 0);
+#else
 			skb->nh.raw = skb->data;
+#endif
 			skb->dev = dev;
 			if (dev->hard_header)
 				dev->hard_header(skb, dev, ETH_P_ZTDETH, addr, dev->dev_addr, skb->len);
-------------- next part --------------
#! /bin/sh /usr/share/dpatch/dpatch-run
## netdev_2624.dpatch by Tzafrir Cohen <tzafrir.cohen at xorcom.com>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix ztd-eth.c for network interface changes in 2.6.24.
## DP: Upstream: http://svn.digium.com/view/zaptel?view=revision&revision=3577

@DPATCH@
diff -urNad zaptel-1.2.11.dfsg~/ztd-eth.c zaptel-1.2.11.dfsg/ztd-eth.c
--- zaptel-1.2.11.dfsg~/ztd-eth.c	2009-01-10 21:50:09.000000000 +0200
+++ zaptel-1.2.11.dfsg/ztd-eth.c	2009-01-10 21:56:02.000000000 +0200
@@ -177,8 +177,12 @@
 			skb->nh.raw = skb->data;
 #endif
 			skb->dev = dev;
+#if  LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
+			dev_hard_header(skb, dev, ETH_P_ZTDETH, addr, dev->dev_addr, skb->len);
+#else
 			if (dev->hard_header)
 				dev->hard_header(skb, dev, ETH_P_ZTDETH, addr, dev->dev_addr, skb->len);
+#endif
 			dev_queue_xmit(skb);
 		}
 	}
@@ -355,7 +359,11 @@
 			}
 			z->subaddr = htons(sub);
 		}
-		z->dev = dev_get_by_name(z->ethdev);
+		z->dev = dev_get_by_name(
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
+				&init_net,
+#endif
+				z->ethdev);
 		if (!z->dev) {
 			printk("TDMoE: Invalid device '%s'\n", z->ethdev);
 			kfree(z);


More information about the Pkg-voip-maintainers mailing list