drivers/misc/genwqe/card_base.c
Source file repositories/reference/linux-study-clean/drivers/misc/genwqe/card_base.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/misc/genwqe/card_base.c- Extension
.c- Size
- 35619 bytes
- Lines
- 1402
- Domain
- Driver Families
- Bucket
- drivers/misc
- 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/types.hlinux/pci.hlinux/err.hlinux/string.hlinux/sched.hlinux/wait.hlinux/delay.hlinux/dma-mapping.hlinux/module.hlinux/notifier.hlinux/device.hlinux/log2.hcard_base.hcard_ddcb.h
Detected Declarations
function genwqe_devnodefunction genwqe_dev_allocfunction genwqe_dev_freefunction genwqe_bus_resetfunction genwqe_need_err_maskingfunction genwqe_tweak_hardwarefunction genwqe_recovery_on_fatal_gfir_requiredfunction genwqe_flash_readback_failsfunction genwqe_T_psecfunction genwqe_setup_pf_jtimerfunction genwqe_setup_vf_jtimerfunction genwqe_ffdc_buffs_allocfunction genwqe_ffdc_buffs_freefunction genwqe_read_idsfunction genwqe_startfunction genwqe_stopfunction genwqe_recover_cardfunction genwqe_health_check_condfunction genwqe_fir_checkingfunction genwqe_pci_fundamental_resetfunction genwqe_platform_recoveryfunction genwqe_reload_bistreamfunction genwqe_health_threadfunction genwqe_health_check_startfunction genwqe_health_thread_runningfunction genwqe_health_check_stopfunction genwqe_pci_setupfunction dma_set_mask_and_coherentfunction genwqe_pci_removefunction genwqe_probefunction genwqe_removefunction genwqe_err_error_detectedfunction genwqe_stopfunction genwqe_err_slot_resetfunction genwqe_err_result_nonefunction genwqe_err_resumefunction genwqe_sriov_configurefunction genwqe_init_modulefunction genwqe_exit_modulemodule init genwqe_init_module
Annotated Snippet
static struct pci_driver genwqe_driver = {
.name = genwqe_driver_name,
.id_table = genwqe_device_table,
.probe = genwqe_probe,
.remove = genwqe_remove,
.sriov_configure = genwqe_sriov_configure,
.err_handler = &genwqe_err_handler,
};
/**
* genwqe_init_module() - Driver registration and initialization
*/
static int __init genwqe_init_module(void)
{
int rc;
rc = class_register(&class_genwqe);
if (rc) {
pr_err("[%s] create class failed\n", __func__);
return -ENOMEM;
}
debugfs_genwqe = debugfs_create_dir(GENWQE_DEVNAME, NULL);
rc = pci_register_driver(&genwqe_driver);
if (rc != 0) {
pr_err("[%s] pci_reg_driver (rc=%d)\n", __func__, rc);
goto err_out0;
}
return rc;
err_out0:
debugfs_remove(debugfs_genwqe);
class_unregister(&class_genwqe);
return rc;
}
/**
* genwqe_exit_module() - Driver exit
*/
static void __exit genwqe_exit_module(void)
{
pci_unregister_driver(&genwqe_driver);
debugfs_remove(debugfs_genwqe);
class_unregister(&class_genwqe);
}
module_init(genwqe_init_module);
module_exit(genwqe_exit_module);
Annotation
- Immediate include surface: `linux/types.h`, `linux/pci.h`, `linux/err.h`, `linux/string.h`, `linux/sched.h`, `linux/wait.h`, `linux/delay.h`, `linux/dma-mapping.h`.
- Detected declarations: `function genwqe_devnode`, `function genwqe_dev_alloc`, `function genwqe_dev_free`, `function genwqe_bus_reset`, `function genwqe_need_err_masking`, `function genwqe_tweak_hardware`, `function genwqe_recovery_on_fatal_gfir_required`, `function genwqe_flash_readback_fails`, `function genwqe_T_psec`, `function genwqe_setup_pf_jtimer`.
- Atlas domain: Driver Families / drivers/misc.
- 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.