drivers/net/wireless/broadcom/b43/phy_ht.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/b43/phy_ht.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/b43/phy_ht.c- Extension
.c- Size
- 33033 bytes
- Lines
- 1138
- 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_ht.htables_phy_ht.hradio_2059.hmain.h
Detected Declarations
enum ht_rssi_typefunction b43_radio_2059_channel_setupfunction b43_radio_2059_rcalfunction b43_radio_2057_rccalfunction b43_radio_2059_init_prefunction b43_radio_2059_initfunction b43_phy_ht_force_rf_sequencefunction b43_phy_ht_pa_overridefunction b43_phy_ht_classifierfunction b43_phy_ht_reset_ccafunction b43_phy_ht_zero_extgfunction b43_phy_ht_afe_unk1function b43_phy_ht_read_clip_detectionfunction b43_phy_ht_bphy_initfunction b43_phy_ht_bphy_resetfunction b43_phy_ht_stop_playbackfunction b43_phy_ht_load_samplesfunction b43_phy_ht_run_samplesfunction b43_phy_ht_tx_tonefunction b43_phy_ht_rssi_selectfunction b43_phy_ht_poll_rssifunction b43_phy_ht_tx_power_fixfunction b43_phy_ht_tx_power_ctlfunction b43_phy_ht_tx_power_ctl_idle_tssifunction b43_phy_ht_tssi_setupfunction b43_phy_ht_tx_power_ctl_setupfunction b43_phy_ht_spur_avoidfunction b43_phy_ht_channel_setupfunction b43_phy_ht_set_channelfunction b43_phy_ht_op_allocatefunction b43_phy_ht_op_prepare_structsfunction b43_phy_ht_op_initfunction b43_phy_ht_op_freefunction b43_phy_ht_op_software_rfkillfunction b43_phy_ht_op_switch_analogfunction b43_phy_ht_op_switch_channelfunction b43_phy_ht_op_get_default_chanfunction b43_phy_ht_op_masksetfunction b43_phy_ht_op_radio_readfunction b43_phy_ht_op_radio_writefunction b43_phy_ht_op_recalc_txpowerfunction b43_phy_ht_op_adjust_txpower
Annotated Snippet
if (!(b43_phy_read(dev, B43_PHY_HT_RF_SEQ_STATUS) & rf_seq)) {
i = 0;
break;
}
msleep(1);
}
if (i)
b43err(dev->wl, "Forcing RF sequence timeout\n");
b43_phy_write(dev, B43_PHY_HT_RF_SEQ_MODE, save_seq_mode);
}
static void b43_phy_ht_pa_override(struct b43_wldev *dev, bool enable)
{
struct b43_phy_ht *htphy = dev->phy.ht;
static const u16 regs[3] = { B43_PHY_HT_RF_CTL_INT_C1,
B43_PHY_HT_RF_CTL_INT_C2,
B43_PHY_HT_RF_CTL_INT_C3 };
int i;
if (enable) {
for (i = 0; i < 3; i++)
b43_phy_write(dev, regs[i], htphy->rf_ctl_int_save[i]);
} else {
for (i = 0; i < 3; i++)
htphy->rf_ctl_int_save[i] = b43_phy_read(dev, regs[i]);
/* TODO: Does 5GHz band use different value (not 0x0400)? */
for (i = 0; i < 3; i++)
b43_phy_write(dev, regs[i], 0x0400);
}
}
/**************************************************
* Various PHY ops
**************************************************/
static u16 b43_phy_ht_classifier(struct b43_wldev *dev, u16 mask, u16 val)
{
u16 tmp;
u16 allowed = B43_PHY_HT_CLASS_CTL_CCK_EN |
B43_PHY_HT_CLASS_CTL_OFDM_EN |
B43_PHY_HT_CLASS_CTL_WAITED_EN;
tmp = b43_phy_read(dev, B43_PHY_HT_CLASS_CTL);
tmp &= allowed;
tmp &= ~mask;
tmp |= (val & mask);
b43_phy_maskset(dev, B43_PHY_HT_CLASS_CTL, ~allowed, tmp);
return tmp;
}
static void b43_phy_ht_reset_cca(struct b43_wldev *dev)
{
u16 bbcfg;
b43_phy_force_clock(dev, true);
bbcfg = b43_phy_read(dev, B43_PHY_HT_BBCFG);
b43_phy_write(dev, B43_PHY_HT_BBCFG, bbcfg | B43_PHY_HT_BBCFG_RSTCCA);
udelay(1);
b43_phy_write(dev, B43_PHY_HT_BBCFG, bbcfg & ~B43_PHY_HT_BBCFG_RSTCCA);
b43_phy_force_clock(dev, false);
b43_phy_ht_force_rf_sequence(dev, B43_PHY_HT_RF_SEQ_TRIG_RST2RX);
}
static void b43_phy_ht_zero_extg(struct b43_wldev *dev)
{
u8 i, j;
static const u16 base[] = { 0x40, 0x60, 0x80 };
for (i = 0; i < ARRAY_SIZE(base); i++) {
for (j = 0; j < 4; j++)
b43_phy_write(dev, B43_PHY_EXTG(base[i] + j), 0);
}
for (i = 0; i < ARRAY_SIZE(base); i++)
b43_phy_write(dev, B43_PHY_EXTG(base[i] + 0xc), 0);
}
/* Some unknown AFE (Analog Frondned) op */
static void b43_phy_ht_afe_unk1(struct b43_wldev *dev)
{
u8 i;
static const u16 ctl_regs[3][2] = {
{ B43_PHY_HT_AFE_C1_OVER, B43_PHY_HT_AFE_C1 },
{ B43_PHY_HT_AFE_C2_OVER, B43_PHY_HT_AFE_C2 },
{ B43_PHY_HT_AFE_C3_OVER, B43_PHY_HT_AFE_C3},
};
Annotation
- Immediate include surface: `linux/slab.h`, `b43.h`, `phy_ht.h`, `tables_phy_ht.h`, `radio_2059.h`, `main.h`.
- Detected declarations: `enum ht_rssi_type`, `function b43_radio_2059_channel_setup`, `function b43_radio_2059_rcal`, `function b43_radio_2057_rccal`, `function b43_radio_2059_init_pre`, `function b43_radio_2059_init`, `function b43_phy_ht_force_rf_sequence`, `function b43_phy_ht_pa_override`, `function b43_phy_ht_classifier`, `function b43_phy_ht_reset_cca`.
- 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.