Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* Copyright(c) 2009-2012  Realtek Corporation.*/
0003 
0004 #ifndef __RTL8723E_HAL_BT_COEXIST_H__
0005 #define __RTL8723E_HAL_BT_COEXIST_H__
0006 
0007 #include "../wifi.h"
0008 
0009 /* The reg define is for 8723 */
0010 #define REG_HIGH_PRIORITY_TXRX          0x770
0011 #define REG_LOW_PRIORITY_TXRX           0x774
0012 
0013 #define BT_FW_COEX_THRESH_TOL           6
0014 #define BT_FW_COEX_THRESH_20            20
0015 #define BT_FW_COEX_THRESH_23            23
0016 #define BT_FW_COEX_THRESH_25            25
0017 #define BT_FW_COEX_THRESH_30            30
0018 #define BT_FW_COEX_THRESH_35            35
0019 #define BT_FW_COEX_THRESH_40            40
0020 #define BT_FW_COEX_THRESH_45            45
0021 #define BT_FW_COEX_THRESH_47            47
0022 #define BT_FW_COEX_THRESH_50            50
0023 #define BT_FW_COEX_THRESH_55            55
0024 
0025 #define BT_COEX_STATE_BT30          BIT(0)
0026 #define BT_COEX_STATE_WIFI_HT20         BIT(1)
0027 #define BT_COEX_STATE_WIFI_HT40         BIT(2)
0028 #define BT_COEX_STATE_WIFI_LEGACY       BIT(3)
0029 
0030 #define BT_COEX_STATE_WIFI_RSSI_LOW     BIT(4)
0031 #define BT_COEX_STATE_WIFI_RSSI_MEDIUM  BIT(5)
0032 #define BT_COEX_STATE_WIFI_RSSI_HIGH    BIT(6)
0033 #define BT_COEX_STATE_DEC_BT_POWER      BIT(7)
0034 
0035 #define BT_COEX_STATE_WIFI_IDLE         BIT(8)
0036 #define BT_COEX_STATE_WIFI_UPLINK       BIT(9)
0037 #define BT_COEX_STATE_WIFI_DOWNLINK     BIT(10)
0038 
0039 #define BT_COEX_STATE_BT_INQ_PAGE       BIT(11)
0040 #define BT_COEX_STATE_BT_IDLE           BIT(12)
0041 #define BT_COEX_STATE_BT_UPLINK         BIT(13)
0042 #define BT_COEX_STATE_BT_DOWNLINK       BIT(14)
0043 
0044 #define BT_COEX_STATE_HOLD_FOR_BT_OPERATION BIT(15)
0045 #define BT_COEX_STATE_BT_RSSI_LOW       BIT(19)
0046 
0047 #define BT_COEX_STATE_PROFILE_HID       BIT(20)
0048 #define BT_COEX_STATE_PROFILE_A2DP      BIT(21)
0049 #define BT_COEX_STATE_PROFILE_PAN       BIT(22)
0050 #define BT_COEX_STATE_PROFILE_SCO       BIT(23)
0051 
0052 #define BT_COEX_STATE_WIFI_RSSI_1_LOW       BIT(24)
0053 #define BT_COEX_STATE_WIFI_RSSI_1_MEDIUM    BIT(25)
0054 #define BT_COEX_STATE_WIFI_RSSI_1_HIGH      BIT(26)
0055 
0056 #define BT_COEX_STATE_BTINFO_COMMON         BIT(30)
0057 #define BT_COEX_STATE_BTINFO_B_HID_SCOESCO  BIT(31)
0058 #define BT_COEX_STATE_BTINFO_B_FTP_A2DP     BIT(29)
0059 
0060 #define BT_COEX_STATE_BT_CNT_LEVEL_0        BIT(0)
0061 #define BT_COEX_STATE_BT_CNT_LEVEL_1        BIT(1)
0062 #define BT_COEX_STATE_BT_CNT_LEVEL_2        BIT(2)
0063 #define BT_COEX_STATE_BT_CNT_LEVEL_3        BIT(3)
0064 
0065 #define BT_RSSI_STATE_HIGH          0
0066 #define BT_RSSI_STATE_MEDIUM            1
0067 #define BT_RSSI_STATE_LOW           2
0068 #define BT_RSSI_STATE_STAY_HIGH         3
0069 #define BT_RSSI_STATE_STAY_MEDIUM       4
0070 #define BT_RSSI_STATE_STAY_LOW          5
0071 
0072 #define BT_AGCTABLE_OFF             0
0073 #define BT_AGCTABLE_ON              1
0074 #define BT_BB_BACKOFF_OFF           0
0075 #define BT_BB_BACKOFF_ON            1
0076 #define BT_FW_NAV_OFF               0
0077 #define BT_FW_NAV_ON                1
0078 
0079 #define BT_COEX_MECH_NONE           0
0080 #define BT_COEX_MECH_SCO            1
0081 #define BT_COEX_MECH_HID            2
0082 #define BT_COEX_MECH_A2DP           3
0083 #define BT_COEX_MECH_PAN            4
0084 #define BT_COEX_MECH_HID_A2DP           5
0085 #define BT_COEX_MECH_HID_PAN            6
0086 #define BT_COEX_MECH_PAN_A2DP           7
0087 #define BT_COEX_MECH_HID_SCO_ESCO       8
0088 #define BT_COEX_MECH_FTP_A2DP           9
0089 #define BT_COEX_MECH_COMMON         10
0090 #define BT_COEX_MECH_MAX            11
0091 
0092 #define BT_DBG_PROFILE_NONE         0
0093 #define BT_DBG_PROFILE_SCO          1
0094 #define BT_DBG_PROFILE_HID          2
0095 #define BT_DBG_PROFILE_A2DP         3
0096 #define BT_DBG_PROFILE_PAN          4
0097 #define BT_DBG_PROFILE_HID_A2DP         5
0098 #define BT_DBG_PROFILE_HID_PAN          6
0099 #define BT_DBG_PROFILE_PAN_A2DP         7
0100 #define BT_DBG_PROFILE_MAX          9
0101 
0102 #define BTINFO_B_FTP                BIT(7)
0103 #define BTINFO_B_A2DP               BIT(6)
0104 #define BTINFO_B_HID                BIT(5)
0105 #define BTINFO_B_SCO_BUSY           BIT(4)
0106 #define BTINFO_B_ACL_BUSY           BIT(3)
0107 #define BTINFO_B_INQ_PAGE           BIT(2)
0108 #define BTINFO_B_SCO_ESCO           BIT(1)
0109 #define BTINFO_B_CONNECTION         BIT(0)
0110 
0111 void rtl8723e_btdm_coex_all_off(struct ieee80211_hw *hw);
0112 void rtl8723e_dm_bt_fw_coex_all_off(struct ieee80211_hw *hw);
0113 
0114 void rtl8723e_dm_bt_sw_coex_all_off(struct ieee80211_hw *hw);
0115 void rtl8723e_dm_bt_hw_coex_all_off(struct ieee80211_hw *hw);
0116 long rtl8723e_dm_bt_get_rx_ss(struct ieee80211_hw *hw);
0117 void rtl8723e_dm_bt_balance(struct ieee80211_hw *hw,
0118                 bool balance_on, u8 ms0, u8 ms1);
0119 void rtl8723e_dm_bt_agc_table(struct ieee80211_hw *hw, u8 tyep);
0120 void rtl8723e_dm_bt_bb_back_off_level(struct ieee80211_hw *hw, u8 type);
0121 u8 rtl8723e_dm_bt_check_coex_rssi_state(struct ieee80211_hw *hw,
0122                     u8 level_num, u8 rssi_thresh,
0123                     u8 rssi_thresh1);
0124 u8 rtl8723e_dm_bt_check_coex_rssi_state1(struct ieee80211_hw *hw,
0125                      u8 level_num, u8 rssi_thresh,
0126                      u8 rssi_thresh1);
0127 void _rtl8723_dm_bt_check_wifi_state(struct ieee80211_hw *hw);
0128 void rtl8723e_dm_bt_reject_ap_aggregated_packet(struct ieee80211_hw *hw,
0129                         bool b_reject);
0130 bool rtl8723e_dm_bt_is_coexist_state_changed(struct ieee80211_hw *hw);
0131 bool rtl8723e_dm_bt_is_wifi_up_link(struct ieee80211_hw *hw);
0132 
0133 #endif