drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c- Extension
.c- Size
- 89632 bytes
- Lines
- 2796
- 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../base.h../pci.h../core.hreg.hdef.hphy.hdm.hfw.htrx.h../btcoexist/rtl_btc.h
Detected Declarations
function rtl8821ae_dm_txpower_track_adjustfunction rtl8821ae_dm_clear_txpower_tracking_statefunction rtl8821ae_dm_get_swing_indexfunction rtl8821ae_dm_initialize_txpower_tracking_thermalmeterfunction rtl8821ae_dm_init_edca_turbofunction rtl8821ae_dm_init_rate_adaptive_maskfunction rtl8821ae_dm_init_dynamic_atc_switchfunction rtl8821ae_dm_common_info_self_initfunction rtl8821ae_dm_initfunction rtl8821ae_dm_find_minimum_rssifunction rtl8812ae_dm_rssi_dump_to_registerfunction rtl8821ae_dm_check_rssi_monitorfunction list_for_each_entryfunction rtl8821ae_dm_write_cck_cca_thresfunction rtl8821ae_dm_write_digfunction rtl8821ae_dm_digfunction rtl8821ae_dm_common_info_self_updatefunction rtl8821ae_dm_false_alarm_counter_statisticsfunction rtl8812ae_dm_check_txpower_tracking_thermalmeterfunction rtl8821ae_dm_iq_calibratefunction rtl8812ae_get_delta_swing_tablefunction rtl8821ae_dm_update_init_ratefunction rtl8821ae_hw_rate_to_mratefunction rtl8812ae_dm_txpwr_track_set_pwrfunction rtl8812ae_dm_txpower_tracking_callback_thermalmeterfunction rtl8821ae_get_delta_swing_tablefunction rtl8821ae_dm_txpwr_track_set_pwrfunction rtl8821ae_dm_txpower_tracking_callback_thermalmeterfunction centigradefunction rtl8821ae_dm_check_txpower_tracking_thermalmeterfunction rtl8821ae_dm_refresh_rate_adaptive_maskfunction rtl8821ae_dm_refresh_basic_rate_maskfunction rtl8821ae_dm_edca_choose_traffic_idxfunction rtl8821ae_dm_check_edca_turbofunction rtl8821ae_dm_cck_packet_detection_threshfunction rtl8821ae_dm_dynamic_atc_switchfunction rtl8821ae_dm_watchdogfunction rtl8821ae_dm_set_tx_ant_by_tx_info
Annotated Snippet
if (rtldm->swing_idx_cck <= rtldm->swing_idx_cck_base) {
*pdirection = 1;
pwr_val = rtldm->swing_idx_cck_base -
rtldm->swing_idx_cck;
} else {
*pdirection = 2;
pwr_val = rtldm->swing_idx_cck -
rtldm->swing_idx_cck_base;
}
}
if (pwr_val >= TXPWRTRACK_MAX_IDX && (*pdirection == 1))
pwr_val = TXPWRTRACK_MAX_IDX;
*poutwrite_val = pwr_val | (pwr_val << 8)|
(pwr_val << 16)|
(pwr_val << 24);
}
void rtl8821ae_dm_clear_txpower_tracking_state(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_dm *rtldm = rtl_dm(rtlpriv);
struct rtl_efuse *rtlefuse = rtl_efuse(rtlpriv);
u8 p = 0;
rtldm->swing_idx_cck_base = rtldm->default_cck_index;
rtldm->swing_idx_cck = rtldm->default_cck_index;
rtldm->cck_index = 0;
for (p = RF90_PATH_A; p <= RF90_PATH_B; ++p) {
rtldm->swing_idx_ofdm_base[p] = rtldm->default_ofdm_index;
rtldm->swing_idx_ofdm[p] = rtldm->default_ofdm_index;
rtldm->ofdm_index[p] = rtldm->default_ofdm_index;
rtldm->power_index_offset[p] = 0;
rtldm->delta_power_index[p] = 0;
rtldm->delta_power_index_last[p] = 0;
/*Initial Mix mode power tracking*/
rtldm->absolute_ofdm_swing_idx[p] = 0;
rtldm->remnant_ofdm_swing_idx[p] = 0;
}
/*Initial at Modify Tx Scaling Mode*/
rtldm->modify_txagc_flag_path_a = false;
/*Initial at Modify Tx Scaling Mode*/
rtldm->modify_txagc_flag_path_b = false;
rtldm->remnant_cck_idx = 0;
rtldm->thermalvalue = rtlefuse->eeprom_thermalmeter;
rtldm->thermalvalue_iqk = rtlefuse->eeprom_thermalmeter;
rtldm->thermalvalue_lck = rtlefuse->eeprom_thermalmeter;
}
static u8 rtl8821ae_dm_get_swing_index(struct ieee80211_hw *hw)
{
struct rtl_hal *rtlhal = rtl_hal(rtl_priv(hw));
u8 i = 0;
u32 bb_swing;
bb_swing = phy_get_tx_swing_8812A(hw, rtlhal->current_bandtype,
RF90_PATH_A);
for (i = 0; i < TXSCALE_TABLE_SIZE; ++i)
if (bb_swing == rtl8821ae_txscaling_table[i])
break;
return i;
}
void rtl8821ae_dm_initialize_txpower_tracking_thermalmeter(
struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_dm *rtldm = rtl_dm(rtlpriv);
struct rtl_efuse *rtlefuse = rtl_efuse(rtlpriv);
u8 default_swing_index = 0;
u8 p = 0;
rtlpriv->dm.txpower_track_control = true;
rtldm->thermalvalue = rtlefuse->eeprom_thermalmeter;
rtldm->thermalvalue_iqk = rtlefuse->eeprom_thermalmeter;
rtldm->thermalvalue_lck = rtlefuse->eeprom_thermalmeter;
default_swing_index = rtl8821ae_dm_get_swing_index(hw);
rtldm->default_ofdm_index =
(default_swing_index == TXSCALE_TABLE_SIZE) ?
24 : default_swing_index;
rtldm->default_cck_index = 24;
rtldm->swing_idx_cck_base = rtldm->default_cck_index;
rtldm->cck_index = rtldm->default_cck_index;
Annotation
- Immediate include surface: `../wifi.h`, `../base.h`, `../pci.h`, `../core.h`, `reg.h`, `def.h`, `phy.h`, `dm.h`.
- Detected declarations: `function rtl8821ae_dm_txpower_track_adjust`, `function rtl8821ae_dm_clear_txpower_tracking_state`, `function rtl8821ae_dm_get_swing_index`, `function rtl8821ae_dm_initialize_txpower_tracking_thermalmeter`, `function rtl8821ae_dm_init_edca_turbo`, `function rtl8821ae_dm_init_rate_adaptive_mask`, `function rtl8821ae_dm_init_dynamic_atc_switch`, `function rtl8821ae_dm_common_info_self_init`, `function rtl8821ae_dm_init`, `function rtl8821ae_dm_find_minimum_rssi`.
- 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.