drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hal_btc.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hal_btc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hal_btc.c- Extension
.c- Size
- 55997 bytes
- Lines
- 1757
- 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.
- 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
hal_btc.h../pci.hphy.hfw.hreg.hdef.h../rtl8723com/phy_common.h
Detected Declarations
function rtl8723e_dm_bt_turn_off_bt_coexist_before_enter_lpsfunction mgnt_link_status_queryfunction rtl_8723e_bt_wifi_media_status_notifyfunction rtl8723e_dm_bt_is_wifi_busyfunction rtl8723e_dm_bt_set_fw_3afunction rtl8723e_dm_bt_need_to_dec_bt_pwrfunction rtl8723e_dm_bt_is_same_coexist_statefunction rtl8723e_dm_bt_set_coex_tablefunction rtl8723e_dm_bt_set_hw_pta_modefunction rtl8723e_dm_bt_set_sw_rf_rx_lpf_cornerfunction dm_bt_set_sw_penalty_tx_rate_adaptfunction rtl8723e_dm_bt_btdm_structure_reloadfunction rtl8723e_dm_bt_btdm_structure_reload_all_offfunction rtl8723e_dm_bt_is_2_ant_common_actionfunction rtl8723e_dm_bt_set_sw_full_time_dac_swingfunction rtl8723e_dm_bt_set_fw_dec_bt_pwrfunction rtl8723e_dm_bt_set_fw_2_ant_hidfunction rtl8723e_dm_bt_set_fw_tdma_ctrlfunction rtl8723e_dm_bt_set_fw_ignore_wlan_actfunction rtl8723e_dm_bt_set_fw_tra_tdma_ctrlfunction rtl8723e_dm_bt_set_fw_dac_swing_levelfunction rtl8723e_dm_bt_set_fw_bt_hid_infofunction rtl8723e_dm_bt_set_fw_bt_retry_indexfunction rtl8723e_dm_bt_set_fw_wlan_actfunction rtl8723e_dm_bt_set_bt_dmfunction rtl8723e_dm_bt_tx_rx_couter_hfunction rtl8723e_dm_bt_tx_rx_couter_lfunction rtl8723e_dm_bt_bt_tx_rx_counter_levelfunction rtl8723e_dm_bt_2_ant_hid_sco_escofunction rtl8723e_dm_bt_2_ant_ftp_a2dpfunction rtl8723e_dm_bt_inq_page_monitorfunction rtl8723e_dm_bt_reset_action_profile_statefunction _rtl8723e_dm_bt_coexist_2_antfunction _rtl8723e_dm_bt_coexist_1_antfunction rtl8723e_dm_bt_hw_coex_all_off_8723afunction rtl8723e_dm_bt_fw_coex_all_off_8723afunction rtl8723e_dm_bt_sw_coex_all_off_8723afunction rtl8723e_dm_bt_query_bt_informationfunction rtl8723e_dm_bt_bt_hw_counters_monitorfunction rtl8723e_dm_bt_bt_enable_disable_checkfunction rtl8723e_dm_bt_coexist_8723function rtl8723e_dm_bt_parse_bt_infofunction rtl_8723e_c2h_command_handle
Annotated Snippet
if (mgnt_link_status_query(hw) == RT_MEDIA_CONNECT) {
rtl_dbg(rtlpriv, COMP_BT_COEXIST, DBG_DMESG,
"Wifi connection exist\n");
b_common = false;
} else {
rtl_dbg(rtlpriv, COMP_BT_COEXIST, DBG_DMESG,
"No Wifi connection!\n");
btdm8723.rf_rx_lpf_shrink = true;
btdm8723.low_penalty_rate_adaptive = false;
btdm8723.reject_aggre_pkt = false;
/* sw mechanism */
btdm8723.agc_table_en = false;
btdm8723.adc_back_off_on = false;
btdm8723.sw_dac_swing_on = false;
btdm8723.pta_on = true;
btdm8723.val_0x6c0 = 0x55555555;
btdm8723.val_0x6c8 = 0x0000ffff;
btdm8723.val_0x6cc = 0x3;
btdm8723.tdma_on = false;
btdm8723.tdma_dac_swing = TDMA_DAC_SWING_OFF;
btdm8723.b2_ant_hid_en = false;
b_common = true;
}
}
if (rtl8723e_dm_bt_need_to_dec_bt_pwr(hw))
btdm8723.dec_bt_pwr = true;
if (b_common)
rtlpriv->btcoexist.cstate |=
BT_COEX_STATE_BTINFO_COMMON;
if (b_common && rtl8723e_dm_bt_is_coexist_state_changed(hw))
rtl8723e_dm_bt_set_bt_dm(hw, &btdm8723);
return b_common;
}
static void rtl8723e_dm_bt_set_sw_full_time_dac_swing(
struct ieee80211_hw *hw,
bool sw_dac_swing_on,
u32 sw_dac_swing_lvl)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
if (sw_dac_swing_on) {
rtl_dbg(rtlpriv, COMP_BT_COEXIST, DBG_TRACE,
"[BTCoex], SwDacSwing = 0x%x\n", sw_dac_swing_lvl);
rtl8723_phy_set_bb_reg(hw, 0x880, 0xff000000,
sw_dac_swing_lvl);
rtlpriv->btcoexist.sw_coexist_all_off = false;
} else {
rtl_dbg(rtlpriv, COMP_BT_COEXIST, DBG_TRACE,
"[BTCoex], SwDacSwing Off!\n");
rtl8723_phy_set_bb_reg(hw, 0x880, 0xff000000, 0xc0);
}
}
static void rtl8723e_dm_bt_set_fw_dec_bt_pwr(
struct ieee80211_hw *hw, bool dec_bt_pwr)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
u8 h2c_parameter[1] = {0};
h2c_parameter[0] = 0;
if (dec_bt_pwr) {
h2c_parameter[0] |= BIT(1);
rtlpriv->btcoexist.fw_coexist_all_off = false;
}
rtl_dbg(rtlpriv, COMP_BT_COEXIST, DBG_TRACE,
"[BTCoex], decrease Bt Power : %s, write 0x21=0x%x\n",
(dec_bt_pwr ? "Yes!!" : "No!!"), h2c_parameter[0]);
rtl8723e_fill_h2c_cmd(hw, 0x21, 1, h2c_parameter);
}
static void rtl8723e_dm_bt_set_fw_2_ant_hid(struct ieee80211_hw *hw,
bool b_enable, bool b_dac_swing_on)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
u8 h2c_parameter[1] = {0};
if (b_enable) {
h2c_parameter[0] |= BIT(0);
Annotation
- Immediate include surface: `hal_btc.h`, `../pci.h`, `phy.h`, `fw.h`, `reg.h`, `def.h`, `../rtl8723com/phy_common.h`.
- Detected declarations: `function rtl8723e_dm_bt_turn_off_bt_coexist_before_enter_lps`, `function mgnt_link_status_query`, `function rtl_8723e_bt_wifi_media_status_notify`, `function rtl8723e_dm_bt_is_wifi_busy`, `function rtl8723e_dm_bt_set_fw_3a`, `function rtl8723e_dm_bt_need_to_dec_bt_pwr`, `function rtl8723e_dm_bt_is_same_coexist_state`, `function rtl8723e_dm_bt_set_coex_table`, `function rtl8723e_dm_bt_set_hw_pta_mode`, `function rtl8723e_dm_bt_set_sw_rf_rx_lpf_corner`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.