drivers/media/firewire/firedtv-avc.c
Source file repositories/reference/linux-study-clean/drivers/media/firewire/firedtv-avc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/firewire/firedtv-avc.c- Extension
.c- Size
- 41201 bytes
- Lines
- 1476
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bug.hlinux/crc32.hlinux/delay.hlinux/device.hlinux/jiffies.hlinux/kernel.hlinux/moduleparam.hlinux/mutex.hlinux/string.hlinux/stringify.hlinux/wait.hlinux/workqueue.hmedia/dvb_frontend.hfiredtv.h
Detected Declarations
struct avc_command_framestruct avc_response_framefunction clear_operandsfunction pad_operandsfunction debug_fcpfunction debug_pmtfunction avc_writefunction is_register_rcfunction avc_recvfunction add_pid_filterfunction avc_tuner_tuneqpskfunction avc_tuner_dsd_dvb_cfunction avc_tuner_dsd_dvb_tfunction avc_tuner_dsdfunction avc_tuner_set_pidsfunction avc_tuner_get_tsfunction avc_identify_subunitfunction avc_tuner_statusfunction avc_lnb_controlfunction avc_register_remote_controlfunction avc_remote_ctrl_workfunction avc_tuner_host2cafunction get_ca_object_posfunction get_ca_object_lengthfunction avc_ca_app_infofunction avc_ca_infofunction avc_ca_resetfunction avc_ca_pmtfunction avc_ca_get_time_datefunction avc_ca_enter_menufunction avc_ca_get_mmifunction cmp_readfunction cmp_lockfunction get_opcrfunction set_opcrfunction cmp_establish_pp_connectionfunction cmp_break_pp_connectionfunction get_opcr_channel
Annotated Snippet
struct avc_command_frame {
u8 ctype;
u8 subunit;
u8 opcode;
u8 operand[509];
};
struct avc_response_frame {
u8 response;
u8 subunit;
u8 opcode;
u8 operand[509];
};
#define LAST_OPERAND (509 - 1)
static inline void clear_operands(struct avc_command_frame *c, int from, int to)
{
memset(&c->operand[from], 0, to - from + 1);
}
static void pad_operands(struct avc_command_frame *c, int from)
{
int to = ALIGN(from, 4);
if (from <= to && to <= LAST_OPERAND)
clear_operands(c, from, to);
}
#define AVC_DEBUG_READ_DESCRIPTOR 0x0001
#define AVC_DEBUG_DSIT 0x0002
#define AVC_DEBUG_DSD 0x0004
#define AVC_DEBUG_REGISTER_REMOTE_CONTROL 0x0008
#define AVC_DEBUG_LNB_CONTROL 0x0010
#define AVC_DEBUG_TUNE_QPSK 0x0020
#define AVC_DEBUG_TUNE_QPSK2 0x0040
#define AVC_DEBUG_HOST2CA 0x0080
#define AVC_DEBUG_CA2HOST 0x0100
#define AVC_DEBUG_APPLICATION_PMT 0x4000
#define AVC_DEBUG_FCP_PAYLOADS 0x8000
static int avc_debug;
module_param_named(debug, avc_debug, int, 0644);
MODULE_PARM_DESC(debug, "Verbose logging (none = 0"
", FCP subactions"
": READ DESCRIPTOR = " __stringify(AVC_DEBUG_READ_DESCRIPTOR)
", DSIT = " __stringify(AVC_DEBUG_DSIT)
", REGISTER_REMOTE_CONTROL = " __stringify(AVC_DEBUG_REGISTER_REMOTE_CONTROL)
", LNB CONTROL = " __stringify(AVC_DEBUG_LNB_CONTROL)
", TUNE QPSK = " __stringify(AVC_DEBUG_TUNE_QPSK)
", TUNE QPSK2 = " __stringify(AVC_DEBUG_TUNE_QPSK2)
", HOST2CA = " __stringify(AVC_DEBUG_HOST2CA)
", CA2HOST = " __stringify(AVC_DEBUG_CA2HOST)
"; Application sent PMT = " __stringify(AVC_DEBUG_APPLICATION_PMT)
", FCP payloads = " __stringify(AVC_DEBUG_FCP_PAYLOADS)
", or a combination, or all = -1)");
/*
* This is a workaround since there is no vendor specific command to retrieve
* ca_info using AVC. If this parameter is not used, ca_system_id will be
* filled with application_manufacturer from ca_app_info.
* Digital Everywhere have said that adding ca_info is on their TODO list.
*/
static unsigned int num_fake_ca_system_ids;
static int fake_ca_system_ids[4] = { -1, -1, -1, -1 };
module_param_array(fake_ca_system_ids, int, &num_fake_ca_system_ids, 0644);
MODULE_PARM_DESC(fake_ca_system_ids, "If your CAM application manufacturer "
"does not have the same ca_system_id as your CAS, you can "
"override what ca_system_ids are presented to the "
"application by setting this field to an array of ids.");
static const char *debug_fcp_ctype(unsigned int ctype)
{
static const char *ctypes[] = {
[0x0] = "CONTROL", [0x1] = "STATUS",
[0x2] = "SPECIFIC INQUIRY", [0x3] = "NOTIFY",
[0x4] = "GENERAL INQUIRY", [0x8] = "NOT IMPLEMENTED",
[0x9] = "ACCEPTED", [0xa] = "REJECTED",
[0xb] = "IN TRANSITION", [0xc] = "IMPLEMENTED/STABLE",
[0xd] = "CHANGED", [0xf] = "INTERIM",
};
const char *ret = ctype < ARRAY_SIZE(ctypes) ? ctypes[ctype] : NULL;
return ret ? ret : "?";
}
static const char *debug_fcp_opcode(unsigned int opcode,
const u8 *data, int length)
{
switch (opcode) {
Annotation
- Immediate include surface: `linux/bug.h`, `linux/crc32.h`, `linux/delay.h`, `linux/device.h`, `linux/jiffies.h`, `linux/kernel.h`, `linux/moduleparam.h`, `linux/mutex.h`.
- Detected declarations: `struct avc_command_frame`, `struct avc_response_frame`, `function clear_operands`, `function pad_operands`, `function debug_fcp`, `function debug_pmt`, `function avc_write`, `function is_register_rc`, `function avc_recv`, `function add_pid_filter`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
- 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.