drivers/nfc/virtual_ncidev.c
Source file repositories/reference/linux-study-clean/drivers/nfc/virtual_ncidev.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/nfc/virtual_ncidev.c- Extension
.c- Size
- 4699 bytes
- Lines
- 213
- Domain
- Driver Families
- Bucket
- drivers/nfc
- 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.
- 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/kernel.hlinux/module.hlinux/miscdevice.hlinux/mutex.hlinux/wait.hnet/nfc/nci_core.h
Detected Declarations
struct virtual_nci_devfunction virtual_nci_openfunction virtual_nci_closefunction virtual_nci_sendfunction virtual_ncidev_readfunction virtual_ncidev_writefunction virtual_ncidev_openfunction virtual_ncidev_closefunction virtual_ncidev_ioctl
Annotated Snippet
static const struct file_operations virtual_ncidev_fops = {
.owner = THIS_MODULE,
.read = virtual_ncidev_read,
.write = virtual_ncidev_write,
.open = virtual_ncidev_open,
.release = virtual_ncidev_close,
.unlocked_ioctl = virtual_ncidev_ioctl
};
static struct miscdevice miscdev = {
.minor = MISC_DYNAMIC_MINOR,
.name = "virtual_nci",
.fops = &virtual_ncidev_fops,
.mode = 0600,
};
module_misc_device(miscdev);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Virtual NCI device simulation driver");
MODULE_AUTHOR("Bongsu Jeon <bongsu.jeon@samsung.com>");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/miscdevice.h`, `linux/mutex.h`, `linux/wait.h`, `net/nfc/nci_core.h`.
- Detected declarations: `struct virtual_nci_dev`, `function virtual_nci_open`, `function virtual_nci_close`, `function virtual_nci_send`, `function virtual_ncidev_read`, `function virtual_ncidev_write`, `function virtual_ncidev_open`, `function virtual_ncidev_close`, `function virtual_ncidev_ioctl`.
- Atlas domain: Driver Families / drivers/nfc.
- 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.