summaryrefslogtreecommitdiff
path: root/tor2.c
diff options
context:
space:
mode:
authormatteo <matteo@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-02-27 06:00:24 +0000
committermatteo <matteo@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-02-27 06:00:24 +0000
commit6707996d1ada38fb52d4ad3920b6549d38277ce5 (patch)
treed7a12009a60ae5d2bcd592b93363f95fb6db84b6 /tor2.c
parentb574418782d181cbd69a271704d8d3f3a3d38fb6 (diff)
Thu Feb 27 07:00:01 CET 2003
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@151 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'tor2.c')
-rwxr-xr-xtor2.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/tor2.c b/tor2.c
index e672296..dc4139c 100755
--- a/tor2.c
+++ b/tor2.c
@@ -168,6 +168,7 @@ struct tor2 *cards[MAX_TOR_CARDS];
#define TOR_BBIT 4
static int debug;
+static int japan;
static int loopback;
static int highestorder;
static int timingcable;
@@ -882,6 +883,9 @@ static int tor2_startup(struct zt_span *span)
t1out(p->tor,tspan, 0x12, 0x22);
t1out(p->tor,tspan, 0x14, 0x80);
t1out(p->tor,tspan, 0x15, 0x80);
+ /* Setup japanese mode if appropriate */
+ t1out(p->tor,tspan,0x19,(japan ? 0x80 : 0x00)); /* no local loop */
+ t1out(p->tor,tspan,0x1e,(japan ? 0x80 : 0x00)); /* no local loop */
}
/* Enable F bits pattern */
i = 0x20;
@@ -972,15 +976,15 @@ static int tor2_maint(struct zt_span *span, int cmd)
}
switch(cmd) {
case ZT_MAINT_NONE:
- t1out(p->tor,tspan,0x19,0); /* no local loop */
+ t1out(p->tor,tspan,0x19,(japan ? 0x80 : 0x00)); /* no local loop */
t1out(p->tor,tspan,0x0a,0); /* no remote loop */
break;
case ZT_MAINT_LOCALLOOP:
- t1out(p->tor,tspan,0x19,0x40); /* local loop */
+ t1out(p->tor,tspan,0x19,0x40 | (japan ? 0x80 : 0x00)); /* local loop */
t1out(p->tor,tspan,0x0a,0); /* no remote loop */
break;
case ZT_MAINT_REMOTELOOP:
- t1out(p->tor,tspan,0x1e,0); /* no local loop */
+ t1out(p->tor,tspan,0x1e,(japan ? 0x80 : 0x00)); /* no local loop */
t1out(p->tor,tspan,0x0a,0x40); /* remote loop */
break;
case ZT_MAINT_LOOPUP:
@@ -1259,7 +1263,7 @@ static void tor2_intr(int irq, void *dev_id, struct pt_regs *regs)
if ((tor->loopupcnt[i]++ > 80) &&
(tor->spans[i].maintstat != ZT_MAINT_REMOTELOOP))
{
- t1out(tor,i + 1,0x1e,0); /* no local loop */
+ t1out(tor,i + 1,0x1e,(japan ? 0x80 : 0x00)); /* no local loop */
t1out(tor,i + 1,0x0a,0x40); /* remote loop */
tor->spans[i].maintstat = ZT_MAINT_REMOTELOOP;
}
@@ -1271,7 +1275,7 @@ static void tor2_intr(int irq, void *dev_id, struct pt_regs *regs)
if ((tor->loopdowncnt[i]++ > 80) &&
(tor->spans[i].maintstat == ZT_MAINT_REMOTELOOP))
{
- t1out(tor,i + 1,0x1e,0); /* no local loop */
+ t1out(tor,i + 1,0x1e,(japan ? 0x80 : 0x00)); /* no local loop */
t1out(tor,i + 1,0x0a,0); /* no remote loop */
tor->spans[i].maintstat = ZT_MAINT_NONE;
}
@@ -1427,6 +1431,7 @@ MODULE_LICENSE("GPL");
MODULE_PARM(debug, "i");
MODULE_PARM(loopback, "i");
MODULE_PARM(timingcable, "i");
+MODULE_PARM(japan, "i");
MODULE_DEVICE_TABLE(pci, tor2_pci_ids);