drivers/bcma/host_pci.c
Source file repositories/reference/linux-study-clean/drivers/bcma/host_pci.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/bcma/host_pci.c- Extension
.c- Size
- 9894 bytes
- Lines
- 387
- Domain
- Driver Families
- Bucket
- drivers/bcma
- 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
bcma_private.hlinux/slab.hlinux/bcma/bcma.hlinux/pci.hlinux/module.h
Detected Declarations
function bcma_host_pci_switch_corefunction bcma_host_pci_provide_access_to_corefunction bcma_host_pci_read8function bcma_host_pci_read16function bcma_host_pci_read32function bcma_host_pci_write8function bcma_host_pci_write16function bcma_host_pci_write32function bcma_host_pci_block_readfunction bcma_host_pci_block_writefunction bcma_host_pci_aread32function bcma_host_pci_awrite32function bcma_host_pci_probefunction bcma_host_pci_removefunction bcma_host_pci_suspendfunction bcma_host_pci_resumefunction bcma_host_pci_initfunction bcma_host_pci_exitfunction bcma_host_pci_upfunction bcma_host_pci_downfunction bcma_host_pci_irq_ctlexport bcma_host_pci_upexport bcma_host_pci_downexport bcma_host_pci_irq_ctl
Annotated Snippet
static struct pci_driver bcma_pci_bridge_driver = {
.name = "bcma-pci-bridge",
.id_table = bcma_pci_bridge_tbl,
.probe = bcma_host_pci_probe,
.remove = bcma_host_pci_remove,
.driver.pm = BCMA_PM_OPS,
};
int __init bcma_host_pci_init(void)
{
return pci_register_driver(&bcma_pci_bridge_driver);
}
void __exit bcma_host_pci_exit(void)
{
pci_unregister_driver(&bcma_pci_bridge_driver);
}
/**************************************************
* Runtime ops for drivers.
**************************************************/
/* See also pcicore_up */
void bcma_host_pci_up(struct bcma_bus *bus)
{
if (bus->hosttype != BCMA_HOSTTYPE_PCI)
return;
if (bus->host_is_pcie2)
bcma_core_pcie2_up(&bus->drv_pcie2);
else
bcma_core_pci_up(&bus->drv_pci[0]);
}
EXPORT_SYMBOL_GPL(bcma_host_pci_up);
/* See also pcicore_down */
void bcma_host_pci_down(struct bcma_bus *bus)
{
if (bus->hosttype != BCMA_HOSTTYPE_PCI)
return;
if (!bus->host_is_pcie2)
bcma_core_pci_down(&bus->drv_pci[0]);
}
EXPORT_SYMBOL_GPL(bcma_host_pci_down);
/* See also si_pci_setup */
int bcma_host_pci_irq_ctl(struct bcma_bus *bus, struct bcma_device *core,
bool enable)
{
struct pci_dev *pdev;
u32 coremask, tmp;
int err = 0;
if (bus->hosttype != BCMA_HOSTTYPE_PCI) {
/* This bcma device is not on a PCI host-bus. So the IRQs are
* not routed through the PCI core.
* So we must not enable routing through the PCI core. */
goto out;
}
pdev = bus->host_pci;
err = pci_read_config_dword(pdev, BCMA_PCI_IRQMASK, &tmp);
if (err)
goto out;
coremask = BIT(core->core_index) << 8;
if (enable)
tmp |= coremask;
else
tmp &= ~coremask;
err = pci_write_config_dword(pdev, BCMA_PCI_IRQMASK, tmp);
out:
return err;
}
EXPORT_SYMBOL_GPL(bcma_host_pci_irq_ctl);
Annotation
- Immediate include surface: `bcma_private.h`, `linux/slab.h`, `linux/bcma/bcma.h`, `linux/pci.h`, `linux/module.h`.
- Detected declarations: `function bcma_host_pci_switch_core`, `function bcma_host_pci_provide_access_to_core`, `function bcma_host_pci_read8`, `function bcma_host_pci_read16`, `function bcma_host_pci_read32`, `function bcma_host_pci_write8`, `function bcma_host_pci_write16`, `function bcma_host_pci_write32`, `function bcma_host_pci_block_read`, `function bcma_host_pci_block_write`.
- Atlas domain: Driver Families / drivers/bcma.
- 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.