drivers/net/wireless/broadcom/b43/tables_nphy.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/b43/tables_nphy.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/b43/tables_nphy.c- Extension
.c- Size
- 162700 bytes
- Lines
- 3924
- Domain
- Driver Families
- Bucket
- drivers/net
- 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
b43.htables_nphy.hphy_common.hphy_n.h
Detected Declarations
function assert_ntab_array_sizesfunction b43_ntab_readfunction b43_ntab_read_bulkfunction b43_ntab_writefunction b43_ntab_write_bulkfunction b43_nphy_tables_init_shared_lutfunction b43_nphy_tables_init_rev7_volatilefunction b43_nphy_tables_init_rev16function b43_nphy_tables_init_rev7function b43_nphy_tables_init_rev3function b43_nphy_tables_init_rev0function b43_nphy_tables_init
Annotated Snippet
if (dev->dev->chip_id == 43224 && dev->dev->chip_rev == 1) {
b43_phy_read(dev, B43_NPHY_TABLE_DATALO);
b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset + i);
}
switch (type) {
case B43_NTAB_8BIT:
*data = b43_phy_read(dev, B43_NPHY_TABLE_DATALO) & 0xFF;
data++;
break;
case B43_NTAB_16BIT:
*((u16 *)data) = b43_phy_read(dev, B43_NPHY_TABLE_DATALO);
data += 2;
break;
case B43_NTAB_32BIT:
*((u32 *)data) =
b43_phy_read(dev, B43_NPHY_TABLE_DATALO);
*((u32 *)data) |=
b43_phy_read(dev, B43_NPHY_TABLE_DATAHI) << 16;
data += 4;
break;
default:
B43_WARN_ON(1);
}
}
}
void b43_ntab_write(struct b43_wldev *dev, u32 offset, u32 value)
{
u32 type;
type = offset & B43_NTAB_TYPEMASK;
offset &= 0xFFFF;
switch (type) {
case B43_NTAB_8BIT:
B43_WARN_ON(value & ~0xFF);
b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset);
b43_phy_write(dev, B43_NPHY_TABLE_DATALO, value);
break;
case B43_NTAB_16BIT:
B43_WARN_ON(value & ~0xFFFF);
b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset);
b43_phy_write(dev, B43_NPHY_TABLE_DATALO, value);
break;
case B43_NTAB_32BIT:
b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset);
b43_phy_write(dev, B43_NPHY_TABLE_DATAHI, value >> 16);
b43_phy_write(dev, B43_NPHY_TABLE_DATALO, value & 0xFFFF);
break;
default:
B43_WARN_ON(1);
}
return;
/* Some compiletime assertions... */
assert_ntab_array_sizes();
}
void b43_ntab_write_bulk(struct b43_wldev *dev, u32 offset,
unsigned int nr_elements, const void *_data)
{
u32 type, value;
const u8 *data = _data;
unsigned int i;
type = offset & B43_NTAB_TYPEMASK;
offset &= ~B43_NTAB_TYPEMASK;
B43_WARN_ON(offset > 0xFFFF);
b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset);
for (i = 0; i < nr_elements; i++) {
/* Auto increment broken + caching issue on BCM43224? */
if ((offset >> 10) == 9 && dev->dev->chip_id == 43224 &&
dev->dev->chip_rev == 1) {
b43_phy_read(dev, B43_NPHY_TABLE_DATALO);
b43_phy_write(dev, B43_NPHY_TABLE_ADDR, offset + i);
}
switch (type) {
case B43_NTAB_8BIT:
value = *data;
data++;
B43_WARN_ON(value & ~0xFF);
b43_phy_write(dev, B43_NPHY_TABLE_DATALO, value);
break;
case B43_NTAB_16BIT:
value = *((u16 *)data);
Annotation
- Immediate include surface: `b43.h`, `tables_nphy.h`, `phy_common.h`, `phy_n.h`.
- Detected declarations: `function assert_ntab_array_sizes`, `function b43_ntab_read`, `function b43_ntab_read_bulk`, `function b43_ntab_write`, `function b43_ntab_write_bulk`, `function b43_nphy_tables_init_shared_lut`, `function b43_nphy_tables_init_rev7_volatile`, `function b43_nphy_tables_init_rev16`, `function b43_nphy_tables_init_rev7`, `function b43_nphy_tables_init_rev3`.
- Atlas domain: Driver Families / drivers/net.
- 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.