1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
4 * Copyright(c) 2009-2012 Realtek Corporation.
7 * wlanfae <wlanfae@realtek.com>
8 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
11 * Larry Finger <Larry.Finger@lwfinger.net>
13 *****************************************************************************/
14 #ifndef __HALBTC_OUT_SRC_H__
15 #define __HALBTC_OUT_SRC_H__
19 #define BTC_COEX_OFFLOAD 0
21 #define NORMAL_EXEC false
22 #define FORCE_EXEC true
24 #define BTC_RF_OFF 0x0
27 #define BTC_RF_A RF90_PATH_A
28 #define BTC_RF_B RF90_PATH_B
29 #define BTC_RF_C RF90_PATH_C
30 #define BTC_RF_D RF90_PATH_D
32 #define BTC_SMSP SINGLEMAC_SINGLEPHY
33 #define BTC_DMDP DUALMAC_DUALPHY
34 #define BTC_DMSP DUALMAC_SINGLEPHY
35 #define BTC_MP_UNKNOWN 0xff
40 #define BT_TMP_BUF_SIZE 100
42 #define BT_COEX_ANT_TYPE_PG 0
43 #define BT_COEX_ANT_TYPE_ANTDIV 1
44 #define BT_COEX_ANT_TYPE_DETECTED 2
46 #define BTC_MIMO_PS_STATIC 0
47 #define BTC_MIMO_PS_DYNAMIC 1
49 #define BTC_RATE_DISABLE 0
50 #define BTC_RATE_ENABLE 1
52 /* single Antenna definition */
53 #define BTC_ANT_PATH_WIFI 0
54 #define BTC_ANT_PATH_BT 1
55 #define BTC_ANT_PATH_PTA 2
56 #define BTC_ANT_PATH_WIFI5G 3
57 #define BTC_ANT_PATH_AUTO 4
58 /* dual Antenna definition */
59 #define BTC_ANT_WIFI_AT_MAIN 0
60 #define BTC_ANT_WIFI_AT_AUX 1
61 #define BTC_ANT_WIFI_AT_DIVERSITY 2
62 /* coupler Antenna definition */
63 #define BTC_ANT_WIFI_AT_CPL_MAIN 0
64 #define BTC_ANT_WIFI_AT_CPL_AUX 1
66 enum btc_bt_reg_type {
69 BTC_BT_REG_BLUEWIZE = 2,
70 BTC_BT_REG_VENDOR = 3,
75 enum btc_chip_interface {
88 BTC_CHIP_RTL8723A = 3,
90 BTC_CHIP_RTL8723B = 5,
95 BTC_MSG_INTERFACE = 0x0,
96 BTC_MSG_ALGORITHM = 0x1,
100 /* following is for BTC_MSG_INTERFACE */
101 #define INTF_INIT BIT0
102 #define INTF_NOTIFY BIT2
104 /* following is for BTC_ALGORITHM */
105 #define ALGO_BT_RSSI_STATE BIT0
106 #define ALGO_WIFI_RSSI_STATE BIT1
107 #define ALGO_BT_MONITOR BIT2
108 #define ALGO_TRACE BIT3
109 #define ALGO_TRACE_FW BIT4
110 #define ALGO_TRACE_FW_DETAIL BIT5
111 #define ALGO_TRACE_FW_EXEC BIT6
112 #define ALGO_TRACE_SW BIT7
113 #define ALGO_TRACE_SW_DETAIL BIT8
114 #define ALGO_TRACE_SW_EXEC BIT9
116 /* following is for wifi link status */
117 #define WIFI_STA_CONNECTED BIT0
118 #define WIFI_AP_CONNECTED BIT1
119 #define WIFI_HS_CONNECTED BIT2
120 #define WIFI_P2P_GO_CONNECTED BIT3
121 #define WIFI_P2P_GC_CONNECTED BIT4
123 #define BTC_RSSI_HIGH(_rssi_) \
124 ((_rssi_ == BTC_RSSI_STATE_HIGH || \
125 _rssi_ == BTC_RSSI_STATE_STAY_HIGH) ? true : false)
126 #define BTC_RSSI_MEDIUM(_rssi_) \
127 ((_rssi_ == BTC_RSSI_STATE_MEDIUM || \
128 _rssi_ == BTC_RSSI_STATE_STAY_MEDIUM) ? true : false)
129 #define BTC_RSSI_LOW(_rssi_) \
130 ((_rssi_ == BTC_RSSI_STATE_LOW || \
131 _rssi_ == BTC_RSSI_STATE_STAY_LOW) ? true : false)
133 enum btc_power_save_type {
134 BTC_PS_WIFI_NATIVE = 0,
140 struct btc_board_info {
141 /* The following is some board information */
143 u8 pg_ant_num; /* pg ant number */
144 u8 btdm_ant_num; /* ant number for btdm */
145 u8 btdm_ant_num_by_ant_det;
147 u8 single_ant_path; /* current used for 8723b only, 1=>s0, 0=>s1 */
149 bool btdm_ant_det_finish;
155 enum btc_dbg_opcode {
156 BTC_DBG_SET_COEX_NORMAL = 0x0,
157 BTC_DBG_SET_COEX_WIFI_ONLY = 0x1,
158 BTC_DBG_SET_COEX_BT_ONLY = 0x2,
162 enum btc_rssi_state {
163 BTC_RSSI_STATE_HIGH = 0x0,
164 BTC_RSSI_STATE_MEDIUM = 0x1,
165 BTC_RSSI_STATE_LOW = 0x2,
166 BTC_RSSI_STATE_STAY_HIGH = 0x3,
167 BTC_RSSI_STATE_STAY_MEDIUM = 0x4,
168 BTC_RSSI_STATE_STAY_LOW = 0x5,
173 BTC_ROLE_STATION = 0x0,
176 BTC_ROLE_HS_MODE = 0x3,
180 enum btc_wireless_freq {
186 enum btc_wifi_bw_mode {
187 BTC_WIFI_BW_LEGACY = 0x0,
188 BTC_WIFI_BW_HT20 = 0x1,
189 BTC_WIFI_BW_HT40 = 0x2,
190 BTC_WIFI_BW_HT80 = 0x3,
194 enum btc_wifi_traffic_dir {
195 BTC_WIFI_TRAFFIC_TX = 0x0,
196 BTC_WIFI_TRAFFIC_RX = 0x1,
201 BTC_WIFI_PNP_WAKE_UP = 0x0,
202 BTC_WIFI_PNP_SLEEP = 0x1,
203 BTC_WIFI_PNP_SLEEP_KEEP_ANT = 0x2,
208 BTC_IOT_PEER_UNKNOWN = 0,
209 BTC_IOT_PEER_REALTEK = 1,
210 BTC_IOT_PEER_REALTEK_92SE = 2,
211 BTC_IOT_PEER_BROADCOM = 3,
212 BTC_IOT_PEER_RALINK = 4,
213 BTC_IOT_PEER_ATHEROS = 5,
214 BTC_IOT_PEER_CISCO = 6,
215 BTC_IOT_PEER_MERU = 7,
216 BTC_IOT_PEER_MARVELL = 8,
217 BTC_IOT_PEER_REALTEK_SOFTAP = 9,
218 BTC_IOT_PEER_SELF_SOFTAP = 10, /* Self is SoftAP */
219 BTC_IOT_PEER_AIRGO = 11,
220 BTC_IOT_PEER_REALTEK_JAGUAR_BCUTAP = 12,
221 BTC_IOT_PEER_REALTEK_JAGUAR_CCUTAP = 13,
225 /* for 8723b-d cut large current issue */
226 enum bt_wifi_coex_state {
229 BTC_WIFI_STAT_NORMAL_OFF,
230 BTC_WIFI_STAT_MP_OFF,
231 BTC_WIFI_STAT_NORMAL,
232 BTC_WIFI_STAT_ANT_DIV,
247 BTC_GET_BL_HS_OPERATION,
248 BTC_GET_BL_HS_CONNECTING,
249 BTC_GET_BL_WIFI_CONNECTED,
250 BTC_GET_BL_WIFI_BUSY,
251 BTC_GET_BL_WIFI_SCAN,
252 BTC_GET_BL_WIFI_LINK,
253 BTC_GET_BL_WIFI_DHCP,
254 BTC_GET_BL_WIFI_SOFTAP_IDLE,
255 BTC_GET_BL_WIFI_SOFTAP_LINKING,
256 BTC_GET_BL_WIFI_IN_EARLY_SUSPEND,
257 BTC_GET_BL_WIFI_ROAM,
258 BTC_GET_BL_WIFI_4_WAY_PROGRESS,
259 BTC_GET_BL_WIFI_UNDER_5G,
260 BTC_GET_BL_WIFI_AP_MODE_ENABLE,
261 BTC_GET_BL_WIFI_ENABLE_ENCRYPTION,
262 BTC_GET_BL_WIFI_UNDER_B_MODE,
263 BTC_GET_BL_EXT_SWITCH,
264 BTC_GET_BL_WIFI_IS_IN_MP_MODE,
265 BTC_GET_BL_IS_ASUS_8723B,
267 BTC_GET_BL_RF4CE_CONNECTED,
270 BTC_GET_S4_WIFI_RSSI,
275 BTC_GET_U4_WIFI_TRAFFIC_DIRECTION,
276 BTC_GET_U4_WIFI_FW_VER,
277 BTC_GET_U4_WIFI_LINK_STATUS,
278 BTC_GET_U4_BT_PATCH_VER,
280 BTC_GET_U4_SUPPORTED_VERSION,
281 BTC_GET_U4_SUPPORTED_FEATURE,
282 BTC_GET_U4_WIFI_IQK_TOTAL,
283 BTC_GET_U4_WIFI_IQK_OK,
284 BTC_GET_U4_WIFI_IQK_FAIL,
287 BTC_GET_U1_WIFI_DOT11_CHNL,
288 BTC_GET_U1_WIFI_CENTRAL_CHNL,
289 BTC_GET_U1_WIFI_HS_CHNL,
290 BTC_GET_U1_MAC_PHY_MODE,
297 BTC_GET_BL_BT_SCO_BUSY,
300 BTC_GET_DRIVER_TEST_CFG,
312 BTC_SET_BL_BT_DISABLE,
313 BTC_SET_BL_BT_ENABLE_DISABLE_CHANGE,
314 BTC_SET_BL_BT_TRAFFIC_BUSY,
315 BTC_SET_BL_BT_LIMITED_DIG,
316 BTC_SET_BL_FORCE_TO_ROAM,
317 BTC_SET_BL_TO_REJ_AP_AGG_PKT,
318 BTC_SET_BL_BT_CTRL_AGG_SIZE,
319 BTC_SET_BL_INC_SCAN_DEV_NUM,
320 BTC_SET_BL_BT_TX_RX_MASK,
321 BTC_SET_BL_MIRACAST_PLUS_BT,
324 BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON,
325 BTC_SET_UI_SCAN_SIG_COMPENSATION,
326 BTC_SET_U1_AGG_BUF_SIZE,
328 /* type trigger some action */
329 BTC_SET_ACT_GET_BT_RSSI,
330 BTC_SET_ACT_AGGREGATE_CTRL,
331 BTC_SET_ACT_ANTPOSREGRISTRY_CTRL,
333 /********* for 1Ant **********/
335 BTC_SET_BL_BT_SCO_BUSY,
337 BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE,
341 BTC_SET_U1_1ANT_RPWM,
342 /* type trigger some action */
343 BTC_SET_ACT_LEAVE_LPS,
344 BTC_SET_ACT_ENTER_LPS,
345 BTC_SET_ACT_NORMAL_LPS,
346 BTC_SET_ACT_INC_FORCE_EXEC_PWR_CMD_CNT,
347 BTC_SET_ACT_DISABLE_LOW_POWER,
348 BTC_SET_ACT_UPDATE_RAMASK,
349 BTC_SET_ACT_SEND_MIMO_PS,
350 /* BT Coex related */
351 BTC_SET_ACT_CTRL_BT_INFO,
352 BTC_SET_ACT_CTRL_BT_COEX,
353 BTC_SET_ACT_CTRL_8723B_ANT,
354 /***************************/
358 enum btc_dbg_disp_type {
359 BTC_DBG_DISP_COEX_STATISTICS = 0x0,
360 BTC_DBG_DISP_BT_LINK_INFO = 0x1,
361 BTC_DBG_DISP_BT_FW_VER = 0x2,
362 BTC_DBG_DISP_FW_PWR_MODE_CMD = 0x3,
363 BTC_DBG_DISP_WIFI_STATUS = 0x04,
367 enum btc_notify_type_ips {
373 enum btc_notify_type_lps {
374 BTC_LPS_DISABLE = 0x0,
375 BTC_LPS_ENABLE = 0x1,
379 enum btc_notify_type_scan {
380 BTC_SCAN_FINISH = 0x0,
381 BTC_SCAN_START = 0x1,
382 BTC_SCAN_START_2G = 0x2,
386 enum btc_notify_type_switchband {
387 BTC_NOT_SWITCH = 0x0,
388 BTC_SWITCH_TO_24G = 0x1,
389 BTC_SWITCH_TO_5G = 0x2,
390 BTC_SWITCH_TO_24G_NOFORSCAN = 0x3,
394 enum btc_notify_type_associate {
395 BTC_ASSOCIATE_FINISH = 0x0,
396 BTC_ASSOCIATE_START = 0x1,
397 BTC_ASSOCIATE_5G_FINISH = 0x2,
398 BTC_ASSOCIATE_5G_START = 0x3,
402 enum btc_notify_type_media_status {
403 BTC_MEDIA_DISCONNECT = 0x0,
404 BTC_MEDIA_CONNECT = 0x1,
408 enum btc_notify_type_special_packet {
409 BTC_PACKET_UNKNOWN = 0x0,
410 BTC_PACKET_DHCP = 0x1,
411 BTC_PACKET_ARP = 0x2,
412 BTC_PACKET_EAPOL = 0x3,
416 enum hci_ext_bt_operation {
417 HCI_BT_OP_NONE = 0x0,
418 HCI_BT_OP_INQUIRY_START = 0x1,
419 HCI_BT_OP_INQUIRY_FINISH = 0x2,
420 HCI_BT_OP_PAGING_START = 0x3,
421 HCI_BT_OP_PAGING_SUCCESS = 0x4,
422 HCI_BT_OP_PAGING_UNSUCCESS = 0x5,
423 HCI_BT_OP_PAIRING_START = 0x6,
424 HCI_BT_OP_PAIRING_FINISH = 0x7,
425 HCI_BT_OP_BT_DEV_ENABLE = 0x8,
426 HCI_BT_OP_BT_DEV_DISABLE = 0x9,
430 enum btc_notify_type_stack_operation {
431 BTC_STACK_OP_NONE = 0x0,
432 BTC_STACK_OP_INQ_PAGE_PAIR_START = 0x1,
433 BTC_STACK_OP_INQ_PAGE_PAIR_FINISH = 0x2,
437 typedef u8 (*bfp_btc_r1)(void *btc_context, u32 reg_addr);
439 typedef u16 (*bfp_btc_r2)(void *btc_context, u32 reg_addr);
441 typedef u32 (*bfp_btc_r4)(void *btc_context, u32 reg_addr);
443 typedef void (*bfp_btc_w1)(void *btc_context, u32 reg_addr, u32 data);
445 typedef void (*bfp_btc_w1_bit_mak)(void *btc_context, u32 reg_addr,
446 u32 bit_mask, u8 data1b);
448 typedef void (*bfp_btc_w2)(void *btc_context, u32 reg_addr, u16 data);
450 typedef void (*bfp_btc_w4)(void *btc_context, u32 reg_addr, u32 data);
452 typedef void (*bfp_btc_local_reg_w1)(void *btc_context, u32 reg_addr, u8 data);
453 typedef void (*bfp_btc_wr_1byte_bit_mask)(void *btc_context, u32 reg_addr,
454 u8 bit_mask, u8 data);
456 typedef void (*bfp_btc_set_bb_reg)(void *btc_context, u32 reg_addr,
457 u32 bit_mask, u32 data);
459 typedef u32 (*bfp_btc_get_bb_reg)(void *btc_context, u32 reg_addr,
462 typedef void (*bfp_btc_set_rf_reg)(void *btc_context, u8 rf_path, u32 reg_addr,
463 u32 bit_mask, u32 data);
465 typedef u32 (*bfp_btc_get_rf_reg)(void *btc_context, u8 rf_path,
466 u32 reg_addr, u32 bit_mask);
468 typedef void (*bfp_btc_fill_h2c)(void *btc_context, u8 element_id,
469 u32 cmd_len, u8 *cmd_buffer);
471 typedef bool (*bfp_btc_get)(void *btcoexist, u8 get_type, void *out_buf);
473 typedef bool (*bfp_btc_set)(void *btcoexist, u8 set_type, void *in_buf);
475 typedef u32 (*bfp_btc_get_bt_coex_supported_feature)(void *btcoexist);
477 typedef u32 (*bfp_btc_get_bt_coex_supported_version)(void *btcoexist);
479 typedef u32 (*bfp_btc_get_bt_phydm_version)(void *btcoexist);
481 typedef void (*bfp_btc_phydm_modify_ra_pcr_threshold)(void *btcoexist,
482 u8 ra_offset_direction,
483 u8 ra_threshold_offset);
485 typedef u32 (*bfp_btc_phydm_query_phy_counter)(void *btcoexist,
486 const char *info_type);
488 typedef u8 (*bfp_btc_get_ant_det_val_from_bt)(void *btcoexist);
490 typedef u8 (*bfp_btc_get_ble_scan_type_from_bt)(void *btcoexist);
492 typedef u32 (*bfp_btc_get_ble_scan_para_from_bt)(void *btcoexist, u8 scan_type);
494 typedef bool (*bfp_btc_get_bt_afh_map_from_bt)(void *btcoexist, u8 map_type,
497 typedef void (*bfp_btc_set_bt_reg)(void *btc_context, u8 reg_type, u32 offset,
499 typedef u32 (*bfp_btc_get_bt_reg)(void *btc_context, u8 reg_type, u32 offset);
501 typedef void (*bfp_btc_disp_dbg_msg)(void *btcoexist, u8 disp_type,
506 u8 rssi_adjust_for_agc_table_on;
507 u8 rssi_adjust_for_1ant_coex_type;
508 bool pre_bt_ctrl_agg_buf_size;
513 bool pre_reject_agg_pkt;
515 bool bt_ctrl_buf_size;
516 bool increase_scan_dev_num;
517 bool miracast_plus_bt;
518 bool bt_ctrl_agg_buf_size;
525 bool bt_disable_low_pwr;
527 /* the following is for 1Ant solution */
529 bool bt_pwr_save_mode;
532 u8 force_exec_pwr_cmd_cnt;
540 u32 bt_supported_feature;
541 u32 bt_supported_version;
544 u32 bt_ble_scan_para;
547 struct btc_stack_info {
548 bool profile_notified;
549 u16 hci_version; /* stack hci version */
558 bool unknown_acl_exist;
562 struct btc_statistics {
564 u32 cnt_init_hw_config;
565 u32 cnt_init_coex_dm;
569 u32 cnt_connect_notify;
570 u32 cnt_media_status_notify;
571 u32 cnt_special_packet_notify;
572 u32 cnt_bt_info_notify;
574 u32 cnt_coex_dm_switch;
575 u32 cnt_stack_operation_notify;
577 u32 cnt_pre_load_firmware;
581 struct btc_bt_link_info {
583 bool bt_hi_pri_link_exist;
596 enum btc_antenna_pos {
597 BTC_ANTENNA_AT_MAIN_PORT = 0x1,
598 BTC_ANTENNA_AT_AUX_PORT = 0x2,
601 enum btc_mp_h2c_op_code {
602 BT_OP_GET_BT_VERSION = 0,
603 BT_OP_WRITE_REG_ADDR = 12,
604 BT_OP_WRITE_REG_VALUE = 13,
606 BT_OP_GET_AFH_MAP_L = 30,
607 BT_OP_GET_AFH_MAP_M = 31,
608 BT_OP_GET_AFH_MAP_H = 32,
609 BT_OP_GET_BT_COEX_SUPPORTED_FEATURE = 42,
610 BT_OP_GET_BT_COEX_SUPPORTED_VERSION = 43,
611 BT_OP_GET_BT_ANT_DET_VAL = 44,
612 BT_OP_GET_BT_BLE_SCAN_PARA = 45,
613 BT_OP_GET_BT_BLE_SCAN_TYPE = 46,
617 enum btc_mp_h2c_req_num {
619 BT_SEQ_DONT_CARE = 0,
620 BT_SEQ_GET_BT_VERSION = 0xE,
621 BT_SEQ_GET_AFH_MAP_L = 0x5,
622 BT_SEQ_GET_AFH_MAP_M = 0x6,
623 BT_SEQ_GET_AFH_MAP_H = 0x9,
624 BT_SEQ_GET_BT_COEX_SUPPORTED_FEATURE = 0x7,
625 BT_SEQ_GET_BT_COEX_SUPPORTED_VERSION = 0x8,
626 BT_SEQ_GET_BT_ANT_DET_VAL = 0x2,
627 BT_SEQ_GET_BT_BLE_SCAN_PARA = 0x3,
628 BT_SEQ_GET_BT_BLE_SCAN_TYPE = 0x4,
632 /* make sure only one adapter can bind the data context */
634 /* default adapter */
636 struct btc_board_info board_info;
637 /* some bt info referenced by non-bt module */
638 struct btc_bt_info bt_info;
639 struct btc_stack_info stack_info;
640 enum btc_chip_interface chip_interface;
641 struct btc_bt_link_info bt_link_info;
643 /* boolean variables to replace BT_AUTO_REPORT_ONLY_XXXXY_ZANT
644 * configuration parameters
646 bool auto_report_1ant;
647 bool auto_report_2ant;
653 struct btc_statistics statistics;
656 struct completion bt_mp_comp;
658 /* function pointers - io related */
659 bfp_btc_r1 btc_read_1byte;
660 bfp_btc_w1 btc_write_1byte;
661 bfp_btc_w1_bit_mak btc_write_1byte_bitmask;
662 bfp_btc_r2 btc_read_2byte;
663 bfp_btc_w2 btc_write_2byte;
664 bfp_btc_r4 btc_read_4byte;
665 bfp_btc_w4 btc_write_4byte;
666 bfp_btc_local_reg_w1 btc_write_local_reg_1byte;
668 bfp_btc_set_bb_reg btc_set_bb_reg;
669 bfp_btc_get_bb_reg btc_get_bb_reg;
671 bfp_btc_set_rf_reg btc_set_rf_reg;
672 bfp_btc_get_rf_reg btc_get_rf_reg;
674 bfp_btc_fill_h2c btc_fill_h2c;
676 bfp_btc_disp_dbg_msg btc_disp_dbg_msg;
681 bfp_btc_set_bt_reg btc_set_bt_reg;
682 bfp_btc_get_bt_reg btc_get_bt_reg;
684 bfp_btc_get_bt_coex_supported_feature btc_get_bt_coex_supported_feature;
685 bfp_btc_get_bt_coex_supported_version btc_get_bt_coex_supported_version;
686 bfp_btc_get_bt_phydm_version btc_get_bt_phydm_version;
687 bfp_btc_phydm_modify_ra_pcr_threshold btc_phydm_modify_ra_pcr_threshold;
688 bfp_btc_phydm_query_phy_counter btc_phydm_query_phy_counter;
689 bfp_btc_get_ant_det_val_from_bt btc_get_ant_det_val_from_bt;
690 bfp_btc_get_ble_scan_type_from_bt btc_get_ble_scan_type_from_bt;
691 bfp_btc_get_ble_scan_para_from_bt btc_get_ble_scan_para_from_bt;
692 bfp_btc_get_bt_afh_map_from_bt btc_get_bt_afh_map_from_bt;
696 bool halbtc_is_wifi_uplink(struct rtl_priv *adapter);
698 #define rtl_btc_coexist(rtlpriv) \
699 ((struct btc_coexist *)((rtlpriv)->btcoexist.btc_context))
700 #define rtl_btc_wifi_only(rtlpriv) \
701 ((struct wifi_only_cfg *)((rtlpriv)->btcoexist.wifi_only_context))
703 struct wifi_only_cfg;
705 bool exhalbtc_initlize_variables(struct rtl_priv *rtlpriv);
706 bool exhalbtc_initlize_variables_wifi_only(struct rtl_priv *rtlpriv);
707 bool exhalbtc_bind_bt_coex_withadapter(void *adapter);
708 void exhalbtc_power_on_setting(struct btc_coexist *btcoexist);
709 void exhalbtc_pre_load_firmware(struct btc_coexist *btcoexist);
710 void exhalbtc_init_hw_config(struct btc_coexist *btcoexist, bool wifi_only);
711 void exhalbtc_init_hw_config_wifi_only(struct wifi_only_cfg *wifionly_cfg);
712 void exhalbtc_init_coex_dm(struct btc_coexist *btcoexist);
713 void exhalbtc_ips_notify(struct btc_coexist *btcoexist, u8 type);
714 void exhalbtc_lps_notify(struct btc_coexist *btcoexist, u8 type);
715 void exhalbtc_scan_notify(struct btc_coexist *btcoexist, u8 type);
716 void exhalbtc_scan_notify_wifi_only(struct wifi_only_cfg *wifionly_cfg,
718 void exhalbtc_connect_notify(struct btc_coexist *btcoexist, u8 action);
719 void exhalbtc_mediastatus_notify(struct btc_coexist *btcoexist,
720 enum rt_media_status media_status);
721 void exhalbtc_special_packet_notify(struct btc_coexist *btcoexist, u8 pkt_type);
722 void exhalbtc_bt_info_notify(struct btc_coexist *btcoexist, u8 *tmp_buf,
724 void exhalbtc_rf_status_notify(struct btc_coexist *btcoexist, u8 type);
725 void exhalbtc_stack_operation_notify(struct btc_coexist *btcoexist, u8 type);
726 void exhalbtc_halt_notify(struct btc_coexist *btcoexist);
727 void exhalbtc_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state);
728 void exhalbtc_coex_dm_switch(struct btc_coexist *btcoexist);
729 void exhalbtc_periodical(struct btc_coexist *btcoexist);
730 void exhalbtc_dbg_control(struct btc_coexist *btcoexist, u8 code, u8 len,
732 void exhalbtc_antenna_detection(struct btc_coexist *btcoexist, u32 cent_freq,
733 u32 offset, u32 span, u32 seconds);
734 void exhalbtc_stack_update_profile_info(void);
735 void exhalbtc_set_hci_version(struct btc_coexist *btcoexist, u16 hci_version);
736 void exhalbtc_set_bt_patch_version(struct btc_coexist *btcoexist,
737 u16 bt_hci_version, u16 bt_patch_version);
738 void exhalbtc_update_min_bt_rssi(struct btc_coexist *btcoexist, s8 bt_rssi);
739 void exhalbtc_set_bt_exist(struct btc_coexist *btcoexist, bool bt_exist);
740 void exhalbtc_set_chip_type(struct btc_coexist *btcoexist, u8 chip_type);
741 void exhalbtc_set_ant_num(struct rtl_priv *rtlpriv, u8 type, u8 ant_num);
742 void exhalbtc_display_bt_coex_info(struct btc_coexist *btcoexist,
744 void exhalbtc_switch_band_notify(struct btc_coexist *btcoexist, u8 type);
745 void exhalbtc_switch_band_notify_wifi_only(struct wifi_only_cfg *wifionly_cfg,
747 void exhalbtc_signal_compensation(struct btc_coexist *btcoexist,
748 u8 *rssi_wifi, u8 *rssi_bt);
749 void exhalbtc_lps_leave(struct btc_coexist *btcoexist);
750 void exhalbtc_low_wifi_traffic_notify(struct btc_coexist *btcoexist);
751 void exhalbtc_set_single_ant_path(struct btc_coexist *btcoexist,
754 /* The following are used by wifi_only case */
755 enum wifionly_chip_interface {
756 WIFIONLY_INTF_UNKNOWN = 0,
757 WIFIONLY_INTF_PCI = 1,
758 WIFIONLY_INTF_USB = 2,
759 WIFIONLY_INTF_SDIO = 3,
763 enum wifionly_customer_id {
768 struct wifi_only_haldata {
776 struct wifi_only_cfg {
778 struct wifi_only_haldata haldata_info;
779 enum wifionly_chip_interface chip_interface;
783 void halwifionly_phy_set_bb_reg(struct wifi_only_cfg *wifi_conly_cfg,
784 u32 regaddr, u32 bitmask, u32 data)
786 struct rtl_priv *rtlpriv = (struct rtl_priv *)wifi_conly_cfg->adapter;
788 rtl_set_bbreg(rtlpriv->hw, regaddr, bitmask, data);