[Asterisk-cvs] zaptel wct4xxp.c,1.7,1.8
markster at lists.digium.com
markster at lists.digium.com
Thu Sep 25 10:29:47 CDT 2003
Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv31633
Modified Files:
wct4xxp.c
Log Message:
Update pulse templates for non-standard LBO's
Index: wct4xxp.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wct4xxp.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- wct4xxp.c 25 Sep 2003 06:07:28 -0000 1.7
+++ wct4xxp.c 25 Sep 2003 15:30:57 -0000 1.8
@@ -58,6 +58,7 @@
static int timingcable;
static int highestorder;
static int t1e1override = -1;
+static int loopback = 0;
#ifdef FANCY_ALARM
static int altab[] = {
@@ -642,6 +643,8 @@
mytxlevel = txlevel - 4;
fmr1 = 0x9c; /* FMR1: Mode 1, T1 mode, CRC on for ESF, 8.192 Mhz system data rate, no XAIS */
fmr2 = 0x22; /* FMR2: no payload loopback, auto send yellow alarm */
+ if (loopback)
+ fmr2 |= 0x4;
fmr4 = 0x0c; /* FMR4: Lose sync on 2 out of 5 framing bits, auto resync */
lim2 = 0x21; /* LIM2: 50% peak is a "1", Advanced Loss recovery */
lim2 |= (mytxlevel << 6); /* LIM2: Add line buildout */
@@ -678,9 +681,29 @@
__t4_framer_out(wc, unit, 0x39, 0x15); /* PCR: 22 "ones" clear LOS */
/* Generate pulse mask for T1 */
- __t4_framer_out(wc, unit, 0x26, 0xd7); /* XPM0 */
- __t4_framer_out(wc, unit, 0x27, 0x22); /* XPM1 */
- __t4_framer_out(wc, unit, 0x28, 0x01); /* XPM2 */
+ switch(mytxlevel) {
+ case 3:
+ __t4_framer_out(wc, unit, 0x26, 0x07); /* XPM0 */
+ __t4_framer_out(wc, unit, 0x27, 0x01); /* XPM1 */
+ __t4_framer_out(wc, unit, 0x28, 0x00); /* XPM2 */
+ break;
+ case 2:
+ __t4_framer_out(wc, unit, 0x26, 0x8c); /* XPM0 */
+ __t4_framer_out(wc, unit, 0x27, 0x11); /* XPM1 */
+ __t4_framer_out(wc, unit, 0x28, 0x01); /* XPM2 */
+ break;
+ case 1:
+ __t4_framer_out(wc, unit, 0x26, 0x8c); /* XPM0 */
+ __t4_framer_out(wc, unit, 0x27, 0x01); /* XPM1 */
+ __t4_framer_out(wc, unit, 0x28, 0x00); /* XPM2 */
+ break;
+ case 0:
+ default:
+ __t4_framer_out(wc, unit, 0x26, 0xd7); /* XPM0 */
+ __t4_framer_out(wc, unit, 0x27, 0x22); /* XPM1 */
+ __t4_framer_out(wc, unit, 0x28, 0x01); /* XPM2 */
+ break;
+ }
printk("TE410P: Span %d configured for %s/%s\n", unit + 1, framing, line);
}
@@ -690,7 +713,9 @@
char *crc4 = "";
char *framing, *line;
fmr1 = 0x44; /* FMR1: E1 mode, Automatic force resync, PCM30 mode, 8.192 Mhz backplane, no XAIS */
- fmr2 = 0x03 /* | 0x4 */; /* FMR2: Auto transmit remote alarm, auto loss of multiframe recovery, no payload loopback */
+ fmr2 = 0x03; /* FMR2: Auto transmit remote alarm, auto loss of multiframe recovery, no payload loopback */
+ if (loopback)
+ fmr2 |= 0x4;
if (lineconfig & ZT_CONFIG_CRC4) {
fmr1 |= 0x08; /* CRC4 transmit */
fmr2 |= 0xc0; /* CRC4 receive */
More information about the svn-commits
mailing list