summaryrefslogtreecommitdiff
path: root/wct1xxp.c
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 /wct1xxp.c
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 'wct1xxp.c')
-rw-r--r--wct1xxp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/wct1xxp.c b/wct1xxp.c
index 6be48c9..a54c511 100644
--- a/wct1xxp.c
+++ b/wct1xxp.c
@@ -747,7 +747,6 @@ static int t1xxp_spanconfig(struct zt_span *span, struct zt_lineconfig *lc)
return t1xxp_startup(span);
return 0;
}
-
static int t1xxp_software_init(struct t1xxp *wc)
{
int x;
@@ -763,6 +762,9 @@ static int t1xxp_software_init(struct t1xxp *wc)
wc->num = x;
sprintf(wc->span.name, "WCT1/%d", wc->num);
sprintf(wc->span.desc, "%s Card %d", wc->variety, wc->num);
+ wc->span.manufacturer = "Digium";
+ wc->span.devicetype = wc->variety;
+ sprintf(wc->span.location, "PCI Bus %02d Slot %02d", wc->dev->bus->number, PCI_SLOT(wc->dev->devfn) + 1);
wc->span.spanconfig = t1xxp_spanconfig;
wc->span.chanconfig = t1xxp_chanconfig;
wc->span.irq = wc->dev->irq;
@@ -778,13 +780,17 @@ static int t1xxp_software_init(struct t1xxp *wc)
wc->span.channels = 24;
wc->span.chans = wc->chans;
wc->span.flags = ZT_FLAG_RBS;
- wc->span.linecompat = ZT_CONFIG_AMI | ZT_CONFIG_B8ZS | ZT_CONFIG_D4 | ZT_CONFIG_ESF;
wc->span.ioctl = t1xxp_ioctl;
wc->span.pvt = wc;
- if (wc->ise1)
+ if (wc->ise1) {
wc->span.deflaw = ZT_LAW_ALAW;
- else
+ wc->span.linecompat = ZT_CONFIG_AMI | ZT_CONFIG_B8ZS | ZT_CONFIG_D4 | ZT_CONFIG_ESF;
+ wc->span.spantype = "T1";
+ } else {
wc->span.deflaw = ZT_LAW_MULAW;
+ wc->span.linecompat = ZT_CONFIG_HDB3 | ZT_CONFIG_CCS | ZT_CONFIG_CRC4;
+ wc->span.spantype = "E1";
+ }
init_waitqueue_head(&wc->span.maintq);
for (x=0;x<wc->span.channels;x++) {
sprintf(wc->chans[x].name, "WCT1/%d/%d", wc->num, x + 1);