drivers/tty/n_hdlc.c
Source file repositories/reference/linux-study-clean/drivers/tty/n_hdlc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/tty/n_hdlc.c- Extension
.c- Size
- 22345 bytes
- Lines
- 810
- Domain
- Driver Families
- Bucket
- drivers/tty
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/init.hlinux/kernel.hlinux/sched.hlinux/types.hlinux/fcntl.hlinux/interrupt.hlinux/ptrace.hlinux/poll.hlinux/in.hlinux/ioctl.hlinux/slab.hlinux/tty.hlinux/errno.hlinux/string.hlinux/signal.hlinux/if.hlinux/bitops.hlinux/uaccess.htty.h
Detected Declarations
struct n_hdlc_bufstruct n_hdlc_buf_liststruct n_hdlcfunction flush_rx_queuefunction flush_tx_queuefunction n_hdlc_free_buf_listfunction n_hdlc_tty_closefunction n_hdlc_tty_openfunction framefunction n_hdlc_tty_write_workfunction n_hdlc_tty_wakeupfunction n_hdlc_tty_receivefunction n_hdlc_tty_readfunction writtenfunction n_hdlc_tty_ioctlfunction scoped_guardfunction operationsfunction n_hdlc_alloc_buffunction n_hdlc_buf_returnfunction n_hdlc_buf_putfunction n_hdlc_initfunction n_hdlc_exitmodule init n_hdlc_init
Annotated Snippet
module_init(n_hdlc_init);
module_exit(n_hdlc_exit);
MODULE_DESCRIPTION("HDLC line discipline support");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Paul Fulghum paulkf@microgate.com");
module_param(maxframe, int, 0);
MODULE_ALIAS_LDISC(N_HDLC);
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/kernel.h`, `linux/sched.h`, `linux/types.h`, `linux/fcntl.h`, `linux/interrupt.h`, `linux/ptrace.h`.
- Detected declarations: `struct n_hdlc_buf`, `struct n_hdlc_buf_list`, `struct n_hdlc`, `function flush_rx_queue`, `function flush_tx_queue`, `function n_hdlc_free_buf_list`, `function n_hdlc_tty_close`, `function n_hdlc_tty_open`, `function frame`, `function n_hdlc_tty_write_work`.
- Atlas domain: Driver Families / drivers/tty.
- Implementation status: integration 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.