Index: drivers/dahdi/wctdm.c =================================================================== --- drivers/dahdi/wctdm.c (revision 6918) +++ drivers/dahdi/wctdm.c (working copy) @@ -737,8 +737,8 @@ } else { if (wc->mod[card].fxs.palarms++ < MAX_ALARMS) { printk(KERN_NOTICE "Power alarm on module %d, resetting!\n", card + 1); - if (wc->mod[card].fxs.lasttxhook == 4) - wc->mod[card].fxs.lasttxhook = 1; + if (wc->mod[card].fxs.lasttxhook == SLIC_LF_RINGING) + wc->mod[card].fxs.lasttxhook = SLIC_LF_ACTIVE_FWD; wctdm_setreg(wc, card, 64, wc->mod[card].fxs.lasttxhook); } else { if (wc->mod[card].fxs.palarms == MAX_ALARMS) @@ -997,6 +997,16 @@ if (debug) #endif printk(KERN_DEBUG "wctdm: Card %d Going off hook\n", card); + + switch ( wc->mod[card].fxs.lasttxhook ) { + case SLIC_LF_RINGING: /* Ringing */ + case SLIC_LF_OHTRAN_FWD: /* Forward On Hook Transfer */ + case SLIC_LF_OHTRAN_REV: /* Reverse On Hook Transfer */ + /* just detected OffHook, during Ringing or OnHookTransfer */ + wc->mod[card].fxs.idletxhookstate = POLARITY_XOR(card) ? SLIC_LF_ACTIVE_REV : SLIC_LF_ACTIVE_FWD; /* Active */ + break; + } + dahdi_hooksig(wc->chans[card], DAHDI_RXSIG_OFFHOOK); if (robust) wctdm_init_proslic(wc, card, 1, 0, 1); @@ -1045,7 +1055,7 @@ for (x=0;x<4;x++) { if (wc->cardflag & (1 << x) && (wc->modtype[x] == MOD_TYPE_FXS)) { - if (wc->mod[x].fxs.lasttxhook == 0x4) { + if (wc->mod[x].fxs.lasttxhook == SLIC_LF_RINGING) { /* RINGing, prepare for OHT */ wc->mod[x].fxs.ohttimer = OHT_TIMER << 3; @@ -1054,15 +1064,15 @@ ioctl channel variable fxs 'reversepolarity', Line Reversal Alert Signal if required. ioctl channel variable fxs 'vmwi_lrev', VMWI pending. */ - wc->mod[x].fxs.idletxhookstate = POLARITY_XOR(x) ? 0x6 : 0x2;/* OHT mode when idle */ + wc->mod[x].fxs.idletxhookstate = POLARITY_XOR(x) ? SLIC_LF_OHTRAN_REV : SLIC_LF_OHTRAN_FWD;/* OHT mode when idle */ } else { if (wc->mod[x].fxs.ohttimer) { wc->mod[x].fxs.ohttimer-= DAHDI_CHUNKSIZE; if (!wc->mod[x].fxs.ohttimer) { - wc->mod[x].fxs.idletxhookstate = POLARITY_XOR(x) ? 0x5 : 0x1; /* Switch to Active : Reverse Forward */ - if ((wc->mod[x].fxs.lasttxhook == 0x2) || (wc->mod[x].fxs.lasttxhook == 0x6)) { + wc->mod[x].fxs.idletxhookstate = POLARITY_XOR(x) ? SLIC_LF_ACTIVE_REV : SLIC_LF_ACTIVE_FWD; /* Switch to Active : Reverse Forward */ + if ((wc->mod[x].fxs.lasttxhook == SLIC_LF_OHTRAN_FWD) || (wc->mod[x].fxs.lasttxhook == SLIC_LF_OHTRAN_REV )) { /* Apply the change if appropriate */ - wc->mod[x].fxs.lasttxhook = POLARITY_XOR(x) ? 0x5 : 0x1; + wc->mod[x].fxs.lasttxhook = POLARITY_XOR(x) ? SLIC_LF_ACTIVE_REV : SLIC_LF_ACTIVE_FWD; wctdm_setreg(wc, x, 64, wc->mod[x].fxs.lasttxhook); } } @@ -1473,21 +1483,21 @@ ); } if (POLARITY_XOR(chan_idx)) { - wc->mod[chan_idx].fxs.idletxhookstate |= 0x4; + wc->mod[chan_idx].fxs.idletxhookstate |= SLIC_LF_REVMASK; /* Do not set while currently ringing or open */ - if (wc->mod[chan_idx].fxs.lasttxhook != 0x04 && - wc->mod[chan_idx ].fxs.lasttxhook != 0x00) { - wc->mod[chan_idx ].fxs.lasttxhook |= 0x4; + if (wc->mod[chan_idx].fxs.lasttxhook != SLIC_LF_RINGING && + wc->mod[chan_idx ].fxs.lasttxhook != SLIC_LF_OPEN) { + wc->mod[chan_idx ].fxs.lasttxhook |= SLIC_LF_REVMASK; wctdm_setreg(wc, chan_idx, 64, wc->mod[chan_idx].fxs.lasttxhook); - } + } } else { - wc->mod[chan_idx].fxs.idletxhookstate &= ~0x04; + wc->mod[chan_idx].fxs.idletxhookstate &= ~SLIC_LF_REVMASK; /* Do not set while currently ringing or open */ - if (wc->mod[chan_idx].fxs.lasttxhook != 0x04 && - wc->mod[chan_idx].fxs.lasttxhook != 0x00) { - wc->mod[chan_idx].fxs.lasttxhook &= ~0x04; + if (wc->mod[chan_idx].fxs.lasttxhook != SLIC_LF_RINGING && + wc->mod[chan_idx].fxs.lasttxhook != SLIC_LF_OPEN) { + wc->mod[chan_idx].fxs.lasttxhook &= ~SLIC_LF_REVMASK; wctdm_setreg(wc, chan_idx, 64, wc->mod[chan_idx].fxs.lasttxhook); - } + } } return 0; } @@ -1618,9 +1628,9 @@ /* By default, don't send on hook */ if (!reversepolarity != !wc->mod[card].fxs.reversepolarity) - wc->mod[card].fxs.idletxhookstate = 5; + wc->mod[card].fxs.idletxhookstate = SLIC_LF_ACTIVE_REV; else - wc->mod[card].fxs.idletxhookstate = 1; + wc->mod[card].fxs.idletxhookstate = SLIC_LF_ACTIVE_FWD; if (sane) { /* Make sure we turn off the DC->DC converter to prevent anything from blowing up */ @@ -1857,10 +1867,10 @@ if (get_user(x, (__user int *) data)) return -EFAULT; wc->mod[chan->chanpos - 1].fxs.ohttimer = x << 3; - wc->mod[chan->chanpos - 1].fxs.idletxhookstate = POLARITY_XOR(chan->chanpos - 1) ? 0x6 : 0x2; /* OHT mode when idle */ - if (wc->mod[chan->chanpos - 1].fxs.lasttxhook == 0x1 || wc->mod[chan->chanpos - 1].fxs.lasttxhook == 0x5) { + wc->mod[chan->chanpos - 1].fxs.idletxhookstate = POLARITY_XOR(chan->chanpos - 1) ? SLIC_LF_ACTIVE_REV : SLIC_LF_ACTIVE_FWD; /* Active mode when idle */ + if (wc->mod[chan->chanpos - 1].fxs.lasttxhook == SLIC_LF_ACTIVE_FWD || wc->mod[chan->chanpos - 1].fxs.lasttxhook == SLIC_LF_ACTIVE_REV) { /* Apply the change if appropriate */ - wc->mod[chan->chanpos - 1].fxs.lasttxhook = POLARITY_XOR(chan->chanpos - 1) ? 0x6 : 0x2; + wc->mod[chan->chanpos - 1].fxs.lasttxhook = POLARITY_XOR(chan->chanpos - 1) ? SLIC_LF_OHTRAN_REV : SLIC_LF_OHTRAN_FWD; wctdm_setreg(wc, chan->chanpos - 1, 64, wc->mod[chan->chanpos - 1].fxs.lasttxhook); } break; @@ -1870,15 +1880,15 @@ if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS) return -EINVAL; /* Can't change polarity while ringing or when open */ - if ((wc->mod[chan->chanpos -1 ].fxs.lasttxhook == 0x04) || - (wc->mod[chan->chanpos -1 ].fxs.lasttxhook == 0x00)) + if ((wc->mod[chan->chanpos -1 ].fxs.lasttxhook == SLIC_LF_RINGING) || + (wc->mod[chan->chanpos -1 ].fxs.lasttxhook == SLIC_LF_OPEN)) return -EINVAL; wc->mod[chan->chanpos - 1].fxs.reversepolarity = x; if ( POLARITY_XOR(chan->chanpos - 1) ) - wc->mod[chan->chanpos - 1].fxs.lasttxhook |= 0x04; + wc->mod[chan->chanpos - 1].fxs.lasttxhook |= SLIC_LF_REVMASK; else - wc->mod[chan->chanpos - 1].fxs.lasttxhook &= ~0x04; + wc->mod[chan->chanpos - 1].fxs.lasttxhook &= ~SLIC_LF_REVMASK; wctdm_setreg(wc, chan->chanpos - 1, 64, wc->mod[chan->chanpos - 1].fxs.lasttxhook); break; case DAHDI_VMWI_CONFIG: @@ -2007,7 +2017,7 @@ struct wctdm *wc = chan->pvt; wc->usecount--; if (wc->modtype[chan->chanpos - 1] == MOD_TYPE_FXS) { - wc->mod[chan->chanpos - 1].fxs.idletxhookstate = POLARITY_XOR(chan->chanpos - 1) ? 0x5 : 0x1; + wc->mod[chan->chanpos - 1].fxs.idletxhookstate = POLARITY_XOR(chan->chanpos - 1) ? SLIC_LF_ACTIVE_REV : SLIC_LF_ACTIVE_FWD; } /* If we're dead, release us now */ if (!wc->usecount && wc->dead) @@ -2040,20 +2050,20 @@ switch(chan->sig) { case DAHDI_SIG_FXOKS: case DAHDI_SIG_FXOLS: - wc->mod[chan->chanpos-1].fxs.lasttxhook = (wc->mod[chan->chanpos-1].fxs.vmwi_hvac ? 4 : wc->mod[chan->chanpos-1].fxs.idletxhookstate); + wc->mod[chan->chanpos-1].fxs.lasttxhook = (wc->mod[chan->chanpos-1].fxs.vmwi_hvac ? SLIC_LF_RINGING : wc->mod[chan->chanpos-1].fxs.idletxhookstate); break; case DAHDI_SIG_EM: wc->mod[chan->chanpos-1].fxs.lasttxhook = wc->mod[chan->chanpos-1].fxs.idletxhookstate; break; case DAHDI_SIG_FXOGS: - wc->mod[chan->chanpos-1].fxs.lasttxhook = 3; + wc->mod[chan->chanpos-1].fxs.lasttxhook = SLIC_LF_TIP_OPEN; break; } break; case DAHDI_TXSIG_OFFHOOK: switch(chan->sig) { case DAHDI_SIG_EM: - wc->mod[chan->chanpos-1].fxs.lasttxhook = 5; + wc->mod[chan->chanpos-1].fxs.lasttxhook = SLIC_LF_ACTIVE_REV; break; default: wc->mod[chan->chanpos-1].fxs.lasttxhook = wc->mod[chan->chanpos-1].fxs.idletxhookstate; @@ -2061,10 +2071,10 @@ } break; case DAHDI_TXSIG_START: - wc->mod[chan->chanpos-1].fxs.lasttxhook = 4; + wc->mod[chan->chanpos-1].fxs.lasttxhook = SLIC_LF_RINGING; break; case DAHDI_TXSIG_KEWL: - wc->mod[chan->chanpos-1].fxs.lasttxhook = 0; + wc->mod[chan->chanpos-1].fxs.lasttxhook = SLIC_LF_OPEN; break; default: printk(KERN_NOTICE "wctdm: Can't set tx state to %d\n", txsig); Index: drivers/dahdi/proslic.h =================================================================== --- drivers/dahdi/proslic.h (revision 6918) +++ drivers/dahdi/proslic.h (working copy) @@ -35,6 +35,19 @@ // Defines #define LPT 0X378 +/* Proslic Linefeed options for register 64 - Linefeed Control */ +#define SLIC_LF_OPEN 0x0 +#define SLIC_LF_ACTIVE_FWD 0x1 +#define SLIC_LF_OHTRAN_FWD 0x2 +#define SLIC_LF_TIP_OPEN 0x3 +#define SLIC_LF_RINGING 0x4 +#define SLIC_LF_ACTIVE_REV 0x5 +#define SLIC_LF_OHTRAN_REV 0x6 +#define SLIC_LF_RING_OPEN 0x7 + +/* Mask used to reverse the linefeed mode between forward and reverse polarity */ +#define SLIC_LF_REVMASK 0x4 + #define IDA_LO 28 #define IDA_HI 29 Index: drivers/dahdi/wctdm24xxp/base.c =================================================================== --- drivers/dahdi/wctdm24xxp/base.c (revision 6918) +++ drivers/dahdi/wctdm24xxp/base.c (working copy) @@ -1196,8 +1196,8 @@ wc->mods[card].fxs.palarms++; if (wc->mods[card].fxs.palarms < MAX_ALARMS) { printk(KERN_NOTICE "Power alarm (%02x) on module %d, resetting!\n", res, card + 1); - if (wc->mods[card].fxs.lasttxhook == 4) { - wc->mods[card].fxs.lasttxhook = POLARITY_XOR(card) ? 0x15 : 0x11; + if (wc->mods[card].fxs.lasttxhook == SLIC_LF_RINGING) { + wc->mods[card].fxs.lasttxhook = 0x10 | POLARITY_XOR(card) ? SLIC_LF_ACTIVE_REV : SLIC_LF_ACTIVE_FWD; } wc->sethook[card] = CMD_WR(19, res); #if 0 @@ -1226,8 +1226,8 @@ wc->mods[card].fxs.palarms++; if (wc->mods[card].fxs.palarms < MAX_ALARMS) { printk(KERN_NOTICE "Power alarm on module %d, resetting!\n", card + 1); - if (wc->mods[card].fxs.lasttxhook == 4) { - wc->mods[card].fxs.lasttxhook = POLARITY_XOR(card) ? 0x15 : 0x11;; + if (wc->mods[card].fxs.lasttxhook == SLIC_LF_RINGING) { + wc->mods[card].fxs.lasttxhook = POLARITY_XOR(card) ? SLIC_LF_ACTIVE_REV : SLIC_LF_ACTIVE_FWD;; } wc->mods[card].fxs.lasttxhook |= 0x10; wc->sethook[card] = CMD_WR(64, wc->mods[card].fxs.lasttxhook); @@ -1600,6 +1600,14 @@ /* Off hook */ if (debug & DEBUG_CARD) printk(KERN_DEBUG "wctdm: Card %d Going off hook\n", card); + switch ( wc->mods[card].fxs.lasttxhook ) { + case SLIC_LF_RINGING: /* Ringing */ + case SLIC_LF_OHTRAN_FWD: /* Forward On Hook Transfer */ + case SLIC_LF_OHTRAN_REV: /* Reverse On Hook Transfer */ + /* just detected OffHook, during Ringing or OnHookTransfer */ + wc->mods[card].fxs.idletxhookstate = POLARITY_XOR(card) ? SLIC_LF_ACTIVE_REV : SLIC_LF_ACTIVE_FWD; /* Active */ + break; + } dahdi_hooksig(wc->chans[card], DAHDI_RXSIG_OFFHOOK); if (robust) wctdm_init_proslic(wc, card, 1, 0, 1); @@ -1728,23 +1736,23 @@ wctdm_proslic_check_hook(wc, x); if (!(wc->intcount & 0xfc)) wctdm_proslic_recheck_sanity(wc, x); - if (wc->mods[x].fxs.lasttxhook == 0x4) { + if (wc->mods[x].fxs.lasttxhook == SLIC_LF_RINGING) { /* RINGing, prepare for OHT */ wc->mods[x].fxs.ohttimer = OHT_TIMER << 3; - wc->mods[x].fxs.idletxhookstate = POLARITY_XOR(x) ? 0x6 : 0x2; /* OHT mode when idle */ + wc->mods[x].fxs.idletxhookstate = POLARITY_XOR(x) ? SLIC_LF_OHTRAN_REV : SLIC_LF_OHTRAN_FWD; /* OHT mode when idle */ } else { if (wc->mods[x].fxs.ohttimer) { wc->mods[x].fxs.ohttimer-= DAHDI_CHUNKSIZE; if (!wc->mods[x].fxs.ohttimer) { - wc->mods[x].fxs.idletxhookstate = POLARITY_XOR(x) ? 0x5 : 0x1; /* Switch to active */ - if (wc->mods[x].fxs.lasttxhook == 0x2) { + wc->mods[x].fxs.idletxhookstate = POLARITY_XOR(x) ? SLIC_LF_ACTIVE_REV : SLIC_LF_ACTIVE_FWD; /* Switch to active */ + if (wc->mods[x].fxs.lasttxhook == SLIC_LF_OHTRAN_FWD) { /* Apply the change if appropriate */ - wc->mods[x].fxs.lasttxhook = 0x11; + wc->mods[x].fxs.lasttxhook = 0x10 | SLIC_LF_ACTIVE_FWD; wc->sethook[x] = CMD_WR(64, wc->mods[x].fxs.lasttxhook); /* Data enqueued here */ /* wctdm_setreg_intr(wc, x, 64, wc->mods[x].fxs.lasttxhook); */ - } else if (wc->mods[x].fxs.lasttxhook == 0x6) { + } else if (wc->mods[x].fxs.lasttxhook == SLIC_LF_OHTRAN_REV) { /* Apply the change if appropriate */ - wc->mods[x].fxs.lasttxhook = 0x15; + wc->mods[x].fxs.lasttxhook = 0x10 | SLIC_LF_ACTIVE_REV; wc->sethook[x] = CMD_WR(64, wc->mods[x].fxs.lasttxhook); /* Data enqueued here */ /* wctdm_setreg_intr(wc, x, 64, wc->mods[x].fxs.lasttxhook); */ } @@ -2129,20 +2137,20 @@ } /* Set line polarity for new VMWI state */ if (POLARITY_XOR(chan_idx)) { - wc->mods[chan_idx].fxs.idletxhookstate |= 0x14; + wc->mods[chan_idx].fxs.idletxhookstate |= 0x10 | SLIC_LF_REVMASK; /* Do not set while currently ringing or open */ - if (wc->mods[chan_idx].fxs.lasttxhook != 0x04 && - wc->mods[chan_idx].fxs.lasttxhook != 0x00) { - wc->mods[chan_idx].fxs.lasttxhook |= 0x14; + if (wc->mods[chan_idx].fxs.lasttxhook != SLIC_LF_RINGING && + wc->mods[chan_idx].fxs.lasttxhook != SLIC_LF_OPEN) { + wc->mods[chan_idx].fxs.lasttxhook |= 0x10 | SLIC_LF_REVMASK; wc->sethook[chan_idx] = CMD_WR(64, wc->mods[chan_idx].fxs.lasttxhook); - } + } } else { - wc->mods[chan_idx].fxs.idletxhookstate &= ~0x04; + wc->mods[chan_idx].fxs.idletxhookstate &= ~SLIC_LF_REVMASK; /* Do not set while currently ringing or open */ - if (wc->mods[chan_idx].fxs.lasttxhook != 0x04 && - wc->mods[chan_idx].fxs.lasttxhook != 0x00) { + if (wc->mods[chan_idx].fxs.lasttxhook != SLIC_LF_RINGING && + wc->mods[chan_idx].fxs.lasttxhook != SLIC_LF_OPEN) { x = wc->mods[chan_idx].fxs.lasttxhook; - x &= ~0x04; + x &= ~SLIC_LF_REVMASK; x |= 0x10; wc->mods[chan_idx].fxs.lasttxhook = x; wc->sethook[chan_idx] = CMD_WR(64, wc->mods[chan_idx].fxs.lasttxhook); @@ -2281,9 +2289,9 @@ /* By default, don't send on hook */ if (!reversepolarity != !wc->mods[card].fxs.reversepolarity) { - wc->mods[card].fxs.idletxhookstate = 5; + wc->mods[card].fxs.idletxhookstate = SLIC_LF_ACTIVE_REV; } else { - wc->mods[card].fxs.idletxhookstate = 1; + wc->mods[card].fxs.idletxhookstate = SLIC_LF_ACTIVE_FWD; } wc->mods[card].fxs.lasttxhook = 0x10; @@ -2660,10 +2668,10 @@ if (get_user(x, (__user int *) data)) return -EFAULT; wc->mods[chan->chanpos - 1].fxs.ohttimer = x << 3; - wc->mods[chan->chanpos - 1].fxs.idletxhookstate = 0x2; /* OHT mode when idle */ - if (wc->mods[chan->chanpos - 1].fxs.lasttxhook == 0x1 || wc->mods[chan->chanpos - 1].fxs.lasttxhook == 0x5) { + wc->mods[chan->chanpos - 1].fxs.idletxhookstate = POLARITY_XOR(chan->chanpos - 1) ? SLIC_LF_ACTIVE_REV : SLIC_LF_ACTIVE_FWD; /* Active mode when idle */ + if (wc->mods[chan->chanpos - 1].fxs.lasttxhook == SLIC_LF_ACTIVE_FWD || wc->mods[chan->chanpos - 1].fxs.lasttxhook == SLIC_LF_ACTIVE_REV) { /* Apply the change if appropriate */ - wc->mods[chan->chanpos - 1].fxs.lasttxhook = POLARITY_XOR(chan->chanpos -1) ? 0x16 : 0x12; + wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x10 | POLARITY_XOR(chan->chanpos -1) ? SLIC_LF_OHTRAN_REV : SLIC_LF_OHTRAN_FWD; 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); */ } @@ -2782,8 +2790,8 @@ if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS) return -EINVAL; /* Can't change polarity while ringing or when open */ - if ((wc->mods[chan->chanpos -1 ].fxs.lasttxhook == 0x04) || - (wc->mods[chan->chanpos -1 ].fxs.lasttxhook == 0x00)) + if ((wc->mods[chan->chanpos -1 ].fxs.lasttxhook == SLIC_LF_RINGING) || + (wc->mods[chan->chanpos -1 ].fxs.lasttxhook == SLIC_LF_OPEN)) return -EINVAL; if (x) { wc->mods[chan->chanpos -1 ].fxs.reversepolarity = 1; @@ -2791,12 +2799,12 @@ wc->mods[chan->chanpos -1 ].fxs.reversepolarity = 0; } if (POLARITY_XOR(chan->chanpos -1)) { - wc->mods[chan->chanpos -1 ].fxs.idletxhookstate |= 0x14; - wc->mods[chan->chanpos -1 ].fxs.lasttxhook |= 0x14; + wc->mods[chan->chanpos -1 ].fxs.idletxhookstate |= SLIC_LF_REVMASK; + wc->mods[chan->chanpos -1 ].fxs.lasttxhook |= 0x10 | SLIC_LF_REVMASK; } else { - wc->mods[chan->chanpos -1 ].fxs.idletxhookstate &= ~0x04; + wc->mods[chan->chanpos -1 ].fxs.idletxhookstate &= ~SLIC_LF_REVMASK; x = wc->mods[chan->chanpos -1 ].fxs.lasttxhook; - x &= ~0x04; + x &= ~SLIC_LF_REVMASK; x |= 0x10; wc->mods[chan->chanpos -1 ].fxs.lasttxhook = x; } @@ -2985,7 +2993,7 @@ wc->usecount--; for (x=0;xcards;x++) { if (wc->modtype[x] == MOD_TYPE_FXS) { - wc->mods[x].fxs.idletxhookstate = POLARITY_XOR(x) ? 5 : 1; + wc->mods[x].fxs.idletxhookstate = POLARITY_XOR(x) ? SLIC_LF_ACTIVE_REV : SLIC_LF_ACTIVE_FWD; } if (wc->modtype[x] == MOD_TYPE_QRV) { @@ -3061,9 +3069,9 @@ break; case DAHDI_SIG_FXOGS: if (POLARITY_XOR(chan->chanpos -1)) { - wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x17; + wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x10 | SLIC_LF_RING_OPEN; } else { - wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x13; + wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x10 | SLIC_LF_TIP_OPEN; } break; } @@ -3072,9 +3080,9 @@ switch(chan->sig) { case DAHDI_SIG_EM: if (POLARITY_XOR(chan->chanpos -1)) { - wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x11; + wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x10 | SLIC_LF_ACTIVE_FWD; } else { - wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x15; + wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x10 | SLIC_LF_ACTIVE_REV; } break; default: @@ -3084,10 +3092,10 @@ } break; case DAHDI_TXSIG_START: - wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x14; + wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x10 | SLIC_LF_RINGING; break; case DAHDI_TXSIG_KEWL: - wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x10; + wc->mods[chan->chanpos - 1].fxs.lasttxhook = 0x10 | SLIC_LF_OPEN; break; default: printk(KERN_NOTICE "wctdm24xxp: Can't set tx state to %d\n", txsig);