drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c- Extension
.c- Size
- 53375 bytes
- Lines
- 1894
- 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
halbt_precomp.h
Detected Declarations
function halbtc_is_bt_coexist_availablefunction halbtc_is_wifi_busyfunction halbtc_dbg_initfunction halbtc_legacyfunction halbtc_is_wifi_uplinkfunction halbtc_get_wifi_bwfunction halbtc_get_wifi_central_chnlfunction rtl_get_hwpg_single_ant_pathfunction rtl_get_hwpg_bt_typefunction rtl_get_hwpg_ant_numfunction rtl_get_hwpg_package_typefunction rtl_get_hwpg_rfe_typefunction halbtc_is_hw_mailbox_existfunction halbtc_send_bt_mp_operationfunction halbtc_leave_lpsfunction halbtc_enter_lpsfunction halbtc_normal_lpsfunction halbtc_pre_normal_lpsfunction halbtc_post_normal_lpsfunction halbtc_leave_low_powerfunction halbtc_aggregation_checkfunction halbtc_get_bt_patch_versionfunction halbtc_get_bt_coex_supported_featurefunction halbtc_get_bt_coex_supported_versionfunction halbtc_get_bt_device_infofunction halbtc_get_bt_forbidden_slot_valfunction halbtc_get_wifi_link_statusfunction halbtc_get_wifi_rssifunction halbtc_getfunction halbtc_setfunction halbtc_display_coex_statisticsfunction halbtc_read_1bytefunction halbtc_read_2bytefunction halbtc_read_4bytefunction halbtc_write_1bytefunction halbtc_bitmask_write_1bytefunction halbtc_write_2bytefunction halbtc_write_4bytefunction halbtc_write_local_reg_1bytefunction halbtc_set_bbregfunction halbtc_get_bbregfunction halbtc_set_rfregfunction halbtc_get_rfregfunction halbtc_fill_h2c_cmdfunction halbtc_send_wifi_port_id_cmdfunction halbtc_set_default_port_id_cmdfunction halbtc_set_bt_regfunction halbtc_display_dbg_msg
Annotated Snippet
switch (rtlphy->current_chan_bw) {
case HT_CHANNEL_WIDTH_20:
wifi_bw = BTC_WIFI_BW_HT20;
break;
case HT_CHANNEL_WIDTH_20_40:
wifi_bw = BTC_WIFI_BW_HT40;
break;
case HT_CHANNEL_WIDTH_80:
wifi_bw = BTC_WIFI_BW_HT80;
break;
}
}
return wifi_bw;
}
static u8 halbtc_get_wifi_central_chnl(struct btc_coexist *btcoexist)
{
struct rtl_priv *rtlpriv = btcoexist->adapter;
struct rtl_phy *rtlphy = &(rtlpriv->phy);
u8 chnl = 1;
if (rtlphy->current_channel != 0)
chnl = rtlphy->current_channel;
rtl_dbg(rtlpriv, COMP_BT_COEXIST, DBG_LOUD,
"%s:%d\n", __func__, chnl);
return chnl;
}
static u8 rtl_get_hwpg_single_ant_path(struct rtl_priv *rtlpriv)
{
return rtlpriv->btcoexist.btc_info.single_ant_path;
}
static u8 rtl_get_hwpg_bt_type(struct rtl_priv *rtlpriv)
{
return rtlpriv->btcoexist.btc_info.bt_type;
}
static u8 rtl_get_hwpg_ant_num(struct rtl_priv *rtlpriv)
{
u8 num;
if (rtlpriv->btcoexist.btc_info.ant_num == ANT_X2)
num = 2;
else
num = 1;
return num;
}
static u8 rtl_get_hwpg_package_type(struct rtl_priv *rtlpriv)
{
struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
return rtlhal->package_type;
}
static
u8 rtl_get_hwpg_rfe_type(struct rtl_priv *rtlpriv)
{
struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
return rtlhal->rfe_type;
}
static
bool halbtc_is_hw_mailbox_exist(struct btc_coexist *btcoexist)
{
if (IS_HARDWARE_TYPE_8812(btcoexist->adapter))
return false;
else
return true;
}
static
bool halbtc_send_bt_mp_operation(struct btc_coexist *btcoexist, u8 op_code,
u8 *cmd, u32 len, unsigned long wait_ms)
{
struct rtl_priv *rtlpriv;
const u8 oper_ver = 0;
u8 req_num;
if (!halbtc_is_hw_mailbox_exist(btcoexist))
return false;
if (wait_ms) /* before h2c to avoid race condition */
reinit_completion(&btcoexist->bt_mp_comp);
rtlpriv = btcoexist->adapter;
Annotation
- Immediate include surface: `halbt_precomp.h`.
- Detected declarations: `function halbtc_is_bt_coexist_available`, `function halbtc_is_wifi_busy`, `function halbtc_dbg_init`, `function halbtc_legacy`, `function halbtc_is_wifi_uplink`, `function halbtc_get_wifi_bw`, `function halbtc_get_wifi_central_chnl`, `function rtl_get_hwpg_single_ant_path`, `function rtl_get_hwpg_bt_type`, `function rtl_get_hwpg_ant_num`.
- 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.