drivers/ssb/host_soc.c
Source file repositories/reference/linux-study-clean/drivers/ssb/host_soc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/ssb/host_soc.c- Extension
.c- Size
- 4577 bytes
- Lines
- 211
- Domain
- Driver Families
- Bucket
- drivers/ssb
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
ssb_private.hlinux/bcm47xx_nvram.hlinux/ssb/ssb.h
Detected Declarations
function ssb_host_soc_read8function ssb_host_soc_read16function ssb_host_soc_read32function ssb_host_soc_block_readfunction ssb_host_soc_write8function ssb_host_soc_write16function ssb_host_soc_write32function ssb_host_soc_block_writefunction ssb_host_soc_get_invariants
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);
}
}
#endif /* CONFIG_SSB_BLOCKIO */
static void ssb_host_soc_write8(struct ssb_device *dev, u16 offset, u8 value)
{
struct ssb_bus *bus = dev->bus;
offset += dev->core_index * SSB_CORE_SIZE;
writeb(value, bus->mmio + offset);
}
static void ssb_host_soc_write16(struct ssb_device *dev, u16 offset, u16 value)
{
struct ssb_bus *bus = dev->bus;
offset += dev->core_index * SSB_CORE_SIZE;
writew(value, bus->mmio + offset);
}
static void ssb_host_soc_write32(struct ssb_device *dev, u16 offset, u32 value)
{
struct ssb_bus *bus = dev->bus;
offset += dev->core_index * SSB_CORE_SIZE;
writel(value, bus->mmio + offset);
}
#ifdef CONFIG_SSB_BLOCKIO
static void ssb_host_soc_block_write(struct ssb_device *dev, const void *buffer,
size_t count, u16 offset, u8 reg_width)
{
struct ssb_bus *bus = dev->bus;
void __iomem *addr;
offset += dev->core_index * SSB_CORE_SIZE;
addr = bus->mmio + 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;
Annotation
- Immediate include surface: `ssb_private.h`, `linux/bcm47xx_nvram.h`, `linux/ssb/ssb.h`.
- Detected declarations: `function ssb_host_soc_read8`, `function ssb_host_soc_read16`, `function ssb_host_soc_read32`, `function ssb_host_soc_block_read`, `function ssb_host_soc_write8`, `function ssb_host_soc_write16`, `function ssb_host_soc_write32`, `function ssb_host_soc_block_write`, `function ssb_host_soc_get_invariants`.
- Atlas domain: Driver Families / drivers/ssb.
- 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.