Commit | Line | Data |
---|---|---|
e22f4eda LF |
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 BIT(7) | |
7 | #define BT_INFO_8723B_1ANT_B_A2DP BIT(6) | |
8 | #define BT_INFO_8723B_1ANT_B_HID BIT(5) | |
9 | #define BT_INFO_8723B_1ANT_B_SCO_BUSY BIT(4) | |
10 | #define BT_INFO_8723B_1ANT_B_ACL_BUSY BIT(3) | |
11 | #define BT_INFO_8723B_1ANT_B_INQ_PAGE BIT(2) | |
12 | #define BT_INFO_8723B_1ANT_B_SCO_ESCO BIT(1) | |
13 | #define BT_INFO_8723B_1ANT_B_CONNECTION BIT(0) | |
14 | ||
15 | #define BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \ | |
16 | (((_BT_INFO_EXT_&BIT(0))) ? true : false) | |
17 | ||
18 | #define BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT 2 | |
19 | ||
20 | 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 | }; | |
26 | ||
27 | 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 | }; | |
36 | ||
37 | 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 | }; | |
46 | ||
47 | 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 | }; | |
61 | ||
62 | struct coex_dm_8723b_1ant { | |
63 | /* fw mechanism */ | |
64 | bool cur_ignore_wlan_act; | |
65 | bool pre_ignore_wlan_act; | |
66 | u8 pre_ps_tdma; | |
67 | u8 cur_ps_tdma; | |
68 | u8 ps_tdma_para[5]; | |
69 | u8 ps_tdma_du_adj_type; | |
70 | bool auto_tdma_adjust; | |
71 | bool pre_ps_tdma_on; | |
72 | bool cur_ps_tdma_on; | |
73 | bool pre_bt_auto_report; | |
74 | bool cur_bt_auto_report; | |
75 | u8 pre_lps; | |
76 | u8 cur_lps; | |
77 | u8 pre_rpwm; | |
78 | u8 cur_rpwm; | |
79 | ||
80 | /* sw mechanism */ | |
81 | bool pre_low_penalty_ra; | |
82 | bool cur_low_penalty_ra; | |
83 | u32 pre_val0x6c0; | |
84 | u32 cur_val0x6c0; | |
85 | u32 pre_val0x6c4; | |
86 | u32 cur_val0x6c4; | |
87 | u32 pre_val0x6c8; | |
88 | u32 cur_val0x6c8; | |
89 | u8 pre_val0x6cc; | |
90 | u8 cur_val0x6cc; | |
91 | bool limited_dig; | |
92 | ||
93 | u32 backup_arfr_cnt1; /* Auto Rate Fallback Retry cnt */ | |
94 | u32 backup_arfr_cnt2; /* Auto Rate Fallback Retry cnt */ | |
95 | u16 backup_retry_limit; | |
96 | u8 backup_ampdu_max_time; | |
97 | ||
98 | /* algorithm related */ | |
99 | u8 pre_algorithm; | |
100 | u8 cur_algorithm; | |
101 | u8 bt_status; | |
102 | u8 wifi_chnl_info[3]; | |
103 | ||
104 | u32 prera_mask; | |
105 | u32 curra_mask; | |
106 | u8 pre_arfr_type; | |
107 | u8 cur_arfr_type; | |
108 | u8 pre_retry_limit_type; | |
109 | u8 cur_retry_limit_type; | |
110 | u8 pre_ampdu_time_type; | |
111 | u8 cur_ampdu_time_type; | |
112 | ||
113 | u8 error_condition; | |
114 | }; | |
115 | ||
116 | struct coex_sta_8723b_1ant { | |
117 | bool bt_link_exist; | |
118 | bool sco_exist; | |
119 | bool a2dp_exist; | |
120 | bool hid_exist; | |
121 | bool pan_exist; | |
122 | ||
123 | bool under_lps; | |
124 | bool under_ips; | |
125 | u32 special_pkt_period_cnt; | |
126 | u32 high_priority_tx; | |
127 | u32 high_priority_rx; | |
128 | u32 low_priority_tx; | |
129 | u32 low_priority_rx; | |
130 | u8 bt_rssi; | |
131 | u8 pre_bt_rssi_state; | |
132 | u8 pre_wifi_rssi_state[4]; | |
133 | bool c2h_bt_info_req_sent; | |
134 | u8 bt_info_c2h[BT_INFO_SRC_8723B_1ANT_MAX][10]; | |
135 | u32 bt_info_c2h_cnt[BT_INFO_SRC_8723B_1ANT_MAX]; | |
136 | bool c2h_bt_inquiry_page; | |
137 | u8 bt_retry_cnt; | |
138 | u8 bt_info_ext; | |
139 | }; | |
140 | ||
141 | /************************************************************************* | |
142 | * The following is interface which will notify coex module. | |
143 | *************************************************************************/ | |
144 | void ex_halbtc8723b1ant_init_hwconfig(struct btc_coexist *btcoexist); | |
145 | void ex_halbtc8723b1ant_init_coex_dm(struct btc_coexist *btcoexist); | |
146 | void ex_halbtc8723b1ant_ips_notify(struct btc_coexist *btcoexist, u8 type); | |
147 | void ex_halbtc8723b1ant_lps_notify(struct btc_coexist *btcoexist, u8 type); | |
148 | void ex_halbtc8723b1ant_scan_notify(struct btc_coexist *btcoexist, u8 type); | |
149 | void ex_halbtc8723b1ant_connect_notify(struct btc_coexist *btcoexist, u8 type); | |
150 | void ex_halbtc8723b1ant_media_status_notify(struct btc_coexist *btcoexist, | |
151 | u8 type); | |
152 | void ex_halbtc8723b1ant_special_packet_notify(struct btc_coexist *btcoexist, | |
153 | u8 type); | |
154 | void ex_halbtc8723b1ant_bt_info_notify(struct btc_coexist *btcoexist, | |
155 | u8 *tmpbuf, u8 length); | |
156 | void ex_halbtc8723b1ant_halt_notify(struct btc_coexist *btcoexist); | |
157 | void ex_halbtc8723b1ant_pnp_notify(struct btc_coexist *btcoexist, u8 state); | |
158 | void ex_halbtc8723b1ant_coex_dm_reset(struct btc_coexist *btcoexist); | |
159 | void ex_halbtc8723b1ant_periodical(struct btc_coexist *btcoexist); | |
160 | void ex_halbtc8723b1ant_display_coex_info(struct btc_coexist *btcoexist); |