#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/moduleparam.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/spinlock.h>
#include <linux/io.h>
#include <linux/uaccess.h>
#define WATCHDOG_NAME …
#define PFX …
#define WD_TIMO …
static unsigned long wafwdt_is_open;
static char expect_close;
static DEFINE_SPINLOCK(wafwdt_lock);
static int wdt_stop = …;
static int wdt_start = …;
static int timeout = …;
module_param(timeout, int, 0);
MODULE_PARM_DESC(…) …;
static bool nowayout = … WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(…) …;
static void wafwdt_ping(void)
{ … }
static void wafwdt_start(void)
{ … }
static void wafwdt_stop(void)
{ … }
static ssize_t wafwdt_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{ … }
static long wafwdt_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{ … }
static int wafwdt_open(struct inode *inode, struct file *file)
{ … }
static int wafwdt_close(struct inode *inode, struct file *file)
{ … }
static int wafwdt_notify_sys(struct notifier_block *this, unsigned long code,
void *unused)
{ … }
static const struct file_operations wafwdt_fops = …;
static struct miscdevice wafwdt_miscdev = …;
static struct notifier_block wafwdt_notifier = …;
static int __init wafwdt_init(void)
{ … }
static void __exit wafwdt_exit(void)
{ … }
module_init(…) …;
module_exit(wafwdt_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;