Commit | Line | Data |
---|---|---|
3c05bedb GKH |
1 | /********************************************************************** |
2 | * The following is for 8723B 1ANT BT Co-exist definition | |
3 | **********************************************************************/ | |
4 | #define BT_AUTO_REPORT_ONLY_8723B_1ANT 1 | |
5 | ||
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 | |
14 | ||
15 | #define BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \ | |
16 | (((_BT_INFO_EXT_&BIT0))? true:false) | |
17 | ||
18 | #define BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT 2 | |
19 | ||
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 | |
e676e066 | 25 | } BT_INFO_SRC_8723B_1ANT, *PBT_INFO_SRC_8723B_1ANT; |
3c05bedb GKH |
26 | |
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 | |
e676e066 | 35 | } BT_8723B_1ANT_BT_STATUS, *PBT_8723B_1ANT_BT_STATUS; |
3c05bedb GKH |
36 | |
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 | |
e676e066 | 45 | } BT_8723B_1ANT_WIFI_STATUS, *PBT_8723B_1ANT_WIFI_STATUS; |
3c05bedb GKH |
46 | |
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, | |
e676e066 | 60 | } BT_8723B_1ANT_COEX_ALGO, *PBT_8723B_1ANT_COEX_ALGO; |
3c05bedb GKH |
61 | |
62 | struct coex_dm_8723b_1ant{ | |
63 | /* fw mechanism */ | |
64 | bool pre_dec_bt_pwr; | |
65 | bool cur_dec_bt_pwr; | |
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; | |
70 | u8 pre_ps_tdma; | |
71 | u8 cur_ps_tdma; | |
72 | u8 ps_tdma_para[5]; | |
73 | u8 ps_tdma_du_adj_type; | |
74 | bool auto_tdma_adjust; | |
75 | bool pre_ps_tdma_on; | |
76 | bool cur_ps_tdma_on; | |
77 | bool pre_bt_auto_report; | |
78 | bool cur_bt_auto_report; | |
79 | u8 pre_lps; | |
80 | u8 cur_lps; | |
81 | u8 pre_rpwm; | |
82 | u8 cur_rpwm; | |
83 | ||
84 | /* sw mechanism */ | |
85 | bool pre_rf_rx_lpf_shrink; | |
86 | bool cur_rf_rx_lpf_shrink; | |
87 | u32 bt_rf0x1e_backup; | |
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; | |
94 | bool pre_adc_backoff; | |
95 | bool cur_adc_backoff; | |
96 | bool pre_agc_table_en; | |
97 | bool cur_agc_table_en; | |
98 | u32 pre_val0x6c0; | |
99 | u32 cur_val0x6c0; | |
100 | u32 pre_val0x6c4; | |
101 | u32 cur_val0x6c4; | |
102 | u32 pre_val0x6c8; | |
103 | u32 cur_val0x6c8; | |
104 | u8 pre_val0x6cc; | |
105 | u8 cur_val0x6cc; | |
106 | bool limited_dig; | |
107 | ||
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; | |
112 | ||
113 | /* algorithm related */ | |
114 | u8 pre_algorithm; | |
115 | u8 cur_algorithm; | |
116 | u8 bt_status; | |
117 | u8 wifi_chnl_info[3]; | |
118 | ||
119 | u32 prera_mask; | |
120 | u32 curra_mask; | |
121 | u8 pre_arfr_type; | |
122 | u8 cur_arfr_type; | |
123 | u8 pre_retry_limit_type; | |
124 | u8 cur_retry_limit_type; | |
125 | u8 pre_ampdu_time_type; | |
126 | u8 cur_ampdu_time_type; | |
127 | ||
128 | u8 error_condition; | |
129 | }; | |
130 | ||
131 | struct coex_sta_8723b_1ant{ | |
132 | bool bt_link_exist; | |
133 | bool sco_exist; | |
134 | bool a2dp_exist; | |
135 | bool hid_exist; | |
136 | bool pan_exist; | |
137 | ||
138 | bool under_lps; | |
139 | bool under_ips; | |
140 | u32 special_pkt_period_cnt; | |
141 | u32 high_priority_tx; | |
142 | u32 high_priority_rx; | |
143 | u32 low_priority_tx; | |
144 | u32 low_priority_rx; | |
145 | u8 bt_rssi; | |
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; | |
152 | u8 bt_retry_cnt; | |
153 | u8 bt_info_ext; | |
154 | }; | |
155 | ||
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, | |
166 | u8 type); | |
167 | void ex_halbtc8723b1ant_special_packet_notify(struct btc_coexist *btcoexist, | |
168 | u8 type); | |
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); | |
175 |