summaryrefslogtreecommitdiff
path: root/wct4xxp
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-12-04 13:55:19 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-12-04 13:55:19 +0000
commit62315ace88956c4456598eaf6b6d278d13c86a17 (patch)
treeeea5aa85c604d11f62cc6ae376ff88f3edb7efb9 /wct4xxp
parentfd130696615d48e186afb5def7e4b3a3b796bd7d (diff)
add a new Zaptel scanning tool, primarily for use by the Asterisk GUI, called 'ztscan'. this tool outputs an Asterisk-style
configuration file containing one context for each Zaptel span with all the details that can be learned about that span. to enable this tool, the ZT_SPANSTAT ioctl gained a number of new elements to report information about the spans: - linecompat (available signaling modes for digital spans) - spantype (T1, E1 or J1 for digital spans) - location (PCI/PCI-Express location) - manufacturer - devicetype Along the way I also found that the digital span drivers always set T1-style signaling bits in 'linecompat' even for E1 spans, and that the ZT_SPANCONFIG ioctl did not properly check these bits when configuring E1 spans. The result of this is that it was possible to configure T1-only coding/framing (AMI/B8Zs, D4/ESF) on E1 spans (but not the reverse); this has been corrected and any attempt to use T1-only coding/framing on E1 spans will now result in an error from ztcfg. Also did some minor simplification of the Makefile rules that build the userspace tools. (the basics of ztscan were written by Brandon Kruse then reworked and fleshed out by me) git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3278 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wct4xxp')
-rw-r--r--wct4xxp/base.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/wct4xxp/base.c b/wct4xxp/base.c
index 33cca7d..1b2207a 100644
--- a/wct4xxp/base.c
+++ b/wct4xxp/base.c
@@ -210,7 +210,8 @@ static int altab[] = {
#define FLAG_VPM2GEN (1 << 5)
#define FLAG_OCTOPT (1 << 6)
#define FLAG_3RDGEN (1 << 7)
-#define FLAG_BURST (1 << 8)
+#define FLAG_BURST (1 << 8)
+#define FLAG_EXPRESS (1 << 9)
#define CANARY 0xc0de
@@ -220,14 +221,14 @@ struct devtype {
};
static struct devtype wct4xxp = { "Wildcard TE410P/TE405P (1st Gen)", 0 };
-static struct devtype wct420p4 = { "Wildcard TE420 (4th Gen)", FLAG_BURST | FLAG_2NDGEN | FLAG_3RDGEN };
+static struct devtype wct420p4 = { "Wildcard TE420 (4th Gen)", FLAG_BURST | FLAG_2NDGEN | FLAG_3RDGEN | FLAG_EXPRESS };
static struct devtype wct410p4 = { "Wildcard TE410P (4th Gen)", FLAG_BURST | FLAG_2NDGEN | FLAG_3RDGEN };
static struct devtype wct410p3 = { "Wildcard TE410P (3rd Gen)", FLAG_2NDGEN | FLAG_3RDGEN };
static struct devtype wct405p4 = { "Wildcard TE405P (4th Gen)", FLAG_BURST | 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 TE220 (4th Gen)", FLAG_BURST | FLAG_2NDGEN | FLAG_3RDGEN | FLAG_2PORT };
+static struct devtype wct220p4 = { "Wildcard TE220 (4th Gen)", FLAG_BURST | FLAG_2NDGEN | FLAG_3RDGEN | FLAG_2PORT | FLAG_EXPRESS };
static struct devtype wct205p4 = { "Wildcard TE205P (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 wct210p4 = { "Wildcard TE210P (4th Gen)", FLAG_BURST | FLAG_2NDGEN | FLAG_3RDGEN | FLAG_2PORT };
@@ -1526,11 +1527,24 @@ static void init_spans(struct t4 *wc)
gen2 = (wc->tspans[0]->spanflags & FLAG_2NDGEN);
if (!wc->t1e1)
offset += 4;
- for (x=0;x<wc->numspans;x++) {
+ for (x = 0; x < wc->numspans; x++) {
ts = wc->tspans[x];
- sprintf(ts->span.name, "TE%d/%d/%d", wc->numspans,
- wc->num, x + 1);
+ sprintf(ts->span.name, "TE%d/%d/%d", wc->numspans, wc->num, x + 1);
sprintf(ts->span.desc, "T%dXXP (PCI) Card %d Span %d", wc->numspans, wc->num, x+1);
+ ts->span.manufacturer = "Digium";
+ ts->span.devicetype = wc->variety;
+ sprintf(ts->span.location, "PCI%sBus %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";
+ break;
+ case TYPE_E1:
+ ts->span.spantype = "E1";
+ break;
+ case TYPE_J1:
+ ts->span.spantype = "J1";
+ break;
+ }
ts->span.spanconfig = t4_spanconfig;
ts->span.chanconfig = t4_chanconfig;
ts->span.irq = wc->dev->irq;
@@ -1549,13 +1563,14 @@ static void init_spans(struct t4 *wc)
if (ts->spantype == TYPE_T1 || ts->spantype == TYPE_J1) {
ts->span.channels = 24;
ts->span.deflaw = ZT_LAW_MULAW;
+ ts->span.linecompat = ZT_CONFIG_AMI | ZT_CONFIG_B8ZS | ZT_CONFIG_D4 | ZT_CONFIG_ESF;
} else {
ts->span.channels = 31;
ts->span.deflaw = ZT_LAW_ALAW;
+ ts->span.linecompat = ZT_CONFIG_HDB3 | ZT_CONFIG_CCS | ZT_CONFIG_CRC4;
}
ts->span.chans = ts->chans;
ts->span.flags = ZT_FLAG_RBS;
- ts->span.linecompat = ZT_CONFIG_AMI | ZT_CONFIG_B8ZS | ZT_CONFIG_D4 | ZT_CONFIG_ESF;
ts->span.ioctl = t4_ioctl;
ts->span.hdlc_hard_xmit = t4_hdlc_hard_xmit;
if (gen2) {