Watchdog data structures and APIs
In this section, we will walk through the watchdog framework and learn how it works under the hood. The watchdog subsystem has a few data structures. The main one is struct watchdog_device, which is the Linux kernel representation of a watchdog device, containing all the information about it. It is defined in include/linux/watchdog.h, as follows:
struct watchdog_device {
int id;
struct device *parent;
const struct watchdog_info *info;
const struct watchdog_ops *ops;
const struct watchdog_governor *gov;
unsigned int bootstatus;
unsigned int timeout;
unsigned int pretimeout;
unsigned int min_timeout;
struct watchdog_core_data *wd_data;
unsigned long status;
[...]
...