summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-06-06 13:50:46 +0000
committermattf <mattf@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-06-06 13:50:46 +0000
commitfa1800a8a8157d44276758f850aa5d50ad85573c (patch)
treec3452e8b3150c624e053c5c302a9e9964a86d187
parenta7a7c76be9f51ab200d70998888d33a82faf4b47 (diff)
Add 220/420 support
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@2575 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--wct4xxp/base.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/wct4xxp/base.c b/wct4xxp/base.c
index b5581af..72c38a7 100644
--- a/wct4xxp/base.c
+++ b/wct4xxp/base.c
@@ -212,6 +212,7 @@ static int altab[] = {
#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 @@ struct devtype {
};
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 @@ static int t4_startup(struct zt_span *span)
#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 @@ static void t4_tsi_unassign(struct t4 *wc, int tospan, int tochan)
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 @@ static int t4_hardware_init_1(struct t4 *wc, int gen2)
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 @@ static int __devinit t4_init_one(struct pci_dev *pdev, const struct pci_device_i
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 @@ static struct pci_device_id t4_pci_tbl[] __devinitdata =
{
{ 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 },