drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c- Extension
.c- Size
- 76269 bytes
- Lines
- 2725
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
../wifi.h../efuse.h../base.h../regd.h../cam.h../ps.h../pci.hreg.hdef.hphy.h../rtl8723com/phy_common.hdm.h../rtl8723com/dm_common.hfw.h../rtl8723com/fw_common.hled.hhw.h../pwrseqcmd.hpwrseq.h../btcoexist/rtl_btc.hlinux/kernel.h
Detected Declarations
function _rtl8723be_return_beacon_queue_skbfunction _rtl8723be_set_bcn_ctrl_regfunction _rtl8723be_stop_tx_beaconfunction _rtl8723be_resume_tx_beaconfunction _rtl8723be_enable_bcn_sub_funcfunction _rtl8723be_disable_bcn_sub_funcfunction _rtl8723be_set_fw_clock_onfunction _rtl8723be_set_fw_clock_offfunction _rtl8723be_set_fw_ps_rf_onfunction _rtl8723be_fwlps_leavefunction _rtl8723be_fwlps_enterfunction rtl8723be_get_hw_regfunction _rtl8723be_download_rsvd_pagefunction rtl8723be_set_hw_regfunction _rtl8723be_llt_writefunction _rtl8723be_llt_table_initfunction _rtl8723be_gen_refresh_led_statefunction _rtl8723be_init_macfunction _rtl8723be_hw_configurefunction _rtl8723be_dbi_readfunction _rtl8723be_dbi_writefunction _rtl8723be_mdio_readfunction _rtl8723be_mdio_writefunction _rtl8723be_enable_aspm_back_doorfunction rtl8723be_enable_hw_security_configfunction _rtl8723be_poweroff_adapterfunction _rtl8723be_check_pcie_dma_hangfunction _rtl8723be_reset_pcie_interface_dmafunction rtl8723be_hw_initfunction _rtl8723be_read_chip_versionfunction _rtl8723be_set_media_statusfunction rtl8723be_set_check_bssidfunction rtl8723be_set_network_typefunction rtl8723be_set_qosfunction rtl8723be_enable_interruptfunction rtl8723be_disable_interruptfunction rtl8723be_card_disablefunction rtl8723be_interrupt_recognizedfunction rtl8723be_set_beacon_related_registersfunction rtl8723be_set_beacon_intervalfunction rtl8723be_update_interrupt_maskfunction _rtl8723be_get_chnl_groupfunction _rtl8723be_read_power_value_frompromfunction _rtl8723be_read_txpower_info_from_hwpgfunction _rtl8723be_read_package_typefunction _rtl8723be_read_adapter_infofunction _rtl8723be_hal_customized_behaviorfunction rtl8723be_read_eeprom_info
Annotated Snippet
if (rtlhal->fw_clk_change_in_progress) {
while (rtlhal->fw_clk_change_in_progress) {
spin_unlock_bh(&rtlpriv->locks.fw_ps_lock);
count++;
udelay(100);
if (count > 1000)
return;
spin_lock_bh(&rtlpriv->locks.fw_ps_lock);
}
spin_unlock_bh(&rtlpriv->locks.fw_ps_lock);
} else {
rtlhal->fw_clk_change_in_progress = false;
spin_unlock_bh(&rtlpriv->locks.fw_ps_lock);
break;
}
}
if (IS_IN_LOW_POWER_STATE(rtlhal->fw_ps_state)) {
rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_SET_RPWM,
(u8 *)(&rpwm_val));
if (FW_PS_IS_ACK(rpwm_val)) {
isr_regaddr = REG_HISR;
content = rtl_read_dword(rtlpriv, isr_regaddr);
while (!(content & IMR_CPWM) && (count < 500)) {
udelay(50);
count++;
content = rtl_read_dword(rtlpriv, isr_regaddr);
}
if (content & IMR_CPWM) {
rtl_write_word(rtlpriv, isr_regaddr, 0x0100);
rtlhal->fw_ps_state = FW_PS_STATE_RF_ON;
rtl_dbg(rtlpriv, COMP_POWER, DBG_LOUD,
"Receive CPWM INT!!! Set pHalData->FwPSState = %X\n",
rtlhal->fw_ps_state);
}
}
spin_lock_bh(&rtlpriv->locks.fw_ps_lock);
rtlhal->fw_clk_change_in_progress = false;
spin_unlock_bh(&rtlpriv->locks.fw_ps_lock);
if (b_schedule_timer)
mod_timer(&rtlpriv->works.fw_clockoff_timer,
jiffies + MSECS(10));
} else {
spin_lock_bh(&rtlpriv->locks.fw_ps_lock);
rtlhal->fw_clk_change_in_progress = false;
spin_unlock_bh(&rtlpriv->locks.fw_ps_lock);
}
}
static void _rtl8723be_set_fw_clock_off(struct ieee80211_hw *hw, u8 rpwm_val)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
struct rtl8192_tx_ring *ring;
enum rf_pwrstate rtstate;
bool b_schedule_timer = false;
u8 queue;
if (!rtlhal->fw_ready)
return;
if (!rtlpriv->psc.fw_current_inpsmode)
return;
if (!rtlhal->allow_sw_to_change_hwclc)
return;
rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_RF_STATE, (u8 *)(&rtstate));
if (rtstate == ERFOFF || rtlpriv->psc.inactive_pwrstate == ERFOFF)
return;
for (queue = 0; queue < RTL_PCI_MAX_TX_QUEUE_COUNT; queue++) {
ring = &rtlpci->tx_ring[queue];
if (skb_queue_len(&ring->queue)) {
b_schedule_timer = true;
break;
}
}
if (b_schedule_timer) {
mod_timer(&rtlpriv->works.fw_clockoff_timer,
jiffies + MSECS(10));
return;
}
if (FW_PS_STATE(rtlhal->fw_ps_state) != FW_PS_STATE_RF_OFF_LOW_PWR) {
spin_lock_bh(&rtlpriv->locks.fw_ps_lock);
if (!rtlhal->fw_clk_change_in_progress) {
rtlhal->fw_clk_change_in_progress = true;
spin_unlock_bh(&rtlpriv->locks.fw_ps_lock);
Annotation
- Immediate include surface: `../wifi.h`, `../efuse.h`, `../base.h`, `../regd.h`, `../cam.h`, `../ps.h`, `../pci.h`, `reg.h`.
- Detected declarations: `function _rtl8723be_return_beacon_queue_skb`, `function _rtl8723be_set_bcn_ctrl_reg`, `function _rtl8723be_stop_tx_beacon`, `function _rtl8723be_resume_tx_beacon`, `function _rtl8723be_enable_bcn_sub_func`, `function _rtl8723be_disable_bcn_sub_func`, `function _rtl8723be_set_fw_clock_on`, `function _rtl8723be_set_fw_clock_off`, `function _rtl8723be_set_fw_ps_rf_on`, `function _rtl8723be_fwlps_leave`.
- 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.