drivers/accessibility/speakup/devsynth.c
Source file repositories/reference/linux-study-clean/drivers/accessibility/speakup/devsynth.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/accessibility/speakup/devsynth.c- Extension
.c- Size
- 4055 bytes
- Lines
- 179
- Domain
- Driver Families
- Bucket
- drivers/accessibility
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/errno.hlinux/miscdevice.hlinux/types.hlinux/uaccess.hspeakup.hspk_priv.h
Detected Declarations
function speakup_file_writefunction speakup_file_writeufunction speakup_file_readfunction speakup_file_openfunction speakup_file_releasefunction speakup_register_devsynthfunction speakup_unregister_devsynth
Annotated Snippet
static const struct file_operations synth_fops = {
.read = speakup_file_read,
.write = speakup_file_write,
.open = speakup_file_open,
.release = speakup_file_release,
};
static const struct file_operations synthu_fops = {
.read = speakup_file_read,
.write = speakup_file_writeu,
.open = speakup_file_open,
.release = speakup_file_release,
};
static struct miscdevice synth_device = {
.minor = MISC_DYNAMIC_MINOR,
.name = "synth",
.fops = &synth_fops,
};
static struct miscdevice synthu_device = {
.minor = MISC_DYNAMIC_MINOR,
.name = "synthu",
.fops = &synthu_fops,
};
void speakup_register_devsynth(void)
{
if (!synth_registered) {
if (misc_register(&synth_device)) {
pr_warn("Couldn't initialize miscdevice /dev/synth.\n");
} else {
pr_info("initialized device: /dev/synth, node (MAJOR %d, MINOR %d)\n",
MISC_MAJOR, synth_device.minor);
synth_registered = 1;
}
}
if (!synthu_registered) {
if (misc_register(&synthu_device)) {
pr_warn("Couldn't initialize miscdevice /dev/synthu.\n");
} else {
pr_info("initialized device: /dev/synthu, node (MAJOR %d, MINOR %d)\n",
MISC_MAJOR, synthu_device.minor);
synthu_registered = 1;
}
}
}
void speakup_unregister_devsynth(void)
{
if (synth_registered) {
pr_info("speakup: unregistering synth device /dev/synth\n");
misc_deregister(&synth_device);
synth_registered = 0;
}
if (synthu_registered) {
pr_info("speakup: unregistering synth device /dev/synthu\n");
misc_deregister(&synthu_device);
synthu_registered = 0;
}
}
Annotation
- Immediate include surface: `linux/errno.h`, `linux/miscdevice.h`, `linux/types.h`, `linux/uaccess.h`, `speakup.h`, `spk_priv.h`.
- Detected declarations: `function speakup_file_write`, `function speakup_file_writeu`, `function speakup_file_read`, `function speakup_file_open`, `function speakup_file_release`, `function speakup_register_devsynth`, `function speakup_unregister_devsynth`.
- Atlas domain: Driver Families / drivers/accessibility.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.