#include "main.h"
#include "coex.h"
#include "fw.h"
#include "ps.h"
#include "debug.h"
#include "reg.h"
#include "phy.h"
static u8 rtw_coex_next_rssi_state(struct rtw_dev *rtwdev, u8 pre_state,
u8 rssi, u8 rssi_thresh)
{ … }
static void rtw_coex_limited_tx(struct rtw_dev *rtwdev,
bool tx_limit_en, bool ampdu_limit_en)
{ … }
static void rtw_coex_limited_wl(struct rtw_dev *rtwdev)
{ … }
static bool rtw_coex_freerun_check(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_wl_slot_extend(struct rtw_dev *rtwdev, bool enable)
{ … }
static void rtw_coex_wl_ccklock_action(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_wl_ccklock_detect(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_wl_noisy_detect(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_tdma_timer_base(struct rtw_dev *rtwdev, u8 type)
{ … }
static void rtw_coex_set_wl_pri_mask(struct rtw_dev *rtwdev, u8 bitmap,
u8 data)
{ … }
void rtw_coex_write_scbd(struct rtw_dev *rtwdev, u16 bitpos, bool set)
{ … }
EXPORT_SYMBOL(…);
static u16 rtw_coex_read_scbd(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_check_rfk(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_query_bt_info(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_gnt_workaround(struct rtw_dev *rtwdev, bool force, u8 mode)
{ … }
static void rtw_coex_monitor_bt_ctr(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_monitor_bt_enable(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_update_wl_link_info(struct rtw_dev *rtwdev, u8 reason)
{ … }
static inline u8 *get_payload_from_coex_resp(struct sk_buff *resp)
{ … }
void rtw_coex_info_response(struct rtw_dev *rtwdev, struct sk_buff *skb)
{ … }
static struct sk_buff *rtw_coex_info_request(struct rtw_dev *rtwdev,
struct rtw_coex_info_req *req)
{ … }
static bool rtw_coex_get_bt_scan_type(struct rtw_dev *rtwdev, u8 *scan_type)
{ … }
static bool rtw_coex_set_lna_constrain_level(struct rtw_dev *rtwdev,
u8 lna_constrain_level)
{ … }
#define case_BTSTATUS(src) …
static const char *rtw_coex_get_bt_status_string(u8 bt_status)
{ … }
static void rtw_coex_update_bt_link_info(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_update_wl_ch_info(struct rtw_dev *rtwdev, u8 type)
{ … }
static void rtw_coex_set_bt_tx_power(struct rtw_dev *rtwdev, u8 bt_pwr_dec_lvl)
{ … }
static void rtw_coex_set_bt_rx_gain(struct rtw_dev *rtwdev, u8 bt_lna_lvl)
{ … }
static void rtw_coex_set_rf_para(struct rtw_dev *rtwdev,
struct coex_rf_para para)
{ … }
u32 rtw_coex_read_indirect_reg(struct rtw_dev *rtwdev, u16 addr)
{ … }
EXPORT_SYMBOL(…);
void rtw_coex_write_indirect_reg(struct rtw_dev *rtwdev, u16 addr,
u32 mask, u32 val)
{ … }
EXPORT_SYMBOL(…);
static void rtw_coex_coex_ctrl_owner(struct rtw_dev *rtwdev, bool wifi_control)
{ … }
static void rtw_coex_set_gnt_bt(struct rtw_dev *rtwdev, u8 state)
{ … }
static void rtw_coex_set_gnt_wl(struct rtw_dev *rtwdev, u8 state)
{ … }
static void rtw_coex_mimo_ps(struct rtw_dev *rtwdev, bool force, bool state)
{ … }
static void rtw_btc_wltoggle_table_a(struct rtw_dev *rtwdev, bool force,
u8 table_case)
{ … }
#define COEX_WL_SLOT_TOGLLE …
static void rtw_btc_wltoggle_table_b(struct rtw_dev *rtwdev, bool force,
u8 interval, u32 table)
{ … }
static void rtw_coex_set_table(struct rtw_dev *rtwdev, bool force, u32 table0,
u32 table1)
{ … }
static void rtw_coex_table(struct rtw_dev *rtwdev, bool force, u8 type)
{ … }
static void rtw_coex_ignore_wlan_act(struct rtw_dev *rtwdev, bool enable)
{ … }
static void rtw_coex_power_save_state(struct rtw_dev *rtwdev, u8 ps_type,
u8 lps_val, u8 rpwm_val)
{ … }
static void rtw_coex_set_tdma(struct rtw_dev *rtwdev, u8 byte1, u8 byte2,
u8 byte3, u8 byte4, u8 byte5)
{ … }
static void rtw_coex_tdma(struct rtw_dev *rtwdev, bool force, u32 tcase)
{ … }
static void rtw_coex_set_ant_path(struct rtw_dev *rtwdev, bool force, u8 phase)
{ … }
#define case_ALGO(src) …
static const char *rtw_coex_get_algo_string(u8 algo)
{ … }
#define case_BT_PROFILE(src) …
static const char *rtw_coex_get_bt_profile_string(u8 bt_profile)
{ … }
static u8 rtw_coex_algorithm(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_coex_all_off(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_freerun(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_rf4ce(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_bt_whql_test(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_bt_relink(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_bt_idle(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_bt_inquiry(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_bt_game_hid(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_bt_hfp(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_bt_hid(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_bt_a2dp(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_bt_a2dpsink(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_bt_pan(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_bt_a2dp_hid(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_bt_a2dp_pan(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_bt_pan_hid(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_bt_a2dp_pan_hid(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_wl_under5g(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_wl_only(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_wl_native_lps(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_wl_linkscan(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_wl_not_connected(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_action_wl_connected(struct rtw_dev *rtwdev)
{ … }
static void rtw_coex_run_coex(struct rtw_dev *rtwdev, u8 reason)
{ … }
static void rtw_coex_init_coex_var(struct rtw_dev *rtwdev)
{ … }
static void __rtw_coex_init_hw_config(struct rtw_dev *rtwdev, bool wifi_only)
{ … }
void rtw_coex_power_on_setting(struct rtw_dev *rtwdev)
{ … }
void rtw_coex_power_off_setting(struct rtw_dev *rtwdev)
{ … }
void rtw_coex_init_hw_config(struct rtw_dev *rtwdev, bool wifi_only)
{ … }
void rtw_coex_ips_notify(struct rtw_dev *rtwdev, u8 type)
{ … }
void rtw_coex_lps_notify(struct rtw_dev *rtwdev, u8 type)
{ … }
void rtw_coex_scan_notify(struct rtw_dev *rtwdev, u8 type)
{ … }
void rtw_coex_switchband_notify(struct rtw_dev *rtwdev, u8 type)
{ … }
void rtw_coex_connect_notify(struct rtw_dev *rtwdev, u8 type)
{ … }
void rtw_coex_media_status_notify(struct rtw_dev *rtwdev, u8 type)
{ … }
void rtw_coex_bt_info_notify(struct rtw_dev *rtwdev, u8 *buf, u8 length)
{ … }
#define COEX_BT_HIDINFO_MTK …
static const u8 coex_bt_hidinfo_ps[] = …;
static const u8 coex_bt_hidinfo_xb[] = …;
void rtw_coex_bt_hid_info_notify(struct rtw_dev *rtwdev, u8 *buf, u8 length)
{ … }
void rtw_coex_query_bt_hid_list(struct rtw_dev *rtwdev)
{ … }
void rtw_coex_wl_fwdbginfo_notify(struct rtw_dev *rtwdev, u8 *buf, u8 length)
{ … }
void rtw_coex_wl_status_change_notify(struct rtw_dev *rtwdev, u32 type)
{ … }
void rtw_coex_wl_status_check(struct rtw_dev *rtwdev)
{ … }
void rtw_coex_bt_relink_work(struct work_struct *work)
{ … }
void rtw_coex_bt_reenable_work(struct work_struct *work)
{ … }
void rtw_coex_defreeze_work(struct work_struct *work)
{ … }
void rtw_coex_wl_remain_work(struct work_struct *work)
{ … }
void rtw_coex_bt_remain_work(struct work_struct *work)
{ … }
void rtw_coex_wl_connecting_work(struct work_struct *work)
{ … }
void rtw_coex_bt_multi_link_remain_work(struct work_struct *work)
{ … }
void rtw_coex_wl_ccklock_work(struct work_struct *work)
{ … }
#ifdef CONFIG_RTW88_DEBUGFS
#define INFO_SIZE …
#define case_BTINFO(src) …
static const char *rtw_coex_get_bt_info_src_string(u8 bt_info_src)
{ … }
#define case_RSN(src) …
static const char *rtw_coex_get_reason_string(u8 reason)
{ … }
static u8 rtw_coex_get_table_index(struct rtw_dev *rtwdev, u32 wl_reg_6c0,
u32 wl_reg_6c4)
{ … }
static u8 rtw_coex_get_tdma_index(struct rtw_dev *rtwdev, u8 *tdma_para)
{ … }
static int rtw_coex_addr_info(struct rtw_dev *rtwdev,
const struct rtw_reg_domain *reg,
char addr_info[], int n)
{ … }
static int rtw_coex_val_info(struct rtw_dev *rtwdev,
const struct rtw_reg_domain *reg,
char val_info[], int n)
{ … }
static void rtw_coex_set_coexinfo_hw(struct rtw_dev *rtwdev, struct seq_file *m)
{ … }
static bool rtw_coex_get_bt_reg(struct rtw_dev *rtwdev,
u8 type, u16 addr, u16 *val)
{ … }
static bool rtw_coex_get_bt_patch_version(struct rtw_dev *rtwdev,
u32 *patch_version)
{ … }
static bool rtw_coex_get_bt_supported_version(struct rtw_dev *rtwdev,
u32 *supported_version)
{ … }
static bool rtw_coex_get_bt_supported_feature(struct rtw_dev *rtwdev,
u32 *supported_feature)
{ … }
struct rtw_coex_sta_stat_iter_data { … };
static void rtw_coex_sta_stat_iter(void *data, struct ieee80211_sta *sta)
{ … }
struct rtw_coex_vif_stat_iter_data { … };
static void rtw_coex_vif_stat_iter(void *data, u8 *mac,
struct ieee80211_vif *vif)
{ … }
#define case_WLINK(src) …
static const char *rtw_coex_get_wl_coex_mode(u8 coex_wl_link_mode)
{ … }
void rtw_coex_display_coex_info(struct rtw_dev *rtwdev, struct seq_file *m)
{ … }
#endif