[dahdi-commits] tzafrir: linux/trunk r10574 - /linux/trunk/drivers/dahdi/xpp/card_fxs.c

SVN commits to the DAHDI project dahdi-commits at lists.digium.com
Wed Mar 21 15:18:28 CDT 2012


Author: tzafrir
Date: Wed Mar 21 15:18:26 2012
New Revision: 10574

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=10574
Log:
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 <oron.peled at xorcom.com>
Acked-by: Tzafrir Cohen <tzafrir.cohen at xorcom.com>

Modified:
    linux/trunk/drivers/dahdi/xpp/card_fxs.c

Modified: linux/trunk/drivers/dahdi/xpp/card_fxs.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/card_fxs.c?view=diff&rev=10574&r1=10573&r2=10574
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/card_fxs.c (original)
+++ linux/trunk/drivers/dahdi/xpp/card_fxs.c Wed Mar 21 15:18:26 2012
@@ -44,6 +44,8 @@
 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 @@
 			    enum fxs_state value)
 {
 	struct FXS_priv_data *priv;
-	bool want_vbat_h = (value == FXS_LINE_RING) ? 1 : 0;
-
-	priv = xpd->priv;
+	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 @@
 	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 @@
 	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);




More information about the dahdi-commits mailing list