drivers/bcma/host_soc.c
Source file repositories/reference/linux-study-clean/drivers/bcma/host_soc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/bcma/host_soc.c- Extension
.c- Size
- 5600 bytes
- Lines
- 277
- Domain
- Driver Families
- Bucket
- drivers/bcma
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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.hscan.hlinux/slab.hlinux/module.hlinux/of_address.hlinux/bcma/bcma.hlinux/bcma/bcma_soc.h
Detected Declarations
function Chipfunction bcma_host_soc_read16function bcma_host_soc_read32function bcma_host_soc_write8function bcma_host_soc_write16function bcma_host_soc_write32function bcma_host_soc_block_readfunction bcma_host_soc_block_writefunction bcma_host_soc_aread32function bcma_host_soc_awrite32function bcma_host_soc_registerfunction bcma_host_soc_initfunction bcma_host_soc_probefunction bcma_host_soc_removefunction bcma_host_soc_register_driverfunction bcma_host_soc_unregister_driver
Annotated Snippet
while (count) {
*buf = __raw_readb(addr);
buf++;
count--;
}
break;
}
case sizeof(u16): {
__le16 *buf = buffer;
WARN_ON(count & 1);
while (count) {
*buf = (__force __le16)__raw_readw(addr);
buf++;
count -= 2;
}
break;
}
case sizeof(u32): {
__le32 *buf = buffer;
WARN_ON(count & 3);
while (count) {
*buf = (__force __le32)__raw_readl(addr);
buf++;
count -= 4;
}
break;
}
default:
WARN_ON(1);
}
}
static void bcma_host_soc_block_write(struct bcma_device *core,
const void *buffer,
size_t count, u16 offset, u8 reg_width)
{
void __iomem *addr = core->io_addr + offset;
switch (reg_width) {
case sizeof(u8): {
const u8 *buf = buffer;
while (count) {
__raw_writeb(*buf, addr);
buf++;
count--;
}
break;
}
case sizeof(u16): {
const __le16 *buf = buffer;
WARN_ON(count & 1);
while (count) {
__raw_writew((__force u16)(*buf), addr);
buf++;
count -= 2;
}
break;
}
case sizeof(u32): {
const __le32 *buf = buffer;
WARN_ON(count & 3);
while (count) {
__raw_writel((__force u32)(*buf), addr);
buf++;
count -= 4;
}
break;
}
default:
WARN_ON(1);
}
}
#endif /* CONFIG_BCMA_BLOCKIO */
static u32 bcma_host_soc_aread32(struct bcma_device *core, u16 offset)
{
if (WARN_ONCE(!core->io_wrap, "Accessed core has no wrapper/agent\n"))
return ~0;
return readl(core->io_wrap + offset);
}
static void bcma_host_soc_awrite32(struct bcma_device *core, u16 offset,
u32 value)
{
if (WARN_ONCE(!core->io_wrap, "Accessed core has no wrapper/agent\n"))
Annotation
- Immediate include surface: `bcma_private.h`, `scan.h`, `linux/slab.h`, `linux/module.h`, `linux/of_address.h`, `linux/bcma/bcma.h`, `linux/bcma/bcma_soc.h`.
- Detected declarations: `function Chip`, `function bcma_host_soc_read16`, `function bcma_host_soc_read32`, `function bcma_host_soc_write8`, `function bcma_host_soc_write16`, `function bcma_host_soc_write32`, `function bcma_host_soc_block_read`, `function bcma_host_soc_block_write`, `function bcma_host_soc_aread32`, `function bcma_host_soc_awrite32`.
- Atlas domain: Driver Families / drivers/bcma.
- Implementation status: source 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.