diff options
Diffstat (limited to 'xpp')
-rw-r--r-- | xpp/card_fxo.c | 10 | ||||
-rw-r--r-- | xpp/utils/xpp_fxloader | 2 |
2 files changed, 8 insertions, 4 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); diff --git a/xpp/utils/xpp_fxloader b/xpp/utils/xpp_fxloader index eb46ccc..5584b5f 100644 --- a/xpp/utils/xpp_fxloader +++ b/xpp/utils/xpp_fxloader @@ -215,7 +215,7 @@ esac ## # 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 |