[svn-commits] mattf: branch 1.2 r3039 - in /branches/1.2: wctdm24xxp/base.c ztcfg.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Sat Sep 15 15:36:59 CDT 2007
Author: mattf
Date: Sat Sep 15 15:36:58 2007
New Revision: 3039
URL: http://svn.digium.com/view/zaptel?view=rev&rev=3039
Log:
This patch was not thought out well enough. Get rid of it for now (CAS signalling conflicts...)
Modified:
branches/1.2/wctdm24xxp/base.c
branches/1.2/ztcfg.c
Modified: branches/1.2/wctdm24xxp/base.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/wctdm24xxp/base.c?view=diff&rev=3039&r1=3038&r2=3039
==============================================================================
--- branches/1.2/wctdm24xxp/base.c (original)
+++ branches/1.2/wctdm24xxp/base.c Sat Sep 15 15:36:58 2007
@@ -1133,7 +1133,7 @@
if (wc->mods[card].fxs.palarms < MAX_ALARMS) {
printk("Power alarm (%02x) on module %d, resetting!\n", res, card + 1);
if (wc->mods[card].fxs.lasttxhook == 4)
- wc->mods[card].fxs.lasttxhook = 1;
+ wc->mods[card].fxs.lasttxhook = 0x11;
wc->sethook[card] = CMD_WR(19, res);
#if 0
wc->sethook[card] = CMD_WR(64, wc->mods[card].fxs.lasttxhook);
@@ -1149,12 +1149,21 @@
}
#else
res = wc->cmdq[card].isrshadow[1];
- if (!res && (res != wc->mods[card].fxs.lasttxhook)) {
+ /* This makes sure the lasthook was put in reg 64 the linefeed reg */
+ if (((res & 0x0f) | 0x10) == wc->mods[card].fxs.lasttxhook)
+ wc->mods[card].fxs.lasttxhook &= 0x0f;
+
+ res = !res && /* reg 64 has to be zero at last isr read */
+ !(wc->mods[card].fxs.lasttxhook & 0x10 ) && /* not a transition */
+ wc->mods[card].fxs.lasttxhook; /* not an intended zero */
+
+ if (res) {
wc->mods[card].fxs.palarms++;
if (wc->mods[card].fxs.palarms < MAX_ALARMS) {
printk("Power alarm on module %d, resetting!\n", card + 1);
if (wc->mods[card].fxs.lasttxhook == 4)
- wc->mods[card].fxs.lasttxhook = 1;
+ wc->mods[card].fxs.lasttxhook = 0x11;
+ wc->mods[card].fxs.lasttxhook |= 0x10;
wc->sethook[card] = CMD_WR(64, wc->mods[card].fxs.lasttxhook);
/* wctdm_setreg_intr(wc, card, 64, wc->mods[card].fxs.lasttxhook); */
@@ -1436,7 +1445,7 @@
wc->mods[x].fxs.idletxhookstate = 0x1; /* Switch to active */
if (wc->mods[x].fxs.lasttxhook == 0x2) {
/* Apply the change if appropriate */
- wc->mods[x].fxs.lasttxhook = 0x1;
+ wc->mods[x].fxs.lasttxhook = 0x11;
wc->sethook[x] = CMD_WR(64, wc->mods[x].fxs.lasttxhook);
/* wctdm_setreg_intr(wc, x, 64, wc->mods[x].fxs.lasttxhook); */
}
@@ -1945,6 +1954,7 @@
/* By default, don't send on hook */
wc->mods[card].fxs.idletxhookstate = 1;
+ wc->mods[card].fxs.lasttxhook = 0x10;
/* Sanity check the ProSLIC */
if (!sane && wctdm_proslic_insane(wc, card))
@@ -2133,8 +2143,8 @@
printk("Reducing ring power on slot %d (50V peak)\n", card + 1);
}
}
+ wc->mods[card].fxs.lasttxhook = 0x11;
wctdm_setreg(wc, card, 64, 0x01);
- wc->mods[card].fxs.lasttxhook = 1;
return 0;
}
@@ -2185,7 +2195,7 @@
wc->mods[chan->chanpos - 1].fxs.idletxhookstate = 0x2; /* OHT mode when idle */
if (wc->mods[chan->chanpos - 1].fxs.lasttxhook == 0x1) {
/* Apply the change if appropriate */
- wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x2;
+ wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x12;
wc->sethook[chan->chanpos - 1] = CMD_WR(64, wc->mods[chan->chanpos - 1].fxs.lasttxhook);
/* wctdm_setreg(wc, chan->chanpos - 1, 64, wc->mods[chan->chanpos - 1].fxs.lasttxhook); */
}
@@ -2228,6 +2238,9 @@
wctdm_proslic_setreg_indirect(wc, chan->chanpos - 1, regop.reg, regop.val);
} else {
regop.val &= 0xff;
+ if (regop.reg == 64)
+ wc->mods[chan->chanpos-1].fxs.lasttxhook = (regop.val & 0x0f) | 0x10;
+
printk("Setting direct %d to %04x on %d\n", regop.reg, regop.val, chan->chanpos);
wctdm_setreg(wc, chan->chanpos - 1, regop.reg, regop.val);
}
@@ -2359,28 +2372,30 @@
case ZT_SIG_EM:
case ZT_SIG_FXOKS:
case ZT_SIG_FXOLS:
- wc->mods[chan->chanpos - 1].fxs.lasttxhook = wc->mods[chan->chanpos - 1].fxs.idletxhookstate;
+ wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x10 |
+ wc->mods[chan->chanpos - 1].fxs.idletxhookstate;
break;
case ZT_SIG_FXOGS:
- wc->mods[chan->chanpos - 1].fxs.lasttxhook = 3;
+ wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x13;
break;
}
break;
case ZT_TXSIG_OFFHOOK:
switch(chan->sig) {
case ZT_SIG_EM:
- wc->mods[chan->chanpos - 1].fxs.lasttxhook = 5;
+ wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x15;
break;
default:
- wc->mods[chan->chanpos - 1].fxs.lasttxhook = wc->mods[chan->chanpos - 1].fxs.idletxhookstate;
+ wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x10 |
+ wc->mods[chan->chanpos - 1].fxs.idletxhookstate;
break;
}
break;
case ZT_TXSIG_START:
- wc->mods[chan->chanpos - 1].fxs.lasttxhook = 4;
+ wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x14;
break;
case ZT_TXSIG_KEWL:
- wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0;
+ wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x10;
break;
default:
printk("wctdm24xxp: Can't set tx state to %d\n", txsig);
Modified: branches/1.2/ztcfg.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/ztcfg.c?view=diff&rev=3039&r1=3038&r2=3039
==============================================================================
--- branches/1.2/ztcfg.c (original)
+++ branches/1.2/ztcfg.c Sat Sep 15 15:36:58 2007
@@ -1281,16 +1281,6 @@
current_state.channo = cc[x].chan | ZT_GET_PARAMS_RETURN_MASTER;
if (ioctl(fd, ZT_GET_PARAMS, ¤t_state))
needupdate = 1;
- else if (current_state.chanpos == 16 &&
- (cc[x].sigtype & ZT_SIG_CLEAR) &&
- !(lc[current_state.spanno - 1].lineconfig &
- (ZT_CONFIG_D4|ZT_CONFIG_ESF|ZT_CONFIG_B8ZS|ZT_CONFIG_CCS))) {
- fprintf(stderr,
- "CAS signalling on span %u conflicts with %s on channel %u.\n",
- current_state.spanno,
- sigtype_to_str(cc[x].sigtype), x);
- exit(1);
- }
}
if (!needupdate) {
More information about the svn-commits
mailing list