From 02ee489e79c4b0c1f5f40fa722d0f94feb950505 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Wed, 21 Mar 2012 20:18:26 +0000 Subject: xpp: FXS: added a 'lower_ringing_noise' parameter * Adds a new parameter, 'lower_ringing_noise', to module xpd_fxs. * Makes the "power-down" behaviour that was added in upstream svn r10478, switchable in runtime. * By default (false), makes the vbat_h behave like it did before the power-down change. - I.e: vbat_h is held throughout the ringing period (during both ring-up/ring-down) - So this patch revert part of r10478 * When switched to true, activate the "power-down" behaviour. - I.e: vbat_h follows the ring-up/ring-down. - This behaviour lowers the noise caused by group ringing of FXS channels in the same unit, but causes problems with CallerID. Signed-off-by: Oron Peled Acked-by: Tzafrir Cohen git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10574 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/xpp/card_fxs.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/dahdi/xpp/card_fxs.c b/drivers/dahdi/xpp/card_fxs.c index e8f0e2a..e92c775 100644 --- a/drivers/dahdi/xpp/card_fxs.c +++ b/drivers/dahdi/xpp/card_fxs.c @@ -44,6 +44,8 @@ static DEF_PARM(uint, poll_digital_inputs, 1000, 0644, "Poll Digital Inputs"); static DEF_PARM_BOOL(vmwi_ioctl, 1, 0644, "Asterisk support VMWI notification via ioctl"); static DEF_PARM_BOOL(ring_trapez, 0, 0664, "Use trapezoid ring type"); +static DEF_PARM_BOOL(lower_ringing_noise, 0, 0664, + "Lower ringing noise (may loose CallerID)"); /* Signaling is opposite (fxo signalling for fxs card) */ #if 1 @@ -208,13 +210,20 @@ static int linefeed_control(xbus_t *xbus, xpd_t *xpd, lineno_t chan, enum fxs_state value) { struct FXS_priv_data *priv; - bool want_vbat_h = (value == FXS_LINE_RING) ? 1 : 0; + bool want_vbat_h; priv = xpd->priv; + /* + * Should we drop vbat_h only during actuall ring? + * - It would lower the noise caused to other channels by + * group ringing + * - But it may also stop CallerID from passing through the SLIC + */ + want_vbat_h = value == FXS_LINE_RING; + if (lower_ringing_noise || want_vbat_h) + do_chan_power(xbus, xpd, chan, want_vbat_h); LINE_DBG(SIGNAL, xpd, chan, "value=0x%02X\n", value); priv->lasttxhook[chan] = value; - if (IS_SET(priv->vbat_h, chan) != want_vbat_h) - do_chan_power(xbus, xpd, chan, want_vbat_h); return SLIC_DIRECT_REQUEST(xbus, xpd, chan, SLIC_WRITE, 0x40, value); } @@ -755,6 +764,7 @@ static void start_stop_vm_led(xbus_t *xbus, xpd_t *xpd, lineno_t pos) msgs = PHONEDEV(xpd).msg_waiting[pos]; LINE_DBG(SIGNAL, xpd, pos, "%s\n", (msgs) ? "ON" : "OFF"); set_vm_led_mode(xbus, xpd, pos, msgs); + do_chan_power(xbus, xpd, pos, msgs > 0); linefeed_control(xbus, xpd, pos, (msgs > 0) ? FXS_LINE_RING : priv->idletxhookstate[pos]); @@ -794,6 +804,7 @@ static int send_ring(xpd_t *xpd, lineno_t chan, bool on) LINE_DBG(SIGNAL, xpd, chan, "%s\n", (on) ? "on" : "off"); priv = xpd->priv; set_vm_led_mode(xbus, xpd, chan, 0); + do_chan_power(xbus, xpd, chan, on); /* Power up (for ring) */ ret = linefeed_control(xbus, xpd, chan, value); if (on) { MARK_BLINK(priv, chan, LED_GREEN, LED_BLINK_RING); -- cgit v1.2.3