1
2
3
4
5
6
7
8#define BT_INFO_8821A_2ANT_B_FTP BIT7
9#define BT_INFO_8821A_2ANT_B_A2DP BIT6
10#define BT_INFO_8821A_2ANT_B_HID BIT5
11#define BT_INFO_8821A_2ANT_B_SCO_BUSY BIT4
12#define BT_INFO_8821A_2ANT_B_ACL_BUSY BIT3
13#define BT_INFO_8821A_2ANT_B_INQ_PAGE BIT2
14#define BT_INFO_8821A_2ANT_B_SCO_ESCO BIT1
15#define BT_INFO_8821A_2ANT_B_CONNECTION BIT0
16
17#define BTC_RSSI_COEX_THRESH_TOL_8821A_2ANT 2
18
19
20#define BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES 42
21
22#define BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES 46
23
24enum _BT_INFO_SRC_8821A_2ANT {
25 BT_INFO_SRC_8821A_2ANT_WIFI_FW = 0x0,
26 BT_INFO_SRC_8821A_2ANT_BT_RSP = 0x1,
27 BT_INFO_SRC_8821A_2ANT_BT_ACTIVE_SEND = 0x2,
28 BT_INFO_SRC_8821A_2ANT_MAX
29};
30
31enum _BT_8821A_2ANT_BT_STATUS {
32 BT_8821A_2ANT_BT_STATUS_IDLE = 0x0,
33 BT_8821A_2ANT_BT_STATUS_CON_IDLE = 0x1,
34 BT_8821A_2ANT_BT_STATUS_NON_IDLE = 0x2,
35 BT_8821A_2ANT_BT_STATUS_ACL_BUSY = 0x3,
36 BT_8821A_2ANT_BT_STATUS_SCO_BUSY = 0x4,
37 BT_8821A_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
38 BT_8821A_2ANT_BT_STATUS_MAX
39};
40
41enum _BT_8821A_2ANT_COEX_ALGO {
42 BT_8821A_2ANT_COEX_ALGO_UNDEFINED = 0x0,
43 BT_8821A_2ANT_COEX_ALGO_SCO = 0x1,
44 BT_8821A_2ANT_COEX_ALGO_HID = 0x2,
45 BT_8821A_2ANT_COEX_ALGO_A2DP = 0x3,
46 BT_8821A_2ANT_COEX_ALGO_A2DP_PANHS = 0x4,
47 BT_8821A_2ANT_COEX_ALGO_PANEDR = 0x5,
48 BT_8821A_2ANT_COEX_ALGO_PANHS = 0x6,
49 BT_8821A_2ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
50 BT_8821A_2ANT_COEX_ALGO_PANEDR_HID = 0x8,
51 BT_8821A_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
52 BT_8821A_2ANT_COEX_ALGO_HID_A2DP = 0xa,
53 BT_8821A_2ANT_COEX_ALGO_MAX = 0xb,
54};
55
56struct coex_dm_8821a_2ant {
57
58 bool pre_dec_bt_pwr_lvl;
59 bool cur_dec_bt_pwr_lvl;
60 u8 pre_fw_dac_swing_lvl;
61 u8 cur_fw_dac_swing_lvl;
62 bool cur_ignore_wlan_act;
63 bool pre_ignore_wlan_act;
64 u8 pre_ps_tdma;
65 u8 cur_ps_tdma;
66 u8 ps_tdma_para[5];
67 u8 ps_tdma_du_adj_type;
68 bool reset_tdma_adjust;
69 bool auto_tdma_adjust;
70 bool pre_ps_tdma_on;
71 bool cur_ps_tdma_on;
72 bool pre_bt_auto_report;
73 bool cur_bt_auto_report;
74
75
76 bool pre_rf_rx_lpf_shrink;
77 bool cur_rf_rx_lpf_shrink;
78 u32 bt_rf0x1e_backup;
79 bool pre_low_penalty_ra;
80 bool cur_low_penalty_ra;
81 bool pre_dac_swing_on;
82 u32 pre_dac_swing_lvl;
83 bool cur_dac_swing_on;
84 u32 cur_dac_swing_lvl;
85 bool pre_adc_back_off;
86 bool cur_adc_back_off;
87 bool pre_agc_table_en;
88 bool cur_agc_table_en;
89 u32 pre_val0x6c0;
90 u32 cur_val0x6c0;
91 u32 pre_val0x6c4;
92 u32 cur_val0x6c4;
93 u32 pre_val0x6c8;
94 u32 cur_val0x6c8;
95 u8 pre_val0x6cc;
96 u8 cur_val0x6cc;
97 bool limited_dig;
98
99
100 u8 pre_algorithm;
101 u8 cur_algorithm;
102 u8 bt_status;
103 u8 wifi_chnl_info[3];
104 u8 pre_lps;
105 u8 cur_lps;
106 u8 pre_rpwm;
107 u8 cur_rpwm;
108};
109
110struct coex_sta_8821a_2ant {
111 bool bt_link_exist;
112 bool sco_exist;
113 bool a2dp_exist;
114 bool hid_exist;
115 bool pan_exist;
116 bool under_lps;
117 bool under_ips;
118 u32 high_priority_tx;
119 u32 high_priority_rx;
120 u32 low_priority_tx;
121 u32 low_priority_rx;
122 u8 bt_rssi;
123 bool bt_tx_rx_mask;
124 u8 pre_bt_rssi_state;
125 u8 pre_wifi_rssi_state[4];
126 bool c2h_bt_info_req_sent;
127 u8 bt_info_c2h[BT_INFO_SRC_8821A_2ANT_MAX][10];
128 u32 bt_info_c2h_cnt[BT_INFO_SRC_8821A_2ANT_MAX];
129 bool c2h_bt_inquiry_page;
130 u8 bt_retry_cnt;
131 u8 bt_info_ext;
132
133 u32 crc_ok_cck;
134 u32 crc_ok_11g;
135 u32 crc_ok_11n;
136 u32 crc_ok_11n_agg;
137
138 u32 crc_err_cck;
139 u32 crc_err_11g;
140 u32 crc_err_11n;
141 u32 crc_err_11n_agg;
142
143 u8 coex_table_type;
144 bool force_lps_on;
145
146 u8 dis_ver_info_cnt;
147};
148
149
150
151
152
153void
154ex_btc8821a2ant_init_hwconfig(
155 struct btc_coexist *btcoexist
156 );
157void
158ex_btc8821a2ant_init_coex_dm(
159 struct btc_coexist *btcoexist
160 );
161void
162ex_btc8821a2ant_ips_notify(
163 struct btc_coexist *btcoexist,
164 u8 type
165 );
166void
167ex_btc8821a2ant_lps_notify(
168 struct btc_coexist *btcoexist,
169 u8 type
170 );
171void
172ex_btc8821a2ant_scan_notify(
173 struct btc_coexist *btcoexist,
174 u8 type
175 );
176void
177ex_btc8821a2ant_connect_notify(
178 struct btc_coexist *btcoexist,
179 u8 type
180 );
181void
182ex_btc8821a2ant_media_status_notify(
183 struct btc_coexist *btcoexist,
184 u8 type
185 );
186void
187ex_btc8821a2ant_special_packet_notify(
188 struct btc_coexist *btcoexist,
189 u8 type
190 );
191void
192ex_btc8821a2ant_bt_info_notify(
193 struct btc_coexist *btcoexist,
194 u8 *tmp_buf,
195 u8 length
196 );
197void
198ex_btc8821a2ant_halt_notify(
199 struct btc_coexist *btcoexist
200 );
201void
202ex_btc8821a2ant_periodical(
203 struct btc_coexist *btcoexist
204 );
205void
206ex_btc8821a2ant_display_coex_info(
207 struct btc_coexist *btcoexist,
208 struct seq_file *m
209 );
210void ex_btc8821a2ant_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state);
211void ex_btc8821a2ant_pre_load_firmware(struct btc_coexist *btcoexist);
212