drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c- Extension
.c- Size
- 71107 bytes
- Lines
- 2516
- 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.h../pwrseqcmd.hreg.hdef.hphy.hdm.hfw.hled.hhw.hpwrseq.h
Detected Declarations
function _rtl88ee_set_bcn_ctrl_regfunction _rtl88ee_stop_tx_beaconfunction _rtl88ee_resume_tx_beaconfunction _rtl88ee_enable_bcn_sub_funcfunction _rtl88ee_return_beacon_queue_skbfunction _rtl88ee_disable_bcn_sub_funcfunction _rtl88ee_set_fw_clock_onfunction _rtl88ee_set_fw_clock_offfunction _rtl88ee_set_fw_ps_rf_onfunction _rtl88ee_set_fw_ps_rf_off_low_powerfunction rtl88ee_fw_clk_off_timer_callbackfunction _rtl88ee_fwlps_leavefunction _rtl88ee_fwlps_enterfunction rtl88ee_get_hw_regfunction rtl88ee_set_hw_regfunction _rtl88ee_llt_writefunction _rtl88ee_llt_table_initfunction _rtl88ee_gen_refresh_led_statefunction _rtl88ee_init_macfunction _rtl88ee_hw_configurefunction _rtl88ee_enable_aspm_back_doorfunction rtl88ee_enable_hw_security_configfunction rtl88ee_hw_initfunction _rtl88ee_read_chip_versionfunction _rtl88ee_set_media_statusfunction rtl88ee_set_check_bssidfunction rtl88ee_set_network_typefunction rtl88ee_set_qosfunction rtl88ee_enable_interruptfunction rtl88ee_disable_interruptfunction _rtl88ee_poweroff_adapterfunction rtl88ee_card_disablefunction rtl88ee_interrupt_recognizedfunction rtl88ee_set_beacon_related_registersfunction rtl88ee_set_beacon_intervalfunction rtl88ee_update_interrupt_maskfunction _rtl88e_get_chnl_groupfunction set_24g_basefunction read_power_value_frompromfunction _rtl88ee_read_txpower_info_from_hwpgfunction _rtl88ee_read_adapter_infofunction _rtl88ee_hal_customized_behaviorfunction rtl88ee_read_eeprom_infofunction rtl88ee_update_hal_rate_tablefunction rtl88ee_update_hal_rate_maskfunction rtl88ee_update_hal_rate_tblfunction rtl88ee_update_channel_access_settingfunction rtl88ee_gpio_radio_on_off_checking
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_88E(rtlhal->fw_ps_state)) {
rtlpriv->cfg->ops->get_hw_reg(hw, HW_VAR_SET_RPWM, &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_88E;
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 (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 _rtl88ee_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 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)) {
schedule_timer = true;
break;
}
}
if (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_88E) {
spin_lock_bh(&rtlpriv->locks.fw_ps_lock);
Annotation
- Immediate include surface: `../wifi.h`, `../efuse.h`, `../base.h`, `../regd.h`, `../cam.h`, `../ps.h`, `../pci.h`, `../pwrseqcmd.h`.
- Detected declarations: `function _rtl88ee_set_bcn_ctrl_reg`, `function _rtl88ee_stop_tx_beacon`, `function _rtl88ee_resume_tx_beacon`, `function _rtl88ee_enable_bcn_sub_func`, `function _rtl88ee_return_beacon_queue_skb`, `function _rtl88ee_disable_bcn_sub_func`, `function _rtl88ee_set_fw_clock_on`, `function _rtl88ee_set_fw_clock_off`, `function _rtl88ee_set_fw_ps_rf_on`, `function _rtl88ee_set_fw_ps_rf_off_low_power`.
- 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.