--- wctdm.c.7109 2009-09-15 21:49:06.000000000 +1200 +++ wctdm.c 2009-09-15 22:00:00.000000000 +1200 @@ -1509,9 +1509,9 @@ static int set_vmwi(struct wctdm * wc, i { struct fxs *const fxs = &wc->mod[chan_idx].fxs; if (fxs->vmwi_active_messages){ - fxs->vmwi_lrev = (wc->mod[chan_idx].fxs.vmwisetting.vmwi_type & DAHDI_VMWI_LREV)?1:0; - fxs->vmwi_hvdc = (wc->mod[chan_idx].fxs.vmwisetting.vmwi_type & DAHDI_VMWI_HVDC)?1:0; - fxs->vmwi_hvac = (wc->mod[chan_idx].fxs.vmwisetting.vmwi_type & DAHDI_VMWI_HVAC)?1:0; + fxs->vmwi_lrev = (fxs->vmwisetting.vmwi_type & DAHDI_VMWI_LREV)?1:0; + fxs->vmwi_hvdc = (fxs->vmwisetting.vmwi_type & DAHDI_VMWI_HVDC)?1:0; + fxs->vmwi_hvac = (fxs->vmwisetting.vmwi_type & DAHDI_VMWI_HVAC)?1:0; } else { fxs->vmwi_lrev = 0; fxs->vmwi_hvdc = 0; @@ -1521,15 +1521,15 @@ static int set_vmwi(struct wctdm * wc, i if (debug) { printk(KERN_DEBUG "Setting VMWI on channel %d, messages=%d, lrev=%d, hvdc=%d, hvac=%d\n", chan_idx, - wc->mod[chan_idx].fxs.vmwi_active_messages, - wc->mod[chan_idx].fxs.vmwi_lrev, - wc->mod[chan_idx].fxs.vmwi_hvdc, - wc->mod[chan_idx].fxs.vmwi_hvac + fxs->vmwi_active_messages, + fxs->vmwi_lrev, + fxs->vmwi_hvdc, + fxs->vmwi_hvac ); } - if (wc->mod[chan_idx].fxs.vmwi_hvac){ + if (fxs->vmwi_hvac){ /* Can't change ring generator while On Hook Transfer might be happening */ - if (!wc->mod[chan_idx].fxs.ohttimer) { + if (!fxs->ohttimer) { if (POLARITY_XOR) { fxs->idletxhookstate |= SLIC_LF_REVMASK; } else { @@ -1545,11 +1545,11 @@ static int set_vmwi(struct wctdm * wc, i fxs->lasttxhook = SLIC_LF_ACTIVE_FWD; /* ACTIVE, polarity determined later */ } else { /* Can't change polarity while ringing or when open, set idlehookstate instead */ - if ((wc->mod[chan_idx].fxs.lasttxhook == SLIC_LF_RINGING) || (wc->mod[chan_idx].fxs.lasttxhook == SLIC_LF_OPEN)){ + if ((fxs->lasttxhook == SLIC_LF_RINGING) || (fxs->lasttxhook == SLIC_LF_OPEN)){ if (POLARITY_XOR) { - wc->mod[chan_idx].fxs.idletxhookstate |= SLIC_LF_REVMASK; + fxs->idletxhookstate |= SLIC_LF_REVMASK; } else { - wc->mod[chan_idx].fxs.idletxhookstate &= ~SLIC_LF_REVMASK; + fxs->idletxhookstate &= ~SLIC_LF_REVMASK; } printk(KERN_DEBUG "Unable to change polarity on channel %d, lasttxhook=0x%X\n", chan_idx, @@ -1565,7 +1565,7 @@ static int set_vmwi(struct wctdm * wc, i fxs->idletxhookstate &= ~SLIC_LF_REVMASK; fxs->lasttxhook &= ~SLIC_LF_REVMASK; } - wctdm_setreg(wc, chan_idx, LINE_STATE, wc->mod[chan_idx].fxs.lasttxhook); + wctdm_setreg(wc, chan_idx, LINE_STATE, fxs->lasttxhook); } return 0; } @@ -1907,8 +1907,8 @@ static int wctdm_ioctl(struct dahdi_chan return -EFAULT; fxs->ohttimer = x << 3; - /* OHT mode when idle */ - fxs->idletxhookstate = POLARITY_XOR ? SLIC_LF_OHTRAN_REV : SLIC_LF_OHTRAN_FWD; + /* Active mode when idle */ + fxs->idletxhookstate = POLARITY_XOR ? SLIC_LF_ACTIVE_REV : SLIC_LF_ACTIVE_FWD; if (fxs->neonringing) { /* keep same Forward polarity */ fxs->lasttxhook = SLIC_LF_OHTRAN_FWD; @@ -1926,8 +1926,8 @@ static int wctdm_ioctl(struct dahdi_chan if (get_user(x, (__user int *) data)) return -EFAULT; /* Can't change polarity while ringing or when open */ - if ((wc->mod[chan->chanpos - 1 ].fxs.lasttxhook == SLIC_LF_RINGING) || - (wc->mod[chan->chanpos - 1 ].fxs.lasttxhook == SLIC_LF_OPEN)) + if ((fxs->lasttxhook == SLIC_LF_RINGING) || + (fxs->lasttxhook == SLIC_LF_OPEN)) return -EINVAL; fxs->reversepolarity = x; if ( POLARITY_XOR ) @@ -2100,7 +2100,7 @@ static int wctdm_set_ring_generator_mode if (mode) { /* Neon */ if (debug) printk(KERN_DEBUG "NEON ring on channel %d, lasttxhook was 0x%x\n", card, fxs->lasttxhook); - fxs->lasttxhook = 0x1; /* Must be in FORWARD ACTIVE before setting ringer */ + fxs->lasttxhook = SLIC_LF_ACTIVE_FWD; /* Must be in FORWARD ACTIVE before setting ringer */ wctdm_setreg(wc, card, LINE_STATE, fxs->lasttxhook); wctdm_proslic_setreg_indirect(wc, card, 22, 0x03e8); /* RNGY (4 HZ) */