diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-09-25 15:30:57 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-09-25 15:30:57 +0000 |
commit | d36504ea15b4141cc624b55a71a0b8e97cb66fb5 (patch) | |
tree | 5ae488982cb75506fe5a6ca5bbe183d598a42717 /wct4xxp.c | |
parent | 7849ef9b1f61e84c3246534477980a21abd50a1a (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-x | wct4xxp.c | 33 |
1 files changed, 29 insertions, 4 deletions
@@ -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 */ |