#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/timer.h>
#include <linux/jiffies.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/fs.h>
#include <linux/ioport.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/uaccess.h>
#define ZF_IOBASE …
#define INDEX …
#define DATA_B …
#define DATA_W …
#define DATA_D …
#define ZFL_VERSION …
#define CONTROL …
#define STATUS …
#define COUNTER_1 …
#define COUNTER_2 …
#define PULSE_LEN …
#define ENABLE_WD1 …
#define ENABLE_WD2 …
#define RESET_WD1 …
#define RESET_WD2 …
#define GEN_SCI …
#define GEN_NMI …
#define GEN_SMI …
#define GEN_RESET …
#define WD1 …
#define WD2 …
#define zf_writew(port, data) …
#define zf_writeb(port, data) …
#define zf_get_ZFL_version() …
static unsigned short zf_readw(unsigned char port)
{ … }
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
static bool nowayout = … WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(…) …;
#define PFX …
static const struct watchdog_info zf_info = …;
static int action;
module_param(action, int, 0);
MODULE_PARM_DESC(…) …;
static void zf_ping(struct timer_list *unused);
static int zf_action = …;
static unsigned long zf_is_open;
static char zf_expect_close;
static DEFINE_SPINLOCK(zf_port_lock);
static DEFINE_TIMER(zf_timer, zf_ping);
static unsigned long next_heartbeat;
#define ZF_USER_TIMEO …
#define ZF_HW_TIMEO …
#define ZF_CTIMEOUT …
#ifndef ZF_DEBUG
#define dprintk(format, args...) …
#else
#define dprintk …
#endif
static inline void zf_set_status(unsigned char new)
{ … }
static inline unsigned short zf_get_control(void)
{ … }
static inline void zf_set_control(unsigned short new)
{ … }
static inline void zf_set_timer(unsigned short new, unsigned char n)
{ … }
static void zf_timer_off(void)
{ … }
static void zf_timer_on(void)
{ … }
static void zf_ping(struct timer_list *unused)
{ … }
static ssize_t zf_write(struct file *file, const char __user *buf, size_t count,
loff_t *ppos)
{ … }
static long zf_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{ … }
static int zf_open(struct inode *inode, struct file *file)
{ … }
static int zf_close(struct inode *inode, struct file *file)
{ … }
static int zf_notify_sys(struct notifier_block *this, unsigned long code,
void *unused)
{ … }
static const struct file_operations zf_fops = …;
static struct miscdevice zf_miscdev = …;
static struct notifier_block zf_notifier = …;
static void __init zf_show_action(int act)
{ … }
static int __init zf_init(void)
{ … }
static void __exit zf_exit(void)
{ … }
module_init(…) …;
module_exit(zf_exit);