drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtlwifi/rtl8192du/phy.c- Extension
.c- Size
- 100297 bytes
- Lines
- 3119
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
../wifi.h../ps.h../core.h../efuse.h../usb.h../rtl8192d/reg.h../rtl8192d/def.h../rtl8192d/phy_common.h../rtl8192d/rf_common.hphy.hrf.htable.h
Detected Declarations
function rtl92du_phy_query_bb_regfunction rtl92du_phy_set_bb_regfunction rtl92du_phy_set_bb_reg_1bytefunction rtl92du_phy_mac_configfunction _rtl92du_phy_config_bbfunction _rtl92du_phy_config_bb_pgfunction _rtl92du_phy_bb_configfunction rtl92du_phy_bb_configfunction rtl92du_phy_rf_configfunction rtl92du_phy_config_rf_with_headerfilefunction rtl92du_phy_set_bw_modefunction _rtl92du_phy_stop_trx_before_changebandfunction rtl92du_phy_switch_wirelessbandfunction _rtl92du_phy_reload_imr_settingfunction _rtl92du_phy_switch_rf_settingfunction _rtl92du_phy_patha_iqkfunction _rtl92du_phy_patha_iqk_5g_normalfunction _rtl92du_phy_pathb_iqkfunction _rtl92du_phy_pathb_iqk_5g_normalfunction _rtl92du_phy_reload_adda_registersfunction _rtl92du_phy_reload_mac_registersfunction _rtl92du_phy_patha_standbyfunction _rtl92du_phy_pimode_switchfunction _rtl92du_phy_iq_calibratefunction _rtl92du_phy_iq_calibrate_5g_normalfunction _rtl92du_phy_simularity_comparefunction _rtl92du_phy_patha_fill_iqk_matrix_5g_normalfunction _rtl92du_phy_patha_fill_iqk_matrixfunction _rtl92du_phy_pathb_fill_iqk_matrix_5g_normalfunction _rtl92du_phy_pathb_fill_iqk_matrixfunction rtl92du_phy_iq_calibratefunction rtl92du_phy_reload_iqk_settingfunction _rtl92du_phy_reload_lck_settingfunction _rtl92du_phy_lc_calibrate_swfunction rtl92du_phy_lc_calibratefunction rtl92du_phy_sw_chnlfunction _rtl92du_phy_set_rfonfunction _rtl92du_phy_set_rfsleepfunction rtl92du_phy_set_rf_power_statefunction rtl92du_phy_set_poweronfunction rtl92du_update_bbrf_configurationfunction rtl92du_phy_check_powerofffunction rtl92du_phy_init_pa_bias
Annotated Snippet
if (rtlhal->current_bandtype == BAND_ON_2_4G) {
agctab_arraylen = AGCTAB_2G_ARRAYLENGTH;
agctab_array_table = rtl8192du_agctab_2garray;
rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD,
" ===> phy:MAC1, Rtl819XAGCTAB_2GArray\n");
} else {
agctab_arraylen = AGCTAB_5G_ARRAYLENGTH;
agctab_array_table = rtl8192du_agctab_5garray;
rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD,
" ===> phy:MAC1, Rtl819XAGCTAB_5GArray\n");
}
}
phy_reg_arraylen = PHY_REG_2T_ARRAYLENGTH;
phy_regarray_table = rtl8192du_phy_reg_2tarray;
rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD,
" ===> phy:Rtl819XPHY_REG_Array_PG\n");
if (configtype == BASEBAND_CONFIG_PHY_REG) {
for (i = 0; i < phy_reg_arraylen; i = i + 2) {
rtl_addr_delay(phy_regarray_table[i]);
rtl_set_bbreg(hw, phy_regarray_table[i], MASKDWORD,
phy_regarray_table[i + 1]);
udelay(1);
rtl_dbg(rtlpriv, COMP_INIT, DBG_TRACE,
"The phy_regarray_table[0] is %x Rtl819XPHY_REGArray[1] is %x\n",
phy_regarray_table[i],
phy_regarray_table[i + 1]);
}
} else if (configtype == BASEBAND_CONFIG_AGC_TAB) {
for (i = 0; i < agctab_arraylen; i = i + 2) {
rtl_set_bbreg(hw, agctab_array_table[i],
MASKDWORD, agctab_array_table[i + 1]);
/* Add 1us delay between BB/RF register setting. */
udelay(1);
rtl_dbg(rtlpriv, COMP_INIT, DBG_TRACE,
"AGC table %u %u\n",
agctab_array_table[i],
agctab_array_table[i + 1]);
}
rtl_dbg(rtlpriv, COMP_INIT, DBG_LOUD,
"Normal Chip, loaded AGC table\n");
}
return true;
}
static bool _rtl92du_phy_config_bb_pg(struct ieee80211_hw *hw, u8 configtype)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
const u32 *phy_regarray_table_pg;
u16 phy_regarray_pg_len;
int i;
phy_regarray_pg_len = PHY_REG_ARRAY_PG_LENGTH;
phy_regarray_table_pg = rtl8192du_phy_reg_array_pg;
if (configtype == BASEBAND_CONFIG_PHY_REG) {
for (i = 0; i < phy_regarray_pg_len; i = i + 3) {
rtl_addr_delay(phy_regarray_table_pg[i]);
rtl92d_store_pwrindex_diffrate_offset(hw,
phy_regarray_table_pg[i],
phy_regarray_table_pg[i + 1],
phy_regarray_table_pg[i + 2]);
}
} else {
rtl_dbg(rtlpriv, COMP_SEND, DBG_TRACE,
"configtype != BaseBand_Config_PHY_REG\n");
}
return true;
}
static bool _rtl92du_phy_bb_config(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_efuse *rtlefuse = rtl_efuse(rtlpriv);
struct rtl_phy *rtlphy = &rtlpriv->phy;
bool ret;
rtl_dbg(rtlpriv, COMP_INIT, DBG_TRACE, "==>\n");
ret = _rtl92du_phy_config_bb(hw, BASEBAND_CONFIG_PHY_REG);
if (!ret) {
pr_err("Write BB Reg Fail!!\n");
return false;
}
if (!rtlefuse->autoload_failflag) {
rtlphy->pwrgroup_cnt = 0;
ret = _rtl92du_phy_config_bb_pg(hw, BASEBAND_CONFIG_PHY_REG);
}
Annotation
- Immediate include surface: `../wifi.h`, `../ps.h`, `../core.h`, `../efuse.h`, `../usb.h`, `../rtl8192d/reg.h`, `../rtl8192d/def.h`, `../rtl8192d/phy_common.h`.
- Detected declarations: `function rtl92du_phy_query_bb_reg`, `function rtl92du_phy_set_bb_reg`, `function rtl92du_phy_set_bb_reg_1byte`, `function rtl92du_phy_mac_config`, `function _rtl92du_phy_config_bb`, `function _rtl92du_phy_config_bb_pg`, `function _rtl92du_phy_bb_config`, `function rtl92du_phy_bb_config`, `function rtl92du_phy_rf_config`, `function rtl92du_phy_config_rf_with_headerfile`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.