From b6a3caba943ae3cfe8978277d97f4060b84705a2 Mon Sep 17 00:00:00 2001 From: mattf Date: Wed, 6 Jun 2007 13:47:12 +0000 Subject: Add 220/420 support git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@2574 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- wct4xxp/base.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'wct4xxp') diff --git a/wct4xxp/base.c b/wct4xxp/base.c index 51b0c64..92ad8c3 100644 --- a/wct4xxp/base.c +++ b/wct4xxp/base.c @@ -220,6 +220,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 @@ -229,10 +230,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 }; @@ -2036,7 +2039,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); /* Startup HDLC controller too */ @@ -3431,12 +3434,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, 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 @@ 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)); @@ -3619,7 +3622,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; @@ -3826,11 +3829,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 }, -- cgit v1.2.3