drivers/usb/gadget/function/f_tcm.c
Source file repositories/reference/linux-study-clean/drivers/usb/gadget/function/f_tcm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/gadget/function/f_tcm.c- Extension
.c- Size
- 65789 bytes
- Lines
- 2658
- Domain
- Driver Families
- Bucket
- drivers/usb
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/types.hlinux/string.hlinux/configfs.hlinux/ctype.hlinux/delay.hlinux/usb/ch9.hlinux/usb/composite.hlinux/usb/gadget.hlinux/usb/storage.hscsi/scsi_tcq.htarget/target_core_base.htarget/target_core_fabric.hlinux/unaligned.htcm.hu_tcm.hconfigfs.h
Detected Declarations
struct tpg_instancestruct guas_setup_wqfunction bot_enqueue_cmd_cbwfunction bot_status_completefunction bot_enqueue_sense_codefunction bot_err_complfunction bot_send_bad_statusfunction bot_send_statusfunction commandfunction bot_read_complfunction bot_send_read_responsefunction bot_send_write_requestfunction bot_cmd_completefunction bot_prepare_reqsfunction bot_cleanup_old_altfunction bot_set_altfunction usbg_bot_setupfunction tcm_to_uasp_responsefunction uasp_to_tcm_funcfunction uasp_cleanup_one_streamfunction uasp_free_cmdreqfunction uasp_cleanup_old_altfunction uasp_prepare_r_requestfunction uasp_prepare_statusfunction uasp_prepare_responsefunction uasp_status_data_cmplfunction uasp_send_status_responsefunction uasp_send_tm_responsefunction uasp_send_read_responsefunction uasp_send_write_requestfunction uasp_cmd_completefunction uasp_alloc_stream_resfunction uasp_alloc_cmdfunction uasp_prepare_reqsfunction uasp_set_altfunction get_cmd_dirfunction usbg_data_write_cmplfunction usbg_prepare_w_requestfunction usbg_send_status_responsefunction usbg_send_write_requestfunction usbg_send_read_responsefunction usbg_submit_tmrfunction usbg_submit_cmdfunction usbg_cmd_workfunction hash_for_each_possible_safefunction usbg_submit_commandfunction hash_for_each_possible_safefunction bot_cmd_work
Annotated Snippet
module_init(tcm_init);
static void __exit tcm_exit(void)
{
target_unregister_template(&usbg_ops);
usb_function_unregister(&tcmusb_func);
}
module_exit(tcm_exit);
MODULE_DESCRIPTION("Target based USB-Gadget");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Sebastian Andrzej Siewior");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/types.h`, `linux/string.h`, `linux/configfs.h`, `linux/ctype.h`, `linux/delay.h`, `linux/usb/ch9.h`.
- Detected declarations: `struct tpg_instance`, `struct guas_setup_wq`, `function bot_enqueue_cmd_cbw`, `function bot_status_complete`, `function bot_enqueue_sense_code`, `function bot_err_compl`, `function bot_send_bad_status`, `function bot_send_status`, `function command`, `function bot_read_compl`.
- Atlas domain: Driver Families / drivers/usb.
- Implementation status: integration 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.