[zaptel-commits] tzafrir: trunk r1392 - /trunk/xpp/card_fxo.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Mon Sep 4 16:08:25 MST 2006


Author: tzafrir
Date: Mon Sep  4 18:08:24 2006
New Revision: 1392

URL: http://svn.digium.com/view/zaptel?rev=1392&view=rev
Log:
Workaround spurious rings described in ticket:102 .

Modified:
    trunk/xpp/card_fxo.c

Modified: trunk/xpp/card_fxo.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/card_fxo.c?rev=1392&r1=1391&r2=1392&view=diff
==============================================================================
--- trunk/xpp/card_fxo.c (original)
+++ trunk/xpp/card_fxo.c Mon Sep  4 18:08:24 2006
@@ -253,7 +253,7 @@
 	priv = xpd->priv;
 	BUG_ON(!priv);
 	if(!IS_SET(priv->battery, pos)) {
-		DBG("%s/%s/%d: WARNING: called while battery is off\n", xpd->xbus->busname, xpd->xpdname, pos);
+		NOTICE("%s/%s/%d: WARNING: called while battery is off\n", xpd->xbus->busname, xpd->xpdname, pos);
 	}
 	spin_lock_irqsave(&xpd->lock, flags);
 	mark_ring(xpd, pos, 0);				// No more rings
@@ -678,6 +678,11 @@
 	spin_lock_irqsave(&xpd->lock, flags);
 	for_each_line(xpd, i) {
 		if(IS_SET(sig_toggles, i)) {
+			if(!IS_SET(priv->battery, i)) {
+				DBG("%s/%s/%d: battery is off. ignore false alarm.\n",
+					xbus->busname, xpd->xpdname, i);
+				continue;
+			}
 			if(IS_SET(sig_status, i)) {
 #ifdef	SOFT_RING
 				priv->ring_sig[i]=1;		/* trigger register polling */
@@ -727,14 +732,14 @@
 				 */
 				if(IS_SET(priv->battery, i) && priv->battery_debounce[i]++ > BAT_DEBOUNCE) {
 					DBG("%s/%s: BATTERY OFF (%04X) voltage=%d\n", xpd->xbus->busname, xpd->xpdname, lines, bat);
-					priv->battery &= ~lines;
+					BIT_CLR(priv->battery, i);
 					update_line_status(xpd, i, 0);
 				}
 			} else {
 				priv->battery_debounce[i] = 0;
 				if(!IS_SET(priv->battery, i)) {
 					DBG("%s/%s: BATTERY ON (%04X) voltage=%d\n", xpd->xbus->busname, xpd->xpdname, lines, bat);
-					priv->battery |= lines;
+					BIT_SET(priv->battery, i);
 					update_line_status(xpd, i, 1);
 				}
 			}



More information about the zaptel-commits mailing list