STRUCT WATCHDOG_DEVICE(9)
π NAME π
okay so this is struct watchdog_device, bestie β straight from the Kernel API Manual, section 9. Itβs literally the structure that defines a watchdog device, and yes, sheβs iconic. Periodt. πβ¨
π SYNOPSIS π
no cap, hereβs the whole struct exactly as it appears β do not touch the formatting, sheβs sensitive:
struct watchdog_device {
int id;
struct device *parent;
const struct attribute_group **groups;
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;
unsigned int max_timeout;
unsigned int min_hw_heartbeat_ms;
unsigned int max_hw_heartbeat_ms;
struct notifier_block reboot_nb;
struct notifier_block restart_nb;
struct notifier_block pm_nb;
void *driver_data;
struct watchdog_core_data *wd_data;
unsigned long status;
#define WDOG_ACTIVE 0 ;
#define WDOG_NO_WAY_OUT 1 ;
#define WDOG_STOP_ON_REBOOT 2 ;
#define WDOG_HW_RUNNING 3 ;
#define WDOG_STOP_ON_UNREGISTER 4 ;
#define WDOG_NO_PING_ON_SUSPEND 5 ;
struct list_head deferred;
};
π Members π
okay bestie, letβs go member by member, because every field matters and we are not skipping a single one:
idβ The watchdogβs ID. (Allocated bywatchdog_register_device.) πparentβ The parent bus device. πgroupsβ List ofsysfsattribute groups to create when creating the watchdog device. β¨infoβ Pointer to awatchdog_infostructure. πopsβ Pointer to the list of watchdog operations. π οΈgovβ Pointer to watchdog pretimeout governor. πbootstatusβ Status of the watchdog device at boot. πtimeoutβ The watchdog deviceβs timeout value (in seconds). β³pretimeoutβ The watchdog deviceβspre_timeoutvalue. β°min_timeoutβ The watchdog deviceβs minimum timeout value (in seconds). π₯Ίmax_timeoutβ The watchdog deviceβs maximum timeout value (in seconds) as configurable from user space. Only relevant ifmax_hw_heartbeat_msis not provided. π₯min_hw_heartbeat_msβ Hardware limit for minimum time between heartbeats, in milli-seconds. πmax_hw_heartbeat_msβ Hardware limit for maximum timeout, in milli-seconds. Replacesmax_timeoutif specified. π₯reboot_nbβ The notifier block to stop watchdog on reboot. πrestart_nbβ The notifier block to register a restart function. π«Άpm_nbβ The notifier block to stop watchdog on suspend and restart it on resume. π΄β‘οΈπdriver_dataβ Pointer to the driverβs private data. πwd_dataβ Pointer to watchdog core internal data. π§statusβ Field that contains the deviceβs internal status bits. πdeferredβ Entry inwtd_deferred_reg_listwhich is used to register early initialized watchdogs. π£
πΈ Description πΈ
The watchdog_device structure contains all information about a watchdog timer device. Thatβs the whole vibe: one struct, all the watchdog tea. π«π
The driver_data field may not be accessed directly. Nope, absolutely not, bestie β thatβs a hard no. It must be accessed via the watchdog_set_drvdata and watchdog_get_drvdata helpers. Thatβs the rule, iykyk. π«π
π₯ SEE ALSO π₯
- Kernel file
./include/linux/watchdog.hβ go read it, itβs giving source-of-truth energy. πβ¨ struct watchdog_ops(9)β the companion page, slay. π―ββοΈ
okay bye bestie π«Ά mwah π β source/version footer says ./include/linux, date October 2026, and the manual title is struct watchdog_device(9). Slay and stay watched. πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms