[zaptel-commits] mattf: trunk r2575 - /trunk/wct4xxp/base.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Wed Jun 6 06:50:47 MST 2007


Author: mattf
Date: Wed Jun  6 08:50:46 2007
New Revision: 2575

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

Modified:
    trunk/wct4xxp/base.c

Modified: trunk/wct4xxp/base.c
URL: http://svn.digium.com/view/zaptel/trunk/wct4xxp/base.c?view=diff&rev=2575&r1=2574&r2=2575
==============================================================================
--- trunk/wct4xxp/base.c (original)
+++ trunk/wct4xxp/base.c Wed Jun  6 08:50:46 2007
@@ -212,6 +212,7 @@
 #define FLAG_VPM2GEN (1 << 5)
 #define FLAG_OCTOPT  (1 << 6)
 #define FLAG_3RDGEN  (1 << 7)
+#define FLAG_BURST  (1 << 8)
 
 #define CANARY 0xc0de
 
@@ -221,10 +222,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 };
@@ -2000,7 +2003,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);
 
@@ -3336,12 +3339,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\n", wc->numspans, version, noburst ? "OFF" : "ON");
+  	printk("TE%dXXP version %08x, burst %s\n", wc->numspans, version, (!(cardflags & FLAG_BURST) && noburst) ? "OFF" : "ON");
 #ifdef ENABLE_WORKQUEUES
 	printk("TE%dXXP running with work queues.\n", wc->numspans);
 #endif
@@ -3357,7 +3360,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));
@@ -3522,7 +3525,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;
@@ -3729,11 +3732,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 zaptel-commits mailing list