drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c- Extension
.c- Size
- 134756 bytes
- Lines
- 4217
- 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
chan.hcoex.hdebug.hmac.hphy.hreg.hrtw8852b.hrtw8852b_common.hrtw8852b_rfk.hrtw8852b_rfk_table.hrtw8852b_table.h
Detected Declarations
enum rtw8852b_dpk_idenum dpk_agc_stepenum rtw8852b_iqk_typefunction _rfk_backup_bb_regfunction _rfk_backup_rf_regfunction _rfk_restore_bb_regfunction _rfk_restore_rf_regfunction _rfk_rf_direct_cntrlfunction _rfk_drf_direct_cntrlfunction _iqk_check_calfunction _kpathfunction _set_rx_dckfunction _rx_dckfunction _rckfunction _afe_initfunction _drckfunction _addck_backupfunction _addck_reloadfunction _dack_backup_s0function _dack_backup_s1function _check_addcfunction _addckfunction _check_dadcfunction _dack_s0_check_donefunction _dack_s0function _dack_s1_check_donefunction _dack_s1function _dackfunction _dack_dumpfunction _dac_calfunction _iqk_rxk_settingfunction _iqk_one_shotfunction _rxk_group_selfunction _iqk_nbrxkfunction _iqk_rxclk_settingfunction _txk_group_selfunction _iqk_nbtxkfunction _lok_res_tablefunction _lok_finetune_checkfunction _iqk_lokfunction _iqk_txk_settingfunction _iqk_txclk_settingfunction _iqk_info_iqkfunction _iqk_by_pathfunction _iqk_get_ch_infofunction _iqk_start_iqkfunction _iqk_restorefunction _iqk_afebb_restore
Annotated Snippet
switch (iqk_info->iqk_band[path]) {
case RTW89_BAND_2G:
rtw89_write_rf(rtwdev, path, RR_MOD, RR_MOD_RGM,
_g_idxrxgain[gp]);
rtw89_write_rf(rtwdev, path, RR_RXBB, RR_RXBB_C2G,
_g_idxattc2[gp]);
rtw89_write_rf(rtwdev, path, RR_RXBB, RR_RXBB_C1G,
_g_idxattc1[gp]);
break;
case RTW89_BAND_5G:
rtw89_write_rf(rtwdev, path, RR_MOD, RR_MOD_RGM,
_a_idxrxgain[gp]);
rtw89_write_rf(rtwdev, path, RR_RXA2, RR_RXA2_HATT,
_a_idxattc2[gp]);
rtw89_write_rf(rtwdev, path, RR_RXA2, RR_RXA2_CC2,
_a_idxattc1[gp]);
break;
default:
break;
}
rtw89_phy_write32_mask(rtwdev, R_CFIR_LUT + (path << 8),
B_CFIR_LUT_SEL, 0x1);
rtw89_phy_write32_mask(rtwdev, R_CFIR_LUT + (path << 8),
B_CFIR_LUT_SET, 0x0);
rtw89_phy_write32_mask(rtwdev, R_CFIR_LUT + (path << 8),
B_CFIR_LUT_GP_V1, gp);
fail = _iqk_one_shot(rtwdev, phy_idx, path, ID_RXK);
rtw89_phy_write32_mask(rtwdev, R_IQKINF,
BIT(16 + gp + path * 4), fail);
kfail |= fail;
}
rtw89_write_rf(rtwdev, path, RR_RXK, RR_RXK_SEL5G, 0x0);
if (kfail) {
iqk_info->nb_rxcfir[path] = 0x40000002;
rtw89_phy_write32_mask(rtwdev, R_IQK_RES + (path << 8),
B_IQK_RES_RXCFIR, 0x0);
iqk_info->is_wb_rxiqk[path] = false;
} else {
iqk_info->nb_rxcfir[path] = 0x40000000;
rtw89_phy_write32_mask(rtwdev, R_IQK_RES + (path << 8),
B_IQK_RES_RXCFIR, 0x5);
iqk_info->is_wb_rxiqk[path] = true;
}
return kfail;
}
static bool _iqk_nbrxk(struct rtw89_dev *rtwdev, enum rtw89_phy_idx phy_idx,
u8 path)
{
struct rtw89_iqk_info *iqk_info = &rtwdev->iqk;
const u8 gp = 0x3;
bool kfail = false;
bool fail;
switch (iqk_info->iqk_band[path]) {
case RTW89_BAND_2G:
rtw89_write_rf(rtwdev, path, RR_MOD, RR_MOD_RGM,
_g_idxrxgain[gp]);
rtw89_write_rf(rtwdev, path, RR_RXBB, RR_RXBB_C2G,
_g_idxattc2[gp]);
rtw89_write_rf(rtwdev, path, RR_RXBB, RR_RXBB_C1G,
_g_idxattc1[gp]);
break;
case RTW89_BAND_5G:
rtw89_write_rf(rtwdev, path, RR_MOD, RR_MOD_RGM,
_a_idxrxgain[gp]);
rtw89_write_rf(rtwdev, path, RR_RXA2, RR_RXA2_HATT,
_a_idxattc2[gp]);
rtw89_write_rf(rtwdev, path, RR_RXA2, RR_RXA2_CC2,
_a_idxattc1[gp]);
break;
default:
break;
}
rtw89_phy_write32_mask(rtwdev, R_CFIR_LUT + (path << 8), B_CFIR_LUT_SEL, 0x1);
rtw89_phy_write32_mask(rtwdev, R_CFIR_LUT + (path << 8), B_CFIR_LUT_SET, 0x0);
rtw89_phy_write32_mask(rtwdev, R_CFIR_LUT + (path << 8), B_CFIR_LUT_GP_V1, gp);
rtw89_write_rf(rtwdev, path, RR_RXKPLL, RFREG_MASK, 0x80013);
udelay(1);
fail = _iqk_one_shot(rtwdev, phy_idx, path, ID_NBRXK);
rtw89_phy_write32_mask(rtwdev, R_IQKINF, BIT(16 + gp + path * 4), fail);
kfail |= fail;
rtw89_write_rf(rtwdev, path, RR_RXK, RR_RXK_SEL5G, 0x0);
if (!kfail)
Annotation
- Immediate include surface: `chan.h`, `coex.h`, `debug.h`, `mac.h`, `phy.h`, `reg.h`, `rtw8852b.h`, `rtw8852b_common.h`.
- Detected declarations: `enum rtw8852b_dpk_id`, `enum dpk_agc_step`, `enum rtw8852b_iqk_type`, `function _rfk_backup_bb_reg`, `function _rfk_backup_rf_reg`, `function _rfk_restore_bb_reg`, `function _rfk_restore_rf_reg`, `function _rfk_rf_direct_cntrl`, `function _rfk_drf_direct_cntrl`, `function _iqk_check_cal`.
- 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.