drivers/usb/gadget/function/u_serial.c
Source file repositories/reference/linux-study-clean/drivers/usb/gadget/function/u_serial.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/gadget/function/u_serial.c- Extension
.c- Size
- 39437 bytes
- Lines
- 1608
- 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/sched.hlinux/device.hlinux/delay.hlinux/tty.hlinux/tty_flip.hlinux/slab.hlinux/string_choices.hlinux/export.hlinux/module.hlinux/console.hlinux/kstrtox.hlinux/kthread.hlinux/workqueue.hlinux/kfifo.hlinux/serial.hu_serial.h
Detected Declarations
struct gs_consolestruct gs_portfunction gs_alloc_reqfunction gs_free_reqfunction gs_send_packetfunction datafunction gs_read_completefunction gs_write_completefunction gs_free_requestsfunction gs_alloc_requestsfunction gs_start_iofunction gserial_wakeup_hostfunction closefunction gs_close_flush_donefunction gs_closefunction gs_writefunction gs_put_charfunction gs_flush_charsfunction gs_write_roomfunction gs_chars_in_bufferfunction gs_unthrottlefunction gs_break_ctlfunction gs_get_icountfunction gs_console_complete_outfunction __gs_console_pushfunction gs_console_workfunction gs_console_writefunction gs_console_connectfunction gs_console_disconnectfunction gs_console_initfunction gs_console_exitfunction gserial_set_consolefunction gserial_get_consolefunction gs_console_connectfunction gs_console_disconnectfunction gs_console_exitfunction gs_closedfunction gserial_free_portfunction gserial_free_linefunction gserial_alloc_line_no_consolefunction gserial_alloc_linefunction gserial_connectfunction gserial_disconnectfunction gserial_suspendfunction gserial_resumefunction userial_initfunction userial_cleanupmodule init userial_init
Annotated Snippet
module_init(userial_init);
static void __exit userial_cleanup(void)
{
tty_unregister_driver(gs_tty_driver);
tty_driver_kref_put(gs_tty_driver);
gs_tty_driver = NULL;
}
module_exit(userial_cleanup);
MODULE_DESCRIPTION("utilities for USB gadget \"serial port\"/TTY support");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/sched.h`, `linux/device.h`, `linux/delay.h`, `linux/tty.h`, `linux/tty_flip.h`, `linux/slab.h`, `linux/string_choices.h`.
- Detected declarations: `struct gs_console`, `struct gs_port`, `function gs_alloc_req`, `function gs_free_req`, `function gs_send_packet`, `function data`, `function gs_read_complete`, `function gs_write_complete`, `function gs_free_requests`, `function gs_alloc_requests`.
- 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.