#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/spinlock.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#define WATCHDOG_VERSION …
#define WATCHDOG_DRIVER_NAME …
#define WATCHDOG_NAME …
#define DRIVER_VERSION …
#ifndef PCI_VENDOR_ID_QUICKLOGIC
#define PCI_VENDOR_ID_QUICKLOGIC …
#endif
#ifndef PCI_DEVICE_ID_WATCHDOG_PCIPCWD
#define PCI_DEVICE_ID_WATCHDOG_PCIPCWD …
#endif
#define WD_PCI_WTRP …
#define WD_PCI_HRBT …
#define WD_PCI_TTRP …
#define WD_PCI_RL2A …
#define WD_PCI_RL1A …
#define WD_PCI_R2DS …
#define WD_PCI_RLY2 …
#define WD_PCI_WDIS …
#define WD_PCI_ENTP …
#define WD_PCI_WRSP …
#define WD_PCI_PCMD …
#define PCI_COMMAND_TIMEOUT …
#define CMD_GET_STATUS …
#define CMD_GET_FIRMWARE_VERSION …
#define CMD_READ_WATCHDOG_TIMEOUT …
#define CMD_WRITE_WATCHDOG_TIMEOUT …
#define CMD_GET_CLEAR_RESET_COUNT …
static const int heartbeat_tbl[] = …;
static int cards_found;
static int temp_panic;
static unsigned long is_active;
static char expect_release;
static struct { … } pcipcwd_private;
#define QUIET …
#define VERBOSE …
#define DEBUG …
static int debug = …;
module_param(debug, int, 0);
MODULE_PARM_DESC(…) …;
#define WATCHDOG_HEARTBEAT …
static int heartbeat = …;
module_param(heartbeat, int, 0);
MODULE_PARM_DESC(…) …;
static bool nowayout = … WATCHDOG_NOWAYOUT;
module_param(nowayout, bool, 0);
MODULE_PARM_DESC(…) …;
static int send_command(int cmd, int *msb, int *lsb)
{ … }
static inline void pcipcwd_check_temperature_support(void)
{ … }
static int pcipcwd_get_option_switches(void)
{ … }
static void pcipcwd_show_card_info(void)
{ … }
static int pcipcwd_start(void)
{ … }
static int pcipcwd_stop(void)
{ … }
static int pcipcwd_keepalive(void)
{ … }
static int pcipcwd_set_heartbeat(int t)
{ … }
static int pcipcwd_get_status(int *status)
{ … }
static int pcipcwd_clear_status(void)
{ … }
static int pcipcwd_get_temperature(int *temperature)
{ … }
static int pcipcwd_get_timeleft(int *time_left)
{ … }
static ssize_t pcipcwd_write(struct file *file, const char __user *data,
size_t len, loff_t *ppos)
{ … }
static long pcipcwd_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{ … }
static int pcipcwd_open(struct inode *inode, struct file *file)
{ … }
static int pcipcwd_release(struct inode *inode, struct file *file)
{ … }
static ssize_t pcipcwd_temp_read(struct file *file, char __user *data,
size_t len, loff_t *ppos)
{ … }
static int pcipcwd_temp_open(struct inode *inode, struct file *file)
{ … }
static int pcipcwd_temp_release(struct inode *inode, struct file *file)
{ … }
static int pcipcwd_notify_sys(struct notifier_block *this, unsigned long code,
void *unused)
{ … }
static const struct file_operations pcipcwd_fops = …;
static struct miscdevice pcipcwd_miscdev = …;
static const struct file_operations pcipcwd_temp_fops = …;
static struct miscdevice pcipcwd_temp_miscdev = …;
static struct notifier_block pcipcwd_notifier = …;
static int pcipcwd_card_init(struct pci_dev *pdev,
const struct pci_device_id *ent)
{ … }
static void pcipcwd_card_exit(struct pci_dev *pdev)
{ … }
static const struct pci_device_id pcipcwd_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, pcipcwd_pci_tbl);
static struct pci_driver pcipcwd_driver = …;
module_pci_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;