drivers/net/wireless/realtek/rtw89/phy_be.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw89/phy_be.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw89/phy_be.c- Extension
.c- Size
- 75531 bytes
- Lines
- 1947
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
chan.hdebug.hmac.hphy.hreg.h
Detected Declarations
struct rtw89_byr_spec_ent_befunction rtw89_phy0_phy1_offset_befunction rtw89_phy0_phy1_offset_be_v1function rtw89_phy_cfg_bb_gain_error_befunction rtw89_phy_cfg_bb_rpl_ofst_befunction rtw89_phy_cfg_bb_gain_op1db_befunction rtw89_phy_config_bb_gain_befunction rtw89_phy_preinit_rf_nctl_befunction rtw89_phy_preinit_rf_nctl_be_v1function rtw89_phy_bb_wrap_flush_addrfunction rtw89_write_bb_wrap_flushfunction rtw89_phy_bb_wrap_pwr_by_macid_initfunction rtw89_phy_bb_wrap_tx_path_by_macid_initfunction rtw89_phy_bb_wrap_tpu_set_allfunction rtw89_phy_bb_wrap_listen_path_en_initfunction rtw89_phy_bb_wrap_force_cr_initfunction rtw89_phy_bb_wrap_ftm_initfunction rtw89_phy_bb_wrap_be_bandedge_decisionfunction rtw89_phy_bb_wrap_set_rfsi_ct_optfunction rtw89_phy_bb_wrap_set_rfsi_bandedge_chfunction rtw89_phy_bb_wrap_tx_rfsi_qam_comp_th_initfunction rtw89_phy_bb_wrap_tx_rfsi_qam_comp_th_gen3_initfunction rtw89_phy_bb_wrap_tx_rfsi_scenario_deffunction rtw89_phy_bb_wrap_tx_rfsi_qam_comp_valfunction rtw89_phy_bb_set_oob_dpd_qam_comp_valfunction rtw89_phy_bb_set_mdpd_qam_comp_valfunction rtw89_phy_bb_set_cim3k_valfunction rtw89_phy_bb_set_cck_cfir_filter_val_gen3function rtw89_phy_bb_wrap_tx_rfsi_ctrl_initfunction rtw89_phy_bb_wrap_ul_pwrfunction __rtw89_phy_bb_wrap_init_befunction rtw89_phy_bb_wrap_init_befunction rtw89_phy_ch_info_init_befunction rtw89_phy_ch_info_init_be_v1function __phy_set_txpwr_byrate_befunction rtw89_phy_set_txpwr_byrate_befunction rtw89_phy_set_txpwr_offset_befunction fill_limit_nonbf_bffunction fill_limit_nonbf_bf_minfunction phy_fill_limit_20m_befunction phy_fill_limit_40m_befunction phy_fill_limit_80m_befunction phy_fill_limit_160m_befunction phy_fill_limit_320m_befunction rtw89_phy_fill_limit_befunction rtw89_phy_set_txpwr_limit_befunction fill_limit_ru_eachfunction phy_fill_limit_ru_20m_be
Annotated Snippet
struct rtw89_byr_spec_ent_be {
struct rtw89_rate_desc init;
u8 num_of_idx;
bool no_over_bw40;
bool no_multi_nss;
};
static const struct rtw89_byr_spec_ent_be rtw89_byr_spec_be[] = {
{
.init = { .rs = RTW89_RS_CCK },
.num_of_idx = RTW89_RATE_CCK_NUM,
.no_over_bw40 = true,
.no_multi_nss = true,
},
{
.init = { .rs = RTW89_RS_OFDM },
.num_of_idx = RTW89_RATE_OFDM_NUM,
.no_multi_nss = true,
},
{
.init = { .rs = RTW89_RS_MCS, .idx = 14, .ofdma = RTW89_NON_OFDMA },
.num_of_idx = 2,
.no_multi_nss = true,
},
{
.init = { .rs = RTW89_RS_MCS, .idx = 14, .ofdma = RTW89_OFDMA },
.num_of_idx = 2,
.no_multi_nss = true,
},
{
.init = { .rs = RTW89_RS_MCS, .ofdma = RTW89_NON_OFDMA },
.num_of_idx = 14,
},
{
.init = { .rs = RTW89_RS_HEDCM, .ofdma = RTW89_NON_OFDMA },
.num_of_idx = RTW89_RATE_HEDCM_NUM,
},
{
.init = { .rs = RTW89_RS_MCS, .ofdma = RTW89_OFDMA },
.num_of_idx = 14,
},
{
.init = { .rs = RTW89_RS_HEDCM, .ofdma = RTW89_OFDMA },
.num_of_idx = RTW89_RATE_HEDCM_NUM,
},
};
static
void __phy_set_txpwr_byrate_be(struct rtw89_dev *rtwdev, u8 band, u8 bw,
u8 nss, u32 *addr, enum rtw89_phy_idx phy_idx)
{
const struct rtw89_byr_spec_ent_be *ent;
struct rtw89_rate_desc desc;
int pos = 0;
int i, j;
u32 val;
s8 v[4];
for (i = 0; i < ARRAY_SIZE(rtw89_byr_spec_be); i++) {
ent = &rtw89_byr_spec_be[i];
if (bw > RTW89_CHANNEL_WIDTH_40 && ent->no_over_bw40)
continue;
if (nss > RTW89_NSS_1 && ent->no_multi_nss)
continue;
desc = ent->init;
desc.nss = nss;
for (j = 0; j < ent->num_of_idx; j++, desc.idx++) {
v[pos] = rtw89_phy_read_txpwr_byrate(rtwdev, band, bw,
&desc);
pos = (pos + 1) % 4;
if (pos)
continue;
val = u32_encode_bits(v[0], GENMASK(7, 0)) |
u32_encode_bits(v[1], GENMASK(15, 8)) |
u32_encode_bits(v[2], GENMASK(23, 16)) |
u32_encode_bits(v[3], GENMASK(31, 24));
rtw89_mac_txpwr_write32(rtwdev, phy_idx, *addr, val);
*addr += 4;
}
}
}
static void rtw89_phy_set_txpwr_byrate_be(struct rtw89_dev *rtwdev,
const struct rtw89_chan *chan,
enum rtw89_phy_idx phy_idx)
{
Annotation
- Immediate include surface: `chan.h`, `debug.h`, `mac.h`, `phy.h`, `reg.h`.
- Detected declarations: `struct rtw89_byr_spec_ent_be`, `function rtw89_phy0_phy1_offset_be`, `function rtw89_phy0_phy1_offset_be_v1`, `function rtw89_phy_cfg_bb_gain_error_be`, `function rtw89_phy_cfg_bb_rpl_ofst_be`, `function rtw89_phy_cfg_bb_gain_op1db_be`, `function rtw89_phy_config_bb_gain_be`, `function rtw89_phy_preinit_rf_nctl_be`, `function rtw89_phy_preinit_rf_nctl_be_v1`, `function rtw89_phy_bb_wrap_flush_addr`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.