[svn-commits] mattf: branch 1.4 r2574 - /branches/1.4/wct4xxp/base.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Wed Jun 6 06:47:12 MST 2007


Author: mattf
Date: Wed Jun  6 08:47:12 2007
New Revision: 2574

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2574
Log:
Add 220/420 support

Modified:
    branches/1.4/wct4xxp/base.c

Modified: branches/1.4/wct4xxp/base.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/wct4xxp/base.c?view=diff&rev=2574&r1=2573&r2=2574
==============================================================================
--- branches/1.4/wct4xxp/base.c (original)
+++ branches/1.4/wct4xxp/base.c Wed Jun  6 08:47:12 2007
@@ -220,6 +220,7 @@
 #define FLAG_VPM2GEN (1 << 5)
 #define FLAG_OCTOPT  (1 << 6)
 #define FLAG_3RDGEN  (1 << 7)
+#define FLAG_BURST  (1 << 8)
 
 #define CANARY 0xc0de
 
@@ -229,10 +230,12 @@
 };
 
 static struct devtype wct4xxp = { "Wildcard TE410P/TE405P (1st Gen)", 0 };
+static struct devtype wct420p4 = { "Wildcard TE420P (4th Gen)", FLAG_BURST | FLAG_2NDGEN | FLAG_3RDGEN };
 static struct devtype wct410p3 = { "Wildcard TE410P (3rd Gen)", FLAG_2NDGEN | FLAG_3RDGEN };
 static struct devtype wct405p3 = { "Wildcard TE405P (3rd Gen)", FLAG_2NDGEN | FLAG_3RDGEN };
 static struct devtype wct410p2 = { "Wildcard TE410P (2nd Gen)", FLAG_2NDGEN };
 static struct devtype wct405p2 = { "Wildcard TE405P (2nd Gen)", FLAG_2NDGEN };
+static struct devtype wct220p4 = { "Wildcard TE220P (4th Gen)", FLAG_BURST | FLAG_2NDGEN | FLAG_3RDGEN | FLAG_2PORT };
 static struct devtype wct205p3 = { "Wildcard TE205P (3rd Gen)", FLAG_2NDGEN | FLAG_3RDGEN | FLAG_2PORT };
 static struct devtype wct210p3 = { "Wildcard TE210P (3rd Gen)", FLAG_2NDGEN | FLAG_3RDGEN | FLAG_2PORT };
 static struct devtype wct205 = { "Wildcard TE205P ", FLAG_2NDGEN | FLAG_2PORT };
@@ -2036,7 +2039,7 @@
 #endif
 		/* Seed interrupt register */
 		__t4_pci_out(wc, WC_INTR, 0x0c);
-		if (noburst)
+		if (noburst && !(ts->spanflags & FLAG_BURST))
 			wc->dmactrl |= (1 << 26);
 		__t4_pci_out(wc, WC_DMACTRL, wc->dmactrl);
 		/* Startup HDLC controller too */
@@ -3431,12 +3434,12 @@
 	spin_unlock_irqrestore(&wc->reglock, flags);
 }
 
-static int t4_hardware_init_1(struct t4 *wc, int gen2)
+static int t4_hardware_init_1(struct t4 *wc, unsigned int cardflags)
 {
 	unsigned int version;
 
 	version = t4_pci_in(wc, WC_VERSION);
-	printk("TE%dXXP version %08x, burst %s, slip debug: %s\n", wc->numspans, version, noburst ? "OFF" : "ON", debugslips ? "ON" : "OFF");
+ 	printk("TE%dXXP version %08x, burst %s, slip debug: %s\n", wc->numspans, version, (!(cardflags & FLAG_BURST) && noburst) ? "OFF" : "ON", debugslips ? "ON" : "OFF");
 #ifdef ENABLE_WORKQUEUES
 	printk("TE%dXXP running with work queues.\n", wc->numspans);
 #endif
@@ -3452,7 +3455,7 @@
 	t4_pci_out(wc, WC_WRADDR, wc->writedma);
 
 	/* Setup counters, interrupt flags (ignored in Gen2) */
-	if (gen2) {
+	if (cardflags & FLAG_2NDGEN) {
 		t4_tsi_reset(wc);
 	} else {
 		t4_pci_out(wc, WC_COUNT, ((ZT_MAX_CHUNKSIZE * 2 * 32 - 1) << 18) | ((ZT_MAX_CHUNKSIZE * 2 * 32 - 1) << 2));
@@ -3619,7 +3622,7 @@
 			pci_set_drvdata(pdev, wc);
 
 			/* Initialize hardware */
-			t4_hardware_init_1(wc, dt->flags & FLAG_2NDGEN);
+			t4_hardware_init_1(wc, dt->flags);
 
 			for(x = 0; x < MAX_T4_CARDS; x++) {
 				if (!cards[x]) break;
@@ -3826,11 +3829,13 @@
 {
 	{ 0x10ee, 0x0314, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (unsigned long)&wct4xxp },
 
+ 	{ 0xd161, 0x0420, 0x0004,     PCI_ANY_ID, 0, 0, (unsigned long)&wct420p4 },
 	{ 0xd161, 0x0410, 0x0003,     PCI_ANY_ID, 0, 0, (unsigned long)&wct410p3 },
 	{ 0xd161, 0x0405, 0x0003,     PCI_ANY_ID, 0, 0, (unsigned long)&wct405p3 },
 	{ 0xd161, 0x0410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (unsigned long)&wct410p2 },
 	{ 0xd161, 0x0405, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (unsigned long)&wct405p2 },
 
+ 	{ 0xd161, 0x0220, 0x0004,     PCI_ANY_ID, 0, 0, (unsigned long)&wct220p4 },
 	{ 0xd161, 0x0205, 0x0003,     PCI_ANY_ID, 0, 0, (unsigned long)&wct205p3 },
 	{ 0xd161, 0x0210, 0x0003,     PCI_ANY_ID, 0, 0, (unsigned long)&wct210p3 },
 	{ 0xd161, 0x0205, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (unsigned long)&wct205 },



More information about the svn-commits mailing list