net/qrtr/tun.c
Source file repositories/reference/linux-study-clean/net/qrtr/tun.c
File Facts
- System
- Linux kernel
- Corpus path
net/qrtr/tun.c- Extension
.c- Size
- 3452 bytes
- Lines
- 177
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: operation-table or driver-model contract
- Status
- pattern implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Defines an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/miscdevice.hlinux/module.hlinux/poll.hlinux/skbuff.hlinux/uaccess.hqrtr.h
Detected Declarations
struct qrtr_tunfunction qrtr_tun_sendfunction qrtr_tun_openfunction qrtr_tun_read_iterfunction qrtr_tun_write_iterfunction qrtr_tun_pollfunction qrtr_tun_releasefunction qrtr_tun_initfunction qrtr_tun_exitmodule init qrtr_tun_init
Annotated Snippet
static const struct file_operations qrtr_tun_ops = {
.owner = THIS_MODULE,
.open = qrtr_tun_open,
.poll = qrtr_tun_poll,
.read_iter = qrtr_tun_read_iter,
.write_iter = qrtr_tun_write_iter,
.release = qrtr_tun_release,
};
static struct miscdevice qrtr_tun_miscdev = {
MISC_DYNAMIC_MINOR,
"qrtr-tun",
&qrtr_tun_ops,
};
static int __init qrtr_tun_init(void)
{
int ret;
ret = misc_register(&qrtr_tun_miscdev);
if (ret)
pr_err("failed to register Qualcomm IPC Router tun device\n");
return ret;
}
static void __exit qrtr_tun_exit(void)
{
misc_deregister(&qrtr_tun_miscdev);
}
module_init(qrtr_tun_init);
module_exit(qrtr_tun_exit);
MODULE_DESCRIPTION("Qualcomm IPC Router TUN device");
MODULE_LICENSE("GPL v2");
Annotation
- Immediate include surface: `linux/miscdevice.h`, `linux/module.h`, `linux/poll.h`, `linux/skbuff.h`, `linux/uaccess.h`, `qrtr.h`.
- Detected declarations: `struct qrtr_tun`, `function qrtr_tun_send`, `function qrtr_tun_open`, `function qrtr_tun_read_iter`, `function qrtr_tun_write_iter`, `function qrtr_tun_poll`, `function qrtr_tun_release`, `function qrtr_tun_init`, `function qrtr_tun_exit`, `module init qrtr_tun_init`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: pattern implementation candidate.
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.