drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtlwifi/rtl8192ce/phy.c- Extension
.c- Size
- 14906 bytes
- Lines
- 518
- 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../pci.h../ps.h../core.hreg.hdef.hhw.hphy.h../rtl8192c/phy_common.hrf.hdm.h../rtl8192c/dm_common.h../rtl8192c/fw_common.htable.h
Detected Declarations
function rtl92c_phy_query_rf_regfunction rtl92c_phy_mac_configfunction rtl92c_phy_bb_configfunction rtl92ce_phy_set_rf_regfunction _rtl92c_phy_config_mac_with_headerfilefunction _rtl92ce_phy_config_bb_with_headerfilefunction _rtl92ce_phy_config_bb_with_pgheaderfilefunction rtl92c_phy_config_rf_with_headerfilefunction rtl92ce_phy_set_bw_mode_callbackfunction _rtl92ce_phy_lc_calibratefunction _rtl92ce_phy_set_rf_power_statefunction rtl92c_phy_set_rf_power_state
Annotated Snippet
if (bitmask != RFREG_OFFSET_MASK) {
original_value = _rtl92c_phy_rf_serial_read(hw,
rfpath,
regaddr);
bitshift = calculate_bit_shift(bitmask);
data =
((original_value & (~bitmask)) |
(data << bitshift));
}
_rtl92c_phy_rf_serial_write(hw, rfpath, regaddr, data);
} else {
if (bitmask != RFREG_OFFSET_MASK) {
original_value = _rtl92c_phy_fw_rf_serial_read(hw,
rfpath,
regaddr);
bitshift = calculate_bit_shift(bitmask);
data =
((original_value & (~bitmask)) |
(data << bitshift));
}
_rtl92c_phy_fw_rf_serial_write(hw, rfpath, regaddr, data);
}
spin_unlock(&rtlpriv->locks.rf_lock);
rtl_dbg(rtlpriv, COMP_RF, DBG_TRACE,
"regaddr(%#x), bitmask(%#x), data(%#x), rfpath(%#x)\n",
regaddr, bitmask, data, rfpath);
}
static bool _rtl92c_phy_config_mac_with_headerfile(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
u32 i;
u32 arraylength;
u32 *ptrarray;
rtl_dbg(rtlpriv, COMP_INIT, DBG_TRACE, "Read Rtl819XMACPHY_Array\n");
arraylength = MAC_2T_ARRAYLENGTH;
ptrarray = RTL8192CEMAC_2T_ARRAY;
rtl_dbg(rtlpriv, COMP_INIT, DBG_TRACE, "Img:RTL8192CEMAC_2T_ARRAY\n");
for (i = 0; i < arraylength; i = i + 2)
rtl_write_byte(rtlpriv, ptrarray[i], (u8) ptrarray[i + 1]);
return true;
}
bool _rtl92ce_phy_config_bb_with_headerfile(struct ieee80211_hw *hw,
u8 configtype)
{
int i;
u32 *phy_regarray_table;
u32 *agctab_array_table;
u16 phy_reg_arraylen, agctab_arraylen;
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
if (IS_92C_SERIAL(rtlhal->version)) {
agctab_arraylen = AGCTAB_2TARRAYLENGTH;
agctab_array_table = RTL8192CEAGCTAB_2TARRAY;
phy_reg_arraylen = PHY_REG_2TARRAY_LENGTH;
phy_regarray_table = RTL8192CEPHY_REG_2TARRAY;
} else {
agctab_arraylen = AGCTAB_1TARRAYLENGTH;
agctab_array_table = RTL8192CEAGCTAB_1TARRAY;
phy_reg_arraylen = PHY_REG_1TARRAY_LENGTH;
phy_regarray_table = RTL8192CEPHY_REG_1TARRAY;
}
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]);
udelay(1);
rtl_dbg(rtlpriv, COMP_INIT, DBG_TRACE,
"The agctab_array_table[0] is %x Rtl819XPHY_REGArray[1] is %x\n",
agctab_array_table[i],
agctab_array_table[i + 1]);
}
}
Annotation
- Immediate include surface: `../wifi.h`, `../pci.h`, `../ps.h`, `../core.h`, `reg.h`, `def.h`, `hw.h`, `phy.h`.
- Detected declarations: `function rtl92c_phy_query_rf_reg`, `function rtl92c_phy_mac_config`, `function rtl92c_phy_bb_config`, `function rtl92ce_phy_set_rf_reg`, `function _rtl92c_phy_config_mac_with_headerfile`, `function _rtl92ce_phy_config_bb_with_headerfile`, `function _rtl92ce_phy_config_bb_with_pgheaderfile`, `function rtl92c_phy_config_rf_with_headerfile`, `function rtl92ce_phy_set_bw_mode_callback`, `function _rtl92ce_phy_lc_calibrate`.
- 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.