drivers/net/wireless/realtek/rtlwifi/rtl8723be/dm.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtlwifi/rtl8723be/dm.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtlwifi/rtl8723be/dm.c- Extension
.c- Size
- 41280 bytes
- Lines
- 1267
- 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.h../rtl8723com/dm_common.hfw.htrx.h../btcoexist/rtl_btc.h
Detected Declarations
function rtl8723be_dm_txpower_track_adjustfunction rtl8723be_dm_init_rate_adaptive_maskfunction rtl8723be_dm_init_txpower_trackingfunction rtl8723be_dm_init_dynamic_atc_switchfunction rtl8723be_dm_initfunction rtl8723be_dm_find_minimum_rssifunction rtl8723be_dm_check_rssi_monitorfunction rtl8723be_dm_write_digfunction rtl8723be_dm_digfunction rtl8723be_dm_false_alarm_counter_statisticsfunction rtl8723be_dm_dynamic_txpowerfunction rtl8723be_set_iqk_matrixfunction rtl8723be_dm_tx_power_track_set_powerfunction rtl8723be_dm_txpower_tracking_callback_thermalmeterfunction rtl8723be_dm_check_txpower_trackingfunction rtl8723be_dm_refresh_rate_adaptive_maskfunction rtl8723be_dm_is_edca_turbo_disablefunction rtl8723be_dm_check_edca_turbofunction rtl8723be_dm_cck_packet_detection_threshfunction rtl8723be_dm_dynamic_edccafunction rtl8723be_dm_dynamic_atc_switchfunction rtl8723be_dm_common_info_self_updatefunction rtl8723be_dm_watchdog
Annotated Snippet
if (ofdm_val <= ofdm_base) {
*pdirection = 1;
pwr_val = ofdm_base - ofdm_val;
} else {
*pdirection = 2;
pwr_val = ofdm_val - ofdm_base;
}
} else if (type == 1) {
if (cck_val <= cck_base) {
*pdirection = 1;
pwr_val = cck_base - cck_val;
} else {
*pdirection = 2;
pwr_val = cck_val - 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 rtl8723be_dm_init_rate_adaptive_mask(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rate_adaptive *p_ra = &rtlpriv->ra;
p_ra->ratr_state = DM_RATR_STA_INIT;
p_ra->pre_ratr_state = DM_RATR_STA_INIT;
if (rtlpriv->dm.dm_type == DM_TYPE_BYDRIVER)
rtlpriv->dm.useramask = true;
else
rtlpriv->dm.useramask = false;
p_ra->high_rssi_thresh_for_ra = 50;
p_ra->low_rssi_thresh_for_ra40m = 20;
}
static void rtl8723be_dm_init_txpower_tracking(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
rtlpriv->dm.txpower_tracking = true;
rtlpriv->dm.txpower_track_control = true;
rtlpriv->dm.thermalvalue = 0;
rtlpriv->dm.ofdm_index[0] = 30;
rtlpriv->dm.cck_index = 20;
rtlpriv->dm.swing_idx_cck_base = rtlpriv->dm.cck_index;
rtlpriv->dm.swing_idx_ofdm_base[0] = rtlpriv->dm.ofdm_index[0];
rtlpriv->dm.delta_power_index[RF90_PATH_A] = 0;
rtlpriv->dm.delta_power_index_last[RF90_PATH_A] = 0;
rtlpriv->dm.power_index_offset[RF90_PATH_A] = 0;
rtl_dbg(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
"rtlpriv->dm.txpower_tracking = %d\n",
rtlpriv->dm.txpower_tracking);
}
static void rtl8723be_dm_init_dynamic_atc_switch(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
rtlpriv->dm.crystal_cap = rtlpriv->efuse.crystalcap;
rtlpriv->dm.atc_status = rtl_get_bbreg(hw, ROFDM1_CFOTRACKING, 0x800);
rtlpriv->dm.cfo_threshold = CFO_THRESHOLD_XTAL;
}
void rtl8723be_dm_init(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
u32 cur_igvalue = rtl_get_bbreg(hw, ROFDM0_XAAGCCORE1, 0x7f);
rtlpriv->dm.dm_type = DM_TYPE_BYDRIVER;
rtl_dm_diginit(hw, cur_igvalue);
rtl8723be_dm_init_rate_adaptive_mask(hw);
rtl8723_dm_init_edca_turbo(hw);
rtl8723_dm_init_dynamic_bb_powersaving(hw);
rtl8723_dm_init_dynamic_txpower(hw);
rtl8723be_dm_init_txpower_tracking(hw);
rtl8723be_dm_init_dynamic_atc_switch(hw);
}
static void rtl8723be_dm_find_minimum_rssi(struct ieee80211_hw *hw)
Annotation
- Immediate include surface: `../wifi.h`, `../base.h`, `../pci.h`, `../core.h`, `reg.h`, `def.h`, `phy.h`, `dm.h`.
- Detected declarations: `function rtl8723be_dm_txpower_track_adjust`, `function rtl8723be_dm_init_rate_adaptive_mask`, `function rtl8723be_dm_init_txpower_tracking`, `function rtl8723be_dm_init_dynamic_atc_switch`, `function rtl8723be_dm_init`, `function rtl8723be_dm_find_minimum_rssi`, `function rtl8723be_dm_check_rssi_monitor`, `function rtl8723be_dm_write_dig`, `function rtl8723be_dm_dig`, `function rtl8723be_dm_false_alarm_counter_statistics`.
- 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.