drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c- Extension
.c- Size
- 17109 bytes
- Lines
- 620
- 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.
- 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/clk-provider.hlinux/pci.hlinux/dmi.hlinux/device.hlinux/of_irq.hstmmac.hstmmac_libpci.hdwmac_dma.hdwmac1000.h
Detected Declarations
struct loongson_datastruct stmmac_pci_infofunction loongson_default_datafunction loongson_gmac_datafunction loongson_gnet_fix_speedfunction loongson_gnet_datafunction loongson_dwmac_dma_init_channelfunction loongson_dwmac_dma_interruptfunction loongson_dwmac_setupfunction loongson_dwmac_msi_configfunction loongson_dwmac_msi_clearfunction loongson_dwmac_dt_configfunction loongson_dwmac_dt_clearfunction loongson_dwmac_acpi_configfunction loongson_dwmac_fix_resetfunction loongson_dwmac_probefunction loongson_dwmac_remove
Annotated Snippet
static struct pci_driver loongson_dwmac_driver = {
.name = DRIVER_NAME,
.id_table = loongson_dwmac_id_table,
.probe = loongson_dwmac_probe,
.remove = loongson_dwmac_remove,
.driver = {
.pm = &stmmac_simple_pm_ops,
},
};
module_pci_driver(loongson_dwmac_driver);
MODULE_DESCRIPTION("Loongson DWMAC PCI driver");
MODULE_AUTHOR("Qing Zhang <zhangqing@loongson.cn>");
MODULE_AUTHOR("Yanteng Si <siyanteng@loongson.cn>");
MODULE_LICENSE("GPL v2");
Annotation
- Immediate include surface: `linux/clk-provider.h`, `linux/pci.h`, `linux/dmi.h`, `linux/device.h`, `linux/of_irq.h`, `stmmac.h`, `stmmac_libpci.h`, `dwmac_dma.h`.
- Detected declarations: `struct loongson_data`, `struct stmmac_pci_info`, `function loongson_default_data`, `function loongson_gmac_data`, `function loongson_gnet_fix_speed`, `function loongson_gnet_data`, `function loongson_dwmac_dma_init_channel`, `function loongson_dwmac_dma_interrupt`, `function loongson_dwmac_setup`, `function loongson_dwmac_msi_config`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- 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.