drivers/staging/media/av7110/av7110_ca.c
Source file repositories/reference/linux-study-clean/drivers/staging/media/av7110/av7110_ca.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/media/av7110/av7110_ca.c- Extension
.c- Size
- 8977 bytes
- Lines
- 388
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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/types.hlinux/delay.hlinux/fs.hlinux/timer.hlinux/poll.hlinux/gfp.hav7110.hav7110_hw.hav7110_ca.h
Detected Declarations
function Copyrightfunction ci_get_datafunction ci_ll_initfunction ci_ll_flushfunction ci_ll_releasefunction ci_ll_resetfunction ci_ll_writefunction ci_ll_readfunction dvb_ca_openfunction dvb_ca_pollfunction dvb_ca_ioctlfunction dvb_ca_writefunction dvb_ca_readfunction av7110_ca_registerfunction av7110_ca_unregisterfunction av7110_ca_initfunction av7110_ca_exit
Annotated Snippet
static const struct file_operations dvb_ca_fops = {
.owner = THIS_MODULE,
.read = dvb_ca_read,
.write = dvb_ca_write,
.unlocked_ioctl = dvb_generic_ioctl,
.open = dvb_ca_open,
.release = dvb_generic_release,
.poll = dvb_ca_poll,
.llseek = default_llseek,
};
static struct dvb_device dvbdev_ca = {
.priv = NULL,
.users = 1,
.writers = 1,
.fops = &dvb_ca_fops,
.kernel_ioctl = dvb_ca_ioctl,
};
int av7110_ca_register(struct av7110 *av7110)
{
return dvb_register_device(&av7110->dvb_adapter, &av7110->ca_dev,
&dvbdev_ca, av7110, DVB_DEVICE_CA, 0);
}
void av7110_ca_unregister(struct av7110 *av7110)
{
dvb_unregister_device(av7110->ca_dev);
}
int av7110_ca_init(struct av7110 *av7110)
{
return ci_ll_init(&av7110->ci_rbuffer, &av7110->ci_wbuffer, 8192);
}
void av7110_ca_exit(struct av7110 *av7110)
{
ci_ll_release(&av7110->ci_rbuffer, &av7110->ci_wbuffer);
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/delay.h`, `linux/fs.h`, `linux/timer.h`, `linux/poll.h`, `linux/gfp.h`, `av7110.h`.
- Detected declarations: `function Copyright`, `function ci_get_data`, `function ci_ll_init`, `function ci_ll_flush`, `function ci_ll_release`, `function ci_ll_reset`, `function ci_ll_write`, `function ci_ll_read`, `function dvb_ca_open`, `function dvb_ca_poll`.
- Atlas domain: Driver Families / drivers/staging.
- 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.