[svn-commits] sruffell: linux/trunk r7003 - in /linux/trunk/drivers/dahdi: ./ wctdm24xxp/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Aug 13 19:46:34 CDT 2009


Author: sruffell
Date: Thu Aug 13 19:46:26 2009
New Revision: 7003

URL: http://svn.asterisk.org/svn-view/dahdi?view=rev&rev=7003
Log:
wctdm24xxp, wctdm: Detect if our hookstate has been set back to the initial state.

Check if our hookstate has been set back to the initial state, typically the
result of a chanconfig, and if so, if we're an FXO port, forget our current
battery state.  This allows the driver to determine and report again what the
hook state of the port is.

(related to issue #14577)
(closes issue #15429)

Modified:
    linux/trunk/drivers/dahdi/wctdm.c
    linux/trunk/drivers/dahdi/wctdm24xxp/base.c

Modified: linux/trunk/drivers/dahdi/wctdm.c
URL: http://svn.asterisk.org/svn-view/dahdi/linux/trunk/drivers/dahdi/wctdm.c?view=diff&rev=7003&r1=7002&r2=7003
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm.c (original)
+++ linux/trunk/drivers/dahdi/wctdm.c Thu Aug 13 19:46:26 2009
@@ -840,6 +840,21 @@
 		if (!(count++ % 100)) {
 			printk(KERN_DEBUG "Card %d: Voltage: %d Debounce %d\n", card + 1, b, fxo->battdebounce);
 		}
+	}
+
+	if (unlikely(DAHDI_RXSIG_INITIAL == wc->chans[card]->rxhooksig)) {
+		/*
+		 * dahdi-base will set DAHDI_RXSIG_INITIAL after a
+		 * DAHDI_STARTUP or DAHDI_CHANCONFIG ioctl so that new events
+		 * will be queued on the channel with the current received
+		 * hook state.  Channels that use robbed-bit signalling always
+		 * report the current received state via the dahdi_rbsbits
+		 * call. Since we only call dahdi_hooksig when we've detected
+		 * a change to report, let's forget our current state in order
+		 * to force us to report it again via dahdi_hooksig.
+		 *
+		 */
+		fxo->battery = BATTERY_UNKNOWN;
 	}
 
 	if (abs(b) < battthresh) {

Modified: linux/trunk/drivers/dahdi/wctdm24xxp/base.c
URL: http://svn.asterisk.org/svn-view/dahdi/linux/trunk/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=7003&r1=7002&r2=7003
==============================================================================
--- linux/trunk/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/trunk/drivers/dahdi/wctdm24xxp/base.c Thu Aug 13 19:46:26 2009
@@ -1403,6 +1403,21 @@
 			printk(KERN_INFO "Port %d: Voltage: %d  Debounce %d\n", card + 1, 
 			       b, fxo->battdebounce);
 		}
+	}
+
+	if (unlikely(DAHDI_RXSIG_INITIAL == wc->chans[card]->rxhooksig)) {
+		/*
+		 * dahdi-base will set DAHDI_RXSIG_INITIAL after a
+		 * DAHDI_STARTUP or DAHDI_CHANCONFIG ioctl so that new events
+		 * will be queued on the channel with the current received
+		 * hook state.  Channels that use robbed-bit signalling always
+		 * report the current received state via the dahdi_rbsbits
+		 * call. Since we only call dahdi_hooksig when we've detected
+		 * a change to report, let's forget our current state in order
+		 * to force us to report it again via dahdi_hooksig.
+		 *
+		 */
+		fxo->battery = BATTERY_UNKNOWN;
 	}
 
 	if (abs_voltage < battthresh) {




More information about the svn-commits mailing list