drivers/media/test-drivers/vidtv/vidtv_channel.c
Source file repositories/reference/linux-study-clean/drivers/media/test-drivers/vidtv/vidtv_channel.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/test-drivers/vidtv/vidtv_channel.c- Extension
.c- Size
- 13632 bytes
- Lines
- 554
- 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.
- 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/dev_printk.hlinux/ratelimit.hlinux/slab.hlinux/types.hvidtv_channel.hvidtv_common.hvidtv_encoder.hvidtv_mux.hvidtv_psi.hvidtv_s302m.h
Detected Declarations
function Copyrightfunction vidtv_channel_pat_prog_cat_into_newfunction vidtv_channel_pmt_match_sectionsfunction vidtv_channel_destroy_service_listfunction vidtv_channel_si_initfunction vidtv_channel_si_destroyfunction vidtv_channels_initfunction vidtv_channels_destroy
Annotated Snippet
while (curr) {
event_id = be16_to_cpu(curr->event_id);
tail = vidtv_psi_eit_event_init(tail, event_id);
if (!tail) {
vidtv_psi_eit_event_destroy(head);
return NULL;
}
desc = vidtv_psi_desc_clone(curr->descriptor);
vidtv_psi_desc_assign(&tail->descriptor, desc);
if (!head)
head = tail;
curr = curr->next;
}
cur_chnl = cur_chnl->next;
}
return head;
}
static struct vidtv_psi_table_sdt_service
*vidtv_channel_sdt_serv_cat_into_new(struct vidtv_mux *m)
{
/* Concatenate the services */
const struct vidtv_channel *cur_chnl = m->channels;
struct vidtv_psi_table_sdt_service *curr = NULL;
struct vidtv_psi_table_sdt_service *head = NULL;
struct vidtv_psi_table_sdt_service *tail = NULL;
struct vidtv_psi_desc *desc = NULL;
u16 service_id;
if (!cur_chnl)
return NULL;
while (cur_chnl) {
curr = cur_chnl->service;
if (!curr)
dev_warn_ratelimited(m->dev,
"No services found for channel %s\n",
cur_chnl->name);
while (curr) {
service_id = be16_to_cpu(curr->service_id);
tail = vidtv_psi_sdt_service_init(tail,
service_id,
curr->EIT_schedule,
curr->EIT_present_following);
if (!tail)
goto free;
desc = vidtv_psi_desc_clone(curr->descriptor);
if (!desc)
goto free_tail;
vidtv_psi_desc_assign(&tail->descriptor, desc);
if (!head)
head = tail;
curr = curr->next;
}
cur_chnl = cur_chnl->next;
}
return head;
free_tail:
vidtv_psi_sdt_service_destroy(tail);
free:
vidtv_psi_sdt_service_destroy(head);
return NULL;
}
static struct vidtv_psi_table_pat_program*
vidtv_channel_pat_prog_cat_into_new(struct vidtv_mux *m)
{
/* Concatenate the programs */
const struct vidtv_channel *cur_chnl = m->channels;
struct vidtv_psi_table_pat_program *curr = NULL;
struct vidtv_psi_table_pat_program *head = NULL;
struct vidtv_psi_table_pat_program *tail = NULL;
u16 serv_id;
u16 pid;
Annotation
- Immediate include surface: `linux/dev_printk.h`, `linux/ratelimit.h`, `linux/slab.h`, `linux/types.h`, `vidtv_channel.h`, `vidtv_common.h`, `vidtv_encoder.h`, `vidtv_mux.h`.
- Detected declarations: `function Copyright`, `function vidtv_channel_pat_prog_cat_into_new`, `function vidtv_channel_pmt_match_sections`, `function vidtv_channel_destroy_service_list`, `function vidtv_channel_si_init`, `function vidtv_channel_si_destroy`, `function vidtv_channels_init`, `function vidtv_channels_destroy`.
- Atlas domain: Driver Families / drivers/media.
- Implementation status: source implementation candidate.
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.