#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/types.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/ioport.h>
#include <linux/delay.h>
#include <linux/fs.h>
#include <linux/init.h>
#include <linux/moduleparam.h>
#include <linux/dmi.h>
#include <linux/io.h>
#include <linux/uaccess.h>
static bool nowayout = … WATCHDOG_NOWAYOUT;
static unsigned int margin = …;
static unsigned long wdt_status;
static DEFINE_MUTEX(wdt_lock);
#define WDT_IN_USE …
#define WDT_OK_TO_CLOSE …
#define COMMAND_PORT …
#define DATA_PORT …
#define IFACE_ON_COMMAND …
#define REBOOT_COMMAND …
#define WATCHDOG_NAME …
static void wdt_send_data(unsigned char command, unsigned char data)
{ … }
static void wdt_enable(void)
{ … }
static void wdt_disable(void)
{ … }
static int fitpc2_wdt_open(struct inode *inode, struct file *file)
{ … }
static ssize_t fitpc2_wdt_write(struct file *file, const char __user *data,
size_t len, loff_t *ppos)
{ … }
static const struct watchdog_info ident = …;
static long fitpc2_wdt_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{ … }
static int fitpc2_wdt_release(struct inode *inode, struct file *file)
{ … }
static const struct file_operations fitpc2_wdt_fops = …;
static struct miscdevice fitpc2_wdt_miscdev = …;
static int __init fitpc2_wdt_init(void)
{ … }
static void __exit fitpc2_wdt_exit(void)
{ … }
module_init(…) …;
module_exit(fitpc2_wdt_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
module_param(margin, int, 0);
MODULE_PARM_DESC(…) …;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(…) …;
MODULE_LICENSE(…) …;