Greg Kroah-Hartman | 3c05bed | 2014-01-21 11:20:45 -0800 | [diff] [blame] | 1 | #ifndef __HALBTC_OUT_SRC_H__ |
| 2 | #define __HALBTC_OUT_SRC_H__ |
| 3 | |
| 4 | #include "../wifi.h" |
| 5 | |
| 6 | #define NORMAL_EXEC false |
| 7 | #define FORCE_EXEC true |
| 8 | |
| 9 | #define BTC_RF_A RF90_PATH_A |
| 10 | #define BTC_RF_B RF90_PATH_B |
| 11 | #define BTC_RF_C RF90_PATH_C |
| 12 | #define BTC_RF_D RF90_PATH_D |
| 13 | |
| 14 | #define BTC_SMSP SINGLEMAC_SINGLEPHY |
| 15 | #define BTC_DMDP DUALMAC_DUALPHY |
| 16 | #define BTC_DMSP DUALMAC_SINGLEPHY |
| 17 | #define BTC_MP_UNKNOWN 0xff |
| 18 | |
| 19 | #define IN |
| 20 | #define OUT |
| 21 | |
| 22 | #define BT_TMP_BUF_SIZE 100 |
| 23 | |
| 24 | #define BT_COEX_ANT_TYPE_PG 0 |
| 25 | #define BT_COEX_ANT_TYPE_ANTDIV 1 |
| 26 | #define BT_COEX_ANT_TYPE_DETECTED 2 |
| 27 | |
| 28 | #define BTC_MIMO_PS_STATIC 0 |
| 29 | #define BTC_MIMO_PS_DYNAMIC 1 |
| 30 | |
| 31 | #define BTC_RATE_DISABLE 0 |
| 32 | #define BTC_RATE_ENABLE 1 |
| 33 | |
| 34 | /* single Antenna definition */ |
| 35 | #define BTC_ANT_PATH_WIFI 0 |
| 36 | #define BTC_ANT_PATH_BT 1 |
| 37 | #define BTC_ANT_PATH_PTA 2 |
| 38 | /* dual Antenna definition */ |
| 39 | #define BTC_ANT_WIFI_AT_MAIN 0 |
| 40 | #define BTC_ANT_WIFI_AT_AUX 1 |
| 41 | /* coupler Antenna definition */ |
| 42 | #define BTC_ANT_WIFI_AT_CPL_MAIN 0 |
| 43 | #define BTC_ANT_WIFI_AT_CPL_AUX 1 |
| 44 | |
| 45 | enum btc_chip_interface{ |
| 46 | BTC_INTF_UNKNOWN = 0, |
| 47 | BTC_INTF_PCI = 1, |
| 48 | BTC_INTF_USB = 2, |
| 49 | BTC_INTF_SDIO = 3, |
| 50 | BTC_INTF_GSPI = 4, |
| 51 | BTC_INTF_MAX |
| 52 | }; |
| 53 | |
| 54 | enum btc_chip_type{ |
| 55 | BTC_CHIP_UNDEF = 0, |
| 56 | BTC_CHIP_CSR_BC4 = 1, |
| 57 | BTC_CHIP_CSR_BC8 = 2, |
| 58 | BTC_CHIP_RTL8723A = 3, |
| 59 | BTC_CHIP_RTL8821 = 4, |
| 60 | BTC_CHIP_RTL8723B = 5, |
| 61 | BTC_CHIP_MAX |
| 62 | }; |
| 63 | |
| 64 | enum btc_msg_type{ |
| 65 | BTC_MSG_INTERFACE = 0x0, |
| 66 | BTC_MSG_ALGORITHM = 0x1, |
| 67 | BTC_MSG_MAX |
| 68 | }; |
| 69 | |
| 70 | extern u32 btc_dbg_type[]; |
| 71 | |
| 72 | /* following is for BTC_MSG_INTERFACE */ |
| 73 | #define INTF_INIT BIT0 |
| 74 | #define INTF_NOTIFY BIT2 |
| 75 | |
| 76 | /* following is for BTC_ALGORITHM */ |
| 77 | #define ALGO_BT_RSSI_STATE BIT0 |
| 78 | #define ALGO_WIFI_RSSI_STATE BIT1 |
| 79 | #define ALGO_BT_MONITOR BIT2 |
| 80 | #define ALGO_TRACE BIT3 |
| 81 | #define ALGO_TRACE_FW BIT4 |
| 82 | #define ALGO_TRACE_FW_DETAIL BIT5 |
| 83 | #define ALGO_TRACE_FW_EXEC BIT6 |
| 84 | #define ALGO_TRACE_SW BIT7 |
| 85 | #define ALGO_TRACE_SW_DETAIL BIT8 |
| 86 | #define ALGO_TRACE_SW_EXEC BIT9 |
| 87 | |
| 88 | |
| 89 | |
| 90 | #define CL_SPRINTF snprintf |
| 91 | #define CL_PRINTF printk |
| 92 | |
| 93 | #define BTC_PRINT(dbgtype, dbgflag, printstr, ...) \ |
| 94 | do { \ |
| 95 | if (unlikely(btc_dbg_type[dbgtype] & dbgflag)) {\ |
| 96 | printk(printstr, ##__VA_ARGS__); \ |
| 97 | } \ |
| 98 | } while(0) |
| 99 | |
| 100 | #define BTC_PRINT_F(dbgtype, dbgflag, printstr, ...) \ |
| 101 | do { \ |
| 102 | if (unlikely(btc_dbg_type[dbgtype] & dbgflag)) {\ |
| 103 | printk(KERN_DEBUG "%s: ", __func__); \ |
| 104 | printk(printstr, ##__VA_ARGS__); \ |
| 105 | } \ |
| 106 | } while(0) |
| 107 | |
| 108 | #define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _ptr) \ |
| 109 | do { \ |
| 110 | if(unlikely(btc_dbg_type[dbgtype] & dbgflag)) { \ |
| 111 | int __i; \ |
| 112 | u8* __ptr = (u8*)_Ptr; \ |
| 113 | printk printstr; \ |
| 114 | for( __i = 0; __i < 6; __i++ ) \ |
| 115 | printk("%02X%s", __ptr[__i], (__i==5)?"":"-");\ |
| 116 | printk(KERN_DEBUG "\n"); \ |
| 117 | }\ |
| 118 | } while(0) |
| 119 | |
| 120 | #define BTC_PRINT_DATA(dbgtype, dbgflag, _titlestring, _hexdata, _hexdatalen) \ |
| 121 | do { \ |
| 122 | if(unlikely(btc_dbg_type[dbgtype] & dbgflag) ) { \ |
| 123 | int __i; \ |
| 124 | u8 *__ptr = (u8*)_hexdata; \ |
| 125 | printk(_titlestring); \ |
| 126 | for( __i = 0; __i < (int)_hexdatalen; __i++ ) { \ |
| 127 | printk("%02X%s", __ptr[__i], (((__i + 1) % 4) \ |
| 128 | == 0)?" ":" ");\ |
| 129 | if (((__i + 1) % 16) == 0) \ |
| 130 | printk("\n"); \ |
| 131 | } \ |
| 132 | printk(KERN_DEBUG "\n"); \ |
| 133 | } \ |
| 134 | } while(0) |
| 135 | |
| 136 | |
| 137 | #define BTC_RSSI_HIGH(_rssi_) \ |
| 138 | ((_rssi_==BTC_RSSI_STATE_HIGH || _rssi_==BTC_RSSI_STATE_STAY_HIGH) ? \ |
| 139 | true : false) |
| 140 | |
| 141 | #define BTC_RSSI_MEDIUM(_rssi_) \ |
| 142 | ((_rssi_==BTC_RSSI_STATE_MEDIUM || _rssi_==BTC_RSSI_STATE_STAY_MEDIUM) \ |
| 143 | ? true : false) |
| 144 | |
| 145 | #define BTC_RSSI_LOW(_rssi_) \ |
| 146 | ((_rssi_==BTC_RSSI_STATE_LOW || _rssi_==BTC_RSSI_STATE_STAY_LOW) ? \ |
| 147 | true : false) |
| 148 | |
| 149 | |
| 150 | enum btc_power_save_type { |
| 151 | BTC_PS_WIFI_NATIVE = 0, |
| 152 | BTC_PS_LPS_ON = 1, |
| 153 | BTC_PS_LPS_OFF = 2, |
| 154 | BTC_PS_LPS_MAX |
| 155 | }; |
| 156 | |
| 157 | struct btc_board_info { |
| 158 | /* The following is some board information */ |
| 159 | u8 bt_chip_type; |
| 160 | u8 pg_ant_num; /* pg ant number */ |
| 161 | u8 btdm_ant_num; /* ant number for btdm */ |
| 162 | u8 btdm_ant_pos; |
| 163 | bool bt_exist; |
| 164 | }; |
| 165 | |
| 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, |
| 170 | BTC_DBG_MAX |
| 171 | }; |
| 172 | |
| 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, |
| 180 | BTC_RSSI_MAX |
| 181 | }; |
| 182 | |
| 183 | enum btc_wifi_role{ |
| 184 | BTC_ROLE_STATION = 0x0, |
| 185 | BTC_ROLE_AP = 0x1, |
| 186 | BTC_ROLE_IBSS = 0x2, |
| 187 | BTC_ROLE_HS_MODE = 0x3, |
| 188 | BTC_ROLE_MAX |
| 189 | }; |
| 190 | |
| 191 | enum btc_wifi_bw_mode{ |
| 192 | BTC_WIFI_BW_LEGACY = 0x0, |
| 193 | BTC_WIFI_BW_HT20 = 0x1, |
| 194 | BTC_WIFI_BW_HT40 = 0x2, |
| 195 | BTC_WIFI_BW_MAX |
| 196 | }; |
| 197 | |
| 198 | enum btc_wifi_traffic_dir{ |
| 199 | BTC_WIFI_TRAFFIC_TX = 0x0, |
| 200 | BTC_WIFI_TRAFFIC_RX = 0x1, |
| 201 | BTC_WIFI_TRAFFIC_MAX |
| 202 | }; |
| 203 | |
| 204 | enum btc_wifi_pnp{ |
| 205 | BTC_WIFI_PNP_WAKE_UP = 0x0, |
| 206 | BTC_WIFI_PNP_SLEEP = 0x1, |
| 207 | BTC_WIFI_PNP_MAX |
| 208 | }; |
| 209 | |
| 210 | |
| 211 | enum btc_get_type{ |
| 212 | /* type bool */ |
| 213 | BTC_GET_BL_HS_OPERATION, |
| 214 | BTC_GET_BL_HS_CONNECTING, |
| 215 | BTC_GET_BL_WIFI_CONNECTED, |
| 216 | BTC_GET_BL_WIFI_BUSY, |
| 217 | BTC_GET_BL_WIFI_SCAN, |
| 218 | BTC_GET_BL_WIFI_LINK, |
| 219 | BTC_GET_BL_WIFI_DHCP, |
| 220 | BTC_GET_BL_WIFI_SOFTAP_IDLE, |
| 221 | BTC_GET_BL_WIFI_SOFTAP_LINKING, |
| 222 | BTC_GET_BL_WIFI_IN_EARLY_SUSPEND, |
| 223 | BTC_GET_BL_WIFI_ROAM, |
| 224 | BTC_GET_BL_WIFI_4_WAY_PROGRESS, |
| 225 | BTC_GET_BL_WIFI_UNDER_5G, |
| 226 | BTC_GET_BL_WIFI_AP_MODE_ENABLE, |
| 227 | BTC_GET_BL_WIFI_ENABLE_ENCRYPTION, |
| 228 | BTC_GET_BL_WIFI_UNDER_B_MODE, |
| 229 | BTC_GET_BL_EXT_SWITCH, |
| 230 | |
| 231 | /* type s4Byte */ |
| 232 | BTC_GET_S4_WIFI_RSSI, |
| 233 | BTC_GET_S4_HS_RSSI, |
| 234 | |
| 235 | /* type u32 */ |
| 236 | BTC_GET_U4_WIFI_BW, |
| 237 | BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, |
| 238 | BTC_GET_U4_WIFI_FW_VER, |
| 239 | BTC_GET_U4_BT_PATCH_VER, |
| 240 | |
| 241 | /* type u1Byte */ |
| 242 | BTC_GET_U1_WIFI_DOT11_CHNL, |
| 243 | BTC_GET_U1_WIFI_CENTRAL_CHNL, |
| 244 | BTC_GET_U1_WIFI_HS_CHNL, |
| 245 | BTC_GET_U1_MAC_PHY_MODE, |
| 246 | BTC_GET_U1_AP_NUM, |
| 247 | |
| 248 | /* for 1Ant */ |
| 249 | BTC_GET_U1_LPS_MODE, |
| 250 | BTC_GET_BL_BT_SCO_BUSY, |
| 251 | |
| 252 | /* for test mode */ |
| 253 | BTC_GET_DRIVER_TEST_CFG, |
| 254 | #if 0 |
| 255 | BTC_GET_U1_LPS, |
| 256 | BTC_GET_U1_RPWM, |
| 257 | #endif |
| 258 | BTC_GET_MAX |
| 259 | }; |
| 260 | |
| 261 | |
| 262 | enum btc_set_type{ |
| 263 | /* type bool */ |
| 264 | BTC_SET_BL_BT_DISABLE, |
| 265 | BTC_SET_BL_BT_TRAFFIC_BUSY, |
| 266 | BTC_SET_BL_BT_LIMITED_DIG, |
| 267 | BTC_SET_BL_FORCE_TO_ROAM, |
| 268 | BTC_SET_BL_TO_REJ_AP_AGG_PKT, |
| 269 | BTC_SET_BL_BT_CTRL_AGG_SIZE, |
| 270 | BTC_SET_BL_INC_SCAN_DEV_NUM, |
| 271 | |
| 272 | /* type u1Byte */ |
| 273 | BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON, |
| 274 | BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, |
| 275 | BTC_SET_UI_SCAN_SIG_COMPENSATION, |
| 276 | BTC_SET_U1_AGG_BUF_SIZE, |
| 277 | |
| 278 | /* type trigger some action */ |
| 279 | BTC_SET_ACT_GET_BT_RSSI, |
| 280 | BTC_SET_ACT_AGGREGATE_CTRL, |
| 281 | |
| 282 | /********* for 1Ant **********/ |
| 283 | /* type bool */ |
| 284 | BTC_SET_BL_BT_SCO_BUSY, |
| 285 | /* type u1Byte */ |
| 286 | BTC_SET_U1_1ANT_LPS, |
| 287 | BTC_SET_U1_1ANT_RPWM, |
| 288 | /* type trigger some action */ |
| 289 | BTC_SET_ACT_LEAVE_LPS, |
| 290 | BTC_SET_ACT_ENTER_LPS, |
| 291 | BTC_SET_ACT_NORMAL_LPS, |
| 292 | BTC_SET_ACT_INC_FORCE_EXEC_PWR_CMD_CNT, |
| 293 | BTC_SET_ACT_DISABLE_LOW_POWER, |
| 294 | BTC_SET_ACT_UPDATE_ra_mask, |
| 295 | BTC_SET_ACT_SEND_MIMO_PS, |
| 296 | /* BT Coex related */ |
| 297 | BTC_SET_ACT_CTRL_BT_INFO, |
| 298 | BTC_SET_ACT_CTRL_BT_COEX, |
| 299 | /***************************/ |
| 300 | BTC_SET_MAX |
| 301 | }; |
| 302 | |
| 303 | enum btc_dbg_disp_type{ |
| 304 | BTC_DBG_DISP_COEX_STATISTICS = 0x0, |
| 305 | BTC_DBG_DISP_BT_LINK_INFO = 0x1, |
| 306 | BTC_DBG_DISP_BT_FW_VER = 0x2, |
| 307 | BTC_DBG_DISP_FW_PWR_MODE_CMD = 0x3, |
| 308 | BTC_DBG_DISP_MAX |
| 309 | }; |
| 310 | |
| 311 | enum btc_notify_type_ips{ |
| 312 | BTC_IPS_LEAVE = 0x0, |
| 313 | BTC_IPS_ENTER = 0x1, |
| 314 | BTC_IPS_MAX |
| 315 | }; |
| 316 | |
| 317 | enum btc_notify_type_lps{ |
| 318 | BTC_LPS_DISABLE = 0x0, |
| 319 | BTC_LPS_ENABLE = 0x1, |
| 320 | BTC_LPS_MAX |
| 321 | }; |
| 322 | |
| 323 | enum btc_notify_type_scan{ |
| 324 | BTC_SCAN_FINISH = 0x0, |
| 325 | BTC_SCAN_START = 0x1, |
| 326 | BTC_SCAN_MAX |
| 327 | }; |
| 328 | |
| 329 | enum btc_notify_type_associate{ |
| 330 | BTC_ASSOCIATE_FINISH = 0x0, |
| 331 | BTC_ASSOCIATE_START = 0x1, |
| 332 | BTC_ASSOCIATE_MAX |
| 333 | }; |
| 334 | |
| 335 | enum btc_notify_type_media_status{ |
| 336 | BTC_MEDIA_DISCONNECT = 0x0, |
| 337 | BTC_MEDIA_CONNECT = 0x1, |
| 338 | BTC_MEDIA_MAX |
| 339 | }; |
| 340 | |
| 341 | enum btc_notify_type_special_packet{ |
| 342 | BTC_PACKET_UNKNOWN = 0x0, |
| 343 | BTC_PACKET_DHCP = 0x1, |
| 344 | BTC_PACKET_ARP = 0x2, |
| 345 | BTC_PACKET_EAPOL = 0x3, |
| 346 | BTC_PACKET_MAX |
| 347 | }; |
| 348 | |
| 349 | enum btc_notify_type_stack_operation{ |
| 350 | BTC_STACK_OP_NONE = 0x0, |
| 351 | BTC_STACK_OP_INQ_PAGE_PAIR_START = 0x1, |
| 352 | BTC_STACK_OP_INQ_PAGE_PAIR_FINISH = 0x2, |
| 353 | BTC_STACK_OP_MAX |
| 354 | }; |
| 355 | |
| 356 | |
| 357 | typedef u8 (*bfp_btc_r1)(void *btc_context, u32 reg_addr); |
| 358 | |
| 359 | typedef u16 (*bfp_btc_r2)(void *btc_context, u32 reg_addr); |
| 360 | |
| 361 | typedef u32 (*bfp_btc_r4)(void *btc_context, u32 reg_addr); |
| 362 | |
| 363 | typedef void (*bfp_btc_w1)(void *btc_context, u32 reg_addr, u8 data); |
| 364 | |
| 365 | typedef void (*bfp_btc_w1_bit_mak)(void *btc_context, u32 reg_addr, |
| 366 | u8 bit_mask, u8 data1b); |
| 367 | |
| 368 | typedef void (*bfp_btc_w2)(void *btc_context, u32 reg_addr, u16 data); |
| 369 | |
| 370 | typedef void (*bfp_btc_w4)(void *btc_context, u32 reg_addr, u32 data); |
| 371 | |
| 372 | typedef void (*bfp_btc_wr_1byte_bit_mask)(void *btc_context, u32 reg_addr, |
| 373 | u8 bit_mask, u8 data); |
| 374 | |
| 375 | typedef void (*bfp_btc_set_bb_reg)(void *btc_context, u32 reg_addr, |
| 376 | u32 bit_mask, u32 data); |
| 377 | |
| 378 | typedef u32 (*bfp_btc_get_bb_reg)(void *btc_context, u32 reg_addr, |
| 379 | u32 bit_mask); |
| 380 | |
| 381 | typedef void (*bfp_btc_set_rf_reg)(void *btc_context, u8 rf_path, u32 reg_addr, |
| 382 | u32 bit_mask, u32 data); |
| 383 | |
| 384 | typedef u32 (*bfp_btc_get_rf_reg)(void *btc_context, u8 rf_path, |
| 385 | u32 reg_addr, u32 bit_mask); |
| 386 | |
| 387 | typedef void (*bfp_btc_fill_h2c)(void *btc_context, u8 element_id, |
| 388 | u32 cmd_len, u8 *cmd_buffer); |
| 389 | |
| 390 | typedef bool (*bfp_btc_get)(void *btcoexist, u8 get_type, void *out_buf); |
| 391 | |
| 392 | typedef bool (*bfp_btc_set)(void *btcoexist, u8 set_type, void *in_buf); |
| 393 | |
| 394 | typedef void (*bfp_btc_disp_dbg_msg)(void *btcoexist, u8 disp_type); |
| 395 | |
| 396 | struct btc_bt_info { |
| 397 | bool bt_disabled; |
| 398 | u8 rssi_adjust_for_agc_table_on; |
| 399 | u8 rssi_adjust_for_1ant_coex_type; |
| 400 | bool bt_busy; |
| 401 | u8 agg_buf_size; |
| 402 | bool limited_dig; |
| 403 | bool reject_agg_pkt; |
| 404 | bool b_bt_ctrl_buf_size; |
| 405 | bool increase_scan_dev_num; |
| 406 | u16 bt_hci_ver; |
| 407 | u16 bt_real_fw_ver; |
| 408 | u8 bt_fw_ver; |
| 409 | |
| 410 | /* the following is for 1Ant solution */ |
| 411 | bool bt_ctrl_lps; |
| 412 | bool bt_pwr_save_mode; |
| 413 | bool bt_lps_on; |
| 414 | bool force_to_roam; |
| 415 | u8 force_exec_pwr_cmd_cnt; |
| 416 | u8 lps_1ant; |
| 417 | u8 rpwm_1ant; |
| 418 | u32 ra_mask; |
| 419 | }; |
| 420 | |
| 421 | struct btc_stack_info { |
| 422 | bool profile_notified; |
| 423 | u16 hci_version; /* stack hci version */ |
| 424 | u8 num_of_link; |
| 425 | bool bt_link_exist; |
| 426 | bool sco_exist; |
| 427 | bool acl_exist; |
| 428 | bool a2dp_exist; |
| 429 | bool hid_exist; |
| 430 | u8 num_of_hid; |
| 431 | bool pan_exist; |
| 432 | bool unknown_acl_exist; |
| 433 | char min_bt_rssi; |
| 434 | }; |
| 435 | |
| 436 | struct btc_statistics { |
| 437 | u32 cnt_bind; |
| 438 | u32 cnt_init_hw_config; |
| 439 | u32 cnt_init_coex_dm; |
| 440 | u32 cnt_ips_notify; |
| 441 | u32 cnt_lps_notify; |
| 442 | u32 cnt_scan_notify; |
| 443 | u32 cnt_connect_notify; |
| 444 | u32 cnt_media_status_notify; |
| 445 | u32 cnt_special_packet_notify; |
| 446 | u32 cnt_bt_info_notify; |
| 447 | u32 cnt_periodical; |
| 448 | u32 cnt_stack_operation_notify; |
| 449 | u32 cnt_dbg_ctrl; |
| 450 | }; |
| 451 | |
| 452 | struct btc_bt_link_info { |
| 453 | bool bt_link_exist; |
| 454 | bool sco_exist; |
| 455 | bool sco_only; |
| 456 | bool a2dp_exist; |
| 457 | bool a2dp_only; |
| 458 | bool hid_exist; |
| 459 | bool hid_only; |
| 460 | bool pan_exist; |
| 461 | bool pan_only; |
| 462 | }; |
| 463 | |
| 464 | enum btc_antenna_pos { |
| 465 | BTC_ANTENNA_AT_MAIN_PORT = 0x1, |
| 466 | BTC_ANTENNA_AT_AUX_PORT = 0x2, |
| 467 | }; |
| 468 | |
| 469 | struct btc_coexist { |
| 470 | /* make sure only one adapter can bind the data context */ |
| 471 | bool binded; |
| 472 | /* default adapter */ |
| 473 | void *adapter; |
| 474 | struct btc_board_info board_info; |
| 475 | /* some bt info referenced by non-bt module */ |
| 476 | struct btc_bt_info bt_info; |
| 477 | struct btc_stack_info stack_info; |
| 478 | enum btc_chip_interface chip_interface; |
| 479 | struct btc_bt_link_info bt_link_info; |
| 480 | |
| 481 | bool initilized; |
| 482 | bool stop_coex_dm; |
| 483 | bool manual_control; |
| 484 | u8 *cli_buf; |
| 485 | struct btc_statistics statistics; |
| 486 | u8 pwr_mode_val[10]; |
| 487 | |
| 488 | /* function pointers |
| 489 | * io related */ |
| 490 | bfp_btc_r1 btc_read_1byte; |
| 491 | bfp_btc_w1 btc_write_1byte; |
| 492 | bfp_btc_w1_bit_mak btc_write_1byte_bitmask; |
| 493 | bfp_btc_r2 btc_read_2byte; |
| 494 | bfp_btc_w2 btc_write_2byte; |
| 495 | bfp_btc_r4 btc_read_4byte; |
| 496 | bfp_btc_w4 btc_write_4byte; |
| 497 | |
| 498 | bfp_btc_set_bb_reg btc_set_bb_reg; |
| 499 | bfp_btc_get_bb_reg btc_get_bb_reg; |
| 500 | |
| 501 | |
| 502 | bfp_btc_set_rf_reg btc_set_rf_reg; |
| 503 | bfp_btc_get_rf_reg btc_get_rf_reg; |
| 504 | |
| 505 | |
| 506 | bfp_btc_fill_h2c btc_fill_h2c; |
| 507 | |
| 508 | bfp_btc_disp_dbg_msg btc_disp_dbg_msg; |
| 509 | |
| 510 | bfp_btc_get btc_get; |
| 511 | bfp_btc_set btc_set; |
| 512 | }; |
| 513 | |
| 514 | bool halbtc_is_wifi_uplink(struct rtl_priv *adapter); |
| 515 | |
| 516 | |
| 517 | extern struct btc_coexist gl_bt_coexist; |
| 518 | |
| 519 | bool exhalbtc_initlize_variables(struct rtl_priv* adapter); |
| 520 | void exhalbtc_init_hw_config(struct btc_coexist *btcoexist); |
| 521 | void exhalbtc_init_coex_dm(struct btc_coexist *btcoexist); |
| 522 | void exhalbtc_ips_notify(struct btc_coexist *btcoexist, u8 type); |
| 523 | void exhalbtc_lps_notify(struct btc_coexist *btcoexist, u8 type); |
| 524 | void exhalbtc_scan_notify(struct btc_coexist *btcoexist, u8 type); |
| 525 | void exhalbtc_connect_notify(struct btc_coexist *btcoexist, u8 action); |
| 526 | void exhalbtc_mediastatus_notify(struct btc_coexist *btcoexist, |
| 527 | enum rt_media_status media_status); |
| 528 | void exhalbtc_special_packet_notify(struct btc_coexist *btcoexist, u8 pkt_type); |
| 529 | void exhalbtc_bt_info_notify(struct btc_coexist *btcoexist, u8 *tmp_buf, |
| 530 | u8 length); |
| 531 | void exhalbtc_stack_operation_notify(struct btc_coexist *btcoexist, u8 type); |
| 532 | void exhalbtc_halt_notify(struct btc_coexist *btcoexist); |
| 533 | void exhalbtc_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state); |
| 534 | void exhalbtc_periodical(struct btc_coexist *btcoexist); |
| 535 | void exhalbtc_dbg_control(struct btc_coexist *btcoexist, u8 code, u8 len, |
| 536 | u8 *data); |
| 537 | void exhalbtc_stack_update_profile_info(void); |
| 538 | void exhalbtc_set_hci_version(u16 hci_version); |
| 539 | void exhalbtc_set_bt_patch_version(u16 bt_hci_version, u16 bt_patch_version); |
| 540 | void exhalbtc_update_min_bt_rssi(char bt_rssi); |
| 541 | void exhalbtc_set_bt_exist(bool bt_exist); |
| 542 | void exhalbtc_set_chip_type(u8 chip_type); |
| 543 | void exhalbtc_set_ant_num(u8 type, u8 ant_num); |
| 544 | void exhalbtc_display_bt_coex_info(struct btc_coexist *btcoexist); |
| 545 | void exhalbtc_signal_compensation(struct btc_coexist *btcoexist, |
| 546 | u8 *rssi_wifi, u8 *rssi_bt); |
| 547 | void exhalbtc_lps_leave(struct btc_coexist *btcoexist); |
| 548 | void exhalbtc_low_wifi_traffic_notify(struct btc_coexist *btcoexist); |
| 549 | #endif |