drivers/media/usb/pvrusb2/pvrusb2-debugifc.c
Source file repositories/reference/linux-study-clean/drivers/media/usb/pvrusb2/pvrusb2-debugifc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/usb/pvrusb2/pvrusb2-debugifc.c- Extension
.c- Size
- 7654 bytes
- Lines
- 305
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/hex.hlinux/string.hpvrusb2-debugifc.hpvrusb2-hdw.hpvrusb2-debug.h
Detected Declarations
function Copyrightfunction debugifc_count_nonwhitespacefunction debugifc_isolate_wordfunction debugifc_parse_unsigned_numberfunction debugifc_match_keywordfunction pvr2_debugifc_print_infofunction pvr2_debugifc_print_statusfunction pvr2_debugifc_do1cmdfunction pvr2_debugifc_docmd
Annotated Snippet
if (debugifc_match_keyword(wptr,wlen,"cpu")) {
pvr2_hdw_cpureset_assert(hdw,!0);
pvr2_hdw_cpureset_assert(hdw,0);
return 0;
} else if (debugifc_match_keyword(wptr,wlen,"bus")) {
pvr2_hdw_device_reset(hdw);
} else if (debugifc_match_keyword(wptr,wlen,"soft")) {
return pvr2_hdw_cmd_powerup(hdw);
} else if (debugifc_match_keyword(wptr,wlen,"deep")) {
return pvr2_hdw_cmd_deep_reset(hdw);
} else if (debugifc_match_keyword(wptr,wlen,"firmware")) {
return pvr2_upload_firmware2(hdw);
} else if (debugifc_match_keyword(wptr,wlen,"decoder")) {
return pvr2_hdw_cmd_decoder_reset(hdw);
} else if (debugifc_match_keyword(wptr,wlen,"worker")) {
return pvr2_hdw_untrip(hdw);
} else if (debugifc_match_keyword(wptr,wlen,"usbstats")) {
pvr2_stream_get_stats(pvr2_hdw_get_video_stream(hdw),
NULL, !0);
return 0;
}
return -EINVAL;
} else if (debugifc_match_keyword(wptr,wlen,"cpufw")) {
scnt = debugifc_isolate_word(buf,count,&wptr,&wlen);
if (!scnt) return -EINVAL;
count -= scnt; buf += scnt;
if (!wptr) return -EINVAL;
if (debugifc_match_keyword(wptr,wlen,"fetch")) {
scnt = debugifc_isolate_word(buf,count,&wptr,&wlen);
if (scnt && wptr) {
count -= scnt; buf += scnt;
if (debugifc_match_keyword(wptr, wlen,
"prom")) {
pvr2_hdw_cpufw_set_enabled(hdw, 2, !0);
} else if (debugifc_match_keyword(wptr, wlen,
"ram8k")) {
pvr2_hdw_cpufw_set_enabled(hdw, 0, !0);
} else if (debugifc_match_keyword(wptr, wlen,
"ram16k")) {
pvr2_hdw_cpufw_set_enabled(hdw, 1, !0);
} else {
return -EINVAL;
}
}
pvr2_hdw_cpufw_set_enabled(hdw,0,!0);
return 0;
} else if (debugifc_match_keyword(wptr,wlen,"done")) {
pvr2_hdw_cpufw_set_enabled(hdw,0,0);
return 0;
} else {
return -EINVAL;
}
} else if (debugifc_match_keyword(wptr,wlen,"gpio")) {
int dir_fl = 0;
int ret;
u32 msk,val;
scnt = debugifc_isolate_word(buf,count,&wptr,&wlen);
if (!scnt) return -EINVAL;
count -= scnt; buf += scnt;
if (!wptr) return -EINVAL;
if (debugifc_match_keyword(wptr,wlen,"dir")) {
dir_fl = !0;
} else if (!debugifc_match_keyword(wptr,wlen,"out")) {
return -EINVAL;
}
scnt = debugifc_isolate_word(buf,count,&wptr,&wlen);
if (!scnt) return -EINVAL;
count -= scnt; buf += scnt;
if (!wptr) return -EINVAL;
ret = debugifc_parse_unsigned_number(wptr,wlen,&msk);
if (ret) return ret;
scnt = debugifc_isolate_word(buf,count,&wptr,&wlen);
if (wptr) {
ret = debugifc_parse_unsigned_number(wptr,wlen,&val);
if (ret) return ret;
} else {
val = msk;
msk = 0xffffffff;
}
if (dir_fl) {
ret = pvr2_hdw_gpio_chg_dir(hdw,msk,val);
} else {
ret = pvr2_hdw_gpio_chg_out(hdw,msk,val);
}
return ret;
}
pvr2_trace(PVR2_TRACE_DEBUGIFC,
"debugifc failed to recognize cmd: \"%.*s\"",wlen,wptr);
return -EINVAL;
}
Annotation
- Immediate include surface: `linux/hex.h`, `linux/string.h`, `pvrusb2-debugifc.h`, `pvrusb2-hdw.h`, `pvrusb2-debug.h`.
- Detected declarations: `function Copyright`, `function debugifc_count_nonwhitespace`, `function debugifc_isolate_word`, `function debugifc_parse_unsigned_number`, `function debugifc_match_keyword`, `function pvr2_debugifc_print_info`, `function pvr2_debugifc_print_status`, `function pvr2_debugifc_do1cmd`, `function pvr2_debugifc_docmd`.
- 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.