drivers/net/wireless/broadcom/b43/phy_lcn.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/b43/phy_lcn.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/b43/phy_lcn.c- Extension
.c- Size
- 24611 bytes
- Lines
- 856
- 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
linux/slab.hb43.hphy_lcn.htables_phy_lcn.hmain.h
Detected Declarations
struct lcn_tx_gainsstruct lcn_tx_iir_filterenum lcn_sense_typefunction b43_radio_2064_channel_setupfunction b43_radio_2064_initfunction b43_phy_lcn_afe_set_unsetfunction b43_phy_lcn_get_pa_gainfunction b43_phy_lcn_set_dac_gainfunction b43_phy_lcn_set_bbmultfunction b43_phy_lcn_clear_tx_power_offsetsfunction b43_phy_lcn_rev0_baseband_initfunction b43_phy_lcn_bu_tweaksfunction b43_phy_lcn_sense_setupfunction b43_phy_lcn_load_tx_iir_cck_filterfunction b43_phy_lcn_load_tx_iir_ofdm_filterfunction b43_phy_lcn_set_tx_gain_overridefunction b43_phy_lcn_set_tx_gainfunction b43_phy_lcn_tx_pwr_ctl_initfunction b43_phy_lcn_txrx_spur_avoidance_modefunction b43_phy_lcn_set_channel_tweaksfunction b43_phy_lcn_set_channelfunction b43_phy_lcn_op_allocatefunction b43_phy_lcn_op_freefunction b43_phy_lcn_op_prepare_structsfunction b43_phy_lcn_op_initfunction b43_phy_lcn_op_software_rfkillfunction b43_phy_lcn_op_switch_analogfunction b43_phy_lcn_op_switch_channelfunction b43_phy_lcn_op_get_default_chanfunction b43_phy_lcn_op_recalc_txpowerfunction b43_phy_lcn_op_adjust_txpowerfunction b43_phy_lcn_op_radio_readfunction b43_phy_lcn_op_radio_write
Annotated Snippet
struct lcn_tx_gains {
u16 gm_gain;
u16 pga_gain;
u16 pad_gain;
u16 dac_gain;
};
struct lcn_tx_iir_filter {
u8 type;
u16 values[16];
};
enum lcn_sense_type {
B43_SENSE_TEMP,
B43_SENSE_VBAT,
};
/**************************************************
* Radio 2064.
**************************************************/
/* wlc_lcnphy_radio_2064_channel_tune_4313 */
static void b43_radio_2064_channel_setup(struct b43_wldev *dev)
{
u16 save[2];
b43_radio_set(dev, 0x09d, 0x4);
b43_radio_write(dev, 0x09e, 0xf);
/* Channel specific values in theory, in practice always the same */
b43_radio_write(dev, 0x02a, 0xb);
b43_radio_maskset(dev, 0x030, ~0x3, 0xa);
b43_radio_maskset(dev, 0x091, ~0x3, 0);
b43_radio_maskset(dev, 0x038, ~0xf, 0x7);
b43_radio_maskset(dev, 0x030, ~0xc, 0x8);
b43_radio_maskset(dev, 0x05e, ~0xf, 0x8);
b43_radio_maskset(dev, 0x05e, ~0xf0, 0x80);
b43_radio_write(dev, 0x06c, 0x80);
save[0] = b43_radio_read(dev, 0x044);
save[1] = b43_radio_read(dev, 0x12b);
b43_radio_set(dev, 0x044, 0x7);
b43_radio_set(dev, 0x12b, 0xe);
/* TODO */
b43_radio_write(dev, 0x040, 0xfb);
b43_radio_write(dev, 0x041, 0x9a);
b43_radio_write(dev, 0x042, 0xa3);
b43_radio_write(dev, 0x043, 0x0c);
/* TODO */
b43_radio_set(dev, 0x044, 0x0c);
udelay(1);
b43_radio_write(dev, 0x044, save[0]);
b43_radio_write(dev, 0x12b, save[1]);
if (dev->phy.rev == 1) {
/* brcmsmac uses outdated 0x3 for 0x038 */
b43_radio_write(dev, 0x038, 0x0);
b43_radio_write(dev, 0x091, 0x7);
}
}
/* wlc_radio_2064_init */
static void b43_radio_2064_init(struct b43_wldev *dev)
{
if (b43_current_band(dev->wl) == NL80211_BAND_2GHZ) {
b43_radio_write(dev, 0x09c, 0x0020);
b43_radio_write(dev, 0x105, 0x0008);
} else {
/* TODO */
}
b43_radio_write(dev, 0x032, 0x0062);
b43_radio_write(dev, 0x033, 0x0019);
b43_radio_write(dev, 0x090, 0x0010);
b43_radio_write(dev, 0x010, 0x0000);
if (dev->phy.rev == 1) {
b43_radio_write(dev, 0x060, 0x007f);
b43_radio_write(dev, 0x061, 0x0072);
b43_radio_write(dev, 0x062, 0x007f);
}
b43_radio_write(dev, 0x01d, 0x0002);
b43_radio_write(dev, 0x01e, 0x0006);
b43_phy_write(dev, 0x4ea, 0x4688);
Annotation
- Immediate include surface: `linux/slab.h`, `b43.h`, `phy_lcn.h`, `tables_phy_lcn.h`, `main.h`.
- Detected declarations: `struct lcn_tx_gains`, `struct lcn_tx_iir_filter`, `enum lcn_sense_type`, `function b43_radio_2064_channel_setup`, `function b43_radio_2064_init`, `function b43_phy_lcn_afe_set_unset`, `function b43_phy_lcn_get_pa_gain`, `function b43_phy_lcn_set_dac_gain`, `function b43_phy_lcn_set_bbmult`, `function b43_phy_lcn_clear_tx_power_offsets`.
- 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.