From 399e9527c164aea4ee0dffa88f7b2c0639ce2b4e Mon Sep 17 00:00:00 2001 From: tzafrir Date: Mon, 11 Aug 2008 14:00:30 +0000 Subject: * pcmtx_chan debugging parameter now refers to a zaptel channel number. * Do initialize xsp. Closes issue #13276 . * xbus_core_shutdown can't be __exit as it is used in initilization as well. Merged revisions 4473 via svnmerge from http://svn.digium.com/svn/zaptel/branches/1.2 git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4474 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- kernel/xpp/card_pri.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'kernel/xpp/card_pri.c') diff --git a/kernel/xpp/card_pri.c b/kernel/xpp/card_pri.c index 6b2f487..ed438cf 100644 --- a/kernel/xpp/card_pri.c +++ b/kernel/xpp/card_pri.c @@ -743,7 +743,7 @@ static int pri_lineconfig(xpd_t *xpd, int lineconfig) byte fmr3 = 0; /* write only for CRC4 */ byte fmr4 = 0; byte imr0 = 0; - byte xsp; + byte xsp = 0; unsigned int bad_bits; int i; @@ -1359,6 +1359,14 @@ static void PRI_card_pcm_fromspan(xbus_t *xbus, xpd_t *xpd, xpp_line_t lines, xp if(IS_SET(lines, i)) { physical_mask |= BIT(physical_chan); if(SPAN_REGISTERED(xpd)) { +#ifdef DEBUG_PCMTX + int channo = xpd->span.chans[i].channo; + + if(pcmtx >= 0 && pcmtx_chan == channo) + memset((u_char *)pcm, pcmtx, ZT_CHUNKSIZE); + else +#endif + memcpy((u_char *)pcm, chans[i].writechunk, ZT_CHUNKSIZE); if(i == PRI_DCHAN_IDX(priv)) { if(priv->dchan_tx_sample != chans[i].writechunk[0]) { priv->dchan_tx_sample = chans[i].writechunk[0]; @@ -1368,12 +1376,6 @@ static void PRI_card_pcm_fromspan(xbus_t *xbus, xpd_t *xpd, xpp_line_t lines, xp else chans[i].writechunk[0] = 0xFF; /* Clobber for next tick */ } -#ifdef DEBUG_PCMTX - if(pcmtx >= 0 && pcmtx_chan == i) - memset((u_char *)pcm, pcmtx, ZT_CHUNKSIZE); - else -#endif - memcpy((u_char *)pcm, chans[i].writechunk, ZT_CHUNKSIZE); } else memset((u_char *)pcm, ZT_XLAW(0, (&chans[i])), ZT_CHUNKSIZE); pcm += ZT_CHUNKSIZE; -- cgit v1.2.3