134 lines · c
1/* SPDX-License-Identifier: GPL-2.0 */2/* Copyright(c) 2009-2012 Realtek Corporation.*/3 4#ifndef __RTL8723E_HAL_BT_COEXIST_H__5#define __RTL8723E_HAL_BT_COEXIST_H__6 7#include "../wifi.h"8 9/* The reg define is for 8723 */10#define REG_HIGH_PRIORITY_TXRX 0x77011#define REG_LOW_PRIORITY_TXRX 0x77412 13#define BT_FW_COEX_THRESH_TOL 614#define BT_FW_COEX_THRESH_20 2015#define BT_FW_COEX_THRESH_23 2316#define BT_FW_COEX_THRESH_25 2517#define BT_FW_COEX_THRESH_30 3018#define BT_FW_COEX_THRESH_35 3519#define BT_FW_COEX_THRESH_40 4020#define BT_FW_COEX_THRESH_45 4521#define BT_FW_COEX_THRESH_47 4722#define BT_FW_COEX_THRESH_50 5023#define BT_FW_COEX_THRESH_55 5524 25#define BT_COEX_STATE_BT30 BIT(0)26#define BT_COEX_STATE_WIFI_HT20 BIT(1)27#define BT_COEX_STATE_WIFI_HT40 BIT(2)28#define BT_COEX_STATE_WIFI_LEGACY BIT(3)29 30#define BT_COEX_STATE_WIFI_RSSI_LOW BIT(4)31#define BT_COEX_STATE_WIFI_RSSI_MEDIUM BIT(5)32#define BT_COEX_STATE_WIFI_RSSI_HIGH BIT(6)33#define BT_COEX_STATE_DEC_BT_POWER BIT(7)34 35#define BT_COEX_STATE_WIFI_IDLE BIT(8)36#define BT_COEX_STATE_WIFI_UPLINK BIT(9)37#define BT_COEX_STATE_WIFI_DOWNLINK BIT(10)38 39#define BT_COEX_STATE_BT_INQ_PAGE BIT(11)40#define BT_COEX_STATE_BT_IDLE BIT(12)41#define BT_COEX_STATE_BT_UPLINK BIT(13)42#define BT_COEX_STATE_BT_DOWNLINK BIT(14)43 44#define BT_COEX_STATE_HOLD_FOR_BT_OPERATION BIT(15)45#define BT_COEX_STATE_BT_RSSI_LOW BIT(19)46 47#define BT_COEX_STATE_PROFILE_HID BIT(20)48#define BT_COEX_STATE_PROFILE_A2DP BIT(21)49#define BT_COEX_STATE_PROFILE_PAN BIT(22)50#define BT_COEX_STATE_PROFILE_SCO BIT(23)51 52#define BT_COEX_STATE_WIFI_RSSI_1_LOW BIT(24)53#define BT_COEX_STATE_WIFI_RSSI_1_MEDIUM BIT(25)54#define BT_COEX_STATE_WIFI_RSSI_1_HIGH BIT(26)55 56#define BT_COEX_STATE_BTINFO_COMMON BIT(30)57#define BT_COEX_STATE_BTINFO_B_HID_SCOESCO BIT(31)58#define BT_COEX_STATE_BTINFO_B_FTP_A2DP BIT(29)59 60#define BT_COEX_STATE_BT_CNT_LEVEL_0 BIT(0)61#define BT_COEX_STATE_BT_CNT_LEVEL_1 BIT(1)62#define BT_COEX_STATE_BT_CNT_LEVEL_2 BIT(2)63#define BT_COEX_STATE_BT_CNT_LEVEL_3 BIT(3)64 65#define BT_RSSI_STATE_HIGH 066#define BT_RSSI_STATE_MEDIUM 167#define BT_RSSI_STATE_LOW 268#define BT_RSSI_STATE_STAY_HIGH 369#define BT_RSSI_STATE_STAY_MEDIUM 470#define BT_RSSI_STATE_STAY_LOW 571 72#define BT_AGCTABLE_OFF 073#define BT_AGCTABLE_ON 174#define BT_BB_BACKOFF_OFF 075#define BT_BB_BACKOFF_ON 176#define BT_FW_NAV_OFF 077#define BT_FW_NAV_ON 178 79#define BT_COEX_MECH_NONE 080#define BT_COEX_MECH_SCO 181#define BT_COEX_MECH_HID 282#define BT_COEX_MECH_A2DP 383#define BT_COEX_MECH_PAN 484#define BT_COEX_MECH_HID_A2DP 585#define BT_COEX_MECH_HID_PAN 686#define BT_COEX_MECH_PAN_A2DP 787#define BT_COEX_MECH_HID_SCO_ESCO 888#define BT_COEX_MECH_FTP_A2DP 989#define BT_COEX_MECH_COMMON 1090#define BT_COEX_MECH_MAX 1191 92#define BT_DBG_PROFILE_NONE 093#define BT_DBG_PROFILE_SCO 194#define BT_DBG_PROFILE_HID 295#define BT_DBG_PROFILE_A2DP 396#define BT_DBG_PROFILE_PAN 497#define BT_DBG_PROFILE_HID_A2DP 598#define BT_DBG_PROFILE_HID_PAN 699#define BT_DBG_PROFILE_PAN_A2DP 7100#define BT_DBG_PROFILE_MAX 9101 102#define BTINFO_B_FTP BIT(7)103#define BTINFO_B_A2DP BIT(6)104#define BTINFO_B_HID BIT(5)105#define BTINFO_B_SCO_BUSY BIT(4)106#define BTINFO_B_ACL_BUSY BIT(3)107#define BTINFO_B_INQ_PAGE BIT(2)108#define BTINFO_B_SCO_ESCO BIT(1)109#define BTINFO_B_CONNECTION BIT(0)110 111void rtl8723e_btdm_coex_all_off(struct ieee80211_hw *hw);112void rtl8723e_dm_bt_fw_coex_all_off(struct ieee80211_hw *hw);113 114void rtl8723e_dm_bt_sw_coex_all_off(struct ieee80211_hw *hw);115void rtl8723e_dm_bt_hw_coex_all_off(struct ieee80211_hw *hw);116long rtl8723e_dm_bt_get_rx_ss(struct ieee80211_hw *hw);117void rtl8723e_dm_bt_balance(struct ieee80211_hw *hw,118 bool balance_on, u8 ms0, u8 ms1);119void rtl8723e_dm_bt_agc_table(struct ieee80211_hw *hw, u8 type);120void rtl8723e_dm_bt_bb_back_off_level(struct ieee80211_hw *hw, u8 type);121u8 rtl8723e_dm_bt_check_coex_rssi_state(struct ieee80211_hw *hw,122 u8 level_num, u8 rssi_thresh,123 u8 rssi_thresh1);124u8 rtl8723e_dm_bt_check_coex_rssi_state1(struct ieee80211_hw *hw,125 u8 level_num, u8 rssi_thresh,126 u8 rssi_thresh1);127void _rtl8723_dm_bt_check_wifi_state(struct ieee80211_hw *hw);128void rtl8723e_dm_bt_reject_ap_aggregated_packet(struct ieee80211_hw *hw,129 bool b_reject);130bool rtl8723e_dm_bt_is_coexist_state_changed(struct ieee80211_hw *hw);131bool rtl8723e_dm_bt_is_wifi_up_link(struct ieee80211_hw *hw);132 133#endif134