diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-05-15 02:42:50 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-05-15 02:42:50 +0000 |
commit | 767135605bbaeb8c53e61e8dabd5d8fc55db2632 (patch) | |
tree | 4d2fb0629d3dfd5574c52e8fc71c674f1c8df7cc /zaptel.c | |
parent | 5b864019c5aeccf32d5ab83a856360e46e1436d9 (diff) |
Turn on watchdog, enable for FXS
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@181 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.c')
-rwxr-xr-x | zaptel.c | 17 |
1 files changed, 12 insertions, 5 deletions
@@ -5563,9 +5563,11 @@ static void watchdog_check(unsigned long ignored) { int x; long flags; + static int wdcheck=0; + local_irq_save(flags); for (x=0;x<maxspans;x++) { - if (spans[x]) { + if (spans[x] && (spans[x]->flags & ZT_FLAG_RUNNING)) { if (spans[x]->watchcounter == ZT_WATCHDOG_INIT) { /* Whoops, dead card */ if ((spans[x]->watchstate == ZT_WATCHSTATE_OK) || @@ -5580,7 +5582,8 @@ static void watchdog_check(unsigned long ignored) } } } else { - if (spans[x]->watchstate != ZT_WATCHSTATE_OK) + if ((spans[x]->watchstate != ZT_WATCHSTATE_OK) && + (spans[x]->watchstate != ZT_WATCHSTATE_UNKNOWN)) printk("Span %s is alive!\n", spans[x]->name); spans[x]->watchstate = ZT_WATCHSTATE_OK; } @@ -5588,7 +5591,11 @@ static void watchdog_check(unsigned long ignored) } } local_irq_restore(flags); - mod_timer(&watchdogtimer, jiffies + 1); + if (!wdcheck) { + printk("Zaptel watchdog on duty!\n"); + wdcheck=1; + } + mod_timer(&watchdogtimer, jiffies + 2); } static int __init watchdog_init(void) @@ -5598,11 +5605,11 @@ static int __init watchdog_init(void) watchdogtimer.data =0; watchdogtimer.function = watchdog_check; /* Run every couple of jiffy or so */ - mod_timer(&watchdogtimer, jiffies + 1); + mod_timer(&watchdogtimer, jiffies + 2); return 0; } -static void watchdog_cleanup(void) +static void __exit watchdog_cleanup(void) { del_timer(&watchdogtimer); } |