drivers/net/ethernet/microsoft/mana/gdma_main.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/microsoft/mana/gdma_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/microsoft/mana/gdma_main.c- Extension
.c- Size
- 61551 bytes
- Lines
- 2516
- Domain
- Driver Families
- Bucket
- drivers/net
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/debugfs.hlinux/module.hlinux/pci.hlinux/sizes.hlinux/utsname.hlinux/version.hlinux/msi.hlinux/irqdomain.hlinux/export.hnet/mana/mana.hnet/mana/hw_channel.h
Detected Declarations
struct mana_dev_recoveryfunction mana_gd_r32function mana_gd_r64function mana_gd_init_pf_regsfunction mana_gd_init_vf_regsfunction mana_gd_init_registersfunction mana_need_logfunction mana_gd_query_max_resourcesfunction mana_gd_query_hwc_timeoutfunction mana_gd_detect_devicesfunction mana_gd_send_requestfunction mana_gd_alloc_memoryfunction mana_gd_free_memoryfunction mana_gd_create_hw_eqfunction mana_gd_disable_queuefunction mana_gd_ring_doorbellfunction mana_gd_wq_ring_doorbellfunction mana_gd_ring_cqfunction mana_serv_rescanfunction mana_serv_fpgafunction mana_serv_resetfunction mana_do_servicefunction mana_recovery_delayed_funcfunction mana_serv_funcfunction mana_schedule_serv_workfunction mana_gd_process_eqefunction mana_gd_process_eq_eventsfunction mana_gd_register_irqfunction mana_gd_deregister_irqfunction mana_gd_test_eqfunction mana_gd_destroy_eqfunction mana_gd_create_eqfunction mana_gd_create_cqfunction mana_gd_destroy_cqfunction mana_gd_create_hwc_queuefunction mana_gd_destroy_dma_regionfunction mana_gd_create_dma_regionfunction mana_gd_create_mana_eqfunction mana_gd_create_mana_wq_cqfunction mana_gd_destroy_queuefunction mana_gd_verify_vf_versionfunction mana_gd_register_devicefunction mana_gd_ring_doorbellfunction mana_gd_deregister_devicefunction mana_gd_wq_avail_spacefunction mana_gd_write_client_oobfunction mana_gd_write_sglfunction mana_gd_post_work_request
Annotated Snippet
static struct pci_driver mana_driver = {
.name = "mana",
.id_table = mana_id_table,
.probe = mana_gd_probe,
.remove = mana_gd_remove,
.suspend = mana_gd_suspend,
.resume = mana_gd_resume,
.shutdown = mana_gd_shutdown,
};
static int __init mana_driver_init(void)
{
int err;
INIT_LIST_HEAD(&mana_dev_recovery_work.dev_list);
spin_lock_init(&mana_dev_recovery_work.lock);
INIT_DELAYED_WORK(&mana_dev_recovery_work.work, mana_recovery_delayed_func);
mana_debugfs_root = debugfs_create_dir("mana", NULL);
err = pci_register_driver(&mana_driver);
if (err) {
debugfs_remove(mana_debugfs_root);
mana_debugfs_root = NULL;
}
return err;
}
static void __exit mana_driver_exit(void)
{
struct mana_dev_recovery *dev;
unsigned long flags;
disable_delayed_work_sync(&mana_dev_recovery_work.work);
spin_lock_irqsave(&mana_dev_recovery_work.lock, flags);
while (!list_empty(&mana_dev_recovery_work.dev_list)) {
dev = list_first_entry(&mana_dev_recovery_work.dev_list,
struct mana_dev_recovery, list);
list_del(&dev->list);
pci_dev_put(dev->pdev);
kfree(dev);
}
spin_unlock_irqrestore(&mana_dev_recovery_work.lock, flags);
pci_unregister_driver(&mana_driver);
debugfs_remove(mana_debugfs_root);
mana_debugfs_root = NULL;
}
module_init(mana_driver_init);
module_exit(mana_driver_exit);
MODULE_DEVICE_TABLE(pci, mana_id_table);
MODULE_LICENSE("Dual BSD/GPL");
MODULE_DESCRIPTION("Microsoft Azure Network Adapter driver");
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/module.h`, `linux/pci.h`, `linux/sizes.h`, `linux/utsname.h`, `linux/version.h`, `linux/msi.h`, `linux/irqdomain.h`.
- Detected declarations: `struct mana_dev_recovery`, `function mana_gd_r32`, `function mana_gd_r64`, `function mana_gd_init_pf_regs`, `function mana_gd_init_vf_regs`, `function mana_gd_init_registers`, `function mana_need_log`, `function mana_gd_query_max_resources`, `function mana_gd_query_hwc_timeout`, `function mana_gd_detect_devices`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.