diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-06-07 21:54:07 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-06-07 21:54:07 +0000 |
commit | 2a18f0d45900c2895f7f6b04c957291abeb6dced (patch) | |
tree | c13011d4e5bb7f099bb21b8c2af66b2ee3cb92c8 /xpp/card_fxo.c | |
parent | 2bed549be6b64b6a38fff9b8cc28fdadb1cc588d (diff) |
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)
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2589 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/card_fxo.c')
-rw-r--r-- | xpp/card_fxo.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/xpp/card_fxo.c b/xpp/card_fxo.c index ad8e438..4c2ac87 100644 --- a/xpp/card_fxo.c +++ b/xpp/card_fxo.c @@ -82,6 +82,9 @@ static int handle_register_command(xpd_t *xpd, char *cmdline); #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 @@ static int do_sethook(xpd_t *xpd, int pos, bool to_offhook) 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 @@ static void update_power_denial(xpd_t *xpd, byte data_low, lineno_t chipsel) 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); |