drivers/net/wireless/broadcom/b43legacy/radio.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/b43legacy/radio.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/b43legacy/radio.c- Extension
.c- Size
- 58873 bytes
- Lines
- 2110
- 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
linux/delay.hb43legacy.hmain.hphy.hradio.hilt.h
Detected Declarations
function flip_4bitfunction channel2freq_bgfunction b43legacy_radio_lockfunction b43legacy_radio_unlockfunction b43legacy_radio_read16function b43legacy_radio_write16function b43legacy_set_all_gainsfunction b43legacy_set_original_gainsfunction b43legacy_synth_pu_workaroundfunction b43legacy_radio_aci_detectfunction b43legacy_radio_aci_scanfunction b43legacy_nrssi_hw_writefunction b43legacy_nrssi_hw_readfunction b43legacy_nrssi_hw_updatefunction b43legacy_nrssi_mem_updatefunction b43legacy_calc_nrssi_offsetfunction b43legacy_calc_nrssi_slopefunction b43legacy_calc_nrssi_thresholdfunction _stack_savefunction _stack_restorefunction b43legacy_radio_interference_mitigation_enablefunction b43legacy_radio_interference_mitigation_disablefunction b43legacy_radio_set_interference_mitigationfunction b43legacy_radio_calibrationvaluefunction b43legacy_get_812_valuefunction b43legacy_radio_init2050function b43legacy_radio_selectchannelfunction b43legacy_radio_set_txantennafunction b43legacy_get_txgain_base_bandfunction b43legacy_get_txgain_freq_power_ampfunction b43legacy_get_txgain_dacfunction b43legacy_radio_set_txpower_afunction b43legacy_radio_set_txpower_bgfunction b43legacy_default_baseband_attenuationfunction b43legacy_default_radio_attenuationfunction b43legacy_default_txctl1function b43legacy_radio_turn_onfunction b43legacy_radio_turn_offfunction b43legacy_radio_clear_tssi
Annotated Snippet
if (phy->radio_ver == 0x2053) {
if (offset < 0x70)
offset += 0x80;
else if (offset < 0x80)
offset += 0x70;
} else if (phy->radio_ver == 0x2050)
offset |= 0x80;
else
B43legacy_WARN_ON(1);
break;
case B43legacy_PHYTYPE_G:
offset |= 0x80;
break;
default:
B43legacy_BUG_ON(1);
}
b43legacy_write16(dev, B43legacy_MMIO_RADIO_CONTROL, offset);
return b43legacy_read16(dev, B43legacy_MMIO_RADIO_DATA_LOW);
}
void b43legacy_radio_write16(struct b43legacy_wldev *dev, u16 offset, u16 val)
{
b43legacy_write16(dev, B43legacy_MMIO_RADIO_CONTROL, offset);
b43legacy_write16(dev, B43legacy_MMIO_RADIO_DATA_LOW, val);
}
static void b43legacy_set_all_gains(struct b43legacy_wldev *dev,
s16 first, s16 second, s16 third)
{
struct b43legacy_phy *phy = &dev->phy;
u16 i;
u16 start = 0x08;
u16 end = 0x18;
u16 offset = 0x0400;
u16 tmp;
if (phy->rev <= 1) {
offset = 0x5000;
start = 0x10;
end = 0x20;
}
for (i = 0; i < 4; i++)
b43legacy_ilt_write(dev, offset + i, first);
for (i = start; i < end; i++)
b43legacy_ilt_write(dev, offset + i, second);
if (third != -1) {
tmp = ((u16)third << 14) | ((u16)third << 6);
b43legacy_phy_write(dev, 0x04A0,
(b43legacy_phy_read(dev, 0x04A0) & 0xBFBF)
| tmp);
b43legacy_phy_write(dev, 0x04A1,
(b43legacy_phy_read(dev, 0x04A1) & 0xBFBF)
| tmp);
b43legacy_phy_write(dev, 0x04A2,
(b43legacy_phy_read(dev, 0x04A2) & 0xBFBF)
| tmp);
}
b43legacy_dummy_transmission(dev);
}
static void b43legacy_set_original_gains(struct b43legacy_wldev *dev)
{
struct b43legacy_phy *phy = &dev->phy;
u16 i;
u16 tmp;
u16 offset = 0x0400;
u16 start = 0x0008;
u16 end = 0x0018;
if (phy->rev <= 1) {
offset = 0x5000;
start = 0x0010;
end = 0x0020;
}
for (i = 0; i < 4; i++) {
tmp = (i & 0xFFFC);
tmp |= (i & 0x0001) << 1;
tmp |= (i & 0x0002) >> 1;
b43legacy_ilt_write(dev, offset + i, tmp);
}
for (i = start; i < end; i++)
b43legacy_ilt_write(dev, offset + i, i - start);
Annotation
- Immediate include surface: `linux/delay.h`, `b43legacy.h`, `main.h`, `phy.h`, `radio.h`, `ilt.h`.
- Detected declarations: `function flip_4bit`, `function channel2freq_bg`, `function b43legacy_radio_lock`, `function b43legacy_radio_unlock`, `function b43legacy_radio_read16`, `function b43legacy_radio_write16`, `function b43legacy_set_all_gains`, `function b43legacy_set_original_gains`, `function b43legacy_synth_pu_workaround`, `function b43legacy_radio_aci_detect`.
- 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.