···4949 * More info available at http://www.berkprod.com/ or http://www.pcwatchdog.com/5050 */51515252-#include <linux/module.h>5353-#include <linux/moduleparam.h>5454-#include <linux/types.h>5555-#include <linux/timer.h>5656-#include <linux/jiffies.h>5757-#include <linux/config.h>5858-#include <linux/wait.h>5959-#include <linux/slab.h>6060-#include <linux/ioport.h>6161-#include <linux/delay.h>6262-#include <linux/fs.h>6363-#include <linux/miscdevice.h>6464-#include <linux/watchdog.h>6565-#include <linux/notifier.h>6666-#include <linux/init.h>6767-#include <linux/spinlock.h>6868-#include <linux/reboot.h>5252+#include <linux/config.h> /* For CONFIG_WATCHDOG_NOWAYOUT/... */5353+#include <linux/module.h> /* For module specific items */5454+#include <linux/moduleparam.h> /* For new moduleparam's */5555+#include <linux/types.h> /* For standard types (like size_t) */5656+#include <linux/errno.h> /* For the -ENODEV/... values */5757+#include <linux/kernel.h> /* For printk/panic/... */5858+#include <linux/delay.h> /* For mdelay function */5959+#include <linux/timer.h> /* For timer related operations */6060+#include <linux/jiffies.h> /* For jiffies stuff */6161+#include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */6262+#include <linux/watchdog.h> /* For the watchdog specific items */6363+#include <linux/notifier.h> /* For notifier support */6464+#include <linux/reboot.h> /* For reboot_notifier stuff */6565+#include <linux/init.h> /* For __init/__exit/... */6666+#include <linux/fs.h> /* For file operations */6767+#include <linux/ioport.h> /* For io-port access */6868+#include <linux/spinlock.h> /* For spin_lock/spin_unlock/... */6969#include <linux/sched.h> /* TASK_INTERRUPTIBLE, set_current_state() and friends */7070-#include <asm/uaccess.h>7171-#include <asm/io.h>7070+#include <linux/slab.h> /* For kmalloc */72717272+#include <asm/uaccess.h> /* For copy_to_user/put_user/... */7373+#include <asm/io.h> /* For inb/outb/... */7474+7575+/* Module and version information */7376#define WD_VER "1.16 (06/12/2004)"7477#define PFX "pcwd: "7578···8784#define PCWD_REVISION_C 288858986/*9090- * These are the defines that describe the control status bits for the8787+ * These are the defines that describe the control status #1 bits for the9188 * PC Watchdog card, revision A.9289 */9390#define WD_WDRST 0x01 /* Previously reset state */···9794#define WD_SRLY2 0x80 /* Software external relay triggered */98959996/*100100- * These are the defines that describe the control status bits for the9797+ * These are the defines that describe the control status #1 bits for the10198 * PC Watchdog card, revision C.10299 */103100#define WD_REVC_WTRP 0x01 /* Watchdog Trip status */···109106#define ISA_COMMAND_TIMEOUT 1000110107111108/* Watchdog's internal commands */112112-#define CMD_ISA_IDLE 0x00113113-#define CMD_ISA_VERSION_INTEGER 0x01114114-#define CMD_ISA_VERSION_TENTH 0x02115115-#define CMD_ISA_VERSION_HUNDRETH 0x03116116-#define CMD_ISA_VERSION_MINOR 0x04117117-#define CMD_ISA_SWITCH_SETTINGS 0x05118118-#define CMD_ISA_DELAY_TIME_2SECS 0x0A119119-#define CMD_ISA_DELAY_TIME_4SECS 0x0B120120-#define CMD_ISA_DELAY_TIME_8SECS 0x0C109109+#define CMD_ISA_IDLE 0x00110110+#define CMD_ISA_VERSION_INTEGER 0x01111111+#define CMD_ISA_VERSION_TENTH 0x02112112+#define CMD_ISA_VERSION_HUNDRETH 0x03113113+#define CMD_ISA_VERSION_MINOR 0x04114114+#define CMD_ISA_SWITCH_SETTINGS 0x05115115+#define CMD_ISA_DELAY_TIME_2SECS 0x0A116116+#define CMD_ISA_DELAY_TIME_4SECS 0x0B117117+#define CMD_ISA_DELAY_TIME_8SECS 0x0C121118122119/*123120 * We are using an kernel timer to do the pinging of the watchdog···770767 printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n");771768772769 /* Check that the heartbeat value is within it's range ; if not reset to the default */773773- if (pcwd_set_heartbeat(heartbeat)) {774774- pcwd_set_heartbeat(WATCHDOG_HEARTBEAT);775775- printk(KERN_INFO PFX "heartbeat value must be 2<=heartbeat<=7200, using %d\n",776776- WATCHDOG_HEARTBEAT);770770+ if (pcwd_set_heartbeat(heartbeat)) {771771+ pcwd_set_heartbeat(WATCHDOG_HEARTBEAT);772772+ printk(KERN_INFO PFX "heartbeat value must be 2<=heartbeat<=7200, using %d\n",773773+ WATCHDOG_HEARTBEAT);777774 }778775779776 ret = register_reboot_notifier(&pcwd_notifier);