1 /******************************************************************************
3 * Copyright(c) 2009-2012 Realtek Corporation.
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
14 * The full GNU General Public License is included in this distribution in the
15 * file called LICENSE.
17 * Contact Information:
18 * wlanfae <wlanfae@realtek.com>
19 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20 * Hsinchu 300, Taiwan.
22 * Larry Finger <Larry.Finger@lwfinger.net>
24 *****************************************************************************/
25 #ifndef __HALBTC_OUT_SRC_H__
26 #define __HALBTC_OUT_SRC_H__
30 #define BTC_COEX_OFFLOAD 0
32 #define NORMAL_EXEC false
33 #define FORCE_EXEC true
35 #define BTC_RF_OFF 0x0
38 #define BTC_RF_A RF90_PATH_A
39 #define BTC_RF_B RF90_PATH_B
40 #define BTC_RF_C RF90_PATH_C
41 #define BTC_RF_D RF90_PATH_D
43 #define BTC_SMSP SINGLEMAC_SINGLEPHY
44 #define BTC_DMDP DUALMAC_DUALPHY
45 #define BTC_DMSP DUALMAC_SINGLEPHY
46 #define BTC_MP_UNKNOWN 0xff
51 #define BT_TMP_BUF_SIZE 100
53 #define BT_COEX_ANT_TYPE_PG 0
54 #define BT_COEX_ANT_TYPE_ANTDIV 1
55 #define BT_COEX_ANT_TYPE_DETECTED 2
57 #define BTC_MIMO_PS_STATIC 0
58 #define BTC_MIMO_PS_DYNAMIC 1
60 #define BTC_RATE_DISABLE 0
61 #define BTC_RATE_ENABLE 1
63 /* single Antenna definition */
64 #define BTC_ANT_PATH_WIFI 0
65 #define BTC_ANT_PATH_BT 1
66 #define BTC_ANT_PATH_PTA 2
67 #define BTC_ANT_PATH_WIFI5G 3
68 #define BTC_ANT_PATH_AUTO 4
69 /* dual Antenna definition */
70 #define BTC_ANT_WIFI_AT_MAIN 0
71 #define BTC_ANT_WIFI_AT_AUX 1
72 #define BTC_ANT_WIFI_AT_DIVERSITY 2
73 /* coupler Antenna definition */
74 #define BTC_ANT_WIFI_AT_CPL_MAIN 0
75 #define BTC_ANT_WIFI_AT_CPL_AUX 1
77 enum btc_bt_reg_type {
80 BTC_BT_REG_BLUEWIZE = 2,
81 BTC_BT_REG_VENDOR = 3,
86 enum btc_chip_interface {
99 BTC_CHIP_RTL8723A = 3,
100 BTC_CHIP_RTL8821 = 4,
101 BTC_CHIP_RTL8723B = 5,
106 BTC_MSG_INTERFACE = 0x0,
107 BTC_MSG_ALGORITHM = 0x1,
111 /* following is for BTC_MSG_INTERFACE */
112 #define INTF_INIT BIT0
113 #define INTF_NOTIFY BIT2
115 /* following is for BTC_ALGORITHM */
116 #define ALGO_BT_RSSI_STATE BIT0
117 #define ALGO_WIFI_RSSI_STATE BIT1
118 #define ALGO_BT_MONITOR BIT2
119 #define ALGO_TRACE BIT3
120 #define ALGO_TRACE_FW BIT4
121 #define ALGO_TRACE_FW_DETAIL BIT5
122 #define ALGO_TRACE_FW_EXEC BIT6
123 #define ALGO_TRACE_SW BIT7
124 #define ALGO_TRACE_SW_DETAIL BIT8
125 #define ALGO_TRACE_SW_EXEC BIT9
127 /* following is for wifi link status */
128 #define WIFI_STA_CONNECTED BIT0
129 #define WIFI_AP_CONNECTED BIT1
130 #define WIFI_HS_CONNECTED BIT2
131 #define WIFI_P2P_GO_CONNECTED BIT3
132 #define WIFI_P2P_GC_CONNECTED BIT4
134 #define BTC_RSSI_HIGH(_rssi_) \
135 ((_rssi_ == BTC_RSSI_STATE_HIGH || \
136 _rssi_ == BTC_RSSI_STATE_STAY_HIGH) ? true : false)
137 #define BTC_RSSI_MEDIUM(_rssi_) \
138 ((_rssi_ == BTC_RSSI_STATE_MEDIUM || \
139 _rssi_ == BTC_RSSI_STATE_STAY_MEDIUM) ? true : false)
140 #define BTC_RSSI_LOW(_rssi_) \
141 ((_rssi_ == BTC_RSSI_STATE_LOW || \
142 _rssi_ == BTC_RSSI_STATE_STAY_LOW) ? true : false)
144 enum btc_power_save_type {
145 BTC_PS_WIFI_NATIVE = 0,
151 struct btc_board_info {
152 /* The following is some board information */
154 u8 pg_ant_num; /* pg ant number */
155 u8 btdm_ant_num; /* ant number for btdm */
156 u8 btdm_ant_num_by_ant_det;
158 u8 single_ant_path; /* current used for 8723b only, 1=>s0, 0=>s1 */
160 bool btdm_ant_det_finish;
166 enum btc_dbg_opcode {
167 BTC_DBG_SET_COEX_NORMAL = 0x0,
168 BTC_DBG_SET_COEX_WIFI_ONLY = 0x1,
169 BTC_DBG_SET_COEX_BT_ONLY = 0x2,
173 enum btc_rssi_state {
174 BTC_RSSI_STATE_HIGH = 0x0,
175 BTC_RSSI_STATE_MEDIUM = 0x1,
176 BTC_RSSI_STATE_LOW = 0x2,
177 BTC_RSSI_STATE_STAY_HIGH = 0x3,
178 BTC_RSSI_STATE_STAY_MEDIUM = 0x4,
179 BTC_RSSI_STATE_STAY_LOW = 0x5,
184 BTC_ROLE_STATION = 0x0,
187 BTC_ROLE_HS_MODE = 0x3,
191 enum btc_wireless_freq {
197 enum btc_wifi_bw_mode {
198 BTC_WIFI_BW_LEGACY = 0x0,
199 BTC_WIFI_BW_HT20 = 0x1,
200 BTC_WIFI_BW_HT40 = 0x2,
201 BTC_WIFI_BW_HT80 = 0x3,
205 enum btc_wifi_traffic_dir {
206 BTC_WIFI_TRAFFIC_TX = 0x0,
207 BTC_WIFI_TRAFFIC_RX = 0x1,
212 BTC_WIFI_PNP_WAKE_UP = 0x0,
213 BTC_WIFI_PNP_SLEEP = 0x1,
214 BTC_WIFI_PNP_SLEEP_KEEP_ANT = 0x2,
219 BTC_IOT_PEER_UNKNOWN = 0,
220 BTC_IOT_PEER_REALTEK = 1,
221 BTC_IOT_PEER_REALTEK_92SE = 2,
222 BTC_IOT_PEER_BROADCOM = 3,
223 BTC_IOT_PEER_RALINK = 4,
224 BTC_IOT_PEER_ATHEROS = 5,
225 BTC_IOT_PEER_CISCO = 6,
226 BTC_IOT_PEER_MERU = 7,
227 BTC_IOT_PEER_MARVELL = 8,
228 BTC_IOT_PEER_REALTEK_SOFTAP = 9,
229 BTC_IOT_PEER_SELF_SOFTAP = 10, /* Self is SoftAP */
230 BTC_IOT_PEER_AIRGO = 11,
231 BTC_IOT_PEER_REALTEK_JAGUAR_BCUTAP = 12,
232 BTC_IOT_PEER_REALTEK_JAGUAR_CCUTAP = 13,
236 /* for 8723b-d cut large current issue */
237 enum bt_wifi_coex_state {
240 BTC_WIFI_STAT_NORMAL_OFF,
241 BTC_WIFI_STAT_MP_OFF,
242 BTC_WIFI_STAT_NORMAL,
243 BTC_WIFI_STAT_ANT_DIV,
258 BTC_GET_BL_HS_OPERATION,
259 BTC_GET_BL_HS_CONNECTING,
260 BTC_GET_BL_WIFI_CONNECTED,
261 BTC_GET_BL_WIFI_BUSY,
262 BTC_GET_BL_WIFI_SCAN,
263 BTC_GET_BL_WIFI_LINK,
264 BTC_GET_BL_WIFI_DHCP,
265 BTC_GET_BL_WIFI_SOFTAP_IDLE,
266 BTC_GET_BL_WIFI_SOFTAP_LINKING,
267 BTC_GET_BL_WIFI_IN_EARLY_SUSPEND,
268 BTC_GET_BL_WIFI_ROAM,
269 BTC_GET_BL_WIFI_4_WAY_PROGRESS,
270 BTC_GET_BL_WIFI_UNDER_5G,
271 BTC_GET_BL_WIFI_AP_MODE_ENABLE,
272 BTC_GET_BL_WIFI_ENABLE_ENCRYPTION,
273 BTC_GET_BL_WIFI_UNDER_B_MODE,
274 BTC_GET_BL_EXT_SWITCH,
275 BTC_GET_BL_WIFI_IS_IN_MP_MODE,
276 BTC_GET_BL_IS_ASUS_8723B,
278 BTC_GET_BL_RF4CE_CONNECTED,
281 BTC_GET_S4_WIFI_RSSI,
286 BTC_GET_U4_WIFI_TRAFFIC_DIRECTION,
287 BTC_GET_U4_WIFI_FW_VER,
288 BTC_GET_U4_WIFI_LINK_STATUS,
289 BTC_GET_U4_BT_PATCH_VER,
291 BTC_GET_U4_SUPPORTED_VERSION,
292 BTC_GET_U4_SUPPORTED_FEATURE,
293 BTC_GET_U4_WIFI_IQK_TOTAL,
294 BTC_GET_U4_WIFI_IQK_OK,
295 BTC_GET_U4_WIFI_IQK_FAIL,
298 BTC_GET_U1_WIFI_DOT11_CHNL,
299 BTC_GET_U1_WIFI_CENTRAL_CHNL,
300 BTC_GET_U1_WIFI_HS_CHNL,
301 BTC_GET_U1_MAC_PHY_MODE,
308 BTC_GET_BL_BT_SCO_BUSY,
311 BTC_GET_DRIVER_TEST_CFG,
323 BTC_SET_BL_BT_DISABLE,
324 BTC_SET_BL_BT_ENABLE_DISABLE_CHANGE,
325 BTC_SET_BL_BT_TRAFFIC_BUSY,
326 BTC_SET_BL_BT_LIMITED_DIG,
327 BTC_SET_BL_FORCE_TO_ROAM,
328 BTC_SET_BL_TO_REJ_AP_AGG_PKT,
329 BTC_SET_BL_BT_CTRL_AGG_SIZE,
330 BTC_SET_BL_INC_SCAN_DEV_NUM,
331 BTC_SET_BL_BT_TX_RX_MASK,
332 BTC_SET_BL_MIRACAST_PLUS_BT,
335 BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON,
336 BTC_SET_UI_SCAN_SIG_COMPENSATION,
337 BTC_SET_U1_AGG_BUF_SIZE,
339 /* type trigger some action */
340 BTC_SET_ACT_GET_BT_RSSI,
341 BTC_SET_ACT_AGGREGATE_CTRL,
342 BTC_SET_ACT_ANTPOSREGRISTRY_CTRL,
344 /********* for 1Ant **********/
346 BTC_SET_BL_BT_SCO_BUSY,
348 BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE,
352 BTC_SET_U1_1ANT_RPWM,
353 /* type trigger some action */
354 BTC_SET_ACT_LEAVE_LPS,
355 BTC_SET_ACT_ENTER_LPS,
356 BTC_SET_ACT_NORMAL_LPS,
357 BTC_SET_ACT_INC_FORCE_EXEC_PWR_CMD_CNT,
358 BTC_SET_ACT_DISABLE_LOW_POWER,
359 BTC_SET_ACT_UPDATE_RAMASK,
360 BTC_SET_ACT_SEND_MIMO_PS,
361 /* BT Coex related */
362 BTC_SET_ACT_CTRL_BT_INFO,
363 BTC_SET_ACT_CTRL_BT_COEX,
364 BTC_SET_ACT_CTRL_8723B_ANT,
365 /***************************/
369 enum btc_dbg_disp_type {
370 BTC_DBG_DISP_COEX_STATISTICS = 0x0,
371 BTC_DBG_DISP_BT_LINK_INFO = 0x1,
372 BTC_DBG_DISP_BT_FW_VER = 0x2,
373 BTC_DBG_DISP_FW_PWR_MODE_CMD = 0x3,
374 BTC_DBG_DISP_WIFI_STATUS = 0x04,
378 enum btc_notify_type_ips {
384 enum btc_notify_type_lps {
385 BTC_LPS_DISABLE = 0x0,
386 BTC_LPS_ENABLE = 0x1,
390 enum btc_notify_type_scan {
391 BTC_SCAN_FINISH = 0x0,
392 BTC_SCAN_START = 0x1,
393 BTC_SCAN_START_2G = 0x2,
397 enum btc_notify_type_switchband {
398 BTC_NOT_SWITCH = 0x0,
399 BTC_SWITCH_TO_24G = 0x1,
400 BTC_SWITCH_TO_5G = 0x2,
401 BTC_SWITCH_TO_24G_NOFORSCAN = 0x3,
405 enum btc_notify_type_associate {
406 BTC_ASSOCIATE_FINISH = 0x0,
407 BTC_ASSOCIATE_START = 0x1,
408 BTC_ASSOCIATE_5G_FINISH = 0x2,
409 BTC_ASSOCIATE_5G_START = 0x3,
413 enum btc_notify_type_media_status {
414 BTC_MEDIA_DISCONNECT = 0x0,
415 BTC_MEDIA_CONNECT = 0x1,
419 enum btc_notify_type_special_packet {
420 BTC_PACKET_UNKNOWN = 0x0,
421 BTC_PACKET_DHCP = 0x1,
422 BTC_PACKET_ARP = 0x2,
423 BTC_PACKET_EAPOL = 0x3,
427 enum hci_ext_bt_operation {
428 HCI_BT_OP_NONE = 0x0,
429 HCI_BT_OP_INQUIRY_START = 0x1,
430 HCI_BT_OP_INQUIRY_FINISH = 0x2,
431 HCI_BT_OP_PAGING_START = 0x3,
432 HCI_BT_OP_PAGING_SUCCESS = 0x4,
433 HCI_BT_OP_PAGING_UNSUCCESS = 0x5,
434 HCI_BT_OP_PAIRING_START = 0x6,
435 HCI_BT_OP_PAIRING_FINISH = 0x7,
436 HCI_BT_OP_BT_DEV_ENABLE = 0x8,
437 HCI_BT_OP_BT_DEV_DISABLE = 0x9,
441 enum btc_notify_type_stack_operation {
442 BTC_STACK_OP_NONE = 0x0,
443 BTC_STACK_OP_INQ_PAGE_PAIR_START = 0x1,
444 BTC_STACK_OP_INQ_PAGE_PAIR_FINISH = 0x2,
448 typedef u8 (*bfp_btc_r1)(void *btc_context, u32 reg_addr);
450 typedef u16 (*bfp_btc_r2)(void *btc_context, u32 reg_addr);
452 typedef u32 (*bfp_btc_r4)(void *btc_context, u32 reg_addr);
454 typedef void (*bfp_btc_w1)(void *btc_context, u32 reg_addr, u32 data);
456 typedef void (*bfp_btc_w1_bit_mak)(void *btc_context, u32 reg_addr,
457 u32 bit_mask, u8 data1b);
459 typedef void (*bfp_btc_w2)(void *btc_context, u32 reg_addr, u16 data);
461 typedef void (*bfp_btc_w4)(void *btc_context, u32 reg_addr, u32 data);
463 typedef void (*bfp_btc_local_reg_w1)(void *btc_context, u32 reg_addr, u8 data);
464 typedef void (*bfp_btc_wr_1byte_bit_mask)(void *btc_context, u32 reg_addr,
465 u8 bit_mask, u8 data);
467 typedef void (*bfp_btc_set_bb_reg)(void *btc_context, u32 reg_addr,
468 u32 bit_mask, u32 data);
470 typedef u32 (*bfp_btc_get_bb_reg)(void *btc_context, u32 reg_addr,
473 typedef void (*bfp_btc_set_rf_reg)(void *btc_context, u8 rf_path, u32 reg_addr,
474 u32 bit_mask, u32 data);
476 typedef u32 (*bfp_btc_get_rf_reg)(void *btc_context, u8 rf_path,
477 u32 reg_addr, u32 bit_mask);
479 typedef void (*bfp_btc_fill_h2c)(void *btc_context, u8 element_id,
480 u32 cmd_len, u8 *cmd_buffer);
482 typedef bool (*bfp_btc_get)(void *btcoexist, u8 get_type, void *out_buf);
484 typedef bool (*bfp_btc_set)(void *btcoexist, u8 set_type, void *in_buf);
486 typedef u32 (*bfp_btc_get_bt_coex_supported_feature)(void *btcoexist);
488 typedef u32 (*bfp_btc_get_bt_coex_supported_version)(void *btcoexist);
490 typedef u32 (*bfp_btc_get_bt_phydm_version)(void *btcoexist);
492 typedef void (*bfp_btc_phydm_modify_ra_pcr_threshold)(void *btcoexist,
493 u8 ra_offset_direction,
494 u8 ra_threshold_offset);
496 typedef u32 (*bfp_btc_phydm_query_phy_counter)(void *btcoexist,
497 const char *info_type);
499 typedef u8 (*bfp_btc_get_ant_det_val_from_bt)(void *btcoexist);
501 typedef u8 (*bfp_btc_get_ble_scan_type_from_bt)(void *btcoexist);
503 typedef u32 (*bfp_btc_get_ble_scan_para_from_bt)(void *btcoexist, u8 scan_type);
505 typedef bool (*bfp_btc_get_bt_afh_map_from_bt)(void *btcoexist, u8 map_type,
508 typedef void (*bfp_btc_set_bt_reg)(void *btc_context, u8 reg_type, u32 offset,
510 typedef u32 (*bfp_btc_get_bt_reg)(void *btc_context, u8 reg_type, u32 offset);
512 typedef void (*bfp_btc_disp_dbg_msg)(void *btcoexist, u8 disp_type,
517 u8 rssi_adjust_for_agc_table_on;
518 u8 rssi_adjust_for_1ant_coex_type;
519 bool pre_bt_ctrl_agg_buf_size;
524 bool pre_reject_agg_pkt;
526 bool bt_ctrl_buf_size;
527 bool increase_scan_dev_num;
528 bool miracast_plus_bt;
529 bool bt_ctrl_agg_buf_size;
536 bool bt_disable_low_pwr;
538 /* the following is for 1Ant solution */
540 bool bt_pwr_save_mode;
543 u8 force_exec_pwr_cmd_cnt;
551 u32 bt_supported_feature;
552 u32 bt_supported_version;
555 u32 bt_ble_scan_para;
558 struct btc_stack_info {
559 bool profile_notified;
560 u16 hci_version; /* stack hci version */
569 bool unknown_acl_exist;
573 struct btc_statistics {
575 u32 cnt_init_hw_config;
576 u32 cnt_init_coex_dm;
580 u32 cnt_connect_notify;
581 u32 cnt_media_status_notify;
582 u32 cnt_special_packet_notify;
583 u32 cnt_bt_info_notify;
585 u32 cnt_coex_dm_switch;
586 u32 cnt_stack_operation_notify;
588 u32 cnt_pre_load_firmware;
592 struct btc_bt_link_info {
594 bool bt_hi_pri_link_exist;
607 enum btc_antenna_pos {
608 BTC_ANTENNA_AT_MAIN_PORT = 0x1,
609 BTC_ANTENNA_AT_AUX_PORT = 0x2,
612 enum btc_mp_h2c_op_code {
613 BT_OP_GET_BT_VERSION = 0,
614 BT_OP_WRITE_REG_ADDR = 12,
615 BT_OP_WRITE_REG_VALUE = 13,
617 BT_OP_GET_AFH_MAP_L = 30,
618 BT_OP_GET_AFH_MAP_M = 31,
619 BT_OP_GET_AFH_MAP_H = 32,
620 BT_OP_GET_BT_COEX_SUPPORTED_FEATURE = 42,
621 BT_OP_GET_BT_COEX_SUPPORTED_VERSION = 43,
622 BT_OP_GET_BT_ANT_DET_VAL = 44,
623 BT_OP_GET_BT_BLE_SCAN_PARA = 45,
624 BT_OP_GET_BT_BLE_SCAN_TYPE = 46,
628 enum btc_mp_h2c_req_num {
630 BT_SEQ_DONT_CARE = 0,
631 BT_SEQ_GET_BT_VERSION = 0xE,
632 BT_SEQ_GET_AFH_MAP_L = 0x5,
633 BT_SEQ_GET_AFH_MAP_M = 0x6,
634 BT_SEQ_GET_AFH_MAP_H = 0x9,
635 BT_SEQ_GET_BT_COEX_SUPPORTED_FEATURE = 0x7,
636 BT_SEQ_GET_BT_COEX_SUPPORTED_VERSION = 0x8,
637 BT_SEQ_GET_BT_ANT_DET_VAL = 0x2,
638 BT_SEQ_GET_BT_BLE_SCAN_PARA = 0x3,
639 BT_SEQ_GET_BT_BLE_SCAN_TYPE = 0x4,
643 /* make sure only one adapter can bind the data context */
645 /* default adapter */
647 struct btc_board_info board_info;
648 /* some bt info referenced by non-bt module */
649 struct btc_bt_info bt_info;
650 struct btc_stack_info stack_info;
651 enum btc_chip_interface chip_interface;
652 struct btc_bt_link_info bt_link_info;
654 /* boolean variables to replace BT_AUTO_REPORT_ONLY_XXXXY_ZANT
655 * configuration parameters
657 bool auto_report_1ant;
658 bool auto_report_2ant;
664 struct btc_statistics statistics;
667 struct completion bt_mp_comp;
669 /* function pointers - io related */
670 bfp_btc_r1 btc_read_1byte;
671 bfp_btc_w1 btc_write_1byte;
672 bfp_btc_w1_bit_mak btc_write_1byte_bitmask;
673 bfp_btc_r2 btc_read_2byte;
674 bfp_btc_w2 btc_write_2byte;
675 bfp_btc_r4 btc_read_4byte;
676 bfp_btc_w4 btc_write_4byte;
677 bfp_btc_local_reg_w1 btc_write_local_reg_1byte;
679 bfp_btc_set_bb_reg btc_set_bb_reg;
680 bfp_btc_get_bb_reg btc_get_bb_reg;
682 bfp_btc_set_rf_reg btc_set_rf_reg;
683 bfp_btc_get_rf_reg btc_get_rf_reg;
685 bfp_btc_fill_h2c btc_fill_h2c;
687 bfp_btc_disp_dbg_msg btc_disp_dbg_msg;
692 bfp_btc_set_bt_reg btc_set_bt_reg;
693 bfp_btc_get_bt_reg btc_get_bt_reg;
695 bfp_btc_get_bt_coex_supported_feature btc_get_bt_coex_supported_feature;
696 bfp_btc_get_bt_coex_supported_version btc_get_bt_coex_supported_version;
697 bfp_btc_get_bt_phydm_version btc_get_bt_phydm_version;
698 bfp_btc_phydm_modify_ra_pcr_threshold btc_phydm_modify_ra_pcr_threshold;
699 bfp_btc_phydm_query_phy_counter btc_phydm_query_phy_counter;
700 bfp_btc_get_ant_det_val_from_bt btc_get_ant_det_val_from_bt;
701 bfp_btc_get_ble_scan_type_from_bt btc_get_ble_scan_type_from_bt;
702 bfp_btc_get_ble_scan_para_from_bt btc_get_ble_scan_para_from_bt;
703 bfp_btc_get_bt_afh_map_from_bt btc_get_bt_afh_map_from_bt;
707 bool halbtc_is_wifi_uplink(struct rtl_priv *adapter);
709 #define rtl_btc_coexist(rtlpriv) \
710 ((struct btc_coexist *)((rtlpriv)->btcoexist.btc_context))
711 #define rtl_btc_wifi_only(rtlpriv) \
712 ((struct wifi_only_cfg *)((rtlpriv)->btcoexist.wifi_only_context))
714 struct wifi_only_cfg;
716 bool exhalbtc_initlize_variables(struct rtl_priv *rtlpriv);
717 bool exhalbtc_initlize_variables_wifi_only(struct rtl_priv *rtlpriv);
718 bool exhalbtc_bind_bt_coex_withadapter(void *adapter);
719 void exhalbtc_power_on_setting(struct btc_coexist *btcoexist);
720 void exhalbtc_pre_load_firmware(struct btc_coexist *btcoexist);
721 void exhalbtc_init_hw_config(struct btc_coexist *btcoexist, bool wifi_only);
722 void exhalbtc_init_hw_config_wifi_only(struct wifi_only_cfg *wifionly_cfg);
723 void exhalbtc_init_coex_dm(struct btc_coexist *btcoexist);
724 void exhalbtc_ips_notify(struct btc_coexist *btcoexist, u8 type);
725 void exhalbtc_lps_notify(struct btc_coexist *btcoexist, u8 type);
726 void exhalbtc_scan_notify(struct btc_coexist *btcoexist, u8 type);
727 void exhalbtc_scan_notify_wifi_only(struct wifi_only_cfg *wifionly_cfg,
729 void exhalbtc_connect_notify(struct btc_coexist *btcoexist, u8 action);
730 void exhalbtc_mediastatus_notify(struct btc_coexist *btcoexist,
731 enum rt_media_status media_status);
732 void exhalbtc_special_packet_notify(struct btc_coexist *btcoexist, u8 pkt_type);
733 void exhalbtc_bt_info_notify(struct btc_coexist *btcoexist, u8 *tmp_buf,
735 void exhalbtc_rf_status_notify(struct btc_coexist *btcoexist, u8 type);
736 void exhalbtc_stack_operation_notify(struct btc_coexist *btcoexist, u8 type);
737 void exhalbtc_halt_notify(struct btc_coexist *btcoexist);
738 void exhalbtc_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state);
739 void exhalbtc_coex_dm_switch(struct btc_coexist *btcoexist);
740 void exhalbtc_periodical(struct btc_coexist *btcoexist);
741 void exhalbtc_dbg_control(struct btc_coexist *btcoexist, u8 code, u8 len,
743 void exhalbtc_antenna_detection(struct btc_coexist *btcoexist, u32 cent_freq,
744 u32 offset, u32 span, u32 seconds);
745 void exhalbtc_stack_update_profile_info(void);
746 void exhalbtc_set_hci_version(struct btc_coexist *btcoexist, u16 hci_version);
747 void exhalbtc_set_bt_patch_version(struct btc_coexist *btcoexist,
748 u16 bt_hci_version, u16 bt_patch_version);
749 void exhalbtc_update_min_bt_rssi(struct btc_coexist *btcoexist, s8 bt_rssi);
750 void exhalbtc_set_bt_exist(struct btc_coexist *btcoexist, bool bt_exist);
751 void exhalbtc_set_chip_type(struct btc_coexist *btcoexist, u8 chip_type);
752 void exhalbtc_set_ant_num(struct rtl_priv *rtlpriv, u8 type, u8 ant_num);
753 void exhalbtc_display_bt_coex_info(struct btc_coexist *btcoexist,
755 void exhalbtc_switch_band_notify(struct btc_coexist *btcoexist, u8 type);
756 void exhalbtc_switch_band_notify_wifi_only(struct wifi_only_cfg *wifionly_cfg,
758 void exhalbtc_signal_compensation(struct btc_coexist *btcoexist,
759 u8 *rssi_wifi, u8 *rssi_bt);
760 void exhalbtc_lps_leave(struct btc_coexist *btcoexist);
761 void exhalbtc_low_wifi_traffic_notify(struct btc_coexist *btcoexist);
762 void exhalbtc_set_single_ant_path(struct btc_coexist *btcoexist,
765 /* The following are used by wifi_only case */
766 enum wifionly_chip_interface {
767 WIFIONLY_INTF_UNKNOWN = 0,
768 WIFIONLY_INTF_PCI = 1,
769 WIFIONLY_INTF_USB = 2,
770 WIFIONLY_INTF_SDIO = 3,
774 enum wifionly_customer_id {
779 struct wifi_only_haldata {
787 struct wifi_only_cfg {
789 struct wifi_only_haldata haldata_info;
790 enum wifionly_chip_interface chip_interface;
794 void halwifionly_phy_set_bb_reg(struct wifi_only_cfg *wifi_conly_cfg,
795 u32 regaddr, u32 bitmask, u32 data)
797 struct rtl_priv *rtlpriv = (struct rtl_priv *)wifi_conly_cfg->adapter;
799 rtl_set_bbreg(rtlpriv->hw, regaddr, bitmask, data);