drivers/staging/vme_user/vme.c
Source file repositories/reference/linux-study-clean/drivers/staging/vme_user/vme.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/staging/vme_user/vme.c- Extension
.c- Size
- 53220 bytes
- Lines
- 1978
- Domain
- Driver Families
- Bucket
- drivers/staging
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/init.hlinux/export.hlinux/mm.hlinux/types.hlinux/kernel.hlinux/errno.hlinux/pci.hlinux/poll.hlinux/highmem.hlinux/interrupt.hlinux/pagemap.hlinux/device.hlinux/dma-mapping.hlinux/syscalls.hlinux/mutex.hlinux/spinlock.hlinux/slab.hvme.hvme_bridge.h
Detected Declarations
function vme_free_consistentfunction vme_get_sizefunction vme_check_windowfunction vme_get_aspacefunction vme_slave_setfunction vme_slave_getfunction vme_slave_freefunction vme_master_setfunction vme_master_getfunction vme_master_readfunction vme_master_writefunction vme_master_rmwfunction vme_master_mmap_preparefunction vme_master_freefunction vme_dma_list_freefunction vme_dma_free_attributefunction vme_dma_free_attributefunction vme_dma_free_attributefunction vme_dma_list_addfunction vme_dma_list_addfunction vme_dma_list_execfunction vme_dma_list_freefunction vme_dma_freefunction vme_bus_error_handlerfunction list_for_each_entryfunction vme_unregister_error_handlerfunction vme_irq_handlerfunction vme_irq_requestfunction vme_irq_freefunction vme_irq_generatefunction vme_lm_countfunction vme_lm_setfunction vme_lm_getfunction vme_lm_attachfunction vme_lm_detachfunction vme_lm_freefunction vme_slot_numfunction vme_bus_numfunction vme_dev_releasefunction vme_register_bridgefunction vme_unregister_bridgefunction __vme_register_driver_busfunction __vme_register_driverfunction vme_register_driverfunction vme_unregister_driverfunction vme_bus_matchfunction vme_bus_probefunction vme_bus_remove
Annotated Snippet
static int vme_bus_match(struct device *dev, const struct device_driver *drv)
{
const struct vme_driver *vme_drv;
vme_drv = container_of(drv, struct vme_driver, driver);
if (dev->platform_data == vme_drv) {
struct vme_dev *vdev = dev_to_vme_dev(dev);
if (vme_drv->match && vme_drv->match(vdev))
return 1;
dev->platform_data = NULL;
}
return 0;
}
static int vme_bus_probe(struct device *dev)
{
struct vme_driver *driver;
struct vme_dev *vdev = dev_to_vme_dev(dev);
driver = dev->platform_data;
if (driver->probe)
return driver->probe(vdev);
return -ENODEV;
}
static void vme_bus_remove(struct device *dev)
{
struct vme_driver *driver;
struct vme_dev *vdev = dev_to_vme_dev(dev);
driver = dev->platform_data;
if (driver->remove)
driver->remove(vdev);
}
const struct bus_type vme_bus_type = {
.name = "vme",
.match = vme_bus_match,
.probe = vme_bus_probe,
.remove = vme_bus_remove,
};
EXPORT_SYMBOL(vme_bus_type);
static int __init vme_init(void)
{
return bus_register(&vme_bus_type);
}
subsys_initcall(vme_init);
Annotation
- Immediate include surface: `linux/init.h`, `linux/export.h`, `linux/mm.h`, `linux/types.h`, `linux/kernel.h`, `linux/errno.h`, `linux/pci.h`, `linux/poll.h`.
- Detected declarations: `function vme_free_consistent`, `function vme_get_size`, `function vme_check_window`, `function vme_get_aspace`, `function vme_slave_set`, `function vme_slave_get`, `function vme_slave_free`, `function vme_master_set`, `function vme_master_get`, `function vme_master_read`.
- Atlas domain: Driver Families / drivers/staging.
- Implementation status: pattern 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.