summaryrefslogtreecommitdiff
path: root/wct4xxp.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-09-25 15:30:57 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-09-25 15:30:57 +0000
commitd36504ea15b4141cc624b55a71a0b8e97cb66fb5 (patch)
tree5ae488982cb75506fe5a6ca5bbe183d598a42717 /wct4xxp.c
parent7849ef9b1f61e84c3246534477980a21abd50a1a (diff)
Update pulse templates for non-standard LBO's
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@248 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wct4xxp.c')
-rwxr-xr-xwct4xxp.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/wct4xxp.c b/wct4xxp.c
index f4ffbf3..9ef7725 100755
--- a/wct4xxp.c
+++ b/wct4xxp.c
@@ -58,6 +58,7 @@ static int debug;
static int timingcable;
static int highestorder;
static int t1e1override = -1;
+static int loopback = 0;
#ifdef FANCY_ALARM
static int altab[] = {
@@ -642,6 +643,8 @@ static void __t4_configure_t1(struct t4 *wc, int unit, int lineconfig, int txlev
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 @@ static void __t4_configure_t1(struct t4 *wc, int unit, int lineconfig, int txlev
__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 @@ static void __t4_configure_e1(struct t4 *wc, int unit, int lineconfig)
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 */