Update to 5.8.7.1

This commit is contained in:
Rin Cat
2020-08-02 05:12:24 -04:00
parent 314b662331
commit e3b09b28f7
449 changed files with 106089 additions and 83748 deletions

53
hal/btc/btc_basic_types.h Normal file
View File

@@ -0,0 +1,53 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2017 Realtek Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*****************************************************************************/
#ifndef __BTC_BASIC_TYPES_H__
#define __BTC_BASIC_TYPES_H__
#define IN
#define OUT
#define VOID void
typedef void *PVOID;
#define u1Byte u8
#define pu1Byte u8*
#define u2Byte u16
#define pu2Byte u16*
#define u4Byte u32
#define pu4Byte u32*
#define u8Byte u64
#define pu8Byte u64*
#define s1Byte s8
#define ps1Byte s8*
#define s2Byte s16
#define ps2Byte s16*
#define s4Byte s32
#define ps4Byte s32*
#define s8Byte s64
#define ps8Byte s64*
#define UCHAR u8
#define USHORT u16
#define UINT u32
#define ULONG u32
#define PULONG u32*
#endif /* __BTC_BASIC_TYPES_H__ */

File diff suppressed because it is too large Load Diff

View File

@@ -78,6 +78,8 @@ enum bt_info_src_8822b_1ant {
BT_8822B_1ANT_INFO_SRC_WIFI_FW = 0x0,
BT_8822B_1ANT_INFO_SRC_BT_RSP = 0x1,
BT_8822B_1ANT_INFO_SRC_BT_ACT = 0x2,
BT_8822B_1ANT_INFO_SRC_BT_IQK = 0x3,
BT_8822B_1ANT_INFO_SRC_BT_SCBD = 0x4,
BT_8822B_1ANT_INFO_SRC_MAX
};
@@ -168,7 +170,9 @@ enum bt_8822b_1ant_scoreboard {
BT_8822B_1ANT_SCBD_RXGAIN = BIT(4),
BT_8822B_1ANT_SCBD_WLBUSY = BIT(6),
BT_8822B_1ANT_SCBD_EXTFEM = BIT(8),
BT_8822B_1ANT_SCBD_CQDDR = BIT(10)
BT_8822B_1ANT_SCBD_TDMA = BIT(9),
BT_8822B_1ANT_SCBD_CQDDR = BIT(10),
BT_8822B_1ANT_SCBD_ALL = 0xffff
};
enum bt_8822b_1ant_RUNREASON {
@@ -252,6 +256,7 @@ struct coex_sta_8822b_1ant {
boolean hid_exist;
boolean pan_exist;
boolean msft_mr_exist;
boolean bt_a2dp_active;
u8 num_of_profile;
boolean under_lps;
@@ -309,7 +314,7 @@ struct coex_sta_8822b_1ant {
u8 isolation_btween_wb; /* 0~ 50 */
u8 a2dp_bit_pool;
u8 cut_version;
u8 kt_ver;
boolean acl_busy;
boolean bt_create_connection;
@@ -324,6 +329,8 @@ struct coex_sta_8822b_1ant {
boolean is_A2DP_3M;
boolean voice_over_HOGP;
boolean bt_418_hid_exist;
boolean bt_ble_hid_exist;
u8 forbidden_slot;
u8 hid_busy_num;
u8 hid_pair_cnt;
@@ -334,6 +341,7 @@ struct coex_sta_8822b_1ant {
u32 cnt_ign_wlan_act;
u32 cnt_page;
u32 cnt_role_switch;
u32 cnt_wl_fw_notify;
u16 bt_reg_vendor_ac;
u16 bt_reg_vendor_ae;
@@ -344,12 +352,9 @@ struct coex_sta_8822b_1ant {
u8 bt_afh_map[10];
u8 bt_relink_downcount;
boolean is_tdma_btautoslot;
boolean is_tdma_btautoslot_hang;
u8 switch_band_notify_to;
boolean is_rf_state_off;
boolean is_hid_low_pri_tx_overhead;
boolean is_bt_multi_link;
boolean is_bt_a2dp_sink;
@@ -364,10 +369,13 @@ struct coex_sta_8822b_1ant {
u8 wl_tx_macid;
u8 wl_tx_retry_ratio;
boolean is_2g_freerun;
u16 score_board_WB;
boolean is_hid_rcu;
u8 bt_a2dp_vendor_id;
u32 bt_a2dp_device_name;
u32 bt_a2dp_flush_time;
boolean is_ble_scan_en;
boolean is_bt_opp_exist;
@@ -394,6 +402,10 @@ struct coex_sta_8822b_1ant {
boolean wl_rxagg_limit_en;
u8 wl_rxagg_size;
u8 coex_run_reason;
u8 tdma_timer_base;
boolean wl_slot_toggle;
boolean wl_slot_toggle_change; /* if toggle to no-toggle */
};
struct rfe_type_8822b_1ant {
@@ -410,6 +422,7 @@ struct wifi_link_info_8822b_1ant {
boolean is_all_under_5g;
boolean is_mcc_25g;
boolean is_p2p_connected;
boolean is_connected;
};
/* *******************************************

File diff suppressed because it is too large Load Diff

View File

@@ -100,6 +100,8 @@ enum bt_info_src_8822b_2ant {
BT_8822B_2ANT_INFO_SRC_WIFI_FW = 0x0,
BT_8822B_2ANT_INFO_SRC_BT_RSP = 0x1,
BT_8822B_2ANT_INFO_SRC_BT_ACT = 0x2,
BT_8822B_2ANT_INFO_SRC_BT_IQK = 0x3,
BT_8822B_2ANT_INFO_SRC_BT_SCBD = 0x4,
BT_8822B_2ANT_INFO_SRC_MAX
};
@@ -179,7 +181,9 @@ enum bt_8822b_2ant_scoreboard {
BT_8822B_2ANT_SCBD_RXGAIN = BIT(4),
BT_8822B_2ANT_SCBD_WLBUSY = BIT(6),
BT_8822B_2ANT_SCBD_EXTFEM = BIT(8),
BT_8822B_2ANT_SCBD_CQDDR = BIT(10)
BT_8822B_2ANT_SCBD_TDMA = BIT(9),
BT_8822B_2ANT_SCBD_CQDDR = BIT(10),
BT_8822B_2ANT_SCBD_ALL = 0xffff
};
enum bt_8822b_2ant_RUNREASON {
@@ -247,11 +251,9 @@ struct coex_dm_8822b_2ant {
u8 cur_lps;
u8 cur_rpwm;
boolean is_switch_to_1dot5_ant;
u32 arp_cnt;
u32 cur_ext_ant_switch_status;
u32 cur_switch_status;
u32 setting_tdma;
};
@@ -263,6 +265,7 @@ struct coex_sta_8822b_2ant {
boolean hid_exist;
boolean pan_exist;
boolean msft_mr_exist;
boolean bt_a2dp_active;
boolean under_lps;
boolean under_ips;
@@ -310,7 +313,7 @@ struct coex_sta_8822b_2ant {
u8 dis_ver_info_cnt;
u8 a2dp_bit_pool;
u8 cut_version;
u8 kt_ver;
boolean concurrent_rx_mode_on;
@@ -338,6 +341,8 @@ struct coex_sta_8822b_2ant {
boolean is_A2DP_3M;
boolean voice_over_HOGP;
boolean bt_418_hid_exist;
boolean bt_ble_hid_exist;
boolean is_autoslot;
u8 forbidden_slot;
u8 hid_busy_num;
@@ -349,6 +354,7 @@ struct coex_sta_8822b_2ant {
u32 cnt_ign_wlan_act;
u32 cnt_page;
u32 cnt_role_switch;
u32 cnt_wl_fw_notify;
u16 bt_reg_vendor_ac;
u16 bt_reg_vendor_ae;
@@ -360,13 +366,10 @@ struct coex_sta_8822b_2ant {
u8 bt_afh_map[10];
u8 bt_relink_downcount;
boolean is_tdma_btautoslot;
boolean is_tdma_btautoslot_hang;
boolean is_esco_mode;
u8 switch_band_notify_to;
boolean is_rf_state_off;
boolean is_hid_low_pri_tx_overhead;
boolean is_bt_multi_link;
boolean is_bt_a2dp_sink;
@@ -387,6 +390,7 @@ struct coex_sta_8822b_2ant {
boolean is_hid_rcu;
u8 bt_a2dp_vendor_id;
u32 bt_a2dp_device_name;
u32 bt_a2dp_flush_time;
boolean is_ble_scan_en;
boolean is_bt_opp_exist;
@@ -413,6 +417,10 @@ struct coex_sta_8822b_2ant {
boolean wl_rxagg_limit_en;
u8 wl_rxagg_size;
u8 coex_run_reason;
u8 tdma_timer_base;
boolean wl_slot_toggle;
boolean wl_slot_toggle_change; /* if toggle to no-toggle */
};
#define BT_8822B_2ANT_EXT_BAND_SWITCH_USE_DPDT 0
@@ -441,6 +449,7 @@ struct wifi_link_info_8822b_2ant {
boolean is_all_under_5g;
boolean is_mcc_25g;
boolean is_p2p_connected;
boolean is_connected;
};
/* *******************************************

View File

@@ -17,7 +17,7 @@
VOID
ex_hal8822b_wifi_only_hw_config(
IN struct wifi_only_cfg *pwifionlycfg
IN struct wifi_only_cfg *pwifionlycfg
)
{
/*BB control*/
@@ -35,9 +35,6 @@ ex_hal8822b_wifi_only_hw_config(
/*gnt_wl=1 , gnt_bt=0*/
halwifionly_phy_set_bb_reg(pwifionlycfg, 0x1704, 0xffffffff, 0x7700);
halwifionly_phy_set_bb_reg(pwifionlycfg, 0x1700, 0xffffffff, 0xc00f0038);
halwifionly_phy_set_bb_reg(pwifionlycfg, 0x6c0, 0xffffffff, 0xaaaaaaaa);
halwifionly_phy_set_bb_reg(pwifionlycfg, 0x6c4, 0xffffffff, 0xaaaaaaaa);
}
VOID
@@ -67,6 +64,7 @@ ex_hal8822b_wifi_only_connectnotify(
hal8822b_wifi_only_switch_antenna(pwifionlycfg, is_5g);
}
VOID
hal8822b_wifi_only_switch_antenna(IN struct wifi_only_cfg *pwifionlycfg,
IN u1Byte is_5g

View File

@@ -116,6 +116,7 @@ enum {
BTC_MULTIPORT_MAX
};
#define BTC_COEX_8822B_COMMON_CODE 0
#define BTC_COEX_OFFLOAD 0
#define BTC_TMP_BUF_SHORT 20
@@ -204,6 +205,13 @@ typedef enum _BTC_CHIP_TYPE {
BTC_CHIP_RTL8723A = 3,
BTC_CHIP_RTL8821 = 4,
BTC_CHIP_RTL8723B = 5,
BTC_CHIP_RTL8822B = 6,
BTC_CHIP_RTL8822C = 7,
BTC_CHIP_RTL8821C = 8,
BTC_CHIP_RTL8821A = 9,
BTC_CHIP_RTL8723D = 10,
BTC_CHIP_RTL8703B = 11,
BTC_CHIP_RTL8725A = 12,
BTC_CHIP_MAX
} BTC_CHIP_TYPE, *PBTC_CHIP_TYPE;
@@ -219,6 +227,397 @@ typedef enum _BTC_CHIP_TYPE {
#define CL_PRINTF DCMD_Printf
#define CL_STRNCAT(dst, dst_size, src, src_size) rstrncat(dst, src, src_size)
static const char *const glbt_info_src[] = {
"BT Info[wifi fw]",
"BT Info[bt rsp]",
"BT Info[bt auto report]",
};
#define TDMA_4SLOT BIT(8)
#define BTC_INFO_FTP BIT(7)
#define BTC_INFO_A2DP BIT(6)
#define BTC_INFO_HID BIT(5)
#define BTC_INFO_SCO_BUSY BIT(4)
#define BTC_INFO_ACL_BUSY BIT(3)
#define BTC_INFO_INQ_PAGE BIT(2)
#define BTC_INFO_SCO_ESCO BIT(1)
#define BTC_INFO_CONNECTION BIT(0)
#define BTC_BTINFO_LENGTH_MAX 10
enum btc_gnt_setup_state {
BTC_GNT_SET_SW_LOW = 0x0,
BTC_GNT_SET_SW_HIGH = 0x1,
BTC_GNT_SET_HW_PTA = 0x2,
BTC_GNT_SET_MAX
};
enum btc_gnt_setup_state_2 {
BTC_GNT_SW_LOW = 0x0,
BTC_GNT_SW_HIGH = 0x1,
BTC_GNT_HW_PTA = 0x2,
BTC_GNT_MAX
};
enum btc_path_ctrl_owner {
BTC_OWNER_BT = 0x0,
BTC_OWNER_WL = 0x1,
BTC_OWNER_MAX
};
enum btc_gnt_ctrl_type {
BTC_GNT_CTRL_BY_PTA = 0x0,
BTC_GNT_CTRL_BY_SW = 0x1,
BTC_GNT_CTRL_MAX
};
enum btc_gnt_ctrl_block {
BTC_GNT_BLOCK_RFC_BB = 0x0,
BTC_GNT_BLOCK_RFC = 0x1,
BTC_GNT_BLOCK_BB = 0x2,
BTC_GNT_BLOCK_MAX
};
enum btc_lte_coex_table_type {
BTC_CTT_WL_VS_LTE = 0x0,
BTC_CTT_BT_VS_LTE = 0x1,
BTC_CTT_MAX
};
enum btc_lte_break_table_type {
BTC_LBTT_WL_BREAK_LTE = 0x0,
BTC_LBTT_BT_BREAK_LTE = 0x1,
BTC_LBTT_LTE_BREAK_WL = 0x2,
BTC_LBTT_LTE_BREAK_BT = 0x3,
BTC_LBTT_MAX
};
enum btc_btinfo_src {
BTC_BTINFO_SRC_WL_FW = 0x0,
BTC_BTINFO_SRC_BT_RSP = 0x1,
BTC_BTINFO_SRC_BT_ACT = 0x2,
BTC_BTINFO_SRC_BT_IQK = 0x3,
BTC_BTINFO_SRC_BT_SCBD = 0x4,
BTC_BTINFO_SRC_H2C60 = 0x5,
BTC_BTINFO_SRC_MAX
};
enum btc_bt_profile {
BTC_BTPROFILE_NONE = 0,
BTC_BTPROFILE_HFP = BIT(0),
BTC_BTPROFILE_HID = BIT(1),
BTC_BTPROFILE_A2DP = BIT(2),
BTC_BTPROFILE_PAN = BIT(3),
BTC_BTPROFILE_MAX = 0xf
};
static const char *const bt_profile_string[] = {
"None",
"HFP",
"HID",
"HID + HFP",
"A2DP",
"A2DP + HFP",
"A2DP + HID",
"PAN + HID + HFP",
"PAN",
"PAN + HFP",
"PAN + HID",
"PAN + HID + HFP",
"PAN + A2DP",
"PAN + A2DP + HFP",
"PAN + A2DP + HID",
"PAN + A2DP + HID + HFP"
};
enum btc_bt_status {
BTC_BTSTATUS_NCON_IDLE = 0x0,
BTC_BTSTATUS_CON_IDLE = 0x1,
BTC_BTSTATUS_INQ_PAGE = 0x2,
BTC_BTSTATUS_ACL_BUSY = 0x3,
BTC_BTSTATUS_SCO_BUSY = 0x4,
BTC_BTSTATUS_ACL_SCO_BUSY = 0x5,
BTC_BTSTATUS_MAX
};
static const char *const bt_status_string[] = {
"BT Non-Connected-idle",
"BT Connected-idle",
"BT Inq-page",
"BT ACL-busy",
"BT SCO-busy",
"BT ACL-SCO-busy",
"BT Non-Defined-state"
};
enum btc_coex_algo {
BTC_COEX_NOPROFILE = 0x0,
BTC_COEX_HFP = 0x1,
BTC_COEX_HID = 0x2,
BTC_COEX_A2DP = 0x3,
BTC_COEX_PAN = 0x4,
BTC_COEX_A2DP_HID = 0x5,
BTC_COEX_A2DP_PAN = 0x6,
BTC_COEX_PAN_HID = 0x7,
BTC_COEX_A2DP_PAN_HID = 0x8,
BTC_COEX_MAX
};
static const char *const coex_algo_string[] = {
"No Profile",
"HFP",
"HID",
"A2DP",
"PAN",
"A2DP + HID",
"A2DP + PAN",
"PAN + HID",
"A2DP + PAN + HID"
};
enum btc_ext_ant_switch_type {
BTC_SWITCH_NONE = 0x0,
BTC_SWITCH_SPDT = 0x1,
BTC_SWITCH_SP3T = 0x2,
BTC_SWITCH_ANTMAX
};
enum btc_ext_ant_switch_ctrl_type {
BTC_SWITCH_CTRL_BY_BBSW = 0x0,
BTC_SWITCH_CTRL_BY_PTA = 0x1,
BTC_SWITCH_CTRL_BY_ANTDIV = 0x2,
BTC_SWITCH_CTRL_BY_MAC = 0x3,
BTC_SWITCH_CTRL_BY_BT = 0x4,
BTC_SWITCH_CTRL_BY_FW = 0x5,
BTC_SWITCH_CTRL_MAX
};
enum btc_ext_ant_switch_pos_type {
BTC_SWITCH_TO_BT = 0x0,
BTC_SWITCH_TO_WLG = 0x1,
BTC_SWITCH_TO_WLA = 0x2,
BTC_SWITCH_TO_NOCARE = 0x3,
BTC_SWITCH_TO_WLG_BT = 0x4,
BTC_SWITCH_TO_MAX
};
enum btx_set_ant_phase {
BTC_ANT_INIT = 0x0,
BTC_ANT_WONLY = 0x1,
BTC_ANT_WOFF = 0x2,
BTC_ANT_2G = 0x3,
BTC_ANT_5G = 0x4,
BTC_ANT_BTMP = 0x5,
BTC_ANT_POWERON = 0x6,
BTC_ANT_2G_WL = 0x7,
BTC_ANT_2G_BT = 0x8,
BTC_ANT_MCC = 0x9,
BTC_ANT_2G_WLBT = 0xa,
BTC_ANT_2G_FREERUN = 0xb,
BTC_ANT_MAX
};
/*ADD SCOREBOARD TO FIX BT LPS 32K ISSUE WHILE WL BUSY*/
enum btc_wl2bt_scoreboard {
BTC_SCBD_ACTIVE = BIT(0),
BTC_SCBD_ON = BIT(1),
BTC_SCBD_SCAN = BIT(2),
BTC_SCBD_UNDERTEST = BIT(3),
BTC_SCBD_RXGAIN = BIT(4),
BTC_SCBD_WLBUSY = BIT(7),
BTC_SCBD_EXTFEM = BIT(8),
BTC_SCBD_TDMA = BIT(9),
BTC_SCBD_FIX2M = BIT(10),
BTC_SCBD_ALL = 0xffff
};
enum btc_bt2wl_scoreboard {
BTC_SCBD_BT_ONOFF = BIT(1),
BTC_SCBD_BT_LPS = BIT(7)
};
enum btc_runreason {
BTC_RSN_2GSCANSTART = 0x0,
BTC_RSN_5GSCANSTART = 0x1,
BTC_RSN_SCANFINISH = 0x2,
BTC_RSN_2GSWITCHBAND = 0x3,
BTC_RSN_5GSWITCHBAND = 0x4,
BTC_RSN_2GCONSTART = 0x5,
BTC_RSN_5GCONSTART = 0x6,
BTC_RSN_2GCONFINISH = 0x7,
BTC_RSN_5GCONFINISH = 0x8,
BTC_RSN_2GMEDIA = 0x9,
BTC_RSN_5GMEDIA = 0xa,
BTC_RSN_MEDIADISCON = 0xb,
BTC_RSN_2GSPECIALPKT = 0xc,
BTC_RSN_5GSPECIALPKT = 0xd,
BTC_RSN_BTINFO = 0xe,
BTC_RSN_PERIODICAL = 0xf,
BTC_RSN_PNP = 0x10,
BTC_RSN_LPS = 0x11,
BTC_RSN_TIMERUP = 0x12,
BTC_RSN_WLSTATUS = 0x13,
BTC_RSN_MAX
};
static const char *const run_reason_string[] = {
"2G_SCAN_START",
"5G_SCAN_START",
"SCAN_FINISH",
"2G_SWITCH_BAND",
"5G_SWITCH_BAND",
"2G_CONNECT_START",
"5G_CONNECT_START",
"2G_CONNECT_FINISH",
"5G_CONNECT_FINISH",
"2G_MEDIA_STATUS",
"5G_MEDIA_STATUS",
"MEDIA_DISCONNECT",
"2G_SPECIALPKT",
"5G_SPECIALPKT",
"BTINFO",
"PERIODICAL",
"PNPNotify",
"LPSNotify",
"TimerUp",
"WL_STATUS_CHANGE",
};
enum btc_wl_link_mode {
BTC_WLINK_2G1PORT = 0x0,
BTC_WLINK_2GMPORT = 0x1,
BTC_WLINK_25GMPORT = 0x2,
BTC_WLINK_5G = 0x3,
BTC_WLINK_2GGO = 0x4,
BTC_WLINK_2GGC = 0x5,
BTC_WLINK_BTMR = 0x6,
BTC_WLINK_MAX
};
static const char *const coex_mode_string[] = {
"2G-SP",
"2G-MP",
"25G-MP",
"5G",
"2G-P2P-GO",
"2G-P2P-GC",
"BT-MR"
};
enum btc_bt_state_cnt {
BTC_CNT_BT_RETRY = 0x0,
BTC_CNT_BT_REINIT = 0x1,
BTC_CNT_BT_POPEVENT = 0x2,
BTC_CNT_BT_SETUPLINK = 0x3,
BTC_CNT_BT_IGNWLANACT = 0x4,
BTC_CNT_BT_INQ = 0x5,
BTC_CNT_BT_PAGE = 0x6,
BTC_CNT_BT_ROLESWITCH = 0x7,
BTC_CNT_BT_AFHUPDATE = 0x8,
BTC_CNT_BT_DISABLE = 0x9,
BTC_CNT_BT_INFOUPDATE = 0xa,
BTC_CNT_BT_IQK = 0xb,
BTC_CNT_BT_IQKFAIL = 0xc,
BTC_CNT_BT_MAX
};
enum btc_wl_state_cnt {
BTC_CNT_WL_SCANAP = 0x0,
BTC_CNT_WL_ARP = 0x1,
BTC_CNT_WL_GNTERR = 0x2,
BTC_CNT_WL_PSFAIL = 0x3,
BTC_CNT_WL_COEXRUN = 0x4,
BTC_CNT_WL_COEXINFO1 = 0x5,
BTC_CNT_WL_COEXINFO2 = 0x6,
BTC_CNT_WL_AUTOSLOT_HANG = 0x7,
BTC_CNT_WL_NOISY0 = 0x8,
BTC_CNT_WL_NOISY1 = 0x9,
BTC_CNT_WL_NOISY2 = 0xa,
BTC_CNT_WL_ACTIVEPORT = 0xb,
BTC_CNT_WL_5MS_NOEXTEND = 0xc,
BTC_CNT_WL_FW_NOTIFY = 0xd,
BTC_CNT_WL_MAX
};
enum btc_wl_crc_cnt {
BTC_WLCRC_11BOK = 0x0,
BTC_WLCRC_11GOK = 0x1,
BTC_WLCRC_11NOK = 0x2,
BTC_WLCRC_11VHTOK = 0x3,
BTC_WLCRC_11BERR = 0x4,
BTC_WLCRC_11GERR = 0x5,
BTC_WLCRC_11NERR = 0x6,
BTC_WLCRC_11VHTERR = 0x7,
BTC_WLCRC_MAX
};
enum btc_timer_cnt {
BTC_TIMER_WL_STAYBUSY = 0x0,
BTC_TIMER_WL_COEXFREEZE = 0x1,
BTC_TIMER_WL_SPECPKT = 0x2,
BTC_TIMER_WL_CONNPKT = 0x3,
BTC_TIMER_WL_PNPWAKEUP = 0x4,
BTC_TIMER_WL_CCKLOCK = 0x5,
BTC_TIMER_WL_FWDBG = 0x6,
BTC_TIMER_BT_RELINK = 0x7,
BTC_TIMER_BT_REENABLE = 0x8,
BTC_TIMER_BT_MULTILINK = 0x9,
BTC_TIMER_MAX
};
enum btc_wl_status_change {
BTC_WLSTATUS_CHANGE_TOIDLE = 0x0,
BTC_WLSTATUS_CHANGE_TOBUSY = 0x1,
BTC_WLSTATUS_CHANGE_RSSI = 0x2,
BTC_WLSTATUS_CHANGE_LINKINFO = 0x3,
BTC_WLSTATUS_CHANGE_DIR = 0x4,
BTC_WLSTATUS_CHANGE_NOISY = 0x5,
BTC_WLSTATUS_CHANGE_MAX
};
enum btc_commom_chip_setup {
BTC_CSETUP_INIT_HW = 0x0,
BTC_CSETUP_ANT_SWITCH = 0x1,
BTC_CSETUP_GNT_FIX = 0x2,
BTC_CSETUP_GNT_DEBUG = 0x3,
BTC_CSETUP_RFE_TYPE = 0x4,
BTC_CSETUP_COEXINFO_HW = 0x5,
BTC_CSETUP_WL_TX_POWER = 0x6,
BTC_CSETUP_WL_RX_GAIN = 0x7,
BTC_CSETUP_WLAN_ACT_IPS = 0x8,
BTC_CSETUP_MAX
};
enum btc_indirect_reg_type {
BTC_INDIRECT_1700 = 0x0,
BTC_INDIRECT_7C0 = 0x1,
BTC_INDIRECT_MAX
};
enum btc_pstdma_type {
BTC_PSTDMA_FORCE_LPSOFF = 0x0,
BTC_PSTDMA_FORCE_LPSON = 0x1,
BTC_PSTDMA_MAX
};
enum btc_btrssi_type {
BTC_BTRSSI_RATIO = 0x0,
BTC_BTRSSI_DBM = 0x1,
BTC_BTRSSI_MAX
};
enum btc_wl_priority_mask {
BTC_WLPRI_RX_RSP = 2,
BTC_WLPRI_TX_RSP = 3,
BTC_WLPRI_TX_BEACON = 4,
BTC_WLPRI_TX_OFDM = 11,
BTC_WLPRI_TX_CCK = 12,
BTC_WLPRI_TX_BEACONQ = 27,
BTC_WLPRI_RX_CCK = 28,
BTC_WLPRI_RX_OFDM = 29,
BTC_WLPRI_MAX
};
struct btc_board_info {
/* The following is some board information */
u8 bt_chip_type;
@@ -239,6 +638,231 @@ struct btc_board_info {
u32 antdetval;
u8 customerID;
u8 customer_id;
u8 ant_distance; /* WL-BT antenna space for non-shared antenna */
};
struct btc_coex_dm {
boolean cur_ignore_wlan_act;
boolean cur_ps_tdma_on;
boolean cur_low_penalty_ra;
boolean cur_wl_rx_low_gain_en;
u8 bt_rssi_state[4];
u8 wl_rssi_state[4];
u8 cur_ps_tdma;
u8 ps_tdma_para[5];
u8 fw_tdma_para[5];
u8 cur_lps;
u8 cur_rpwm;
u8 cur_bt_pwr_lvl;
u8 cur_bt_lna_lvl;
u8 cur_wl_pwr_lvl;
u8 cur_algorithm;
u8 bt_status;
u8 wl_chnl_info[3];
u8 cur_toggle_para[6];
u8 cur_val0x6cc;
u32 cur_val0x6c0;
u32 cur_val0x6c4;
u32 cur_val0x6c8;
u32 cur_ant_pos_type;
u32 cur_switch_status;
u32 setting_tdma;
};
struct btc_coex_sta {
boolean coex_freeze;
boolean coex_freerun;
boolean tdma_bt_autoslot;
boolean rf4ce_en;
boolean is_no_wl_5ms_extend;
boolean bt_disabled;
boolean bt_disabled_pre;
boolean bt_link_exist;
boolean bt_whck_test;
boolean bt_inq_page;
boolean bt_inq;
boolean bt_page;
boolean bt_ble_voice;
boolean bt_ble_exist;
boolean bt_hfp_exist;
boolean bt_a2dp_exist;
boolean bt_hid_exist;
boolean bt_pan_exist; // PAN or OPP
boolean bt_opp_exist; //OPP only
boolean bt_msft_mr_exist;
boolean bt_acl_busy;
boolean bt_fix_2M;
boolean bt_setup_link;
boolean bt_multi_link;
boolean bt_multi_link_pre;
boolean bt_multi_link_remain;
boolean bt_a2dp_sink;
boolean bt_reenable;
boolean bt_ble_scan_en;
boolean bt_slave;
boolean bt_a2dp_active;
boolean bt_slave_latency;
boolean bt_init_scan;
boolean bt_418_hid_exist;
boolean bt_ble_hid_exist;
boolean bt_mesh;
boolean wl_under_lps;
boolean wl_under_ips;
boolean wl_under_4way;
boolean wl_hi_pri_task1;
boolean wl_hi_pri_task2;
boolean wl_cck_lock;
boolean wl_cck_lock_pre;
boolean wl_cck_lock_ever;
boolean wl_force_lps_ctrl;
boolean wl_busy_pre;
boolean wl_gl_busy;
boolean wl_gl_busy_pre;
boolean wl_linkscan_proc;
boolean wl_mimo_ps;
boolean wl_ps_state_fail;
boolean wl_cck_dead_lock_ap;
boolean wl_tx_limit_en;
boolean wl_ampdu_limit_en;
boolean wl_rxagg_limit_en;
boolean wl_connecting;
boolean wl_pnp_wakeup;
boolean wl_slot_toggle;
boolean wl_slot_toggle_change; /* if toggle to no-toggle */
u8 coex_table_type;
u8 coex_run_reason;
u8 tdma_byte4_modify_pre;
u8 kt_ver;
u8 gnt_workaround_state;
u8 tdma_timer_base;
u8 bt_rssi;
u8 bt_profile_num;
u8 bt_profile_num_pre;
u8 bt_info_c2h[BTC_BTINFO_SRC_MAX][BTC_BTINFO_LENGTH_MAX];
u8 bt_info_lb2;
u8 bt_info_lb3;
u8 bt_info_hb0;
u8 bt_info_hb1;
u8 bt_info_hb2;
u8 bt_info_hb3;
u8 bt_ble_scan_type;
u8 bt_afh_map[10];
u8 bt_a2dp_vendor_id;
u8 bt_hid_pair_num;
u8 bt_hid_slot;
u8 bt_a2dp_bitpool;
u8 bt_iqk_state;
u8 bt_sut_pwr_lvl[4];
u8 bt_golden_rx_shift[4];
u8 bt_ext_autoslot_thres;
u8 wl_pnp_state_pre;
u8 wl_noisy_level;
u8 wl_fw_dbg_info[10];
u8 wl_fw_dbg_info_pre[10];
u8 wl_rx_rate;
u8 wl_tx_rate;
u8 wl_rts_rx_rate;
u8 wl_center_ch;
u8 wl_tx_macid;
u8 wl_tx_retry_ratio;
u8 wl_coex_mode;
u8 wl_iot_peer;
u8 wl_ra_thres;
u8 wl_ampdulen_backup;
u8 wl_rxagg_size;
u8 wl_toggle_para[6];
u16 score_board_BW;
u16 score_board_WB;
u16 bt_reg_vendor_ac;
u16 bt_reg_vendor_ae;
u16 bt_reg_modem_a;
u16 bt_reg_rf_2;
u16 wl_txlimit_backup;
u32 hi_pri_tx;
u32 hi_pri_rx;
u32 lo_pri_tx;
u32 lo_pri_rx;
u32 bt_supported_feature;
u32 bt_supported_version;
u32 bt_ble_scan_para[3];
u32 bt_a2dp_device_name;
u32 wl_arfb1_backup;
u32 wl_arfb2_backup;
u32 wl_traffic_dir;
u32 wl_bw;
u32 cnt_bt_info_c2h[BTC_BTINFO_SRC_MAX];
u32 cnt_bt[BTC_CNT_BT_MAX];
u32 cnt_wl[BTC_CNT_WL_MAX];
u32 cnt_timer[BTC_TIMER_MAX];
};
struct btc_rfe_type {
boolean ant_switch_exist;
boolean ant_switch_diversity; /* If diversity on */
boolean ant_switch_with_bt; /* If WL_2G/BT use ext-switch at shared-ant */
u8 rfe_module_type;
u8 ant_switch_type;
u8 ant_switch_polarity;
boolean band_switch_exist;
u8 band_switch_type; /* 0:DPDT, 1:SPDT */
u8 band_switch_polarity;
/* If TRUE: WLG at BTG, If FALSE: WLG at WLAG */
boolean wlg_at_btg;
};
struct btc_wifi_link_info_ext {
boolean is_all_under_5g;
boolean is_mcc_25g;
boolean is_p2p_connected;
boolean is_ap_mode;
boolean is_scan;
boolean is_link;
boolean is_roam;
boolean is_4way;
boolean is_32k;
boolean is_connected;
u8 num_of_active_port;
u32 port_connect_status;
u32 traffic_dir;
u32 wifi_bw;
};
struct btc_coex_table_para {
u32 bt; //0x6c0
u32 wl; //0x6c4
};
struct btc_tdma_para {
u8 para[5];
};
struct btc_reg_byte_modify {
u32 addr;
u8 bitmask;
u8 val;
};
struct btc_5g_afh_map {
u32 wl_5g_ch;
u8 bt_skip_ch;
u8 bt_skip_span;
};
struct btc_rf_para {
u8 wl_pwr_dec_lvl;
u8 bt_pwr_dec_lvl;
boolean wl_low_gain_en;
u8 bt_lna_lvl;
};
typedef enum _BTC_DBG_OPCODE {
@@ -383,7 +1007,9 @@ typedef enum _BTC_GET_TYPE {
/* type u4Byte */
BTC_GET_U4_WIFI_BW,
BTC_GET_U4_WIFI_TRAFFIC_DIRECTION,
BTC_GET_U4_WIFI_TRAFFIC_DIR,
BTC_GET_U4_WIFI_FW_VER,
BTC_GET_U4_WIFI_PHY_VER,
BTC_GET_U4_WIFI_LINK_STATUS,
BTC_GET_U4_BT_PATCH_VER,
BTC_GET_U4_VENDOR,
@@ -391,6 +1017,7 @@ typedef enum _BTC_GET_TYPE {
BTC_GET_U4_SUPPORTED_FEATURE,
BTC_GET_U4_BT_DEVICE_INFO,
BTC_GET_U4_BT_FORBIDDEN_SLOT_VAL,
BTC_GET_U4_BT_A2DP_FLUSH_VAL,
BTC_GET_U4_WIFI_IQK_TOTAL,
BTC_GET_U4_WIFI_IQK_OK,
BTC_GET_U4_WIFI_IQK_FAIL,
@@ -428,6 +1055,7 @@ typedef enum _BTC_SET_TYPE {
BTC_SET_BL_BT_TX_RX_MASK,
BTC_SET_BL_MIRACAST_PLUS_BT,
BTC_SET_BL_BT_LNA_CONSTRAIN_LEVEL,
BTC_SET_BL_BT_GOLDEN_RX_RANGE,
/* type u1Byte */
BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON,
@@ -460,6 +1088,7 @@ typedef enum _BTC_SET_TYPE {
BTC_SET_ACT_CTRL_BT_INFO,
BTC_SET_ACT_CTRL_BT_COEX,
BTC_SET_ACT_CTRL_8723B_ANT,
BTC_SET_RESET_COEX_VAR,
/*=================*/
BTC_SET_MAX
} BTC_SET_TYPE, *PBTC_SET_TYPE;
@@ -675,6 +1304,7 @@ struct btc_wifi_link_info {
BOOLEAN bhotspot;
};
#if 0
typedef enum _BTC_MULTI_PORT_TDMA_MODE {
BTC_MULTI_PORT_TDMA_MODE_NONE=0,
BTC_MULTI_PORT_TDMA_MODE_2G_SCC_GO,
@@ -687,6 +1317,22 @@ typedef struct btc_multi_port_tdma_info {
u1Byte start_time_from_bcn;
u1Byte bt_time;
} BTC_MULTI_PORT_TDMA_INFO, *PBTC_MULTI_PORT_TDMA_INFO;
#endif
typedef enum _btc_concurrent_mode {
btc_concurrent_mode_none = 0,
btc_concurrent_mode_2g_go_miracast,
btc_concurrent_mode_2g_go_hotspot,
btc_concurrent_mode_2g_scc_go_miracast_sta,
btc_concurrent_mode_2g_scc_go_hotspot_sta,
btc_concurrent_mode_2g_gc,
} btc_concurrent_mode, *pbtc_concurrent_mode;
struct btc_concurrent_setting {
btc_concurrent_mode btc_concurrent_mode;
u1Byte start_time_from_bcn;
u1Byte bt_time;
};
typedef u1Byte
(*BFP_BTC_R1)(
@@ -734,6 +1380,29 @@ typedef VOID
IN u4Byte RegAddr,
IN u1Byte Data
);
typedef u4Byte
(*BFP_BTC_R_LINDIRECT)(
IN PVOID pBtcContext,
IN u2Byte reg_addr
);
typedef VOID
(*BFP_BTC_R_SCBD)(
IN PVOID pBtcContext,
IN pu2Byte score_board_val
);
typedef VOID
(*BFP_BTC_W_SCBD)(
IN PVOID pBtcContext,
IN u2Byte bitpos,
IN BOOLEAN state
);
typedef VOID
(*BFP_BTC_W_LINDIRECT)(
IN PVOID pBtcContext,
IN u2Byte reg_addr,
IN u4Byte bit_mask,
IN u4Byte reg_value
);
typedef VOID
(*BFP_BTC_SET_BB_REG)(
IN PVOID pBtcContext,
@@ -839,6 +1508,13 @@ typedef u4Byte
IN PVOID pBtcContext
);
typedef u1Byte
(*BFP_BTC_SET_TIMER) (
IN PVOID pBtcContext,
IN u4Byte type,
IN u4Byte val
);
typedef u4Byte
(*BFP_BTC_SET_ATOMIC) (
IN PVOID pBtcContext,
@@ -860,6 +1536,12 @@ typedef u4Byte
IN u1Byte info_type
);
typedef VOID
(*BTC_REDUCE_WL_TX_POWER)(
IN PVOID pDM_Odm,
IN s1Byte tx_power
);
typedef VOID
(*BTC_PHYDM_MODIFY_ANTDIV_HWSW)(
IN PVOID pDM_Odm,
@@ -906,8 +1588,7 @@ struct btc_bt_info {
boolean bt_busy;
boolean limited_dig;
u16 bt_hci_ver;
u16 bt_real_fw_ver;
u8 bt_fw_ver;
u32 bt_real_fw_ver;
u32 get_bt_fw_ver_cnt;
u32 bt_get_fw_ver;
boolean miracast_plus_bt;
@@ -989,6 +1670,11 @@ struct btc_coexist {
struct btc_stack_info stack_info;
struct btc_bt_link_info bt_link_info;
struct btc_wifi_link_info wifi_link_info;
struct btc_wifi_link_info_ext wifi_link_info_ext;
struct btc_coex_dm coex_dm;
struct btc_coex_sta coex_sta;
struct btc_rfe_type rfe_type;
const struct btc_chip_para *chip_para;
#ifdef CONFIG_RF4CE_COEXIST
struct btc_rf4ce_info rf4ce_info;
@@ -1005,6 +1691,8 @@ struct btc_coexist {
u1Byte pwrModeVal[10];
BOOLEAN dbg_mode;
BOOLEAN auto_report;
u8 chip_type;
BOOLEAN wl_rf_state_off;
/* function pointers */
/* io related */
@@ -1016,6 +1704,10 @@ struct btc_coexist {
BFP_BTC_R4 btc_read_4byte;
BFP_BTC_W4 btc_write_4byte;
BFP_BTC_LOCAL_REG_W1 btc_write_local_reg_1byte;
BFP_BTC_R_LINDIRECT btc_read_linderct;
BFP_BTC_W_LINDIRECT btc_write_linderct;
BFP_BTC_R_SCBD btc_read_scbd;
BFP_BTC_W_SCBD btc_write_scbd;
/* read/write bb related */
BFP_BTC_SET_BB_REG btc_set_bb_reg;
BFP_BTC_GET_BB_REG btc_get_bb_reg;
@@ -1042,9 +1734,11 @@ struct btc_coexist {
BFP_BTC_GET_BT_COEX_SUPPORTED_FEATURE btc_get_bt_coex_supported_feature;
BFP_BTC_GET_BT_COEX_SUPPORTED_VERSION btc_get_bt_coex_supported_version;
BFP_BTC_GET_PHYDM_VERSION btc_get_bt_phydm_version;
BFP_BTC_SET_TIMER btc_set_timer;
BFP_BTC_SET_ATOMIC btc_set_atomic;
BTC_PHYDM_MODIFY_RA_PCR_THRESHLOD btc_phydm_modify_RA_PCR_threshold;
BTC_PHYDM_CMNINFOQUERY btc_phydm_query_PHY_counter;
BTC_REDUCE_WL_TX_POWER btc_reduce_wl_tx_power;
BTC_PHYDM_MODIFY_ANTDIV_HWSW btc_phydm_modify_antdiv_hwsw;
BFP_BTC_GET_ANT_DET_VAL_FROM_BT btc_get_ant_det_val_from_bt;
BFP_BTC_GET_BLE_SCAN_TYPE_FROM_BT btc_get_ble_scan_type_from_bt;
@@ -1108,6 +1802,49 @@ typedef struct btc_coexist *PBTC_COEXIST;
extern struct btc_coexist GLBtCoexist;
typedef void
(*BFP_BTC_CHIP_SETUP)(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte setType
);
struct btc_chip_para {
const char *chip_name;
u32 para_ver_date;
u32 para_ver;
u32 bt_desired_ver;
boolean scbd_support;
boolean mailbox_support;
boolean lte_indirect_access;
boolean new_scbd10_def; /* TRUE: 1:fix 2M(8822c) */
u8 indirect_type; /* 0:17xx, 1:7cx */
u8 pstdma_type; /* 0: LPSoff, 1:LPSon */
u8 bt_rssi_type;
u8 ant_isolation;
u8 rssi_tolerance;
u8 rx_path_num;
u8 wl_rssi_step_num;
const u8 *wl_rssi_step;
u8 bt_rssi_step_num;
const u8 *bt_rssi_step;
u8 table_sant_num;
const struct btc_coex_table_para *table_sant;
u8 table_nsant_num;
const struct btc_coex_table_para *table_nsant;
u8 tdma_sant_num;
const struct btc_tdma_para *tdma_sant;
u8 tdma_nsant_num;
const struct btc_tdma_para *tdma_nsant;
u8 wl_rf_para_tx_num;
const struct btc_rf_para *wl_rf_para_tx;
const struct btc_rf_para *wl_rf_para_rx;
u8 bt_afh_span_bw20;
u8 bt_afh_span_bw40;
u8 afh_5g_num;
const struct btc_5g_afh_map *afh_5g;
BFP_BTC_CHIP_SETUP chip_setup;
};
BOOLEAN
EXhalbtcoutsrc_InitlizeVariables(
IN PVOID Adapter
@@ -1175,6 +1912,14 @@ EXhalbtcoutsrc_RfStatusNotify(
IN PBTC_COEXIST pBtCoexist,
IN u1Byte type
);
u4Byte
EXhalbtcoutsrc_CoexTimerCheck(
IN PBTC_COEXIST pBtCoexist
);
u4Byte
EXhalbtcoutsrc_WLStatusCheck(
IN PBTC_COEXIST pBtCoexist
);
VOID
EXhalbtcoutsrc_WlFwDbgInfoNotify(
IN PBTC_COEXIST pBtCoexist,
@@ -1202,6 +1947,16 @@ EXhalbtcoutsrc_PnpNotify(
IN u1Byte pnpState
);
VOID
EXhalbtcoutsrc_TimerNotify(
IN PBTC_COEXIST pBtCoexist,
IN u4Byte timer_type
);
VOID
EXhalbtcoutsrc_WLStatusChangeNotify(
IN PBTC_COEXIST pBtCoexist,
IN u4Byte change_type
);
VOID
EXhalbtcoutsrc_CoexDmSwitch(
IN PBTC_COEXIST pBtCoexist
);

View File

@@ -17,6 +17,7 @@
#include <drv_types.h>
#include <hal_data.h>
#include "btc_basic_types.h"
#define BT_TMP_BUF_SIZE 100
@@ -111,6 +112,24 @@ struct btc_coexist;
#include "halbtc8821c2ant.h"
#endif
#ifdef CONFIG_RTL8814A
#include "halbtc8814a2ant.h"
#endif
#if (CONFIG_BTCOEX_SUPPORT_BTC_CMN == 1)
#include "halbtccommon.h"
#ifdef CONFIG_RTL8822C
#include "halbtc8822cwifionly.h"
#include "halbtc8822c.h"
#endif
#ifdef CONFIG_RTL8192F
#include "halbtc8192f.h"
#endif
#endif
#include "halbtcoutsrc.h"
#else /* CONFIG_BT_COEXIST */
@@ -127,6 +146,14 @@ struct btc_coexist;
#include "halbtc8821cwifionly.h"
#endif
#ifdef CONFIG_RTL8822C
#include "halbtc8822cwifionly.h"
#endif
#ifdef CONFIG_RTL8814B
#include "halbtc8814bwifionly.h"
#endif
#endif /* CONFIG_BT_COEXIST */
#endif /* __MP_PRECOMP_H__ */