[Pkg-voip-commits] r9428 - in /dahdi-linux/trunk/debian: changelog patches/dahdi_linux_extra patches/series patches/xpp_fix_2fxs6fxo rules

tzafrir at alioth.debian.org tzafrir at alioth.debian.org
Tue Jan 17 18:32:53 UTC 2012


Author: tzafrir
Date: Tue Jan 17 18:32:52 2012
New Revision: 9428

URL: http://svn.debian.org/wsvn/pkg-voip/?sc=1&rev=9428
Log:
New upstream release: 2.6.0

* New upstream release: 2.6.0
  - Patch xpp_fix_2fxs6fxo removed: merged upstream. 
* Removed all EXTRA_* build variables:
  - wcopenpci builds on big-endial (sort of).
  - All other logic is set through Kbuild.
* Do apply stripping to all kernels (3.x included).

Removed:
    dahdi-linux/trunk/debian/patches/xpp_fix_2fxs6fxo
Modified:
    dahdi-linux/trunk/debian/changelog
    dahdi-linux/trunk/debian/patches/dahdi_linux_extra
    dahdi-linux/trunk/debian/patches/series
    dahdi-linux/trunk/debian/rules

Modified: dahdi-linux/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-linux/trunk/debian/changelog?rev=9428&op=diff
==============================================================================
--- dahdi-linux/trunk/debian/changelog (original)
+++ dahdi-linux/trunk/debian/changelog Tue Jan 17 18:32:52 2012
@@ -1,8 +1,14 @@
-dahdi-linux (1:2.5.0.1+dfsg-2) UNRELEASED; urgency=low
+dahdi-linux (1:2.6.0+dfsg-1) UNRELEASED; urgency=low
 
   * NOT RELEASED YET
-
- -- Tzafrir Cohen <tzafrir at debian.org>  Tue, 27 Sep 2011 00:27:02 +0300
+  * New upstream release:
+    - Patch xpp_fix_2fxs6fxo removed: merged upstream. 
+  * Removed all EXTRA_* build variables:
+    - wcopenpci builds on big-endial (sort of).
+    - All other logic is set through Kbuild.
+  * Do apply stripping to all kernels (3.x included).
+
+ -- Tzafrir Cohen <tzafrir at debian.org>  Tue, 17 Jan 2012 17:27:06 +0200
 
 dahdi-linux (1:2.5.0.1+dfsg-1) unstable; urgency=low
 

Modified: dahdi-linux/trunk/debian/patches/dahdi_linux_extra
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-linux/trunk/debian/patches/dahdi_linux_extra?rev=9428&op=diff
==============================================================================
--- dahdi-linux/trunk/debian/patches/dahdi_linux_extra (original)
+++ dahdi-linux/trunk/debian/patches/dahdi_linux_extra Tue Jan 17 18:32:52 2012
@@ -1,77 +1,90 @@
 Subject: dahdi-extra: out-of-tree DAHDI drivers
 Origin: http://gitorious.org/dahdi-extra/dahdi-linux-extra
 Forwarded: No
-Last-Update: 2011-08-08
+Last-Update: 2012-01-17
  
 This patch includes a number of out-of-tree DAHDI drivers from the
 dahdi-extra repository. They are all out-of-tree and are highly likely
 not to be included in DAHDI-linux in the forseeable future.
  
-Git-Commit: 1a5eb3aa8925626b7a7c333a5248c7dfe8ffe97b
-Dahdi: tags/2.5.0
+Git-Commit: 64c3652f8923ae19c59b74e86a8f7ee3b315dcfa
+Dahdi: tags/2.6.0
 ---
 diff --git a/drivers/dahdi/Kbuild b/drivers/dahdi/Kbuild
-index ec881dc..dcd6e3c 100644
+index 8bbfea0..9fed863 100644
 --- a/drivers/dahdi/Kbuild
 +++ b/drivers/dahdi/Kbuild
-@@ -29,6 +29,14 @@ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_STEVE2)	+= dahdi_echocan_sec2.o
+@@ -31,6 +31,14 @@ obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_STEVE2)	+= dahdi_echocan_sec2.o
  obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_KB1)	+= dahdi_echocan_kb1.o
  obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_MG2)	+= dahdi_echocan_mg2.o
  
++ifdef CONFIG_PCI
 +obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_AP400)		+= ap400/
-+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_OPVXD115)          += opvxd115/
-+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_OPVXA1200)         += opvxa1200/
++obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_OPVXA1200)		+= opvxa1200/
++obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_OPVXD115)		+= opvxd115/
 +obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCOPENPCI)		+= wcopenpci.o
 +obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ZAPHFC)		+= zaphfc/
-+obj-$(DAHDI_BUILD_ALL)$(CONFIG_ECHO)			+= ../staging/echo/
-+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_ECHOCAN_OSLEC)	+= dahdi_echocan_oslec.o
++endif
 +
  obj-m += $(DAHDI_MODULES_EXTRA)
  
  # Only enable this if you think you know what you're doing. This is not
 diff --git a/drivers/dahdi/Kconfig b/drivers/dahdi/Kconfig
-index 6952c6a..3ad3e6c 100644
+index 6952c6a..4275775 100644
 --- a/drivers/dahdi/Kconfig
 +++ b/drivers/dahdi/Kconfig
-@@ -292,3 +292,76 @@ config DAHDI_WCTE11XP
+@@ -292,3 +292,89 @@ config DAHDI_WCTE11XP
  	  If unsure, say Y.
  
  source "drivers/dahdi/xpp/Kconfig"
 +
++config DAHDI_AP4XX
++	tristate "Aligera AP4XX PCI Card Driver"
++	depends on DAHDI && PCI
++	default DAHDI
++	---help---
++	  This driver provides support for the Aligera AP400 quad-span
++	  E1/T1 DAHDI cards:
++
++	  To compile this driver as a module, choose M here: the
++	  module will be called ap4xx.
++
++	  If unsure, say Y.
++
++config DAHDI_OPVXA1200
++	tristate "OpenVox 8/12 ports analog card Support"
++	depends on DAHDI && PCI
++	default DAHDI
++	---help---
++	  This driver provides support for the following OpenVox
++	  Wildcard products:
++
++	  * A1200P (PCI)
++	  * A1200E (PCI-E)
++	  * A800P (PCI)
++	  * A800E (PCI-E)
++
++	  To compile this driver as a module, choose M here: the
++	  module will be called opvxa1200.
++
++	  If unsure, say Y.
 +
 +config DAHDI_OPVXD115
-+        tristate "OpenVox Single-T1/E1/J1 Support"
-+        depends on DAHDI && PCI
-+        default DAHDI
-+        ---help---
-+          This driver provides support for the following OpenVox
-+          Wildcard products:
-+
-+          * D115P/DE115P/D130P/DE130P (PCI)
-+          * D115E/DE115E/D130E/DE130E (PCI-E)
-+
-+          To compile this driver as a module, choose M here: the
-+          module will be called opvxd115.
-+
-+          If unsure, say Y.
-+
-+config DAHDI_OPVXA1200
-+        tristate "OpenVox 8/12 ports analog card Support"
-+        depends on DAHDI && PCI
-+        default DAHDI
-+        ---help---
-+          This driver provides support for the following OpenVox
-+          Wildcard products:
-+
-+          * A1200P (PCI)
-+          * A1200E (PCI-E)
-+          * A800P (PCI)
-+          * A800E (PCI-E)
-+
-+          To compile this driver as a module, choose M here: the
-+          module will be called opvxa1200.
-+
-+          If unsure, say Y.
++	tristate "OpenVox Single-T1/E1/J1 Support"
++	depends on DAHDI && PCI
++	default DAHDI
++	---help---
++	  This driver provides support for the following OpenVox
++	  Wildcard products:
++
++	  * D115P/DE115P/D130P/DE130P (PCI)
++	  * D115E/DE115E/D130E/DE130E (PCI-E)
++
++	  To compile this driver as a module, choose M here: the
++	  module will be called opvxd115.
++
++	  If unsure, say Y.
++
 +
 +config DAHDI_WCOPENPCI
 +	tristate "Voicetronix OpenPCI Interface DAHDI driver"
@@ -90,7 +103,7 @@
 +	depends on DAHDI && PCI
 +	default DAHDI
 +	---help---
-+	  This driver provides DAHDI support for various HFC-S single-port 
++	  This driver provides DAHDI support for various HFC-S single-port
 +          ISDN (BRI) cards.
 +
 +	  To compile this driver as a module, choose M here: the
@@ -257,10 +270,10 @@
 +
 diff --git a/drivers/dahdi/ap400/ap400_drv.c b/drivers/dahdi/ap400/ap400_drv.c
 new file mode 100644
-index 0000000..f625f12
+index 0000000..24c3807
 --- /dev/null
 +++ b/drivers/dahdi/ap400/ap400_drv.c
-@@ -0,0 +1,2362 @@
+@@ -0,0 +1,2337 @@
 +/*
 + * AP4XX PCI Card Driver
 + *
@@ -552,6 +565,7 @@
 +struct ap4 {
 +	/* This structure exists one per card */
 +	struct pci_dev *dev;		/* Pointer to PCI device */
++	struct dahdi_device *ddev;
 +	struct ap4_regs *hw_regs;
 +	unsigned int intcount;
 +	int flag_1st_irq;
@@ -1308,10 +1322,6 @@
 +		ts = wc->tspans[x];
 +		sprintf(ts->span.name, "AP4%d%d/%d/%d", 0, wc->numspans, wc->num, x + 1);
 +		snprintf(ts->span.desc, sizeof(ts->span.desc) - 1, "AP4%d%d Card %d Span %d", 0, wc->numspans, wc->num+1, x+1);
-+		snprintf(ts->span.location, sizeof(ts->span.location) - 1,
-+			 "PCI Bus %02d Slot %02d", wc->dev->bus->number, PCI_SLOT(wc->dev->devfn) + 1);
-+		ts->span.manufacturer = "Aligera";
-+		dahdi_copy_string(ts->span.devicetype, wc->variety, sizeof(ts->span.devicetype));
 +		ts->span.ops = &ap4_span_ops;
 +		if (ts->spantype == TYPE_E1) {
 +			ts->span.channels = 31;
@@ -2005,8 +2015,6 @@
 +		if(cnt_irq_misses) {
 +			wc->flag_1st_irq--;
 +			*(wc->membase+AP_CNT_IRQ_REG)=0;
-+			for(x=0;x<(wc->numspans);x++)
-+				wc->tspans[x]->span.irqmisses = 0;
 +		}
 +		// zera erro de CRC
 +		cnt_tmp = (*(wc->membase + AP_CNT_CRC_REG));
@@ -2023,7 +2031,7 @@
 +		// reseta o contador
 +		*(wc->membase+AP_CNT_IRQ_REG)=0;
 +		for(x=0;x<(wc->numspans);x++)
-+			wc->tspans[x]->span.irqmisses += (cnt_irq_misses-1);
++			wc->ddev->irqmisses += (cnt_irq_misses-1);
 +	}
 +
 +	if (!wc->spansstarted) {
@@ -2137,31 +2145,12 @@
 +		wc->globalconfig = 1;
 +	}
 +
-+	if (dahdi_register(&wc->tspans[0]->span, 0)) {
++	for (x=0; x<wc->numspans; x++)
++		list_add_tail(&wc->tspans[x]->span.device_node,
++				&wc->ddev->spans);
++	if (dahdi_register_device(wc->ddev, &wc->dev->dev)) {
 +		printk(KERN_ERR "Unable to register span %s\n", wc->tspans[0]->span.name);
-+		return -1;
-+	}
-+	if (wc->numspans > 1) {
-+		if (dahdi_register(&wc->tspans[1]->span, 0)) {
-+			printk(KERN_ERR "Unable to register span %s\n", wc->tspans[1]->span.name);
-+			dahdi_unregister(&wc->tspans[0]->span);
-+			return -1;
-+		}
-+	}
-+	if (wc->numspans == 4) {
-+		if (dahdi_register(&wc->tspans[2]->span, 0)) {
-+			printk(KERN_ERR "Unable to register span %s\n", wc->tspans[2]->span.name);
-+			dahdi_unregister(&wc->tspans[0]->span);
-+			dahdi_unregister(&wc->tspans[1]->span);
-+			return -1;
-+		}
-+		if (dahdi_register(&wc->tspans[3]->span, 0)) {
-+			printk(KERN_ERR "Unable to register span %s\n", wc->tspans[3]->span.name);
-+			dahdi_unregister(&wc->tspans[0]->span);
-+			dahdi_unregister(&wc->tspans[1]->span);
-+			dahdi_unregister(&wc->tspans[2]->span);
-+			return -1;
-+		}
++		return -1; /* FIXME: proper error handling */
 +	}
 +	wc->checktiming = 1;
 +	spin_lock_irqsave(&wc->reglock, flags);
@@ -2434,6 +2423,14 @@
 +		goto out;
 +	}
 +
++	wc->ddev = dahdi_create_device();
++	wc->ddev->location = kasprintf(GFP_KERNEL, "PCI Bus %02d Slot %02d",
++			wc->dev->bus->number, PCI_SLOT(wc->dev->devfn) + 1);
++	if (!wc->ddev->location)
++		return -ENOMEM; /* FIXME: proper error handling */
++	wc->ddev->manufacturer = "Aligera";
++	wc->ddev->devicetype = wc->variety;
++	wc->ddev->irqmisses = 0;
 +	init_spans(wc);
 +
 +	/* Launch cards as appropriate */
@@ -2513,18 +2510,9 @@
 +		ap4_apec_release(wc);
 +#endif
 +		/* Unregister spans */
-+		if (wc->tspans[0]->span.flags & DAHDI_FLAG_REGISTERED)
-+			dahdi_unregister(&wc->tspans[0]->span);
-+		if (wc->numspans > 1) {
-+			if (wc->tspans[1]->span.flags & DAHDI_FLAG_REGISTERED)
-+				dahdi_unregister(&wc->tspans[1]->span);
-+		}
-+		if (wc->numspans == 4) {
-+			if (wc->tspans[2]->span.flags & DAHDI_FLAG_REGISTERED)
-+				dahdi_unregister(&wc->tspans[2]->span);
-+			if (wc->tspans[3]->span.flags & DAHDI_FLAG_REGISTERED)
-+				dahdi_unregister(&wc->tspans[3]->span);
-+		}
++		dahdi_unregister_device(wc->ddev);
++		kfree(wc->ddev->location);
++		dahdi_free_device(wc->ddev);
 +#ifdef ENABLE_WORKQUEUES
 +		if (wc->workq) {
 +			flush_workqueue(wc->workq);
@@ -3114,10 +3102,10 @@
 +endif
 diff --git a/drivers/dahdi/opvxa1200/base.c b/drivers/dahdi/opvxa1200/base.c
 new file mode 100644
-index 0000000..32da0e0
+index 0000000..25ce3c4
 --- /dev/null
 +++ b/drivers/dahdi/opvxa1200/base.c
-@@ -0,0 +1,3049 @@
+@@ -0,0 +1,3065 @@
 +/*
 + * OpenVox A1200P FXS/FXO Interface Driver for DAHDI Telephony interface
 + *
@@ -3415,6 +3403,7 @@
 +	struct pci_dev *dev;
 +	char *variety;
 +	struct dahdi_span span;
++	struct dahdi_device *ddev;
 +	unsigned char ios;
 +	int usecount;
 +	unsigned int intcount;
@@ -5511,10 +5500,17 @@
 +	/* Dahdi stuff */
 +	sprintf(wc->span.name, "OPVXA1200/%d", wc->pos);
 +	snprintf(wc->span.desc, sizeof(wc->span.desc)-1, "%s Board %d", wc->variety, wc->pos + 1);
-+	snprintf(wc->span.location, sizeof(wc->span.location) - 1,
-+		 "PCI Bus %02d Slot %02d", wc->dev->bus->number, PCI_SLOT(wc->dev->devfn) + 1);
-+	wc->span.manufacturer = "OpenVox";
-+	dahdi_copy_string(wc->span.devicetype, wc->variety, sizeof(wc->span.devicetype));
++	wc->ddev->location = kasprintf(GFP_KERNEL,
++				      "PCI Bus %02d Slot %02d",
++				      wc->dev->bus->number,
++				      PCI_SLOT(wc->dev->devfn) + 1);
++	if (!wc->ddev->location) {
++		dahdi_free_device(wc->ddev);
++		wc->ddev = NULL;
++		return -ENOMEM;
++	}
++	wc->ddev->manufacturer = "OpenVox";
++	wc->ddev->devicetype = wc->variety;
 +	if (alawoverride) {
 +		printk(KERN_INFO "ALAW override parameter detected.  Device will be operating in ALAW\n");
 +		wc->span.deflaw = DAHDI_LAW_ALAW;
@@ -5558,12 +5554,16 @@
 +#endif
 +	wc->span.chans = wc->chans;
 +	wc->span.channels = wc->max_cards;	/*MAX_NUM_CARDS;*/
-+	wc->span.irq = wc->dev->irq;
 +	wc->span.flags = DAHDI_FLAG_RBS;
 +	wc->span.ops = &wctdm_span_ops;
 +
-+	if (dahdi_register(&wc->span, 0)) {
-+		printk(KERN_NOTICE "Unable to register span with Dahdi\n");
++	list_add_tail(&wc->span.device_node, &wc->ddev->spans);
++	if (dahdi_register_device(wc->ddev, &wc->dev->dev)) {
++		printk(KERN_NOTICE "Unable to register device %s with DAHDI\n",
++				wc->span.name);
++		kfree(wc->ddev->location);
++		dahdi_free_device(wc->ddev);
++		wc->ddev = NULL;
 +		return -1;
 +	}
 +	return 0;
@@ -5922,7 +5922,9 @@
 +				}
 +				pci_free_consistent(pdev,  DAHDI_MAX_CHUNKSIZE * (MAX_NUM_CARDS+NUM_FLAG) * 2 * 2, (void *)wc->writechunk, wc->writedma);
 +				pci_set_drvdata(pdev, NULL);
-+				dahdi_unregister(&wc->span);
++				dahdi_unregister_device(wc->ddev);
++				kfree(wc->ddev->location);
++				dahdi_free_device(wc->ddev);
 +				kfree(wc);
 +				return -EIO;
 +
@@ -5985,7 +5987,9 @@
 +	char fname[20];
 +#endif
 +	
-+	dahdi_unregister(&wc->span);
++	dahdi_unregister_device(wc->ddev);
++	kfree(wc->ddev->location);
++	dahdi_free_device(wc->ddev);
 +	if (wc->freeregion & 0x01)
 +		release_region(wc->ioaddr, 0xff);
 +	if (wc->freeregion & 0x02)
@@ -6221,10 +6225,10 @@
 +endif
 diff --git a/drivers/dahdi/opvxd115/base.c b/drivers/dahdi/opvxd115/base.c
 new file mode 100644
-index 0000000..123a2e0
+index 0000000..479eacc
 --- /dev/null
 +++ b/drivers/dahdi/opvxd115/base.c
-@@ -0,0 +1,4903 @@
+@@ -0,0 +1,4911 @@
 +/*
 + * OpenVox D115P/D115E PCI/PCI-E Driver version 0.1 01/07/2011
 + *
@@ -6529,6 +6533,7 @@
 +struct t4 {
 +	/* This structure exists one per card */
 +	struct pci_dev *dev;		/* Pointer to PCI device */
++	struct dahdi_device *ddev;	/* Pointer to DAHDI device */
 +	unsigned int intcount;
 +	int num;			/* Which card we are */
 +	int t1e1;			/* T1/E1 select pins */
@@ -8204,20 +8209,20 @@
 +
 +static void set_span_devicetype(struct t4 *wc)
 +{
-+	int x;
-+	struct t4_span *ts;
-+
-+	for (x = 0; x < wc->numspans; x++) {
-+		ts = wc->tspans[x];
-+		dahdi_copy_string(ts->span.devicetype, wc->variety, sizeof(ts->span.devicetype));
-+		if (wc->vpm == T4_VPM_PRESENT) {
-+			if (!wc->vpm450m)
-+				strncat(ts->span.devicetype, " (VPM400M)", sizeof(ts->span.devicetype) - 1);
-+			else
-+				strncat(ts->span.devicetype, " (VPMOCT032)",
-+					sizeof(ts->span.devicetype) - 1);
-+		}
-+	}
++	struct dahdi_device *ddev = wc->ddev;
++	const char *devicetype_old = ddev->devicetype;
++	char *extra_str = "";
++
++	if (wc->vpm == T4_VPM_PRESENT)
++		extra_str = (!wc->vpm450m) ? " (VPM400M)" : " (VPMOCT032)",
++	wc->ddev->devicetype = kasprintf(GFP_KERNEL, "%s%s",
++			wc->variety, extra_str);
++
++	/* On the off chance that we were able to allocate it previously. */
++	if (!wc->ddev->devicetype)
++		wc->ddev->devicetype = devicetype_old;
++	else
++		kfree(devicetype_old);
 +}
 +
 +/* The number of cards we have seen with each
@@ -8291,20 +8296,27 @@
 +	int gen2;
 +	struct t4_span *ts;
 +	unsigned int reg;
-+	
++
++	wc->ddev->manufacturer = "OpenVox";
++	if (order_index[wc->order] == 1)
++		wc->ddev->location = kasprintf(GFP_KERNEL,
++				"Board ID Switch %d", wc->order);
++	else
++		wc->ddev->location = kasprintf(GFP_KERNEL,
++				"PCI%s Bus %02d Slot %02d",
++				(ts->spanflags & FLAG_EXPRESS) ?
++					" Express" : " ",
++				wc->dev->bus->number,
++				PCI_SLOT(wc->dev->devfn) + 1);
++	if (!wc->ddev->location)
++		return; /* FIXME: Error handling */
++
 +	gen2 = (wc->tspans[0]->spanflags & FLAG_2NDGEN);
 +	for (x = 0; x < wc->numspans; x++) {
 +		ts = wc->tspans[x];
 +		sprintf(ts->span.name, "D115/D130/%d/%d", wc->num, x + 1);
 +		snprintf(ts->span.desc, sizeof(ts->span.desc) - 1,
 +			 "D115/D130 (E1|T1) Card %d Span %d", wc->num, x+1);
-+		ts->span.manufacturer = "OpenVox";
-+		if (order_index[wc->order] == 1)
-+			snprintf(ts->span.location, sizeof(ts->span.location) - 1, "Board ID Switch %d", wc->order);
-+		else
-+			snprintf(ts->span.location, sizeof(ts->span.location) - 1,
-+				 "PCI%s Bus %02d Slot %02d", (ts->spanflags & FLAG_EXPRESS) ? " Express" : " ",
-+				 wc->dev->bus->number, PCI_SLOT(wc->dev->devfn) + 1);
 +		switch (ts->spantype) {
 +		case TYPE_T1:
 +			ts->span.spantype = "T1";
@@ -8345,7 +8357,6 @@
 +		}
 +		ts->span.pvt = ts;
 +#endif
-+		ts->span.irq = wc->dev->irq;
 +
 +		/* HDLC Specific init */
 +		ts->sigchan = NULL;
@@ -9033,7 +9044,7 @@
 +	}
 +	if (dbl) {
 +		for (x=0;x<wc->numspans;x++)
-+			wc->tspans[x]->irqmisses++;
++			wc->ddev->irqmisses++;
 +		if (debug & DEBUG_MAIN)
 +			dev_notice(&wc->dev->dev, "opvxd115: Double/missed "
 +				"interrupt detected\n");
@@ -10080,7 +10091,7 @@
 +					"latency.  Estimated latency should "
 +					"be %d\n", needed_latency);
 +				for (x = 0; x < wc->numspans; x++)
-+					wc->tspans[x]->span.irqmisses++;
++					wc->ddev->irqmisses++;
 +				wc->needed_latency = needed_latency;
 +				__t4_pci_out(wc, WC_DMACTRL, 0x00000000);
 +				set_bit(T4_CHANGE_LATENCY, &wc->checkflag);
@@ -10735,7 +10746,11 @@
 +	for (x=0;x<PORTS_PER_FRAMER;x++)
 +		t4_serial_setup(wc, x);
 +
-+	if (dahdi_register(&wc->tspans[0]->span, 0)) {
++	for (x = 0; x < wc->numspans; ++x) {
++		list_add_tail(&wc->tspans[x]->span.device_node,
++			      &wc->ddev->spans);
++	}
++	if (dahdi_register_device(wc->ddev, &wc->dev->dev)) {
 +		dev_err(&wc->dev->dev, "Unable to register span %s\n",
 +				wc->tspans[0]->span.name);
 +		return -1;
@@ -11000,9 +11015,7 @@
 +static void __devexit t4_remove_one(struct pci_dev *pdev)
 +{
 +	struct t4 *wc = pci_get_drvdata(pdev);
-+	struct dahdi_span *span;
 +	int basesize;
-+	int i;
 +
 +	if (!wc) {
 +		return;
@@ -11023,11 +11036,10 @@
 +	if (!(wc->tspans[0]->spanflags & FLAG_2NDGEN))
 +		basesize = basesize * 2;
 +
-+	for (i = 0; i < wc->numspans; ++i) {
-+		span = &wc->tspans[i]->span;
-+		if (test_bit(DAHDI_FLAGBIT_REGISTERED, &span->flags))
-+			dahdi_unregister(span);
-+	}
++	dahdi_unregister_device(wc->ddev);
++	kfree(wc->ddev->location);
++	kfree(wc->ddev->devicetype);
++	dahdi_free_device(wc->ddev);
 +#ifdef ENABLE_WORKQUEUES
 +	if (wc->workq) {
 +		flush_workqueue(wc->workq);
@@ -12335,10 +12347,10 @@
 +#endif
 diff --git a/drivers/dahdi/wcopenpci.c b/drivers/dahdi/wcopenpci.c
 new file mode 100644
-index 0000000..ef4d1f3
+index 0000000..214d396
 --- /dev/null
 +++ b/drivers/dahdi/wcopenpci.c
-@@ -0,0 +1,1849 @@
+@@ -0,0 +1,1868 @@
 +/*
 + * Voicetronix OpenPCI Interface Driver for Zapata Telephony interface
 + *
@@ -12754,6 +12766,7 @@
 +
 +	struct dahdi_chan _chans[MAX_PORTS];
 +	struct dahdi_chan *chans[MAX_PORTS];
++	struct dahdi_device *ddev;
 +	struct dahdi_span span;
 +} *cards[MAX_CARDS];
 +
@@ -13185,7 +13198,7 @@
 +	for (y=0,x=0;x<DAHDI_CHUNKSIZE;++x) {
 +		/* Send a sample, as a 32-bit word */
 +#ifdef __BIG_ENDIAN
-+#error No big endian support (yet)
++#warning No big endian support (yet)
 +#else
 +		/* transmit second 4 ports */
 +		writechunk[y]=0;
@@ -13239,7 +13252,7 @@
 +
 +	for (y=0,x=0;x<DAHDI_CHUNKSIZE;++x) {
 +#ifdef __BIG_ENDIAN
-+#error No big endian support (yet)
++#warning No big endian support (yet)
 +#else
 +		/* Receive first 4 ports */
 +
@@ -13649,10 +13662,16 @@
 +{ //{{{
 +	int x;
 +
++	wc->ddev = dahdi_create_device();
 +	//XXX Set a THIS_MODULE as the owner of the span...
 +	/* Zapata stuff */
 +	sprintf(wc->span.name, "WCTDM/%d", wc->boardnum);
 +	sprintf(wc->span.desc, "%s Board %d", wc->variety, wc->boardnum + 1);
++	wc->ddev->location = kasprintf(GFP_KERNEL, "PCI Bus %02d Slot %02d",
++				      wc->dev->bus->number,
++				      PCI_SLOT(wc->dev->devfn) + 1);
++	if (!wc->ddev->location)
++		return -ENOMEM;
 +	for (x = 0; x < MAX_PORTS; x++) {
 +		struct dahdi_chan *chan = &wc->_chans[x];
 +		wc->chans[x] = chan;
@@ -13663,14 +13682,17 @@
 +		chan->chanpos = x+1;
 +		chan->pvt = wc;
 +	}
++	wc->ddev->manufacturer = "Voicetronix";
++	wc->ddev->devicetype = wc->variety;
 +	wc->span.deflaw = DAHDI_LAW_MULAW;
 +	wc->span.chans = wc->chans;
 +	wc->span.channels = MAX_PORTS;
 +	wc->span.flags = DAHDI_FLAG_RBS;
 +	wc->span.ops = &openpci_span_ops;
 +
-+	if (dahdi_register(&wc->span, 0)) {
-+		cardcrit(wc->boardnum, "Unable to register span with dahdi");
++	list_add_tail(&wc->span.device_node, &wc->ddev->spans);
++	if (dahdi_register_device(wc->ddev, &wc->dev->dev)) {
++		cardcrit(wc->boardnum, "Unable to register device with dahdi");
 +		return RET_FAIL;
 +	}
 +	return RET_OK;
@@ -14099,7 +14121,7 @@
 +	return 0;
 +
 +    hell_5:
-+	dahdi_unregister(&wc->span);
++	dahdi_unregister_device(wc->ddev);
 +    hell_4:
 +	if (wc->writechunk){
 +		pci_free_consistent(pdev, VT_PCIDMA_BLOCKSIZE,
@@ -14111,6 +14133,8 @@
 +    hell_2:
 +	cards[boardnum] = NULL;
 +    hell:
++	kfree(wc->ddev->location);
++	dahdi_free_device(wc->ddev);
 +	kfree(wc);
 +	return failret;
 +} //}}}
@@ -14133,7 +14157,7 @@
 +	/* Release span, possibly delayed */
 +	//XXX if (!wc->usecount) openpci_release(wc); else wc->dead = 1;
 +
-+	dahdi_unregister(&wc->span);
++	dahdi_unregister_device(wc->ddev);
 +	outb(0x00, TJ_CNTL);
 +
 +	pci_free_consistent(pdev, VT_PCIDMA_BLOCKSIZE, (void *)wc->writechunk, wc->writedma);
@@ -14145,6 +14169,8 @@
 +	cards[wc->boardnum] = NULL;
 +	mutex_unlock(&cards_mutex);
 +
++	kfree(wc->ddev->location);
++	dahdi_free_device(wc->ddev);
 +	kfree(wc);
 +	cardinfo(wc->boardnum, "Removed OpenPCI card.");
 +} //}}}
@@ -14167,6 +14193,11 @@
 +
 +static int __init openpci_init(void)
 +{
++#ifdef __BIG_ENDIAN
++	warn("No big endian support (yet)");
++	return -ENODEV;
++#endif
++
 +	if( dahdi_pci_module(&openpci_driver) )
 +		return -ENODEV;
 +
@@ -14206,10 +14237,10 @@
 +
 diff --git a/drivers/dahdi/zaphfc/base.c b/drivers/dahdi/zaphfc/base.c
 new file mode 100644
-index 0000000..841454c
+index 0000000..bbf5c3e
 --- /dev/null
 +++ b/drivers/dahdi/zaphfc/base.c
-@@ -0,0 +1,1710 @@
+@@ -0,0 +1,1719 @@
 +/*
 + * zaphfc.c - Dahdi driver for HFC-S PCI A based ISDN BRI cards
 + *
@@ -14875,6 +14906,13 @@
 +	 struct hfc_card *hfctmp = hfccard->card;
 +	int i;
 +
++	hfccard->ddev = dahdi_create_device();
++	hfccard->ddev->manufacturer = "Cologne Chips";
++	hfccard->ddev->devicetype = "HFC-S PCI-A ISDN";
++	hfccard->ddev->location = kasprintf(GFP_KERNEL,
++			"PCI Bus %02d Slot %02d",
++			hfctmp->pcidev->bus->number,
++			PCI_SLOT(hfctmp->pcidev->devfn) + 1);
 +	memset(&hfccard->span, 0x0, sizeof(struct dahdi_span));
 +	sprintf(hfccard->span.name, "ZTHFC%d", hfctmp->cardnum + 1);
 +	sprintf(hfccard->span.desc,
@@ -14882,15 +14920,8 @@
 +			hfctmp->cardnum,
 +			hfctmp->nt_mode ? "NT" : "TE");
 +	hfccard->span.spantype = hfctmp->nt_mode ? "NT" : "TE";
-+	hfccard->span.manufacturer = "Cologne Chips";
 +	hfccard->span.flags = 0;
 +	hfccard->span.ops = &hfc_zap_span_ops;
-+	hfccard->span.irq = hfctmp->pcidev->irq;
-+	dahdi_copy_string(hfccard->span.devicetype, "HFC-S PCI-A ISDN",
-+			sizeof(hfccard->span.devicetype));
-+	sprintf(hfccard->span.location, "PCI Bus %02d Slot %02d",
-+			hfctmp->pcidev->bus->number,
-+			PCI_SLOT(hfctmp->pcidev->devfn) + 1);
 +	hfccard->span.chans = hfccard->_chans;
 +	hfccard->span.channels = 3;
 +	for (i = 0; i < hfccard->span.channels; i++)
@@ -14949,12 +14980,20 @@
 +
 +	hfccard->chans[DAHDI_B2].pvt = &hfctmp->chans[B2];
 +
-+	if (dahdi_register(&hfccard->span, 0)) {
-+		printk(KERN_CRIT "unable to register zaptel device!\n");
-+		return -1;
++	list_add_tail(&hfccard->span.device_node, &hfccard->ddev->spans);
++	if (dahdi_register_device(hfccard->ddev, &hfctmp->pcidev->dev)) {
++		printk(KERN_ERR "unable to register DAHDI device %s!\n",
++				hfccard->span.name);
++		return -1; /* FIXME: release resources? */
 +	}
 +
 +	return 0;
++}
++
++static void hfc_dahdi_free(struct dahdi_hfc *hfccard)
++{
++	kfree(hfccard->ddev->location);
++	dahdi_free_device(hfccard->ddev);
 +}
 +
 +static void hfc_zap_transmit(struct hfc_chan_simplex *chan)
@@ -15822,7 +15861,8 @@
 +
 +	hfc_softreset(card);
 +
-+	dahdi_unregister(&card->ztdev->span);
++	dahdi_unregister_device(card->ztdev->ddev);
++	hfc_dahdi_free(card->ztdev);
 +
 +
 +	/*
@@ -16448,10 +16488,10 @@
 +#endif
 diff --git a/drivers/dahdi/zaphfc/zaphfc.h b/drivers/dahdi/zaphfc/zaphfc.h
 new file mode 100644
-index 0000000..29dd304
+index 0000000..d1d20be
 --- /dev/null
 +++ b/drivers/dahdi/zaphfc/zaphfc.h
-@@ -0,0 +1,418 @@
+@@ -0,0 +1,419 @@
 +/*
 + * zaphfc.h - Dahdi driver for HFC-S PCI A based ISDN BRI cards
 + *
@@ -16839,6 +16879,7 @@
 +
 +typedef struct dahdi_hfc {
 +    unsigned int usecount;
++    struct dahdi_device *ddev;
 +    struct dahdi_span span;
 +    struct dahdi_chan chans[3];
 +    struct dahdi_chan *_chans[3];

Modified: dahdi-linux/trunk/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-linux/trunk/debian/patches/series?rev=9428&op=diff
==============================================================================
--- dahdi-linux/trunk/debian/patches/series (original)
+++ dahdi-linux/trunk/debian/patches/series Tue Jan 17 18:32:52 2012
@@ -4,4 +4,3 @@
 no_firmware_download
 chanmute
 notest
-xpp_fix_2fxs6fxo

Modified: dahdi-linux/trunk/debian/rules
URL: http://svn.debian.org/wsvn/pkg-voip/dahdi-linux/trunk/debian/rules?rev=9428&op=diff
==============================================================================
--- dahdi-linux/trunk/debian/rules (original)
+++ dahdi-linux/trunk/debian/rules Tue Jan 17 18:32:52 2012
@@ -37,15 +37,6 @@
 # the generated headers as part of the source:
 GENERATED_SOURCES := include/dahdi/version.h
 
-EXTRA_MODS=dahdi_echocan_oslec
-EXTRA_SUBDIRS = ap400 opvxa1200 opvxd115 zaphfc ../staging/echo
-
-ifneq (,$(filter-out powerpc m68k armeb mips,$(shell dpkg-architecture -qDEB_HOST_ARCH)))
-EXTRA_MODS += wcopenpci
-endif
-
-MOD_ARGS=MODULES_EXTRA="$(EXTRA_MODS)" SUBDIRS_EXTRA="$(EXTRA_SUBDIRS)"
-
 %:
 	dh $@
 
@@ -58,13 +49,11 @@
 	dh_testroot
 	dh_prep
 	#cp -a $(CURDIR)/debian/generated/* .
-	make $(MOD_ARGS) modules KERNEL_SOURCES=$(KSRC) MODVERSIONS=detect KERNEL=linux-$(KVERS) 
-	make $(MOD_ARGS) install-modules KERNELRELEASE=$(KVERS) DESTDIR=$(CURDIR)/debian/$(PKGNAME)
-ifeq (2.6,$(shell echo $(KVERS) | cut -d. -f1-2))
-	# The 2.6 modules are way too big. This is only in kernel 2.6
+	make modules KERNEL_SOURCES=$(KSRC) MODVERSIONS=detect KERNEL=linux-$(KVERS) 
+	make install-modules KERNELRELEASE=$(KVERS) DESTDIR=$(CURDIR)/debian/$(PKGNAME)
+	# The modules are way too big. This is only in kernel 2.6
 	find debian/$(PKGNAME)/lib/modules -name '*.ko' |xargs strip -g
 	$(RM) -f debian/$(PKGNAME)/lib/modules/$(KVERS)/modules.*
-endif
 	dh_installmodules
 	dh_installdebconf
 	dh_installdocs




More information about the Pkg-voip-commits mailing list