[svn-commits] tzafrir: branch 1.4 r2591 - in /branches/1.4/xpp: card_fxo.c utils/xpp_fxloader

svn-commits at lists.digium.com svn-commits at lists.digium.com
Thu Jun 7 15:36:45 MST 2007


Author: tzafrir
Date: Thu Jun  7 17:36:45 2007
New Revision: 2591

URL: http://svn.digium.com/view/zaptel?view=rev&rev=2591
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:
    branches/1.4/xpp/card_fxo.c
    branches/1.4/xpp/utils/xpp_fxloader

Modified: branches/1.4/xpp/card_fxo.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/xpp/card_fxo.c?view=diff&rev=2591&r1=2590&r2=2591
==============================================================================
--- branches/1.4/xpp/card_fxo.c (original)
+++ branches/1.4/xpp/card_fxo.c Thu Jun  7 17:36: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: branches/1.4/xpp/utils/xpp_fxloader
URL: http://svn.digium.com/view/zaptel/branches/1.4/xpp/utils/xpp_fxloader?view=diff&rev=2591&r1=2590&r2=2591
==============================================================================
--- branches/1.4/xpp/utils/xpp_fxloader (original)
+++ branches/1.4/xpp/utils/xpp_fxloader Thu Jun  7 17:36: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