drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hal_bt_coexist.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hal_bt_coexist.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hal_bt_coexist.c- Extension
.c- Size
- 15824 bytes
- Lines
- 516
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
hal_bt_coexist.h../pci.hdm.hfw.hphy.hreg.hhal_btc.h
Detected Declarations
function rtl8723e_dm_bt_reject_ap_aggregated_packetfunction rtl8723e_dm_bt_check_coex_rssi_state1function rtl8723e_dm_bt_check_coex_rssi_statefunction rtl8723e_dm_bt_get_rx_ssfunction rtl8723e_dm_bt_balancefunction rtl8723e_dm_bt_agc_tablefunction rtl8723e_dm_bt_bb_back_off_levelfunction rtl8723e_dm_bt_fw_coex_all_offfunction rtl8723e_dm_bt_sw_coex_all_offfunction rtl8723e_dm_bt_hw_coex_all_offfunction rtl8723e_btdm_coex_all_offfunction rtl8723e_dm_bt_is_coexist_state_changedfunction rtl8723e_dm_bt_is_wifi_up_link
Annotated Snippet
if (rtlphy->current_chan_bw == HT_CHANNEL_WIDTH_20_40) {
rtlpriv->btcoexist.cstate |=
BT_COEX_STATE_WIFI_HT40;
rtlpriv->btcoexist.cstate &=
~BT_COEX_STATE_WIFI_HT20;
} else {
rtlpriv->btcoexist.cstate |=
BT_COEX_STATE_WIFI_HT20;
rtlpriv->btcoexist.cstate &=
~BT_COEX_STATE_WIFI_HT40;
}
}
if (bt_operation_on)
rtlpriv->btcoexist.cstate |= BT_COEX_STATE_BT30;
else
rtlpriv->btcoexist.cstate &= ~BT_COEX_STATE_BT30;
}
u8 rtl8723e_dm_bt_check_coex_rssi_state1(struct ieee80211_hw *hw,
u8 level_num, u8 rssi_thresh,
u8 rssi_thresh1)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
long undecoratedsmoothed_pwdb;
u8 bt_rssi_state = 0;
undecoratedsmoothed_pwdb = rtl8723e_dm_bt_get_rx_ss(hw);
if (level_num == 2) {
rtlpriv->btcoexist.cstate &=
~BT_COEX_STATE_WIFI_RSSI_1_MEDIUM;
if ((rtlpriv->btcoexist.bt_pre_rssi_state ==
BT_RSSI_STATE_LOW) ||
(rtlpriv->btcoexist.bt_pre_rssi_state ==
BT_RSSI_STATE_STAY_LOW)) {
if (undecoratedsmoothed_pwdb >=
(rssi_thresh + BT_FW_COEX_THRESH_TOL)) {
bt_rssi_state = BT_RSSI_STATE_HIGH;
rtlpriv->btcoexist.cstate |=
BT_COEX_STATE_WIFI_RSSI_1_HIGH;
rtlpriv->btcoexist.cstate &=
~BT_COEX_STATE_WIFI_RSSI_1_LOW;
rtl_dbg(rtlpriv, COMP_BT_COEXIST, DBG_TRACE,
"[DM][BT], RSSI_1 state switch to High\n");
} else {
bt_rssi_state = BT_RSSI_STATE_STAY_LOW;
rtl_dbg(rtlpriv, COMP_BT_COEXIST, DBG_TRACE,
"[DM][BT], RSSI_1 state stay at Low\n");
}
} else {
if (undecoratedsmoothed_pwdb < rssi_thresh) {
bt_rssi_state = BT_RSSI_STATE_LOW;
rtlpriv->btcoexist.cstate |=
BT_COEX_STATE_WIFI_RSSI_1_LOW;
rtlpriv->btcoexist.cstate &=
~BT_COEX_STATE_WIFI_RSSI_1_HIGH;
rtl_dbg(rtlpriv, COMP_BT_COEXIST, DBG_TRACE,
"[DM][BT], RSSI_1 state switch to Low\n");
} else {
bt_rssi_state = BT_RSSI_STATE_STAY_HIGH;
rtl_dbg(rtlpriv, COMP_BT_COEXIST, DBG_TRACE,
"[DM][BT], RSSI_1 state stay at High\n");
}
}
} else if (level_num == 3) {
if (rssi_thresh > rssi_thresh1) {
rtl_dbg(rtlpriv, COMP_BT_COEXIST, DBG_TRACE,
"[DM][BT], RSSI_1 thresh error!!\n");
return rtlpriv->btcoexist.bt_pre_rssi_state;
}
if ((rtlpriv->btcoexist.bt_pre_rssi_state ==
BT_RSSI_STATE_LOW) ||
(rtlpriv->btcoexist.bt_pre_rssi_state ==
BT_RSSI_STATE_STAY_LOW)) {
if (undecoratedsmoothed_pwdb >=
(rssi_thresh+BT_FW_COEX_THRESH_TOL)) {
bt_rssi_state = BT_RSSI_STATE_MEDIUM;
rtlpriv->btcoexist.cstate |=
BT_COEX_STATE_WIFI_RSSI_1_MEDIUM;
rtlpriv->btcoexist.cstate &=
~BT_COEX_STATE_WIFI_RSSI_1_LOW;
rtlpriv->btcoexist.cstate &=
~BT_COEX_STATE_WIFI_RSSI_1_HIGH;
rtl_dbg(rtlpriv, COMP_BT_COEXIST, DBG_TRACE,
"[DM][BT], RSSI_1 state switch to Medium\n");
} else {
Annotation
- Immediate include surface: `hal_bt_coexist.h`, `../pci.h`, `dm.h`, `fw.h`, `phy.h`, `reg.h`, `hal_btc.h`.
- Detected declarations: `function rtl8723e_dm_bt_reject_ap_aggregated_packet`, `function rtl8723e_dm_bt_check_coex_rssi_state1`, `function rtl8723e_dm_bt_check_coex_rssi_state`, `function rtl8723e_dm_bt_get_rx_ss`, `function rtl8723e_dm_bt_balance`, `function rtl8723e_dm_bt_agc_table`, `function rtl8723e_dm_bt_bb_back_off_level`, `function rtl8723e_dm_bt_fw_coex_all_off`, `function rtl8723e_dm_bt_sw_coex_all_off`, `function rtl8723e_dm_bt_hw_coex_all_off`.
- 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.