drivers/staging/greybus/loopback.c
Source file repositories/reference/linux-study-clean/drivers/staging/greybus/loopback.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/greybus/loopback.c- Extension
.c- Size
- 30707 bytes
- Lines
- 1180
- Domain
- Driver Families
- Bucket
- drivers/staging
- 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/mutex.hlinux/slab.hlinux/kthread.hlinux/delay.hlinux/random.hlinux/sizes.hlinux/cdev.hlinux/fs.hlinux/kfifo.hlinux/debugfs.hlinux/list_sort.hlinux/spinlock.hlinux/workqueue.hlinux/atomic.hlinux/pm_runtime.hlinux/greybus.hasm/div64.h
Detected Declarations
struct gb_loopback_statsstruct gb_loopback_devicestruct gb_loopback_async_operationstruct gb_loopbackfunction gb_loopback_check_attrfunction gb_loopback_nsec_to_usec_latencyfunction __gb_loopback_calc_latencyfunction gb_loopback_calc_latencyfunction gb_loopback_operation_syncfunction gb_loopback_async_wait_allfunction gb_loopback_async_operation_callbackfunction gb_loopback_async_operationfunction gb_loopback_sync_sinkfunction gb_loopback_sync_transferfunction gb_loopback_sync_pingfunction gb_loopback_async_sinkfunction gb_loopback_async_transfer_completefunction gb_loopback_async_transferfunction gb_loopback_async_pingfunction gb_loopback_request_handlerfunction gb_loopback_reset_statsfunction gb_loopback_update_statsfunction gb_loopback_update_stats_windowfunction gb_loopback_requests_updatefunction gb_loopback_throughput_updatefunction gb_loopback_calculate_latency_statsfunction gb_loopback_calculate_statsfunction gb_loopback_async_wait_to_sendfunction gb_loopback_fnfunction gb_loopback_dbgfs_latency_show_commonfunction gb_loopback_dbgfs_latency_showfunction gb_loopback_probefunction gb_loopback_disconnectfunction loopback_initfunction loopback_exitmodule init loopback_init
Annotated Snippet
module_init(loopback_init);
static void __exit loopback_exit(void)
{
debugfs_remove_recursive(gb_dev.root);
greybus_deregister(&gb_loopback_driver);
class_unregister(&loopback_class);
ida_destroy(&loopback_ida);
}
module_exit(loopback_exit);
MODULE_DESCRIPTION("Loopback bridge driver for the Greybus loopback module");
MODULE_LICENSE("GPL v2");
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/mutex.h`, `linux/slab.h`, `linux/kthread.h`, `linux/delay.h`, `linux/random.h`, `linux/sizes.h`.
- Detected declarations: `struct gb_loopback_stats`, `struct gb_loopback_device`, `struct gb_loopback_async_operation`, `struct gb_loopback`, `function gb_loopback_check_attr`, `function gb_loopback_nsec_to_usec_latency`, `function __gb_loopback_calc_latency`, `function gb_loopback_calc_latency`, `function gb_loopback_operation_sync`, `function gb_loopback_async_wait_all`.
- Atlas domain: Driver Families / drivers/staging.
- 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.