drivers/watchdog/wdt285.c
Source file repositories/reference/linux-study-clean/drivers/watchdog/wdt285.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/watchdog/wdt285.c- Extension
.c- Size
- 4559 bytes
- Lines
- 225
- Domain
- Driver Families
- Bucket
- drivers/watchdog
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/moduleparam.hlinux/types.hlinux/kernel.hlinux/fs.hlinux/mm.hlinux/miscdevice.hlinux/watchdog.hlinux/reboot.hlinux/init.hlinux/interrupt.hlinux/uaccess.hlinux/irq.hmach/hardware.hasm/mach-types.hasm/system_info.hasm/hardware/dec21285.h
Detected Declarations
function watchdog_firefunction watchdog_pingfunction watchdog_openfunction watchdog_releasefunction watchdog_writefunction watchdog_ioctlfunction footbridge_watchdog_initfunction footbridge_watchdog_exitmodule init footbridge_watchdog_init
Annotated Snippet
static const struct file_operations watchdog_fops = {
.owner = THIS_MODULE,
.write = watchdog_write,
.unlocked_ioctl = watchdog_ioctl,
.compat_ioctl = compat_ptr_ioctl,
.open = watchdog_open,
.release = watchdog_release,
};
static struct miscdevice watchdog_miscdev = {
.minor = WATCHDOG_MINOR,
.name = "watchdog",
.fops = &watchdog_fops,
};
static int __init footbridge_watchdog_init(void)
{
int retval;
if (machine_is_netwinder())
return -ENODEV;
retval = misc_register(&watchdog_miscdev);
if (retval < 0)
return retval;
pr_info("Footbridge Watchdog Timer: 0.01, timer margin: %d sec\n",
soft_margin);
return 0;
}
static void __exit footbridge_watchdog_exit(void)
{
misc_deregister(&watchdog_miscdev);
}
MODULE_AUTHOR("Phil Blundell <pb@nexus.co.uk>");
MODULE_DESCRIPTION("Footbridge watchdog driver");
MODULE_LICENSE("GPL");
module_param(soft_margin, int, 0);
MODULE_PARM_DESC(soft_margin, "Watchdog timeout in seconds");
module_init(footbridge_watchdog_init);
module_exit(footbridge_watchdog_exit);
Annotation
- Immediate include surface: `linux/module.h`, `linux/moduleparam.h`, `linux/types.h`, `linux/kernel.h`, `linux/fs.h`, `linux/mm.h`, `linux/miscdevice.h`, `linux/watchdog.h`.
- Detected declarations: `function watchdog_fire`, `function watchdog_ping`, `function watchdog_open`, `function watchdog_release`, `function watchdog_write`, `function watchdog_ioctl`, `function footbridge_watchdog_init`, `function footbridge_watchdog_exit`, `module init footbridge_watchdog_init`.
- Atlas domain: Driver Families / drivers/watchdog.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.