drivers/net/wireless/broadcom/brcm80211/brcmsmac/stf.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/broadcom/brcm80211/brcmsmac/stf.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/broadcom/brcm80211/brcmsmac/stf.c- Extension
.c- Size
- 12760 bytes
- Lines
- 438
- 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
net/mac80211.htypes.hd11.hrate.hphy/phy_hal.hchannel.hmain.hstf.hdebug.h
Detected Declarations
function brcms_c_stf_stbc_rx_ht_updatefunction brcms_c_tempsense_updfunction brcms_c_stf_ss_algo_channel_getfunction brcms_c_stf_stbc_tx_setfunction brcms_c_stf_stbc_rx_setfunction brcms_c_stf_txcore_setfunction brcms_c_stf_spatial_policy_setfunction autofunction brcms_c_stf_txchain_setfunction brcms_c_stf_ss_updatefunction brcms_c_stf_attachfunction brcms_c_stf_detachfunction brcms_c_stf_phy_chain_calcfunction _brcms_c_stf_phytxchain_selfunction brcms_c_stf_phytxchain_selfunction brcms_c_stf_d11hdrs_phyctl_txant
Annotated Snippet
if (wlc->clk) {
brcms_c_suspend_mac_and_wait(wlc);
brcms_c_beacon_phytxctl_txant_upd(wlc, wlc->bcn_rspec);
brcms_c_enable_mac(wlc);
}
}
return 0;
}
static int brcms_c_stf_spatial_policy_set(struct brcms_c_info *wlc, int val)
{
int i;
u8 core_mask = 0;
brcms_dbg_ht(wlc->hw->d11core, "wl%d: val %x\n", wlc->pub->unit,
val);
wlc->stf->spatial_policy = (s8) val;
for (i = 1; i <= MAX_STREAMS_SUPPORTED; i++) {
core_mask = (val == MAX_SPATIAL_EXPANSION) ?
wlc->stf->txchain : txcore_default[i];
brcms_c_stf_txcore_set(wlc, (u8) i, core_mask);
}
return 0;
}
/*
* Centralized txant update function. call it whenever wlc->stf->txant and/or
* wlc->stf->txchain change.
*
* Antennas are controlled by ucode indirectly, which drives PHY or GPIO to
* achieve various tx/rx antenna selection schemes
*
* legacy phy, bit 6 and bit 7 means antenna 0 and 1 respectively, bit6+bit7
* means auto(last rx).
* for NREV<3, bit 6 and bit 7 means antenna 0 and 1 respectively, bit6+bit7
* means last rx and do tx-antenna selection for SISO transmissions
* for NREV=3, bit 6 and bit _8_ means antenna 0 and 1 respectively, bit6+bit7
* means last rx and do tx-antenna selection for SISO transmissions
* for NREV>=7, bit 6 and bit 7 mean antenna 0 and 1 respectively, nit6+bit7
* means both cores active
*/
static void _brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc)
{
s8 txant;
txant = (s8) wlc->stf->txant;
if (BRCMS_PHY_11N_CAP(wlc->band)) {
if (txant == ANT_TX_FORCE_0) {
wlc->stf->phytxant = PHY_TXC_ANT_0;
} else if (txant == ANT_TX_FORCE_1) {
wlc->stf->phytxant = PHY_TXC_ANT_1;
if (BRCMS_ISNPHY(wlc->band) &&
NREV_GE(wlc->band->phyrev, 3)
&& NREV_LT(wlc->band->phyrev, 7))
wlc->stf->phytxant = PHY_TXC_ANT_2;
} else {
if (BRCMS_ISLCNPHY(wlc->band) ||
BRCMS_ISSSLPNPHY(wlc->band))
wlc->stf->phytxant = PHY_TXC_LCNPHY_ANT_LAST;
else {
/* catch out of sync wlc->stf->txcore */
WARN_ON(wlc->stf->txchain <= 0);
wlc->stf->phytxant =
wlc->stf->txchain << PHY_TXC_ANT_SHIFT;
}
}
} else {
if (txant == ANT_TX_FORCE_0)
wlc->stf->phytxant = PHY_TXC_OLD_ANT_0;
else if (txant == ANT_TX_FORCE_1)
wlc->stf->phytxant = PHY_TXC_OLD_ANT_1;
else
wlc->stf->phytxant = PHY_TXC_OLD_ANT_LAST;
}
brcms_b_txant_set(wlc->hw, wlc->stf->phytxant);
}
int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val, bool force)
{
u8 txchain = (u8) int_val;
u8 txstreams;
uint i;
if (wlc->stf->txchain == txchain)
return 0;
Annotation
- Immediate include surface: `net/mac80211.h`, `types.h`, `d11.h`, `rate.h`, `phy/phy_hal.h`, `channel.h`, `main.h`, `stf.h`.
- Detected declarations: `function brcms_c_stf_stbc_rx_ht_update`, `function brcms_c_tempsense_upd`, `function brcms_c_stf_ss_algo_channel_get`, `function brcms_c_stf_stbc_tx_set`, `function brcms_c_stf_stbc_rx_set`, `function brcms_c_stf_txcore_set`, `function brcms_c_stf_spatial_policy_set`, `function auto`, `function brcms_c_stf_txchain_set`, `function brcms_c_stf_ss_update`.
- 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.