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.

Dependency Surface

Detected Declarations

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

Implementation Notes