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; Â Â Â Â [...] ...