drivers/net/wireless/broadcom/b43/lo.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/b43/lo.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/b43/lo.c- Extension
.c- Size
- 26753 bytes
- Lines
- 1004
- 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.
- 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
b43.hlo.hphy_g.hmain.hlinux/delay.hlinux/sched.hlinux/slab.h
Detected Declarations
struct lo_g_saved_valuesstruct b43_lo_g_statemachinefunction LOfunction list_for_each_entryfunction b43_lo_writefunction lo_measure_feedthroughfunction lo_txctl_register_tablefunction lo_measure_txctl_valuesfunction lo_read_power_vectorfunction lo_measure_gain_valuesfunction lo_measure_setupfunction lo_measure_restorefunction lo_probe_possible_loctlsfunction lo_probe_loctls_statemachinefunction b43_gphy_dc_lt_initfunction b43_lo_fixup_rfattfunction b43_lo_g_adjustfunction b43_lo_g_adjust_tofunction b43_lo_g_maintenance_workfunction b43_lo_g_cleanupfunction b43_lo_g_init
Annotated Snippet
struct lo_g_saved_values {
u8 old_channel;
/* Core registers */
u16 reg_3F4;
u16 reg_3E2;
/* PHY registers */
u16 phy_lo_mask;
u16 phy_extg_01;
u16 phy_dacctl_hwpctl;
u16 phy_dacctl;
u16 phy_cck_14;
u16 phy_hpwr_tssictl;
u16 phy_analogover;
u16 phy_analogoverval;
u16 phy_rfover;
u16 phy_rfoverval;
u16 phy_classctl;
u16 phy_cck_3E;
u16 phy_crs0;
u16 phy_pgactl;
u16 phy_cck_2A;
u16 phy_syncctl;
u16 phy_cck_30;
u16 phy_cck_06;
/* Radio registers */
u16 radio_43;
u16 radio_7A;
u16 radio_52;
};
static void lo_measure_setup(struct b43_wldev *dev,
struct lo_g_saved_values *sav)
{
struct ssb_sprom *sprom = dev->dev->bus_sprom;
struct b43_phy *phy = &dev->phy;
struct b43_phy_g *gphy = phy->g;
struct b43_txpower_lo_control *lo = gphy->lo_control;
u16 tmp;
if (b43_has_hardware_pctl(dev)) {
sav->phy_lo_mask = b43_phy_read(dev, B43_PHY_LO_MASK);
sav->phy_extg_01 = b43_phy_read(dev, B43_PHY_EXTG(0x01));
sav->phy_dacctl_hwpctl = b43_phy_read(dev, B43_PHY_DACCTL);
sav->phy_cck_14 = b43_phy_read(dev, B43_PHY_CCK(0x14));
sav->phy_hpwr_tssictl = b43_phy_read(dev, B43_PHY_HPWR_TSSICTL);
b43_phy_set(dev, B43_PHY_HPWR_TSSICTL, 0x100);
b43_phy_set(dev, B43_PHY_EXTG(0x01), 0x40);
b43_phy_set(dev, B43_PHY_DACCTL, 0x40);
b43_phy_set(dev, B43_PHY_CCK(0x14), 0x200);
}
if (phy->type == B43_PHYTYPE_B &&
phy->radio_ver == 0x2050 && phy->radio_rev < 6) {
b43_phy_write(dev, B43_PHY_CCK(0x16), 0x410);
b43_phy_write(dev, B43_PHY_CCK(0x17), 0x820);
}
if (phy->rev >= 2) {
sav->phy_analogover = b43_phy_read(dev, B43_PHY_ANALOGOVER);
sav->phy_analogoverval =
b43_phy_read(dev, B43_PHY_ANALOGOVERVAL);
sav->phy_rfover = b43_phy_read(dev, B43_PHY_RFOVER);
sav->phy_rfoverval = b43_phy_read(dev, B43_PHY_RFOVERVAL);
sav->phy_classctl = b43_phy_read(dev, B43_PHY_CLASSCTL);
sav->phy_cck_3E = b43_phy_read(dev, B43_PHY_CCK(0x3E));
sav->phy_crs0 = b43_phy_read(dev, B43_PHY_CRS0);
b43_phy_mask(dev, B43_PHY_CLASSCTL, 0xFFFC);
b43_phy_mask(dev, B43_PHY_CRS0, 0x7FFF);
b43_phy_set(dev, B43_PHY_ANALOGOVER, 0x0003);
b43_phy_mask(dev, B43_PHY_ANALOGOVERVAL, 0xFFFC);
if (phy->type == B43_PHYTYPE_G) {
if ((phy->rev >= 7) &&
(sprom->boardflags_lo & B43_BFL_EXTLNA)) {
b43_phy_write(dev, B43_PHY_RFOVER, 0x933);
} else {
b43_phy_write(dev, B43_PHY_RFOVER, 0x133);
}
} else {
b43_phy_write(dev, B43_PHY_RFOVER, 0);
}
b43_phy_write(dev, B43_PHY_CCK(0x3E), 0);
}
sav->reg_3F4 = b43_read16(dev, 0x3F4);
sav->reg_3E2 = b43_read16(dev, 0x3E2);
sav->radio_43 = b43_radio_read16(dev, 0x43);
sav->radio_7A = b43_radio_read16(dev, 0x7A);
sav->phy_pgactl = b43_phy_read(dev, B43_PHY_PGACTL);
Annotation
- Immediate include surface: `b43.h`, `lo.h`, `phy_g.h`, `main.h`, `linux/delay.h`, `linux/sched.h`, `linux/slab.h`.
- Detected declarations: `struct lo_g_saved_values`, `struct b43_lo_g_statemachine`, `function LO`, `function list_for_each_entry`, `function b43_lo_write`, `function lo_measure_feedthrough`, `function lo_txctl_register_table`, `function lo_measure_txctl_values`, `function lo_read_power_vector`, `function lo_measure_gain_values`.
- 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.