[svn-commits] tzafrir: trunk r2592 - in /trunk/xpp: card_fxo.c utils/xpp_fxloader

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu Jun 7 16:06:46 MST 2007


Author: tzafrir
Date: Thu Jun  7 18:06:45 2007
New Revision: 2592

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2592
Log:
Some XPP bugfixes:
* Fix FXO power denial detection (changeset:4054)
* Incorrect data type could cause FXO module to go off-hook
  (changeset:4048)
* xpp_fxloader: fix the error message when you want to disable automatic
  firmware loading... (changeset:4060)

Merged from: branches/1.2 r2589

Modified:
    trunk/xpp/card_fxo.c
    trunk/xpp/utils/xpp_fxloader

Modified: trunk/xpp/card_fxo.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/card_fxo.c?view=diff&rev=2592&r1=2591&r2=2592
==============================================================================
--- trunk/xpp/card_fxo.c (original)
+++ trunk/xpp/card_fxo.c Thu Jun  7 18:06:45 2007
@@ -82,6 +82,9 @@
 #define	DAA_CURRENT_REGISTER	0x1C
 #define	DAA_RING_REGISTER	0x05
 
+#define	POWER_DENIAL_CURRENT	3
+#define	POWER_DENIAL_TIME	1000	/* ticks */
+
 struct FXO_priv_data {
 	struct proc_dir_entry	*regfile;
 	struct proc_dir_entry	*fxo_info;
@@ -210,7 +213,7 @@
 	xbus_t			*xbus;
 	struct FXO_priv_data	*priv;
 	int			ret = 0;
-	bool			value;
+	byte			value;
 
 	BUG_ON(!xpd);
 	BUG_ON(xpd->direction == TO_PHONE);		// We can SETHOOK state only on PSTN
@@ -708,9 +711,10 @@
 
 	priv = xpd->priv;
 	BUG_ON(!priv);
-	if (IS_SET(xpd->offhook, chipsel) && data_low < 3) {
+	if (IS_SET(xpd->offhook, chipsel) && data_low < POWER_DENIAL_CURRENT) {
+		/* Current dropped */
 		priv->current_counter[chipsel]++;
-		if (priv->current_counter[chipsel] >= 10) {
+		if (priv->current_counter[chipsel] * poll_battery_interval >= POWER_DENIAL_TIME) {
 			DBG("%s/%s/%d: Power Denial Hangup\n", xpd->xbus->busname, xpd->xpdname, chipsel);
 			priv->current_counter[chipsel] = 0;
 			do_sethook(xpd, chipsel, 0);

Modified: trunk/xpp/utils/xpp_fxloader
URL: http://svn.digium.com/view/zaptel/trunk/xpp/utils/xpp_fxloader?view=diff&rev=2592&r1=2591&r2=2592
==============================================================================
--- trunk/xpp/utils/xpp_fxloader (original)
+++ trunk/xpp/utils/xpp_fxloader Thu Jun  7 18:06:45 2007
@@ -215,7 +215,7 @@
 ##
 
 # allow disabling automatic hotplugging:
-if [ "$XPP_HOTPLUG_DISABLED" != '' ]; then return 0; fi
+if [ "$XPP_HOTPLUG_DISABLED" != '' ]; then exit 0; fi
 
 if [ "$ACTION" = "add" ] && [ -w "$DEVICE" ]
 then



More information about the svn-commits mailing list