1 /**********************************************************************
2 * The following is for 8723B 1ANT BT Co-exist definition
3 **********************************************************************/
4 #define BT_AUTO_REPORT_ONLY_8723B_1ANT 1
6 #define BT_INFO_8723B_1ANT_B_FTP BIT7
7 #define BT_INFO_8723B_1ANT_B_A2DP BIT6
8 #define BT_INFO_8723B_1ANT_B_HID BIT5
9 #define BT_INFO_8723B_1ANT_B_SCO_BUSY BIT4
10 #define BT_INFO_8723B_1ANT_B_ACL_BUSY BIT3
11 #define BT_INFO_8723B_1ANT_B_INQ_PAGE BIT2
12 #define BT_INFO_8723B_1ANT_B_SCO_ESCO BIT1
13 #define BT_INFO_8723B_1ANT_B_CONNECTION BIT0
15 #define BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
16 (((_BT_INFO_EXT_&BIT0))? true:false)
18 #define BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT 2
20 typedef enum _BT_INFO_SRC_8723B_1ANT
{
21 BT_INFO_SRC_8723B_1ANT_WIFI_FW
= 0x0,
22 BT_INFO_SRC_8723B_1ANT_BT_RSP
= 0x1,
23 BT_INFO_SRC_8723B_1ANT_BT_ACTIVE_SEND
= 0x2,
24 BT_INFO_SRC_8723B_1ANT_MAX
25 } BT_INFO_SRC_8723B_1ANT
, *PBT_INFO_SRC_8723B_1ANT
;
27 typedef enum _BT_8723B_1ANT_BT_STATUS
{
28 BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE
= 0x0,
29 BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE
= 0x1,
30 BT_8723B_1ANT_BT_STATUS_INQ_PAGE
= 0x2,
31 BT_8723B_1ANT_BT_STATUS_ACL_BUSY
= 0x3,
32 BT_8723B_1ANT_BT_STATUS_SCO_BUSY
= 0x4,
33 BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY
= 0x5,
34 BT_8723B_1ANT_BT_STATUS_MAX
35 } BT_8723B_1ANT_BT_STATUS
, *PBT_8723B_1ANT_BT_STATUS
;
37 typedef enum _BT_8723B_1ANT_WIFI_STATUS
{
38 BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE
= 0x0,
39 BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN
= 0x1,
40 BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN
= 0x2,
41 BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT
= 0x3,
42 BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE
= 0x4,
43 BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY
= 0x5,
44 BT_8723B_1ANT_WIFI_STATUS_MAX
45 } BT_8723B_1ANT_WIFI_STATUS
, *PBT_8723B_1ANT_WIFI_STATUS
;
47 typedef enum _BT_8723B_1ANT_COEX_ALGO
{
48 BT_8723B_1ANT_COEX_ALGO_UNDEFINED
= 0x0,
49 BT_8723B_1ANT_COEX_ALGO_SCO
= 0x1,
50 BT_8723B_1ANT_COEX_ALGO_HID
= 0x2,
51 BT_8723B_1ANT_COEX_ALGO_A2DP
= 0x3,
52 BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS
= 0x4,
53 BT_8723B_1ANT_COEX_ALGO_PANEDR
= 0x5,
54 BT_8723B_1ANT_COEX_ALGO_PANHS
= 0x6,
55 BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP
= 0x7,
56 BT_8723B_1ANT_COEX_ALGO_PANEDR_HID
= 0x8,
57 BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR
= 0x9,
58 BT_8723B_1ANT_COEX_ALGO_HID_A2DP
= 0xa,
59 BT_8723B_1ANT_COEX_ALGO_MAX
= 0xb,
60 } BT_8723B_1ANT_COEX_ALGO
, *PBT_8723B_1ANT_COEX_ALGO
;
62 struct coex_dm_8723b_1ant
{
66 u8 pre_fw_dac_swing_lvl
;
67 u8 cur_fw_dac_swing_lvl
;
68 bool cur_ignore_wlan_act
;
69 bool pre_ignore_wlan_act
;
73 u8 ps_tdma_du_adj_type
;
74 bool auto_tdma_adjust
;
77 bool pre_bt_auto_report
;
78 bool cur_bt_auto_report
;
85 bool pre_rf_rx_lpf_shrink
;
86 bool cur_rf_rx_lpf_shrink
;
88 bool pre_low_penalty_ra
;
89 bool cur_low_penalty_ra
;
90 bool pre_dac_swing_on
;
91 u32 pre_dac_swing_lvl
;
92 bool cur_dac_swing_on
;
93 u32 cur_dac_swing_lvl
;
96 bool pre_agc_table_en
;
97 bool cur_agc_table_en
;
108 u32 backup_arfr_cnt1
; /* Auto Rate Fallback Retry cnt */
109 u32 backup_arfr_cnt2
; /* Auto Rate Fallback Retry cnt */
110 u16 backup_retry_limit
;
111 u8 backup_ampdu_max_time
;
113 /* algorithm related */
117 u8 wifi_chnl_info
[3];
123 u8 pre_retry_limit_type
;
124 u8 cur_retry_limit_type
;
125 u8 pre_ampdu_time_type
;
126 u8 cur_ampdu_time_type
;
131 struct coex_sta_8723b_1ant
{
140 u32 special_pkt_period_cnt
;
141 u32 high_priority_tx
;
142 u32 high_priority_rx
;
146 u8 pre_bt_rssi_state
;
147 u8 pre_wifi_rssi_state
[4];
148 bool c2h_bt_info_req_sent
;
149 u8 bt_info_c2h
[BT_INFO_SRC_8723B_1ANT_MAX
][10];
150 u32 bt_info_c2h_cnt
[BT_INFO_SRC_8723B_1ANT_MAX
];
151 bool c2h_bt_inquiry_page
;
156 /*************************************************************************
157 * The following is interface which will notify coex module.
158 *************************************************************************/
159 void ex_halbtc8723b1ant_init_hwconfig(struct btc_coexist
*btcoexist
);
160 void ex_halbtc8723b1ant_init_coex_dm(struct btc_coexist
*btcoexist
);
161 void ex_halbtc8723b1ant_ips_notify(struct btc_coexist
*btcoexist
, u8 type
);
162 void ex_halbtc8723b1ant_lps_notify(struct btc_coexist
*btcoexist
, u8 type
);
163 void ex_halbtc8723b1ant_scan_notify(struct btc_coexist
*btcoexist
, u8 type
);
164 void ex_halbtc8723b1ant_connect_notify(struct btc_coexist
*btcoexist
, u8 type
);
165 void ex_halbtc8723b1ant_media_status_notify(struct btc_coexist
*btcoexist
,
167 void ex_halbtc8723b1ant_special_packet_notify(struct btc_coexist
*btcoexist
,
169 void ex_halbtc8723b1ant_bt_info_notify(struct btc_coexist
*btcoexist
,
170 u8
*tmpbuf
, u8 length
);
171 void ex_halbtc8723b1ant_halt_notify(struct btc_coexist
*btcoexist
);
172 void ex_halbtc8723b1ant_pnp_notify(struct btc_coexist
*btcoexist
, u8 pnpState
);
173 void ex_halbtc8723b1ant_periodical(struct btc_coexist
*btcoexist
);
174 void ex_halbtc8723b1ant_display_coex_info(struct btc_coexist
*btcoexist
);