1 /******************************************************************************
3 * Copyright(c) 2007 - 2013 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 ******************************************************************************/
17 #include "halbt_precomp.h"
19 /***********************************************
21 ***********************************************/
22 static const char *const bt_profile_string
[] = {
30 static const char *const bt_spec_string
[] = {
40 static const char *const bt_link_role_string
[] = {
45 static const char *const h2c_state_string
[] = {
52 static const char *const io_state_string
[] = {
54 "IO_STATUS_FAIL_CANNOT_IO",
55 "IO_STATUS_FAIL_RF_OFF",
56 "IO_STATUS_FAIL_FW_READ_CLEAR_TIMEOUT",
57 "IO_STATUS_FAIL_WAIT_IO_EVENT_TIMEOUT",
58 "IO_STATUS_INVALID_LEN",
59 "IO_STATUS_IO_IDLE_QUEUE_EMPTY",
60 "IO_STATUS_IO_INSERT_WAIT_QUEUE_FAIL",
61 "IO_STATUS_UNKNOWN_FAIL",
62 "IO_STATUS_WRONG_LEVEL",
63 "IO_STATUS_H2C_STOPPED",
66 struct btc_coexist gl92e_bt_coexist
;
68 u32 btc_92edbg_type
[BTC_MSG_MAX
];
69 static u8 btc_dbg_buf
[100];
71 /***************************************************
72 * Debug related function
73 ***************************************************/
74 static bool is_any_client_connect_to_ap(struct btc_coexist
*btcoexist
)
76 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
77 struct rtl_mac
*mac
= rtl_mac(rtlpriv
);
78 struct rtl_sta_info
*drv_priv
;
81 if (mac
->opmode
== NL80211_IFTYPE_ADHOC
||
82 mac
->opmode
== NL80211_IFTYPE_MESH_POINT
||
83 mac
->opmode
== NL80211_IFTYPE_AP
) {
84 spin_lock_bh(&rtlpriv
->locks
.entry_list_lock
);
85 list_for_each_entry(drv_priv
, &rtlpriv
->entry_list
, list
) {
88 spin_unlock_bh(&rtlpriv
->locks
.entry_list_lock
);
96 static bool halbtc_is_bt_coexist_available(struct btc_coexist
*btcoexist
)
98 if (!btcoexist
->binded
|| NULL
== btcoexist
->adapter
)
104 static bool halbtc_is_wifi_busy(struct rtl_priv
*rtlpriv
)
106 if (rtlpriv
->link_info
.b_busytraffic
)
113 static void halbtc_dbg_init(void)
117 for (i
= 0; i
< BTC_MSG_MAX
; i
++)
118 btc_92edbg_type
[i
] = 0;
120 btc_92edbg_type
[BTC_MSG_INTERFACE
] = 0;
122 btc_92edbg_type
[BTC_MSG_ALGORITHM
] = 0;
125 static bool halbtc_is_bt40(struct rtl_priv
*adapter
)
127 struct rtl_priv
*rtlpriv
= adapter
;
128 struct rtl_phy
*rtlphy
= &(rtlpriv
->phy
);
130 enum ht_channel_width bw
= rtlphy
->current_chan_bw
;
133 if (bw
== HT_CHANNEL_WIDTH_20
)
135 else if (bw
== HT_CHANNEL_WIDTH_20_40
)
141 static bool halbtc_legacy(struct rtl_priv
*adapter
)
143 struct rtl_priv
*rtlpriv
= adapter
;
144 struct rtl_mac
*mac
= rtl_mac(rtlpriv
);
146 bool is_legacy
= false;
148 if ((mac
->mode
== WIRELESS_MODE_B
) || (mac
->mode
== WIRELESS_MODE_G
))
154 bool halbtc92e_is_wifi_uplink(struct rtl_priv
*adapter
)
156 struct rtl_priv
*rtlpriv
= adapter
;
158 if (rtlpriv
->link_info
.b_tx_busy_traffic
)
164 static u32
halbtc_get_wifi_bw(struct btc_coexist
*btcoexist
)
166 struct rtl_priv
*rtlpriv
=
167 (struct rtl_priv
*)btcoexist
->adapter
;
168 u32 wifi_bw
= BTC_WIFI_BW_HT20
;
170 if (halbtc_is_bt40(rtlpriv
)) {
171 wifi_bw
= BTC_WIFI_BW_HT40
;
173 if (halbtc_legacy(rtlpriv
))
174 wifi_bw
= BTC_WIFI_BW_LEGACY
;
176 wifi_bw
= BTC_WIFI_BW_HT20
;
181 static u8
halbtc_get_wifi_central_chnl(struct btc_coexist
*btcoexist
)
183 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
184 struct rtl_phy
*rtlphy
= &(rtlpriv
->phy
);
188 if (rtlphy
->current_channel
!= 0)
189 chnl
= rtlphy
->current_channel
;
190 BTC_PRINT(BTC_MSG_ALGORITHM
, ALGO_TRACE
,
191 "halbtc_get_wifi_central_chnl:%d\n", chnl
);
195 static void halbtc_leave_lps(struct btc_coexist
*btcoexist
)
197 struct rtl_priv
*rtlpriv
;
198 struct rtl_ps_ctl
*ppsc
;
199 bool ap_enable
= false;
201 rtlpriv
= btcoexist
->adapter
;
202 ppsc
= rtl_psc(rtlpriv
);
204 btcoexist
->btc_get(btcoexist
, BTC_GET_BL_WIFI_AP_MODE_ENABLE
,
208 pr_debug("halbtc_leave_lps()<--dont leave lps under AP mode\n");
212 btcoexist
->bt_info
.bt_ctrl_lps
= true;
213 btcoexist
->bt_info
.bt_lps_on
= false;
214 rtl92e_lps_leave(rtlpriv
->mac80211
.hw
);
217 static void halbtc_enter_lps(struct btc_coexist
*btcoexist
)
219 struct rtl_priv
*rtlpriv
;
220 struct rtl_ps_ctl
*ppsc
;
221 bool ap_enable
= false;
223 rtlpriv
= btcoexist
->adapter
;
224 ppsc
= rtl_psc(rtlpriv
);
226 btcoexist
->btc_get(btcoexist
, BTC_GET_BL_WIFI_AP_MODE_ENABLE
,
230 pr_debug("halbtc_enter_lps()<--dont enter lps under AP mode\n");
234 btcoexist
->bt_info
.bt_ctrl_lps
= true;
235 btcoexist
->bt_info
.bt_lps_on
= false;
236 rtl92e_lps_enter(rtlpriv
->mac80211
.hw
);
239 static void halbtc_normal_lps(struct btc_coexist
*btcoexist
)
241 if (btcoexist
->bt_info
.bt_ctrl_lps
) {
242 btcoexist
->bt_info
.bt_lps_on
= false;
243 btcoexist
->bt_info
.bt_ctrl_lps
= false;
247 static void halbtc_aggregation_check(struct btc_coexist
*btcoexist
)
251 static u32
halbtcoutsrc_get_wifi_link_status(struct btc_coexist
*btcoexist
)
253 /*------------------------------------
255 * [31:16] => connected port number
256 * [15:0] => port connected bit define
257 *------------------------------------
260 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
261 struct rtl_mac
*mac
= rtl_mac(rtlpriv
);
263 u32 port_connected_status
= 0, num_of_connected_port
= 0;
265 if (mac
->opmode
== NL80211_IFTYPE_STATION
&&
266 mac
->link_state
>= MAC80211_LINKED
) {
267 port_connected_status
|= WIFI_STA_CONNECTED
;
268 num_of_connected_port
++;
270 /* AP & ADHOC & MESH */
271 if (is_any_client_connect_to_ap(btcoexist
)) {
272 port_connected_status
|= WIFI_AP_CONNECTED
;
273 num_of_connected_port
++;
275 /*if (BT_HsConnectionEstablished(Adapter))
277 port_connected_status |= WIFI_HS_CONNECTED;
278 num_of_connected_port++;
281 * P2P Connected Status */
283 ret_val
= (num_of_connected_port
<< 16) | port_connected_status
;
289 static u32
halbtc_get_bt_patch_version(struct btc_coexist
*btcoexist
)
294 static s32
halbtc_get_wifi_rssi(struct rtl_priv
*adapter
)
296 struct rtl_priv
*rtlpriv
= adapter
;
297 s32 undecorated_smoothed_pwdb
= 0;
299 if (rtlpriv
->mac80211
.link_state
>= MAC80211_LINKED
)
300 undecorated_smoothed_pwdb
=
301 rtlpriv
->dm
.undecorated_smoothed_pwdb
;
302 else /* associated entry pwdb */
303 undecorated_smoothed_pwdb
=
304 rtlpriv
->dm
.undecorated_smoothed_pwdb
;
305 return undecorated_smoothed_pwdb
;
308 static bool halbtc_get(void *void_btcoexist
, u8 get_type
, void *out_buf
)
310 struct btc_coexist
*btcoexist
= (struct btc_coexist
*)void_btcoexist
;
311 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
312 struct rtl_phy
*rtlphy
= &(rtlpriv
->phy
);
313 struct rtl_mac
*mac
= rtl_mac(rtlpriv
);
314 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
315 bool *bool_tmp
= (bool *)out_buf
;
316 int *s32_tmp
= (int *)out_buf
;
317 u32
*u32_tmp
= (u32
*)out_buf
;
318 u8
*u8_tmp
= (u8
*)out_buf
;
322 if (!halbtc_is_bt_coexist_available(btcoexist
))
327 case BTC_GET_BL_HS_OPERATION
:
330 case BTC_GET_BL_HS_CONNECTING
:
333 case BTC_GET_BL_WIFI_CONNECTED
:
334 if (rtlpriv
->mac80211
.opmode
== NL80211_IFTYPE_STATION
&&
335 rtlpriv
->mac80211
.link_state
>= MAC80211_LINKED
)
337 if (is_any_client_connect_to_ap(btcoexist
))
341 case BTC_GET_BL_WIFI_BUSY
:
342 if (halbtc_is_wifi_busy(rtlpriv
))
347 case BTC_GET_BL_WIFI_SCAN
:
348 if (mac
->act_scanning
)
353 case BTC_GET_BL_WIFI_LINK
:
354 if (mac
->link_state
== MAC80211_LINKING
)
359 case BTC_GET_BL_WIFI_ROAM
: /*TODO*/
362 case BTC_GET_BL_WIFI_4_WAY_PROGRESS
: /*TODO*/
365 case BTC_GET_BL_WIFI_UNDER_5G
:
366 *bool_tmp
= false; /*TODO*/
368 case BTC_GET_BL_WIFI_DHCP
: /*TODO*/
370 case BTC_GET_BL_WIFI_SOFTAP_IDLE
:
373 case BTC_GET_BL_WIFI_SOFTAP_LINKING
:
376 case BTC_GET_BL_WIFI_IN_EARLY_SUSPEND
:
379 case BTC_GET_BL_WIFI_AP_MODE_ENABLE
:
382 case BTC_GET_BL_WIFI_ENABLE_ENCRYPTION
:
383 if (NO_ENCRYPTION
== rtlpriv
->sec
.pairwise_enc_algorithm
)
388 case BTC_GET_BL_WIFI_UNDER_B_MODE
:
389 if (WIRELESS_MODE_B
== rtlpriv
->mac80211
.mode
)
394 case BTC_GET_BL_EXT_SWITCH
:
397 case BTC_GET_S4_WIFI_RSSI
:
398 *s32_tmp
= halbtc_get_wifi_rssi(rtlpriv
);
400 case BTC_GET_S4_HS_RSSI
: /*TODO*/
401 *s32_tmp
= halbtc_get_wifi_rssi(rtlpriv
);
403 case BTC_GET_U4_WIFI_BW
:
404 *u32_tmp
= halbtc_get_wifi_bw(btcoexist
);
406 case BTC_GET_U4_WIFI_TRAFFIC_DIRECTION
:
407 if (halbtc92e_is_wifi_uplink(rtlpriv
))
408 *u32_tmp
= BTC_WIFI_TRAFFIC_TX
;
410 *u32_tmp
= BTC_WIFI_TRAFFIC_RX
;
412 case BTC_GET_U4_WIFI_FW_VER
:
413 *u32_tmp
= (rtlhal
->fw_version
<< 16) | rtlhal
->fw_subversion
;
415 case BTC_GET_U4_WIFI_LINK_STATUS
:
416 *u32_tmp
= halbtcoutsrc_get_wifi_link_status(btcoexist
);
418 case BTC_GET_U4_BT_PATCH_VER
:
419 *u32_tmp
= halbtc_get_bt_patch_version(btcoexist
);
421 case BTC_GET_U1_WIFI_DOT11_CHNL
:
422 *u8_tmp
= rtlphy
->current_channel
;
424 case BTC_GET_U1_WIFI_CENTRAL_CHNL
:
425 *u8_tmp
= halbtc_get_wifi_central_chnl(btcoexist
);
427 case BTC_GET_U1_WIFI_HS_CHNL
:
428 *u8_tmp
= 1;/* BT_OperateChnl(rtlpriv); */
430 case BTC_GET_U1_MAC_PHY_MODE
:
431 *u8_tmp
= BTC_MP_UNKNOWN
;
433 case BTC_GET_U1_AP_NUM
:
434 /* driver don't know AP num in Linux,
435 * So, the return value here is not right */
436 *u8_tmp
= 1;/* pDefMgntInfo->NumBssDesc4Query; */
439 /************* 1Ant **************/
440 case BTC_GET_U1_LPS_MODE
:
441 *u8_tmp
= btcoexist
->pwr_mode_val
[0];
451 static bool halbtc_set(void *void_btcoexist
, u8 set_type
, void *in_buf
)
453 struct btc_coexist
*btcoexist
= (struct btc_coexist
*)void_btcoexist
;
454 bool *bool_tmp
= (bool *)in_buf
;
455 u8
*u8_tmp
= (u8
*)in_buf
;
456 u32
*u32_tmp
= (u32
*)in_buf
;
459 if (!halbtc_is_bt_coexist_available(btcoexist
))
463 /* set some bool type variables. */
464 case BTC_SET_BL_BT_DISABLE
:
465 btcoexist
->bt_info
.bt_disabled
= *bool_tmp
;
467 case BTC_SET_BL_BT_TRAFFIC_BUSY
:
468 btcoexist
->bt_info
.bt_busy
= *bool_tmp
;
470 case BTC_SET_BL_BT_LIMITED_DIG
:
471 btcoexist
->bt_info
.limited_dig
= *bool_tmp
;
473 case BTC_SET_BL_FORCE_TO_ROAM
:
474 btcoexist
->bt_info
.force_to_roam
= *bool_tmp
;
476 case BTC_SET_BL_TO_REJ_AP_AGG_PKT
:
477 btcoexist
->bt_info
.reject_agg_pkt
= *bool_tmp
;
479 case BTC_SET_BL_BT_CTRL_AGG_SIZE
:
480 btcoexist
->bt_info
.b_bt_ctrl_buf_size
= *bool_tmp
;
482 case BTC_SET_BL_INC_SCAN_DEV_NUM
:
483 btcoexist
->bt_info
.increase_scan_dev_num
= *bool_tmp
;
485 /* set some u1Byte type variables. */
486 case BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON
:
487 btcoexist
->bt_info
.rssi_adjust_for_agc_table_on
= *u8_tmp
;
489 case BTC_SET_U1_AGG_BUF_SIZE
:
490 btcoexist
->bt_info
.agg_buf_size
= *u8_tmp
;
492 /* the following are some action which will be triggered */
493 case BTC_SET_ACT_GET_BT_RSSI
:
494 /*BTHCI_SendGetBtRssiEvent(rtlpriv);*/
496 case BTC_SET_ACT_AGGREGATE_CTRL
:
497 halbtc_aggregation_check(btcoexist
);
501 case BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE
:
502 btcoexist
->bt_info
.rssi_adjust_for_1ant_coex_type
= *u8_tmp
;
504 case BTC_SET_U1_LPS_VAL
:
505 btcoexist
->bt_info
.lps_val
= *u8_tmp
;
507 case BTC_SET_U1_RPWM_VAL
:
508 btcoexist
->bt_info
.rpwm_val
= *u8_tmp
;
510 /* the following are some action which will be triggered */
511 case BTC_SET_ACT_LEAVE_LPS
:
512 halbtc_leave_lps(btcoexist
);
514 case BTC_SET_ACT_ENTER_LPS
:
515 halbtc_enter_lps(btcoexist
);
517 case BTC_SET_ACT_NORMAL_LPS
:
518 halbtc_normal_lps(btcoexist
);
520 case BTC_SET_ACT_DISABLE_LOW_POWER
:
522 case BTC_SET_ACT_UPDATE_ra_mask
:
523 btcoexist
->bt_info
.ra_mask
= *u32_tmp
;
525 case BTC_SET_ACT_SEND_MIMO_PS
:
527 case BTC_SET_ACT_INC_FORCE_EXEC_PWR_CMD_CNT
:
528 btcoexist
->bt_info
.force_exec_pwr_cmd_cnt
++;
530 case BTC_SET_ACT_CTRL_BT_INFO
: /*wait for 8812/8821*/
532 case BTC_SET_ACT_CTRL_BT_COEX
:
541 static void halbtc_display_coex_statistics(struct btc_coexist
*btcoexist
)
545 static void halbtc_display_bt_link_info(struct btc_coexist
*btcoexist
)
549 static void halbtc_display_bt_fw_info(struct btc_coexist
*btcoexist
)
553 static void halbtc_display_fw_pwr_mode_cmd(struct btc_coexist
*btcoexist
)
557 /************************************************************
558 * IO related function
559 ************************************************************/
560 static u8
halbtc_read_1byte(void *bt_context
, u32 reg_addr
)
562 struct btc_coexist
*btcoexist
= (struct btc_coexist
*)bt_context
;
563 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
565 return rtl_read_byte(rtlpriv
, reg_addr
);
569 static u16
halbtc_read_2byte(void *bt_context
, u32 reg_addr
)
571 struct btc_coexist
*btcoexist
= (struct btc_coexist
*)bt_context
;
572 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
574 return rtl_read_word(rtlpriv
, reg_addr
);
578 static u32
halbtc_read_4byte(void *bt_context
, u32 reg_addr
)
580 struct btc_coexist
*btcoexist
= (struct btc_coexist
*)bt_context
;
581 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
583 return rtl_read_dword(rtlpriv
, reg_addr
);
587 static void halbtc_write_1byte(void *bt_context
, u32 reg_addr
, u8 data
)
589 struct btc_coexist
*btcoexist
= (struct btc_coexist
*)bt_context
;
590 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
592 rtl_write_byte(rtlpriv
, reg_addr
, data
);
595 static void halbtc_bitmask_write_1byte(void *bt_context
, u32 reg_addr
,
596 u8 bit_mask
, u8 data
)
598 struct btc_coexist
*btcoexist
= (struct btc_coexist
*)bt_context
;
599 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
600 u8 original_value
, bit_shift
= 0;
603 if (bit_mask
!= MASKBYTE0
) {/*if not "byte" write*/
604 original_value
= rtl_read_byte(rtlpriv
, reg_addr
);
605 for (i
= 0; i
<= 7; i
++) {
606 if ((bit_mask
>>i
)&0x1)
610 data
= (original_value
& (~bit_mask
)) |
611 ((data
<< bit_shift
) & bit_mask
);
613 rtl_write_byte(rtlpriv
, reg_addr
, data
);
617 static void halbtc_write_2byte(void *bt_context
, u32 reg_addr
, u16 data
)
619 struct btc_coexist
*btcoexist
= (struct btc_coexist
*)bt_context
;
620 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
622 rtl_write_word(rtlpriv
, reg_addr
, data
);
626 static void halbtc_write_4byte(void *bt_context
, u32 reg_addr
, u32 data
)
628 struct btc_coexist
*btcoexist
=
629 (struct btc_coexist
*)bt_context
;
630 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
632 rtl_write_dword(rtlpriv
, reg_addr
, data
);
636 static void halbtc_set_bbreg(void *bt_context
, u32 reg_addr
,
637 u32 bit_mask
, u32 data
)
639 struct btc_coexist
*btcoexist
= (struct btc_coexist
*)bt_context
;
640 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
642 rtl_set_bbreg(rtlpriv
->mac80211
.hw
, reg_addr
, bit_mask
, data
);
646 static u32
halbtc_get_bbreg(void *bt_context
, u32 reg_addr
, u32 bit_mask
)
648 struct btc_coexist
*btcoexist
= (struct btc_coexist
*)bt_context
;
649 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
651 return rtl_get_bbreg(rtlpriv
->mac80211
.hw
, reg_addr
, bit_mask
);
655 static void halbtc_set_rfreg(void *bt_context
, u8 rf_path
, u32 reg_addr
,
656 u32 bit_mask
, u32 data
)
658 struct btc_coexist
*btcoexist
= (struct btc_coexist
*)bt_context
;
659 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
661 rtl_set_rfreg(rtlpriv
->mac80211
.hw
, rf_path
, reg_addr
, bit_mask
, data
);
665 static u32
halbtc_get_rfreg(void *bt_context
, u8 rf_path
, u32 reg_addr
,
668 struct btc_coexist
*btcoexist
= (struct btc_coexist
*)bt_context
;
669 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
671 return rtl_get_rfreg(rtlpriv
->mac80211
.hw
, rf_path
, reg_addr
, bit_mask
);
675 static void halbtc_fill_h2c_cmd(void *bt_context
, u8 element_id
,
676 u32 cmd_len
, u8
*cmd_buf
)
678 struct btc_coexist
*btcoexist
= (struct btc_coexist
*)bt_context
;
679 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
681 rtlpriv
->cfg
->ops
->fill_h2c_cmd(rtlpriv
->mac80211
.hw
, element_id
,
685 static void halbtc_display_dbg_msg(void *bt_context
, u8 disp_type
)
687 struct btc_coexist
*btcoexist
= (struct btc_coexist
*)bt_context
;
689 case BTC_DBG_DISP_COEX_STATISTICS
:
690 halbtc_display_coex_statistics(btcoexist
);
692 case BTC_DBG_DISP_BT_LINK_INFO
:
693 halbtc_display_bt_link_info(btcoexist
);
695 case BTC_DBG_DISP_BT_FW_VER
:
696 halbtc_display_bt_fw_info(btcoexist
);
698 case BTC_DBG_DISP_FW_PWR_MODE_CMD
:
699 halbtc_display_fw_pwr_mode_cmd(btcoexist
);
706 static bool halbtc_under_ips(struct btc_coexist
*btcoexist
)
708 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
709 struct rtl_ps_ctl
*ppsc
= rtl_psc(rtlpriv
);
710 enum rf_pwrstate rtstate
;
712 if (ppsc
->b_inactiveps
) {
713 rtstate
= ppsc
->rfpwr_state
;
715 if (rtstate
!= ERFON
&&
716 ppsc
->rfoff_reason
== RF_CHANGE_BY_IPS
)
723 /*****************************************************************
724 * Extern functions called by other module
725 *****************************************************************/
726 bool exhalbtc92e_initlize_variables(struct rtl_priv
*adapter
)
728 struct btc_coexist
*btcoexist
= &gl92e_bt_coexist
;
730 btcoexist
->statistics
.cnt_bind
++;
734 if (btcoexist
->binded
)
737 btcoexist
->binded
= true;
739 btcoexist
->chip_interface
= BTC_INTF_UNKNOWN
;
741 if (NULL
== btcoexist
->adapter
)
742 btcoexist
->adapter
= adapter
;
744 btcoexist
->stack_info
.profile_notified
= false;
746 btcoexist
->btc_read_1byte
= halbtc_read_1byte
;
747 btcoexist
->btc_write_1byte
= halbtc_write_1byte
;
748 btcoexist
->btc_write_1byte_bitmask
= halbtc_bitmask_write_1byte
;
749 btcoexist
->btc_read_2byte
= halbtc_read_2byte
;
750 btcoexist
->btc_write_2byte
= halbtc_write_2byte
;
751 btcoexist
->btc_read_4byte
= halbtc_read_4byte
;
752 btcoexist
->btc_write_4byte
= halbtc_write_4byte
;
754 btcoexist
->btc_set_bb_reg
= halbtc_set_bbreg
;
755 btcoexist
->btc_get_bb_reg
= halbtc_get_bbreg
;
757 btcoexist
->btc_set_rf_reg
= halbtc_set_rfreg
;
758 btcoexist
->btc_get_rf_reg
= halbtc_get_rfreg
;
760 btcoexist
->btc_fill_h2c
= halbtc_fill_h2c_cmd
;
761 btcoexist
->btc_disp_dbg_msg
= halbtc_display_dbg_msg
;
763 btcoexist
->btc_get
= halbtc_get
;
764 btcoexist
->btc_set
= halbtc_set
;
766 btcoexist
->cli_buf
= &btc_dbg_buf
[0];
768 btcoexist
->bt_info
.b_bt_ctrl_buf_size
= false;
769 btcoexist
->bt_info
.agg_buf_size
= 5;
771 btcoexist
->bt_info
.increase_scan_dev_num
= false;
775 void exhalbtc92e_init_hw_config(struct btc_coexist
*btcoexist
)
777 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
778 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
780 if (!halbtc_is_bt_coexist_available(btcoexist
))
783 btcoexist
->statistics
.cnt_init_hw_config
++;
785 if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8723BE
) {
786 if (btcoexist
->board_info
.btdm_ant_num
== 2)
787 ex92e_halbtc8723b2ant_init_hwconfig(btcoexist
);
788 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
789 ex_halbtc8723b1ant_init_hwconfig(btcoexist
);
790 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8192EE
) {
791 ex_halbtc8192e2ant_init_hwconfig(btcoexist
);
792 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8821AE
) {
793 if (btcoexist
->board_info
.btdm_ant_num
== 2)
794 ex_halbtc8821a2ant_init_hwconfig(btcoexist
);
795 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
796 ex_halbtc8821a1ant_init_hwconfig(btcoexist
);
800 void exhalbtc92e_init_coex_dm(struct btc_coexist
*btcoexist
)
802 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
803 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
805 if (!halbtc_is_bt_coexist_available(btcoexist
))
808 btcoexist
->statistics
.cnt_init_coex_dm
++;
810 if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8723BE
) {
811 if (btcoexist
->board_info
.btdm_ant_num
== 2)
812 ex92e_halbtc8723b2ant_init_coex_dm(btcoexist
);
813 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
814 ex_halbtc8723b1ant_init_coex_dm(btcoexist
);
815 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8192EE
) {
816 ex_halbtc8192e2ant_init_coex_dm(btcoexist
);
817 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8821AE
) {
818 if (btcoexist
->board_info
.btdm_ant_num
== 2)
819 ex_halbtc8821a2ant_init_coex_dm(btcoexist
);
820 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
821 ex_halbtc8821a1ant_init_coex_dm(btcoexist
);
824 btcoexist
->initilized
= true;
827 void exhalbtc92e_ips_notify(struct btc_coexist
*btcoexist
, u8 type
)
829 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
830 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
833 if (!halbtc_is_bt_coexist_available(btcoexist
))
835 btcoexist
->statistics
.cnt_ips_notify
++;
836 if (btcoexist
->manual_control
)
840 ips_type
= BTC_IPS_ENTER
;
842 ips_type
= BTC_IPS_LEAVE
;
844 if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8723BE
) {
845 if (btcoexist
->board_info
.btdm_ant_num
== 2)
846 ex92e_halbtc8723b2ant_ips_notify(btcoexist
, ips_type
);
847 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
848 ex_halbtc8723b1ant_ips_notify(btcoexist
, ips_type
);
849 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8192EE
) {
850 ex_halbtc8192e2ant_ips_notify(btcoexist
, ips_type
);
851 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8821AE
) {
852 if (btcoexist
->board_info
.btdm_ant_num
== 2)
853 ex_halbtc8821a2ant_ips_notify(btcoexist
, ips_type
);
854 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
855 ex_halbtc8821a1ant_ips_notify(btcoexist
, ips_type
);
859 void exhalbtc92e_lps_notify(struct btc_coexist
*btcoexist
, u8 type
)
861 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
862 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
865 if (!halbtc_is_bt_coexist_available(btcoexist
))
867 btcoexist
->statistics
.cnt_lps_notify
++;
868 if (btcoexist
->manual_control
)
872 lps_type
= BTC_LPS_DISABLE
;
874 lps_type
= BTC_LPS_ENABLE
;
876 if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8723BE
) {
877 if (btcoexist
->board_info
.btdm_ant_num
== 2)
878 ex92e_halbtc8723b2ant_lps_notify(btcoexist
, lps_type
);
879 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
880 ex_halbtc8723b1ant_lps_notify(btcoexist
, lps_type
);
881 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8192EE
) {
882 ex_halbtc8192e2ant_lps_notify(btcoexist
, lps_type
);
883 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8821AE
) {
884 if (btcoexist
->board_info
.btdm_ant_num
== 2)
885 ex_halbtc8821a2ant_lps_notify(btcoexist
, lps_type
);
886 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
887 ex_halbtc8821a1ant_lps_notify(btcoexist
, lps_type
);
891 void exhalbtc92e_scan_notify(struct btc_coexist
*btcoexist
, u8 type
)
893 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
894 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
897 if (!halbtc_is_bt_coexist_available(btcoexist
))
899 btcoexist
->statistics
.cnt_scan_notify
++;
900 if (btcoexist
->manual_control
)
904 scan_type
= BTC_SCAN_START
;
906 scan_type
= BTC_SCAN_FINISH
;
908 if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8723BE
) {
909 if (btcoexist
->board_info
.btdm_ant_num
== 2)
910 ex92e_halbtc8723b2ant_scan_notify(btcoexist
, scan_type
);
911 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
912 ex_halbtc8723b1ant_scan_notify(btcoexist
, scan_type
);
913 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8192EE
) {
914 ex_halbtc8192e2ant_scan_notify(btcoexist
, scan_type
);
915 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8821AE
) {
916 if (btcoexist
->board_info
.btdm_ant_num
== 2)
917 ex_halbtc8821a2ant_scan_notify(btcoexist
, scan_type
);
918 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
919 ex_halbtc8821a1ant_scan_notify(btcoexist
, scan_type
);
923 void exhalbtc92e_connect_notify(struct btc_coexist
*btcoexist
, u8 action
)
925 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
926 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
929 if (!halbtc_is_bt_coexist_available(btcoexist
))
931 btcoexist
->statistics
.cnt_connect_notify
++;
932 if (btcoexist
->manual_control
)
936 asso_type
= BTC_ASSOCIATE_START
;
938 asso_type
= BTC_ASSOCIATE_FINISH
;
940 if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8723BE
) {
941 if (btcoexist
->board_info
.btdm_ant_num
== 2)
942 ex92e_halbtc8723b2ant_connect_notify(btcoexist
,
944 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
945 ex_halbtc8723b1ant_connect_notify(btcoexist
, asso_type
);
946 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8192EE
) {
947 ex_halbtc8192e2ant_connect_notify(btcoexist
, asso_type
);
948 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8821AE
) {
949 if (btcoexist
->board_info
.btdm_ant_num
== 2)
950 ex_halbtc8821a2ant_connect_notify(btcoexist
,
952 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
953 ex_halbtc8821a1ant_connect_notify(btcoexist
,
958 void exhalbtc92e_mediastatus_notify(struct btc_coexist
*btcoexist
,
959 enum rt_media_status media_status
)
961 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
962 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
965 if (!halbtc_is_bt_coexist_available(btcoexist
))
967 btcoexist
->statistics
.cnt_media_status_notify
++;
968 if (btcoexist
->manual_control
)
971 if (RT_MEDIA_CONNECT
== media_status
)
972 status
= BTC_MEDIA_CONNECT
;
974 status
= BTC_MEDIA_DISCONNECT
;
976 if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8723BE
) {
977 if (btcoexist
->board_info
.btdm_ant_num
== 2)
978 ex92e_halbtc8723b2ant_media_status_notify(btcoexist
,
980 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
981 ex_halbtc8723b1ant_media_status_notify(btcoexist
,
983 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8192EE
) {
984 ex_halbtc8192e2ant_media_status_notify(btcoexist
, status
);
985 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8821AE
) {
986 if (btcoexist
->board_info
.btdm_ant_num
== 2)
987 ex_halbtc8821a2ant_media_status_notify(btcoexist
,
989 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
990 ex_halbtc8821a1ant_media_status_notify(btcoexist
,
995 void exhalbtc92e_special_packet_notify(struct btc_coexist
*btcoexist
,
998 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
999 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
1002 if (!halbtc_is_bt_coexist_available(btcoexist
))
1004 btcoexist
->statistics
.cnt_special_packet_notify
++;
1005 if (btcoexist
->manual_control
)
1008 if (PACKET_DHCP
== pkt_type
) {
1009 packet_type
= BTC_PACKET_DHCP
;
1010 } else if (PACKET_EAPOL
== pkt_type
) {
1011 packet_type
= BTC_PACKET_EAPOL
;
1012 } else if (PACKET_ARP
== pkt_type
) {
1013 packet_type
= BTC_PACKET_ARP
;
1015 packet_type
= BTC_PACKET_UNKNOWN
;
1019 if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8723BE
) {
1020 if (btcoexist
->board_info
.btdm_ant_num
== 2)
1021 ex92e_halbtc8723b2ant_special_packet_notify(btcoexist
,
1023 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
1024 ex_halbtc8723b1ant_special_packet_notify(btcoexist
,
1026 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8821AE
) {
1027 if (btcoexist
->board_info
.btdm_ant_num
== 2)
1028 ex_halbtc8821a2ant_special_packet_notify(btcoexist
,
1030 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
1031 ex_halbtc8821a1ant_special_packet_notify(btcoexist
,
1036 void exhalbtc92e_bt_info_notify(struct btc_coexist
*btcoexist
,
1037 u8
*tmp_buf
, u8 length
)
1039 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
1040 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
1041 if (!halbtc_is_bt_coexist_available(btcoexist
))
1043 btcoexist
->statistics
.cnt_bt_info_notify
++;
1045 if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8723BE
) {
1046 if (btcoexist
->board_info
.btdm_ant_num
== 2)
1047 ex92e_halbtc8723b2ant_bt_info_notify(btcoexist
,
1049 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
1050 ex_halbtc8723b1ant_bt_info_notify(btcoexist
, tmp_buf
,
1052 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8192EE
) {
1053 /* ex_halbtc8192e2ant_bt_info_notify(btcoexist,
1054 tmp_buf, length); */
1055 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8821AE
) {
1056 if (btcoexist
->board_info
.btdm_ant_num
== 2)
1057 ex_halbtc8821a2ant_bt_info_notify(btcoexist
,
1059 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
1060 ex_halbtc8821a1ant_bt_info_notify(btcoexist
,
1065 void exhalbtc92e_stack_operation_notify(struct btc_coexist
*btcoexist
, u8 type
)
1069 if (!halbtc_is_bt_coexist_available(btcoexist
))
1071 btcoexist
->statistics
.cnt_stack_operation_notify
++;
1072 if (btcoexist
->manual_control
)
1075 if ((HCI_BT_OP_INQUIRY_START
== type
) ||
1076 (HCI_BT_OP_PAGING_START
== type
) ||
1077 (HCI_BT_OP_PAIRING_START
== type
))
1078 stack_op_type
= BTC_STACK_OP_INQ_PAGE_PAIR_START
;
1079 else if ((HCI_BT_OP_INQUIRY_FINISH
== type
) ||
1080 (HCI_BT_OP_PAGING_SUCCESS
== type
) ||
1081 (HCI_BT_OP_PAGING_UNSUCCESS
== type
) ||
1082 (HCI_BT_OP_PAIRING_FINISH
== type
))
1083 stack_op_type
= BTC_STACK_OP_INQ_PAGE_PAIR_FINISH
;
1085 stack_op_type
= BTC_STACK_OP_NONE
;
1088 void exhalbtc92e_halt_notify(struct btc_coexist
*btcoexist
)
1090 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
1091 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
1092 if (!halbtc_is_bt_coexist_available(btcoexist
))
1095 btcoexist
->binded
= false;
1097 if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8723BE
) {
1098 if (btcoexist
->board_info
.btdm_ant_num
== 2)
1099 ex92e_halbtc8723b2ant_halt_notify(btcoexist
);
1100 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
1101 ex_halbtc8723b1ant_halt_notify(btcoexist
);
1102 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8192EE
) {
1103 ex_halbtc8192e2ant_halt_notify(btcoexist
);
1104 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8821AE
) {
1105 if (btcoexist
->board_info
.btdm_ant_num
== 2)
1106 ex_halbtc8821a2ant_halt_notify(btcoexist
);
1107 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
1108 ex_halbtc8821a1ant_halt_notify(btcoexist
);
1112 void exhalbtc92e_pnp_notify(struct btc_coexist
*btcoexist
, u8 pnp_state
)
1114 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
1115 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
1117 if (!halbtc_is_bt_coexist_available(btcoexist
))
1120 if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8723BE
) {
1121 if (btcoexist
->board_info
.btdm_ant_num
== 1)
1122 ex_halbtc8723b1ant_pnp_notify(btcoexist
, pnp_state
);
1126 void exhalbtc_coex_dm_switch(struct btc_coexist
*btcoexist
)
1128 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
1129 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
1130 if (!halbtc_is_bt_coexist_available(btcoexist
))
1132 btcoexist
->statistics
.cnt_coex_dm_switch
++;
1134 if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8723BE
) {
1135 if (btcoexist
->board_info
.btdm_ant_num
== 1) {
1136 btcoexist
->stop_coex_dm
= true;
1137 ex_halbtc8723b1ant_coex_dm_reset(btcoexist
);
1138 exhalbtc92e_set_ant_num(BT_COEX_ANT_TYPE_DETECTED
, 2);
1139 ex92e_halbtc8723b2ant_init_hwconfig(btcoexist
);
1140 ex92e_halbtc8723b2ant_init_coex_dm(btcoexist
);
1141 btcoexist
->stop_coex_dm
= false;
1146 void exhalbtc92e_periodical(struct btc_coexist
*btcoexist
)
1148 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
1149 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
1150 if (!halbtc_is_bt_coexist_available(btcoexist
))
1152 btcoexist
->statistics
.cnt_periodical
++;
1154 if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8723BE
) {
1155 if (btcoexist
->board_info
.btdm_ant_num
== 2)
1156 ex92e_halbtc8723b2ant_periodical(btcoexist
);
1157 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
1158 ex_halbtc8723b1ant_periodical(btcoexist
);
1159 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8192EE
) {
1160 ex_halbtc8192e2ant_periodical(btcoexist
);
1161 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8821AE
) {
1162 if (btcoexist
->board_info
.btdm_ant_num
== 2)
1163 ex_halbtc8821a2ant_periodical(btcoexist
);
1164 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
1165 if (!halbtc_under_ips(btcoexist
))
1166 ex_halbtc8821a1ant_periodical(btcoexist
);
1170 void exhalbtc92e_dbg_control(struct btc_coexist
*btcoexist
,
1171 u8 code
, u8 len
, u8
*data
)
1173 if (!halbtc_is_bt_coexist_available(btcoexist
))
1175 btcoexist
->statistics
.cnt_dbg_ctrl
++;
1178 void exhalbtc92e_stack_update_profile_info(void)
1182 void exhalbtc92e_update_min_bt_rssi(char bt_rssi
)
1184 struct btc_coexist
*btcoexist
= &gl92e_bt_coexist
;
1186 if (!halbtc_is_bt_coexist_available(btcoexist
))
1189 btcoexist
->stack_info
.min_bt_rssi
= bt_rssi
;
1193 void exhalbtc92e_set_hci_version(u16 hci_version
)
1195 struct btc_coexist
*btcoexist
= &gl92e_bt_coexist
;
1197 if (!halbtc_is_bt_coexist_available(btcoexist
))
1200 btcoexist
->stack_info
.hci_version
= hci_version
;
1203 void exhalbtc92e_set_bt_patch_version(u16 bt_hci_version
, u16 bt_patch_version
)
1205 struct btc_coexist
*btcoexist
= &gl92e_bt_coexist
;
1207 if (!halbtc_is_bt_coexist_available(btcoexist
))
1210 btcoexist
->bt_info
.bt_real_fw_ver
= bt_patch_version
;
1211 btcoexist
->bt_info
.bt_hci_ver
= bt_hci_version
;
1214 void exhalbtc92e_set_bt_exist(bool bt_exist
)
1216 gl92e_bt_coexist
.board_info
.bt_exist
= bt_exist
;
1219 void exhalbtc92e_set_chip_type(u8 chip_type
)
1221 switch (chip_type
) {
1227 gl92e_bt_coexist
.board_info
.bt_chip_type
= BTC_CHIP_UNDEF
;
1230 gl92e_bt_coexist
.board_info
.bt_chip_type
= BTC_CHIP_CSR_BC4
;
1233 gl92e_bt_coexist
.board_info
.bt_chip_type
= BTC_CHIP_CSR_BC8
;
1236 gl92e_bt_coexist
.board_info
.bt_chip_type
= BTC_CHIP_RTL8723A
;
1239 gl92e_bt_coexist
.board_info
.bt_chip_type
= BTC_CHIP_RTL8821
;
1242 gl92e_bt_coexist
.board_info
.bt_chip_type
= BTC_CHIP_RTL8723B
;
1247 void exhalbtc92e_set_ant_num(u8 type
, u8 ant_num
)
1249 if (BT_COEX_ANT_TYPE_PG
== type
) {
1250 gl92e_bt_coexist
.board_info
.pg_ant_num
= ant_num
;
1251 gl92e_bt_coexist
.board_info
.btdm_ant_num
= ant_num
;
1252 /* The antenna position:
1253 * Main (default) or Aux for pgAntNum = 2 && btdmAntNum = 1.
1254 * The antenna position should be determined by
1255 * auto-detect mechanism.
1256 * The following is assumed to main,
1257 * and those must be modified
1258 * if y auto-detect mechanism is ready
1260 if ((gl92e_bt_coexist
.board_info
.pg_ant_num
== 2) &&
1261 (gl92e_bt_coexist
.board_info
.btdm_ant_num
== 1))
1262 gl92e_bt_coexist
.board_info
.btdm_ant_pos
=
1263 BTC_ANTENNA_AT_MAIN_PORT
;
1265 gl92e_bt_coexist
.board_info
.btdm_ant_pos
=
1266 BTC_ANTENNA_AT_MAIN_PORT
;
1267 } else if (BT_COEX_ANT_TYPE_ANTDIV
== type
) {
1268 gl92e_bt_coexist
.board_info
.btdm_ant_num
= ant_num
;
1269 gl92e_bt_coexist
.board_info
.btdm_ant_pos
=
1270 BTC_ANTENNA_AT_MAIN_PORT
;
1271 } else if (BT_COEX_ANT_TYPE_DETECTED
== type
) {
1272 gl92e_bt_coexist
.board_info
.btdm_ant_num
= ant_num
;
1273 gl92e_bt_coexist
.board_info
.btdm_ant_pos
=
1274 BTC_ANTENNA_AT_MAIN_PORT
;
1278 void exhalbtc92e_display_bt_coex_info(struct btc_coexist
*btcoexist
)
1280 struct rtl_priv
*rtlpriv
= btcoexist
->adapter
;
1281 struct rtl_hal
*rtlhal
= rtl_hal(rtlpriv
);
1283 if (!halbtc_is_bt_coexist_available(btcoexist
))
1286 if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8723BE
) {
1287 if (btcoexist
->board_info
.btdm_ant_num
== 2)
1288 ex_halbtc8723b2ant92e_display_coex_info(btcoexist
);
1289 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
1290 ex_halbtc8723b1ant_display_coex_info(btcoexist
);
1291 } else if (rtlhal
->hw_type
== HARDWARE_TYPE_RTL8821AE
) {
1292 if (btcoexist
->board_info
.btdm_ant_num
== 2)
1293 ex_halbtc8821a2ant_display_coex_info(btcoexist
);
1294 else if (btcoexist
->board_info
.btdm_ant_num
== 1)
1295 ex_halbtc8821a1ant_display_coex_info(btcoexist
);