1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2009-2012 Realtek Corporation.*/
4 #ifndef __RTL8723E_HAL_BTC_H__
5 #define __RTL8723E_HAL_BTC_H__
9 #include "hal_bt_coexist.h"
11 #define BT_TXRX_CNT_THRES_1 1200
12 #define BT_TXRX_CNT_THRES_2 1400
13 #define BT_TXRX_CNT_THRES_3 3000
15 #define BT_TXRX_CNT_LEVEL_0 0
16 /* >= 1200 && < 1400 */
17 #define BT_TXRX_CNT_LEVEL_1 1
19 #define BT_TXRX_CNT_LEVEL_2 2
20 #define BT_TXRX_CNT_LEVEL_3 3
22 #define BT_COEX_DISABLE 0
23 #define BT_Q_PKT_OFF 0
26 #define BT_TX_PWR_OFF 0
27 #define BT_TX_PWR_ON 1
29 /* TDMA mode definition */
32 #define TDMA_NAV_OFF 0
34 #define TDMA_DAC_SWING_OFF 0
35 #define TDMA_DAC_SWING_ON 1
37 /* PTA mode related definition */
38 #define BT_PTA_MODE_OFF 0
39 #define BT_PTA_MODE_ON 1
41 /* Penalty Tx Rate Adaptive */
42 #define BT_TX_RATE_ADAPTIVE_NORMAL 0
43 #define BT_TX_RATE_ADAPTIVE_LOW_PENALTY 1
46 #define BT_RF_RX_LPF_CORNER_RESUME 0
47 #define BT_RF_RX_LPF_CORNER_SHRINK 1
49 #define C2H_EVT_HOST_CLOSE 0x00
50 #define C2H_EVT_FW_CLOSE 0xFF
52 enum bt_traffic_mode
{
53 BT_MOTOR_EXT_BE
= 0x00,
54 BT_MOTOR_EXT_GUL
= 0x01,
55 BT_MOTOR_EXT_GUB
= 0x02,
56 BT_MOTOR_EXT_GULB
= 0x03
59 enum bt_traffic_mode_profile
{
68 enum hci_ext_bt_operation {
70 HCI_BT_OP_INQUIRE_START = 0x1,
71 HCI_BT_OP_INQUIRE_FINISH = 0x2,
72 HCI_BT_OP_PAGING_START = 0x3,
73 HCI_BT_OP_PAGING_SUCCESS = 0x4,
74 HCI_BT_OP_PAGING_UNSUCCESS = 0x5,
75 HCI_BT_OP_PAIRING_START = 0x6,
76 HCI_BT_OP_PAIRING_FINISH = 0x7,
77 HCI_BT_OP_BT_DEV_ENABLE = 0x8,
78 HCI_BT_OP_BT_DEV_DISABLE = 0x9,
87 BT_SPEC_2_0_EDR
= 0x03,
88 BT_SPEC_2_1_EDR
= 0x04,
89 BT_SPEC_3_0_HS
= 0x05,
100 BT_INFO_STATE_DISABLED
= 0,
101 BT_INFO_STATE_NO_CONNECTION
= 1,
102 BT_INFO_STATE_CONNECT_IDLE
= 2,
103 BT_INFO_STATE_INQ_OR_PAG
= 3,
104 BT_INFO_STATE_ACL_ONLY_BUSY
= 4,
105 BT_INFO_STATE_SCO_ONLY_BUSY
= 5,
106 BT_INFO_STATE_ACL_SCO_BUSY
= 6,
107 BT_INFO_STATE_HID_BUSY
= 7,
108 BT_INFO_STATE_HID_SCO_BUSY
= 8,
109 BT_INFO_STATE_MAX
= 7
112 enum rtl8723e_c2h_evt_v0
{
115 C2H_V0_AP_RPT_RSP
= 2,
116 /* The FW notify the report of the specific tx packet. */
117 C2H_V0_CCX_TX_RPT
= 3,
119 C2H_V0_BT_OP_MODE
= 5,
120 C2H_V0_HW_INFO_EXCH
= 10,
121 C2H_V0_C2H_H2C_TEST
= 11,
126 void rtl8723e_dm_bt_fw_coex_all_off_8723a(struct ieee80211_hw
*hw
);
127 void rtl8723e_dm_bt_sw_coex_all_off_8723a(struct ieee80211_hw
*hw
);
128 void rtl8723e_dm_bt_hw_coex_all_off_8723a(struct ieee80211_hw
*hw
);
129 void rtl8723e_dm_bt_coexist_8723(struct ieee80211_hw
*hw
);
130 void rtl8723e_dm_bt_set_bt_dm(struct ieee80211_hw
*hw
,
131 struct btdm_8723
*p_btdm
);
132 void rtl_8723e_c2h_command_handle(struct ieee80211_hw
*hw
);
133 void rtl_8723e_bt_wifi_media_status_notify(struct ieee80211_hw
*hw
,
135 void rtl8723e_dm_bt_turn_off_bt_coexist_before_enter_lps(
136 struct ieee80211_hw
*hw
);