drivers/media/cec/core/cec-api.c
Source file repositories/reference/linux-study-clean/drivers/media/cec/core/cec-api.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/cec/core/cec-api.c- Extension
.c- Size
- 17628 bytes
- Lines
- 702
- Domain
- Driver Families
- Bucket
- drivers/media
- 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/errno.hlinux/init.hlinux/module.hlinux/kernel.hlinux/kmod.hlinux/ktime.hlinux/slab.hlinux/mm.hlinux/string.hlinux/types.hlinux/uaccess.hlinux/version.hmedia/cec-pin.hcec-priv.hcec-pin-priv.h
Detected Declarations
function cec_pollfunction cec_is_busyfunction cec_adap_g_capsfunction cec_adap_g_phys_addrfunction cec_validate_phys_addrfunction cec_adap_s_phys_addrfunction cec_adap_g_log_addrsfunction cec_adap_s_log_addrsfunction cec_adap_g_connector_infofunction cec_transmitfunction cec_receive_msgfunction cec_receivefunction cec_dqeventfunction cec_g_modefunction cec_s_modefunction cec_ioctlfunction cec_openfunction cec_release
Annotated Snippet
const struct file_operations cec_devnode_fops = {
.owner = THIS_MODULE,
.open = cec_open,
.unlocked_ioctl = cec_ioctl,
.compat_ioctl = cec_ioctl,
.release = cec_release,
.poll = cec_poll,
};
Annotation
- Immediate include surface: `linux/errno.h`, `linux/init.h`, `linux/module.h`, `linux/kernel.h`, `linux/kmod.h`, `linux/ktime.h`, `linux/slab.h`, `linux/mm.h`.
- Detected declarations: `function cec_poll`, `function cec_is_busy`, `function cec_adap_g_caps`, `function cec_adap_g_phys_addr`, `function cec_validate_phys_addr`, `function cec_adap_s_phys_addr`, `function cec_adap_g_log_addrs`, `function cec_adap_s_log_addrs`, `function cec_adap_g_connector_info`, `function cec_transmit`.
- Atlas domain: Driver Families / drivers/media.
- 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.