[zaptel-commits] tzafrir: trunk r1387 - /trunk/xpp/card_fxo.c
zaptel-commits at lists.digium.com
zaptel-commits at lists.digium.com
Mon Sep 4 15:42:03 MST 2006
Author: tzafrir
Date: Mon Sep 4 17:42:02 2006
New Revision: 1387
URL: http://svn.digium.com/view/zaptel?rev=1387&view=rev
Log:
Fix FXO polling (separate poll_counter for each unit)
Modified:
trunk/xpp/card_fxo.c
Modified: trunk/xpp/card_fxo.c
URL: http://svn.digium.com/view/zaptel/trunk/xpp/card_fxo.c?rev=1387&r1=1386&r2=1387&view=diff
==============================================================================
--- trunk/xpp/card_fxo.c (original)
+++ trunk/xpp/card_fxo.c Mon Sep 4 17:42:02 2006
@@ -82,6 +82,7 @@
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 __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 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;
}
More information about the zaptel-commits
mailing list