diff options
-rw-r--r-- | xpp/card_fxo.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/xpp/card_fxo.c b/xpp/card_fxo.c index 1b3e6cc..56ed05a 100644 --- a/xpp/card_fxo.c +++ b/xpp/card_fxo.c @@ -82,6 +82,7 @@ static int process_slic_cmdline(xpd_t *xpd, char *cmdline); struct FXO_priv_data { struct proc_dir_entry *xpd_slic; struct proc_dir_entry *fxo_info; + uint poll_counter; slic_reply_t requested_reply; slic_reply_t last_reply; xpp_line_t battery; @@ -211,7 +212,7 @@ static void mark_ring(xpd_t *xpd, lineno_t pos, bool on) } } -static __do_sethook(xbus_t *xbus, xpd_t *xpd, int pos, bool offhook) +static int __do_sethook(xbus_t *xbus, xpd_t *xpd, int pos, bool offhook) { int ret = 0; xpacket_t *pack; @@ -496,21 +497,20 @@ static void poll_ring(xbus_t *xbus, xpd_t *xpd) static int FXO_card_tick(xbus_t *xbus, xpd_t *xpd) { - static unsigned rate_limit = 0; struct FXO_priv_data *priv; BUG_ON(!xpd); priv = xpd->priv; BUG_ON(!priv); - rate_limit++; - if(poll_battery_interval != 0 && (rate_limit % poll_battery_interval) == 0) { + if(poll_battery_interval != 0 && (priv->poll_counter % poll_battery_interval) == 0) { poll_battery(xbus, xpd); } #ifdef SOFT_RING - if((rate_limit % POLL_RING_INTERVAL) == 0) + if((priv->poll_counter % POLL_RING_INTERVAL) == 0) poll_ring(xbus, xpd); #endif handle_fxo_leds(xpd); + priv->poll_counter++; return 0; } |