Lines Matching +full:max +full:- +full:heartbeat +full:- +full:sec
1 // SPDX-License-Identifier: GPL-2.0-only
10 * 960108 Fixed end-of-file pointer (Thanks to Dan Hollis), added
20 * typedefs to replace them. Made heartbeat reset only available
24 * added watchdog disable/re-enable routines. Added firmware
60 #include <linux/errno.h> /* For the -ENODEV/... values */
71 #include <linux/ioport.h> /* For io-port access */
79 #define WATCHDOG_DRIVER_NAME "ISA-PC Watchdog"
94 * These are the auto-probe addresses available.
104 * PCI-PC Watchdog card.
109 #define WD_HRTBT 0x04 /* Heartbeat sense */
114 #define WD_REVC_HRBT 0x02 /* Watchdog Heartbeat */
117 on-board processor */
125 (1:SW1 <-> 0:SW2) */
128 /* max. time we give an ISA watchdog card to process a command */
148 /* Watchdog's Dip Switch heartbeat values */
150 20, /* OFF-OFF-OFF = 20 Sec */
151 40, /* OFF-OFF-ON = 40 Sec */
152 60, /* OFF-ON-OFF = 1 Min */
153 300, /* OFF-ON-ON = 5 Min */
154 600, /* ON-OFF-OFF = 10 Min */
155 1800, /* ON-OFF-ON = 30 Min */
156 3600, /* ON-ON-OFF = 1 Hour */
157 7200, /* ON-ON-ON = 2 hour */
162 * every ~500ms. We try to set the internal heartbeat of the
176 /* this is private data for each ISA-PC watchdog card */
200 /* default heartbeat = delay-time from dip-switches */
202 static int heartbeat = WATCHDOG_HEARTBEAT; variable
203 module_param(heartbeat, int, 0);
204 MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. "
205 "(2 <= heartbeat <= 7200 or 0=delay-time from dip-switches, default="
337 pr_info("ISA-PC Watchdog (REV.A) detected at port 0x%04x\n", in pcwd_show_card_info()
341 pr_info("ISA-PC Watchdog (REV.C) detected at port 0x%04x (Firmware version: %s)\n", in pcwd_show_card_info()
349 /* Reprogram internal heartbeat to 2 seconds */ in pcwd_show_card_info()
368 pr_info("No previous trip detected - Cold boot or reset\n"); in pcwd_show_card_info()
375 /* If we got a heartbeat pulse within the WDT_INTERVAL in pcwd_timer_ping()
389 /* Re-trigger watchdog by writing to port 0 */ in pcwd_timer_ping()
393 /* Re-set the timer interval */ in pcwd_timer_ping()
398 pr_warn("Heartbeat lost! Will not ping the watchdog\n"); in pcwd_timer_ping()
406 pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ); in pcwd_start()
420 return -EIO; in pcwd_start()
448 return -EIO; in pcwd_stop()
461 pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ); in pcwd_keepalive()
472 return -EINVAL; in pcwd_set_heartbeat()
474 heartbeat = t; in pcwd_set_heartbeat()
477 pr_debug("New heartbeat: %d\n", heartbeat); in pcwd_set_heartbeat()
497 * over-temperature condition. And the reboot in pcwd_get_status()
561 return -1; in pcwd_get_temperature()
565 return -ENODEV; in pcwd_get_temperature()
606 return -EFAULT; in pcwd_ioctl()
618 return -EFAULT; in pcwd_ioctl()
625 return -EFAULT; in pcwd_ioctl()
640 return -EINVAL; in pcwd_ioctl()
648 return -EFAULT; in pcwd_ioctl()
651 return -EINVAL; in pcwd_ioctl()
657 return put_user(heartbeat, argp); in pcwd_ioctl()
660 return -ENOTTY; in pcwd_ioctl()
680 return -EFAULT; in pcwd_write()
693 return -EBUSY; in pcwd_open()
725 return -EFAULT; in pcwd_temp_read()
728 return -EFAULT; in pcwd_temp_read()
736 return -ENODEV; in pcwd_temp_open()
800 * The ISA cards have a heartbeat bit in one of the registers, which
801 * register is card dependent. The heartbeat bit is monitored, and if
865 return -ENODEV; in pcwd_isa_probe()
869 pr_err("No I/O-Address for card detected\n"); in pcwd_isa_probe()
870 return -ENODEV; in pcwd_isa_probe()
883 ret = -EIO; in pcwd_isa_probe()
909 /* If heartbeat = 0 then we use the heartbeat from the dip-switches */ in pcwd_isa_probe()
910 if (heartbeat == 0) in pcwd_isa_probe()
911 heartbeat = heartbeat_tbl[(pcwd_get_option_switches() & 0x07)]; in pcwd_isa_probe()
913 /* Check that the heartbeat value is within it's range; in pcwd_isa_probe()
915 if (pcwd_set_heartbeat(heartbeat)) { in pcwd_isa_probe()
917 pr_info("heartbeat value must be 2 <= heartbeat <= 7200, using %d\n", in pcwd_isa_probe()
937 pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", in pcwd_isa_probe()
938 heartbeat, nowayout); in pcwd_isa_probe()
950 cards_found--; in pcwd_isa_probe()
970 cards_found--; in pcwd_isa_remove()
996 MODULE_DESCRIPTION("Berkshire ISA-PC Watchdog driver");