drivers/mtd/maps/esb2rom.c
Source file repositories/reference/linux-study-clean/drivers/mtd/maps/esb2rom.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mtd/maps/esb2rom.c- Extension
.c- Size
- 12903 bytes
- Lines
- 447
- Domain
- Driver Families
- Bucket
- drivers/mtd
- 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.
- 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/module.hlinux/types.hlinux/kernel.hlinux/init.hlinux/slab.hasm/io.hlinux/mtd/mtd.hlinux/mtd/map.hlinux/mtd/cfi.hlinux/mtd/flashchip.hlinux/pci.hlinux/pci_ids.hlinux/list.h
Detected Declarations
struct esb2rom_windowstruct esb2rom_map_infofunction esb2rom_cleanupfunction esb2rom_init_onefunction esb2rom_remove_onefunction init_esb2romfunction cleanup_esb2rommodule init init_esb2rom
Annotated Snippet
static struct pci_driver esb2rom_driver = {
.name = MOD_NAME,
.id_table = esb2rom_pci_tbl,
.probe = esb2rom_init_one,
.remove = esb2rom_remove_one,
};
#endif
static int __init init_esb2rom(void)
{
struct pci_dev *pdev;
const struct pci_device_id *id;
int retVal;
pdev = NULL;
for (id = esb2rom_pci_tbl; id->vendor; id++) {
printk(KERN_DEBUG "device id = %x\n", id->device);
pdev = pci_get_device(id->vendor, id->device, NULL);
if (pdev) {
printk(KERN_DEBUG "matched device = %x\n", id->device);
break;
}
}
if (pdev) {
printk(KERN_DEBUG "matched device id %x\n", id->device);
retVal = esb2rom_init_one(pdev, &esb2rom_pci_tbl[0]);
pci_dev_put(pdev);
printk(KERN_DEBUG "retVal = %d\n", retVal);
return retVal;
}
return -ENXIO;
#if 0
return pci_register_driver(&esb2rom_driver);
#endif
}
static void __exit cleanup_esb2rom(void)
{
esb2rom_remove_one(esb2rom_window.pdev);
}
module_init(init_esb2rom);
module_exit(cleanup_esb2rom);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Lew Glendenning <lglendenning@lnxi.com>");
MODULE_DESCRIPTION("MTD map driver for BIOS chips on the ESB2 southbridge");
Annotation
- Immediate include surface: `linux/module.h`, `linux/types.h`, `linux/kernel.h`, `linux/init.h`, `linux/slab.h`, `asm/io.h`, `linux/mtd/mtd.h`, `linux/mtd/map.h`.
- Detected declarations: `struct esb2rom_window`, `struct esb2rom_map_info`, `function esb2rom_cleanup`, `function esb2rom_init_one`, `function esb2rom_remove_one`, `function init_esb2rom`, `function cleanup_esb2rom`, `module init init_esb2rom`.
- Atlas domain: Driver Families / drivers/mtd.
- Implementation status: pattern implementation candidate.
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.