drivers/media/pci/bt8xx/dst_ca.c
Source file repositories/reference/linux-study-clean/drivers/media/pci/bt8xx/dst_ca.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/pci/bt8xx/dst_ca.c- Extension
.c- Size
- 19727 bytes
- Lines
- 676
- 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/kernel.hlinux/module.hlinux/slab.hlinux/init.hlinux/mutex.hlinux/string.hlinux/dvb/ca.hmedia/dvbdev.hmedia/dvb_frontend.hdst_ca.hdst_common.h
Detected Declarations
function Copyrightfunction put_command_and_lengthfunction put_checksumfunction dst_ci_commandfunction dst_put_cifunction ca_get_app_infofunction ca_get_ca_infofunction ca_get_slot_capsfunction ca_get_slot_descrfunction ca_get_slot_infofunction ca_get_messagefunction handle_dst_tagfunction write_to_8820function asn_1_decodefunction debug_stringfunction ca_set_pmtfunction dst_check_ca_pmtfunction ca_send_messagefunction dst_ca_ioctlfunction dst_ca_openfunction dst_ca_releasefunction dst_ca_readfunction dst_ca_writeexport dst_ca_attach
Annotated Snippet
static const struct file_operations dst_ca_fops = {
.owner = THIS_MODULE,
.unlocked_ioctl = dst_ca_ioctl,
.open = dst_ca_open,
.release = dst_ca_release,
.read = dst_ca_read,
.write = dst_ca_write,
.llseek = noop_llseek,
};
static struct dvb_device dvbdev_ca = {
.priv = NULL,
.users = 1,
.readers = 1,
.writers = 1,
.fops = &dst_ca_fops
};
struct dvb_device *dst_ca_attach(struct dst_state *dst, struct dvb_adapter *dvb_adapter)
{
struct dvb_device *dvbdev;
dprintk(verbose, DST_CA_ERROR, 1, "registering DST-CA device");
if (dvb_register_device(dvb_adapter, &dvbdev, &dvbdev_ca, dst,
DVB_DEVICE_CA, 0) == 0) {
dst->dst_ca = dvbdev;
return dst->dst_ca;
}
return NULL;
}
EXPORT_SYMBOL_GPL(dst_ca_attach);
MODULE_DESCRIPTION("DST DVB-S/T/C Combo CA driver");
MODULE_AUTHOR("Manu Abraham");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/slab.h`, `linux/init.h`, `linux/mutex.h`, `linux/string.h`, `linux/dvb/ca.h`, `media/dvbdev.h`.
- Detected declarations: `function Copyright`, `function put_command_and_length`, `function put_checksum`, `function dst_ci_command`, `function dst_put_ci`, `function ca_get_app_info`, `function ca_get_ca_info`, `function ca_get_slot_caps`, `function ca_get_slot_descr`, `function ca_get_slot_info`.
- 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.