1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25#ifndef __RTL8723E_HAL_BTC_H__
26#define __RTL8723E_HAL_BTC_H__
27
28#include "../wifi.h"
29#include "btc.h"
30#include "hal_bt_coexist.h"
31
32#define BT_TXRX_CNT_THRES_1 1200
33#define BT_TXRX_CNT_THRES_2 1400
34#define BT_TXRX_CNT_THRES_3 3000
35
36#define BT_TXRX_CNT_LEVEL_0 0
37
38#define BT_TXRX_CNT_LEVEL_1 1
39
40#define BT_TXRX_CNT_LEVEL_2 2
41#define BT_TXRX_CNT_LEVEL_3 3
42
43#define BT_COEX_DISABLE 0
44#define BT_Q_PKT_OFF 0
45#define BT_Q_PKT_ON 1
46
47#define BT_TX_PWR_OFF 0
48#define BT_TX_PWR_ON 1
49
50
51#define TDMA_2ANT 0
52#define TDMA_1ANT 1
53#define TDMA_NAV_OFF 0
54#define TDMA_NAV_ON 1
55#define TDMA_DAC_SWING_OFF 0
56#define TDMA_DAC_SWING_ON 1
57
58
59#define BT_PTA_MODE_OFF 0
60#define BT_PTA_MODE_ON 1
61
62
63#define BT_TX_RATE_ADAPTIVE_NORMAL 0
64#define BT_TX_RATE_ADAPTIVE_LOW_PENALTY 1
65
66
67#define BT_RF_RX_LPF_CORNER_RESUME 0
68#define BT_RF_RX_LPF_CORNER_SHRINK 1
69
70#define C2H_EVT_HOST_CLOSE 0x00
71#define C2H_EVT_FW_CLOSE 0xFF
72
73enum bt_traffic_mode {
74 BT_MOTOR_EXT_BE = 0x00,
75 BT_MOTOR_EXT_GUL = 0x01,
76 BT_MOTOR_EXT_GUB = 0x02,
77 BT_MOTOR_EXT_GULB = 0x03
78};
79
80enum bt_traffic_mode_profile {
81 BT_PROFILE_NONE,
82 BT_PROFILE_A2DP,
83 BT_PROFILE_PAN,
84 BT_PROFILE_HID,
85 BT_PROFILE_SCO
86};
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104enum bt_spec {
105 BT_SPEC_1_0_b = 0x00,
106 BT_SPEC_1_1 = 0x01,
107 BT_SPEC_1_2 = 0x02,
108 BT_SPEC_2_0_EDR = 0x03,
109 BT_SPEC_2_1_EDR = 0x04,
110 BT_SPEC_3_0_HS = 0x05,
111 BT_SPEC_4_0 = 0x06
112};
113
114struct c2h_evt_hdr {
115 u8 cmd_id;
116 u8 cmd_len;
117 u8 cmd_seq;
118};
119
120enum bt_state {
121 BT_INFO_STATE_DISABLED = 0,
122 BT_INFO_STATE_NO_CONNECTION = 1,
123 BT_INFO_STATE_CONNECT_IDLE = 2,
124 BT_INFO_STATE_INQ_OR_PAG = 3,
125 BT_INFO_STATE_ACL_ONLY_BUSY = 4,
126 BT_INFO_STATE_SCO_ONLY_BUSY = 5,
127 BT_INFO_STATE_ACL_SCO_BUSY = 6,
128 BT_INFO_STATE_HID_BUSY = 7,
129 BT_INFO_STATE_HID_SCO_BUSY = 8,
130 BT_INFO_STATE_MAX = 7
131};
132
133enum rtl8723e_c2h_evt {
134 C2H_DBG = 0,
135 C2H_TSF = 1,
136 C2H_AP_RPT_RSP = 2,
137
138 C2H_CCX_TX_RPT = 3,
139 C2H_BT_RSSI = 4,
140 C2H_BT_OP_MODE = 5,
141 C2H_HW_INFO_EXCH = 10,
142 C2H_C2H_H2C_TEST = 11,
143 BT_INFO = 12,
144 MAX_C2HEVENT
145};
146
147void rtl8723e_dm_bt_fw_coex_all_off_8723a(struct ieee80211_hw *hw);
148void rtl8723e_dm_bt_sw_coex_all_off_8723a(struct ieee80211_hw *hw);
149void rtl8723e_dm_bt_hw_coex_all_off_8723a(struct ieee80211_hw *hw);
150void rtl8723e_dm_bt_coexist_8723(struct ieee80211_hw *hw);
151void rtl8723e_dm_bt_set_bt_dm(struct ieee80211_hw *hw,
152 struct btdm_8723 *p_btdm);
153void rtl_8723e_c2h_command_handle(struct ieee80211_hw *hw);
154void rtl_8723e_bt_wifi_media_status_notify(struct ieee80211_hw *hw,
155 bool mstatus);
156void rtl8723e_dm_bt_turn_off_bt_coexist_before_enter_lps(
157 struct ieee80211_hw *hw);
158
159#endif
160