1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /****************************************************************************** 3 * 4 * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved. 5 * 6 ******************************************************************************/ 7 #ifndef __HALBTC_OUT_SRC_H__ 8 #define __HALBTC_OUT_SRC_H__ 9 10 #define NORMAL_EXEC false 11 #define FORCE_EXEC true 12 13 #define BTC_RF_OFF 0x0 14 #define BTC_RF_ON 0x1 15 16 #define BTC_RF_A 0x0 17 #define BTC_RF_B 0x1 18 #define BTC_RF_C 0x2 19 #define BTC_RF_D 0x3 20 21 #define BTC_SMSP SINGLEMAC_SINGLEPHY 22 #define BTC_DMDP DUALMAC_DUALPHY 23 #define BTC_DMSP DUALMAC_SINGLEPHY 24 #define BTC_MP_UNKNOWN 0xff 25 26 #define BT_COEX_ANT_TYPE_PG 0 27 #define BT_COEX_ANT_TYPE_ANTDIV 1 28 #define BT_COEX_ANT_TYPE_DETECTED 2 29 30 #define BTC_MIMO_PS_STATIC 0 /* 1ss */ 31 #define BTC_MIMO_PS_DYNAMIC 1 /* 2ss */ 32 33 #define BTC_RATE_DISABLE 0 34 #define BTC_RATE_ENABLE 1 35 36 /* single Antenna definition */ 37 #define BTC_ANT_PATH_WIFI 0 38 #define BTC_ANT_PATH_BT 1 39 #define BTC_ANT_PATH_PTA 2 40 /* dual Antenna definition */ 41 #define BTC_ANT_WIFI_AT_MAIN 0 42 #define BTC_ANT_WIFI_AT_AUX 1 43 /* coupler Antenna definition */ 44 #define BTC_ANT_WIFI_AT_CPL_MAIN 0 45 #define BTC_ANT_WIFI_AT_CPL_AUX 1 46 47 typedef enum _BTC_POWERSAVE_TYPE { 48 BTC_PS_WIFI_NATIVE = 0, /* wifi original power save behavior */ 49 BTC_PS_LPS_ON = 1, 50 BTC_PS_LPS_OFF = 2, 51 BTC_PS_MAX 52 } BTC_POWERSAVE_TYPE, *PBTC_POWERSAVE_TYPE; 53 54 typedef enum _BTC_BT_REG_TYPE { 55 BTC_BT_REG_RF = 0, 56 BTC_BT_REG_MODEM = 1, 57 BTC_BT_REG_BLUEWIZE = 2, 58 BTC_BT_REG_VENDOR = 3, 59 BTC_BT_REG_LE = 4, 60 BTC_BT_REG_MAX 61 } BTC_BT_REG_TYPE, *PBTC_BT_REG_TYPE; 62 63 typedef enum _BTC_CHIP_INTERFACE { 64 BTC_INTF_UNKNOWN = 0, 65 BTC_INTF_PCI = 1, 66 BTC_INTF_USB = 2, 67 BTC_INTF_SDIO = 3, 68 BTC_INTF_MAX 69 } BTC_CHIP_INTERFACE, *PBTC_CHIP_INTERFACE; 70 71 typedef enum _BTC_CHIP_TYPE { 72 BTC_CHIP_UNDEF = 0, 73 BTC_CHIP_CSR_BC4 = 1, 74 BTC_CHIP_CSR_BC8 = 2, 75 BTC_CHIP_RTL8723A = 3, 76 BTC_CHIP_RTL8821 = 4, 77 BTC_CHIP_RTL8723B = 5, 78 BTC_CHIP_MAX 79 } BTC_CHIP_TYPE, *PBTC_CHIP_TYPE; 80 81 typedef enum _BTC_MSG_TYPE { 82 BTC_MSG_INTERFACE = 0x0, 83 BTC_MSG_ALGORITHM = 0x1, 84 BTC_MSG_MAX 85 } BTC_MSG_TYPE; 86 extern u32 GLBtcDbgType[]; 87 88 /* following is for BTC_MSG_INTERFACE */ 89 #define INTF_INIT BIT0 90 #define INTF_NOTIFY BIT2 91 92 /* following is for BTC_ALGORITHM */ 93 #define ALGO_BT_RSSI_STATE BIT0 94 #define ALGO_WIFI_RSSI_STATE BIT1 95 #define ALGO_BT_MONITOR BIT2 96 #define ALGO_TRACE BIT3 97 #define ALGO_TRACE_FW BIT4 98 #define ALGO_TRACE_FW_DETAIL BIT5 99 #define ALGO_TRACE_FW_EXEC BIT6 100 #define ALGO_TRACE_SW BIT7 101 #define ALGO_TRACE_SW_DETAIL BIT8 102 #define ALGO_TRACE_SW_EXEC BIT9 103 104 /* following is for wifi link status */ 105 #define WIFI_STA_CONNECTED BIT0 106 #define WIFI_AP_CONNECTED BIT1 107 #define WIFI_HS_CONNECTED BIT2 108 #define WIFI_P2P_GO_CONNECTED BIT3 109 #define WIFI_P2P_GC_CONNECTED BIT4 110 111 /* following is for command line utility */ 112 #define CL_SPRINTF snprintf 113 #define CL_PRINTF DCMD_Printf 114 115 /* The following is for dbgview print */ 116 #if DBG 117 #define BTC_PRINT(dbgtype, dbgflag, printstr)\ 118 {\ 119 if (GLBtcDbgType[dbgtype] & dbgflag)\ 120 DbgPrint printstr;\ 121 } 122 123 #define BTC_PRINT_F(dbgtype, dbgflag, printstr)\ 124 {\ 125 if (GLBtcDbgType[dbgtype] & dbgflag) {\ 126 DbgPrint("%s(): ", __func__);\ 127 DbgPrint printstr;\ 128 } \ 129 } 130 131 #define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr)\ 132 {\ 133 if (GLBtcDbgType[dbgtype] & dbgflag) {\ 134 int __i;\ 135 u8 *ptr = (u8 *)_Ptr;\ 136 DbgPrint printstr;\ 137 DbgPrint(" ");\ 138 for (__i = 0; __i < 6; __i++)\ 139 DbgPrint("%02X%s", ptr[__i], (__i == 5) ? "" : "-");\ 140 DbgPrint("\n");\ 141 } \ 142 } 143 144 #define BTC_PRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)\ 145 {\ 146 if (GLBtcDbgType[dbgtype] & dbgflag) {\ 147 int __i;\ 148 u8 *ptr = (u8 *)_HexData;\ 149 DbgPrint(_TitleString);\ 150 for (__i = 0; __i < (int)_HexDataLen; __i++) {\ 151 DbgPrint("%02X%s", ptr[__i], (((__i + 1) % 4) == 0) ? " " : " ");\ 152 if (((__i + 1) % 16) == 0)\ 153 DbgPrint("\n");\ 154 } \ 155 DbgPrint("\n");\ 156 } \ 157 } 158 159 #else 160 #define BTC_PRINT(dbgtype, dbgflag, printstr) no_printk printstr 161 #define BTC_PRINT_F(dbgtype, dbgflag, printstr) no_printk printstr 162 #define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) no_printk printstr 163 #define BTC_PRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen) \ 164 no_printk("%s %p %zu", _TitleString, _HexData, _HexDataLen) 165 #endif 166 167 typedef struct _BTC_BOARD_INFO { 168 /* The following is some board information */ 169 u8 btChipType; 170 u8 pgAntNum; /* pg ant number */ 171 u8 btdmAntNum; /* ant number for btdm */ 172 u8 btdmAntPos; /* Bryant Add to indicate Antenna Position for (pgAntNum = 2) && (btdmAntNum = 1) (DPDT+1Ant case) */ 173 u8 singleAntPath; /* current used for 8723b only, 1 =>s0, 0 =>s1 */ 174 /* bool bBtExist; */ 175 } BTC_BOARD_INFO, *PBTC_BOARD_INFO; 176 177 typedef enum _BTC_DBG_OPCODE { 178 BTC_DBG_SET_COEX_NORMAL = 0x0, 179 BTC_DBG_SET_COEX_WIFI_ONLY = 0x1, 180 BTC_DBG_SET_COEX_BT_ONLY = 0x2, 181 BTC_DBG_SET_COEX_DEC_BT_PWR = 0x3, 182 BTC_DBG_SET_COEX_BT_AFH_MAP = 0x4, 183 BTC_DBG_SET_COEX_BT_IGNORE_WLAN_ACT = 0x5, 184 BTC_DBG_MAX 185 } BTC_DBG_OPCODE, *PBTC_DBG_OPCODE; 186 187 typedef enum _BTC_RSSI_STATE { 188 BTC_RSSI_STATE_HIGH = 0x0, 189 BTC_RSSI_STATE_MEDIUM = 0x1, 190 BTC_RSSI_STATE_LOW = 0x2, 191 BTC_RSSI_STATE_STAY_HIGH = 0x3, 192 BTC_RSSI_STATE_STAY_MEDIUM = 0x4, 193 BTC_RSSI_STATE_STAY_LOW = 0x5, 194 BTC_RSSI_MAX 195 } BTC_RSSI_STATE, *PBTC_RSSI_STATE; 196 #define BTC_RSSI_HIGH(_rssi_) ((_rssi_ == BTC_RSSI_STATE_HIGH || _rssi_ == BTC_RSSI_STATE_STAY_HIGH) ? true : false) 197 #define BTC_RSSI_MEDIUM(_rssi_) ((_rssi_ == BTC_RSSI_STATE_MEDIUM || _rssi_ == BTC_RSSI_STATE_STAY_MEDIUM) ? true : false) 198 #define BTC_RSSI_LOW(_rssi_) ((_rssi_ == BTC_RSSI_STATE_LOW || _rssi_ == BTC_RSSI_STATE_STAY_LOW) ? true : false) 199 200 typedef enum _BTC_WIFI_ROLE { 201 BTC_ROLE_STATION = 0x0, 202 BTC_ROLE_AP = 0x1, 203 BTC_ROLE_IBSS = 0x2, 204 BTC_ROLE_HS_MODE = 0x3, 205 BTC_ROLE_MAX 206 } BTC_WIFI_ROLE, *PBTC_WIFI_ROLE; 207 208 typedef enum _BTC_WIFI_BW_MODE { 209 BTC_WIFI_BW_LEGACY = 0x0, 210 BTC_WIFI_BW_HT20 = 0x1, 211 BTC_WIFI_BW_HT40 = 0x2, 212 BTC_WIFI_BW_MAX 213 } BTC_WIFI_BW_MODE, *PBTC_WIFI_BW_MODE; 214 215 typedef enum _BTC_WIFI_TRAFFIC_DIR { 216 BTC_WIFI_TRAFFIC_TX = 0x0, 217 BTC_WIFI_TRAFFIC_RX = 0x1, 218 BTC_WIFI_TRAFFIC_MAX 219 } BTC_WIFI_TRAFFIC_DIR, *PBTC_WIFI_TRAFFIC_DIR; 220 221 typedef enum _BTC_WIFI_PNP { 222 BTC_WIFI_PNP_WAKE_UP = 0x0, 223 BTC_WIFI_PNP_SLEEP = 0x1, 224 BTC_WIFI_PNP_MAX 225 } BTC_WIFI_PNP, *PBTC_WIFI_PNP; 226 227 /* for 8723b-d cut large current issue */ 228 typedef enum _BT_WIFI_COEX_STATE { 229 BTC_WIFI_STAT_INIT, 230 BTC_WIFI_STAT_IQK, 231 BTC_WIFI_STAT_NORMAL_OFF, 232 BTC_WIFI_STAT_MP_OFF, 233 BTC_WIFI_STAT_NORMAL, 234 BTC_WIFI_STAT_ANT_DIV, 235 BTC_WIFI_STAT_MAX 236 } BT_WIFI_COEX_STATE, *PBT_WIFI_COEX_STATE; 237 238 /* defined for BFP_BTC_GET */ 239 typedef enum _BTC_GET_TYPE { 240 /* type bool */ 241 BTC_GET_BL_HS_OPERATION, 242 BTC_GET_BL_HS_CONNECTING, 243 BTC_GET_BL_WIFI_CONNECTED, 244 BTC_GET_BL_WIFI_BUSY, 245 BTC_GET_BL_WIFI_SCAN, 246 BTC_GET_BL_WIFI_LINK, 247 BTC_GET_BL_WIFI_ROAM, 248 BTC_GET_BL_WIFI_4_WAY_PROGRESS, 249 BTC_GET_BL_WIFI_UNDER_5G, 250 BTC_GET_BL_WIFI_AP_MODE_ENABLE, 251 BTC_GET_BL_WIFI_ENABLE_ENCRYPTION, 252 BTC_GET_BL_WIFI_UNDER_B_MODE, 253 BTC_GET_BL_EXT_SWITCH, 254 BTC_GET_BL_WIFI_IS_IN_MP_MODE, 255 256 /* type s32 */ 257 BTC_GET_S4_WIFI_RSSI, 258 BTC_GET_S4_HS_RSSI, 259 260 /* type u32 */ 261 BTC_GET_U4_WIFI_BW, 262 BTC_GET_U4_WIFI_TRAFFIC_DIRECTION, 263 BTC_GET_U4_WIFI_FW_VER, 264 BTC_GET_U4_WIFI_LINK_STATUS, 265 BTC_GET_U4_BT_PATCH_VER, 266 267 /* type u8 */ 268 BTC_GET_U1_WIFI_DOT11_CHNL, 269 BTC_GET_U1_WIFI_CENTRAL_CHNL, 270 BTC_GET_U1_WIFI_HS_CHNL, 271 BTC_GET_U1_MAC_PHY_MODE, 272 BTC_GET_U1_AP_NUM, 273 274 /* for 1Ant ====== */ 275 BTC_GET_U1_LPS_MODE, 276 277 BTC_GET_MAX 278 } BTC_GET_TYPE, *PBTC_GET_TYPE; 279 280 /* defined for BFP_BTC_SET */ 281 typedef enum _BTC_SET_TYPE { 282 /* type bool */ 283 BTC_SET_BL_BT_DISABLE, 284 BTC_SET_BL_BT_TRAFFIC_BUSY, 285 BTC_SET_BL_BT_LIMITED_DIG, 286 BTC_SET_BL_FORCE_TO_ROAM, 287 BTC_SET_BL_TO_REJ_AP_AGG_PKT, 288 BTC_SET_BL_BT_CTRL_AGG_SIZE, 289 BTC_SET_BL_INC_SCAN_DEV_NUM, 290 BTC_SET_BL_BT_TX_RX_MASK, 291 292 /* type u8 */ 293 BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON, 294 BTC_SET_U1_AGG_BUF_SIZE, 295 296 /* type trigger some action */ 297 BTC_SET_ACT_GET_BT_RSSI, 298 BTC_SET_ACT_AGGREGATE_CTRL, 299 /* for 1Ant ====== */ 300 /* type bool */ 301 302 /* type u8 */ 303 BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, 304 BTC_SET_U1_LPS_VAL, 305 BTC_SET_U1_RPWM_VAL, 306 /* type trigger some action */ 307 BTC_SET_ACT_LEAVE_LPS, 308 BTC_SET_ACT_ENTER_LPS, 309 BTC_SET_ACT_NORMAL_LPS, 310 BTC_SET_ACT_DISABLE_LOW_POWER, 311 BTC_SET_ACT_UPDATE_RAMASK, 312 BTC_SET_ACT_SEND_MIMO_PS, 313 /* BT Coex related */ 314 BTC_SET_ACT_CTRL_BT_INFO, 315 BTC_SET_ACT_CTRL_BT_COEX, 316 BTC_SET_ACT_CTRL_8723B_ANT, 317 /* */ 318 BTC_SET_MAX 319 } BTC_SET_TYPE, *PBTC_SET_TYPE; 320 321 typedef enum _BTC_DBG_DISP_TYPE { 322 BTC_DBG_DISP_COEX_STATISTICS = 0x0, 323 BTC_DBG_DISP_BT_LINK_INFO = 0x1, 324 BTC_DBG_DISP_FW_PWR_MODE_CMD = 0x2, 325 BTC_DBG_DISP_MAX 326 } BTC_DBG_DISP_TYPE, *PBTC_DBG_DISP_TYPE; 327 328 typedef enum _BTC_NOTIFY_TYPE_IPS { 329 BTC_IPS_LEAVE = 0x0, 330 BTC_IPS_ENTER = 0x1, 331 BTC_IPS_MAX 332 } BTC_NOTIFY_TYPE_IPS, *PBTC_NOTIFY_TYPE_IPS; 333 334 typedef enum _BTC_NOTIFY_TYPE_LPS { 335 BTC_LPS_DISABLE = 0x0, 336 BTC_LPS_ENABLE = 0x1, 337 BTC_LPS_MAX 338 } BTC_NOTIFY_TYPE_LPS, *PBTC_NOTIFY_TYPE_LPS; 339 340 typedef enum _BTC_NOTIFY_TYPE_SCAN { 341 BTC_SCAN_FINISH = 0x0, 342 BTC_SCAN_START = 0x1, 343 BTC_SCAN_MAX 344 } BTC_NOTIFY_TYPE_SCAN, *PBTC_NOTIFY_TYPE_SCAN; 345 346 typedef enum _BTC_NOTIFY_TYPE_ASSOCIATE { 347 BTC_ASSOCIATE_FINISH = 0x0, 348 BTC_ASSOCIATE_START = 0x1, 349 BTC_ASSOCIATE_MAX 350 } BTC_NOTIFY_TYPE_ASSOCIATE, *PBTC_NOTIFY_TYPE_ASSOCIATE; 351 352 typedef enum _BTC_NOTIFY_TYPE_MEDIA_STATUS { 353 BTC_MEDIA_DISCONNECT = 0x0, 354 BTC_MEDIA_CONNECT = 0x1, 355 BTC_MEDIA_MAX 356 } BTC_NOTIFY_TYPE_MEDIA_STATUS, *PBTC_NOTIFY_TYPE_MEDIA_STATUS; 357 358 typedef enum _BTC_NOTIFY_TYPE_SPECIAL_PACKET { 359 BTC_PACKET_UNKNOWN = 0x0, 360 BTC_PACKET_DHCP = 0x1, 361 BTC_PACKET_ARP = 0x2, 362 BTC_PACKET_EAPOL = 0x3, 363 BTC_PACKET_MAX 364 } BTC_NOTIFY_TYPE_SPECIAL_PACKET, *PBTC_NOTIFY_TYPE_SPECIAL_PACKET; 365 366 typedef enum _BTC_NOTIFY_TYPE_STACK_OPERATION { 367 BTC_STACK_OP_NONE = 0x0, 368 BTC_STACK_OP_INQ_PAGE_PAIR_START = 0x1, 369 BTC_STACK_OP_INQ_PAGE_PAIR_FINISH = 0x2, 370 BTC_STACK_OP_MAX 371 } BTC_NOTIFY_TYPE_STACK_OPERATION, *PBTC_NOTIFY_TYPE_STACK_OPERATION; 372 373 /* Bryant Add */ 374 typedef enum _BTC_ANTENNA_POS { 375 BTC_ANTENNA_AT_MAIN_PORT = 0x1, 376 BTC_ANTENNA_AT_AUX_PORT = 0x2, 377 } BTC_ANTENNA_POS, *PBTC_ANTENNA_POS; 378 379 typedef u8 (*BFP_BTC_R1)(void *pBtcContext, u32 RegAddr); 380 typedef u16(*BFP_BTC_R2)(void *pBtcContext, u32 RegAddr); 381 typedef u32 (*BFP_BTC_R4)(void *pBtcContext, u32 RegAddr); 382 typedef void (*BFP_BTC_W1)(void *pBtcContext, u32 RegAddr, u8 Data); 383 typedef void(*BFP_BTC_W1_BIT_MASK)( 384 void *pBtcContext, u32 regAddr, u8 bitMask, u8 data1b 385 ); 386 typedef void (*BFP_BTC_W2)(void *pBtcContext, u32 RegAddr, u16 Data); 387 typedef void (*BFP_BTC_W4)(void *pBtcContext, u32 RegAddr, u32 Data); 388 typedef void (*BFP_BTC_LOCAL_REG_W1)(void *pBtcContext, u32 RegAddr, u8 Data); 389 typedef void (*BFP_BTC_SET_BB_REG)( 390 void *pBtcContext, u32 RegAddr, u32 BitMask, u32 Data 391 ); 392 typedef u32 (*BFP_BTC_GET_BB_REG)(void *pBtcContext, u32 RegAddr, u32 BitMask); 393 typedef void (*BFP_BTC_SET_RF_REG)( 394 void *pBtcContext, u8 eRFPath, u32 RegAddr, u32 BitMask, u32 Data 395 ); 396 typedef u32 (*BFP_BTC_GET_RF_REG)( 397 void *pBtcContext, u8 eRFPath, u32 RegAddr, u32 BitMask 398 ); 399 typedef void (*BFP_BTC_FILL_H2C)( 400 void *pBtcContext, u8 elementId, u32 cmdLen, u8 *pCmdBuffer 401 ); 402 403 typedef u8 (*BFP_BTC_GET)(void *pBtCoexist, u8 getType, void *pOutBuf); 404 405 typedef u8 (*BFP_BTC_SET)(void *pBtCoexist, u8 setType, void *pInBuf); 406 typedef void (*BFP_BTC_SET_BT_REG)( 407 void *pBtcContext, u8 regType, u32 offset, u32 value 408 ); 409 typedef u32 (*BFP_BTC_GET_BT_REG)(void *pBtcContext, u8 regType, u32 offset); 410 typedef void (*BFP_BTC_DISP_DBG_MSG)(void *pBtCoexist, u8 dispType); 411 412 typedef struct _BTC_BT_INFO { 413 bool bBtDisabled; 414 u8 rssiAdjustForAgcTableOn; 415 u8 rssiAdjustFor1AntCoexType; 416 bool bPreBtCtrlAggBufSize; 417 bool bBtCtrlAggBufSize; 418 bool bRejectAggPkt; 419 bool bIncreaseScanDevNum; 420 bool bBtTxRxMask; 421 u8 preAggBufSize; 422 u8 aggBufSize; 423 bool bBtBusy; 424 bool bLimitedDig; 425 u16 btHciVer; 426 u16 btRealFwVer; 427 u8 btFwVer; 428 u32 getBtFwVerCnt; 429 430 bool bBtDisableLowPwr; 431 432 bool bBtCtrlLps; 433 bool bBtLpsOn; 434 bool bForceToRoam; /* for 1Ant solution */ 435 u8 lpsVal; 436 u8 rpwmVal; 437 u32 raMask; 438 } BTC_BT_INFO, *PBTC_BT_INFO; 439 440 typedef struct _BTC_STACK_INFO { 441 bool bProfileNotified; 442 u16 hciVersion; /* stack hci version */ 443 u8 numOfLink; 444 bool bBtLinkExist; 445 bool bScoExist; 446 bool bAclExist; 447 bool bA2dpExist; 448 bool bHidExist; 449 u8 numOfHid; 450 bool bPanExist; 451 bool bUnknownAclExist; 452 s8 minBtRssi; 453 } BTC_STACK_INFO, *PBTC_STACK_INFO; 454 455 typedef struct _BTC_BT_LINK_INFO { 456 bool bBtLinkExist; 457 bool bScoExist; 458 bool bScoOnly; 459 bool bA2dpExist; 460 bool bA2dpOnly; 461 bool bHidExist; 462 bool bHidOnly; 463 bool bPanExist; 464 bool bPanOnly; 465 bool bSlaveRole; 466 } BTC_BT_LINK_INFO, *PBTC_BT_LINK_INFO; 467 468 typedef struct _BTC_STATISTICS { 469 u32 cntBind; 470 u32 cntPowerOn; 471 u32 cntInitHwConfig; 472 u32 cntInitCoexDm; 473 u32 cntIpsNotify; 474 u32 cntLpsNotify; 475 u32 cntScanNotify; 476 u32 cntConnectNotify; 477 u32 cntMediaStatusNotify; 478 u32 cntSpecialPacketNotify; 479 u32 cntBtInfoNotify; 480 u32 cntRfStatusNotify; 481 u32 cntPeriodical; 482 u32 cntCoexDmSwitch; 483 u32 cntStackOperationNotify; 484 u32 cntDbgCtrl; 485 } BTC_STATISTICS, *PBTC_STATISTICS; 486 487 typedef struct _BTC_COEXIST { 488 bool bBinded; /* make sure only one adapter can bind the data context */ 489 void *Adapter; /* default adapter */ 490 BTC_BOARD_INFO boardInfo; 491 BTC_BT_INFO btInfo; /* some bt info referenced by non-bt module */ 492 BTC_STACK_INFO stackInfo; 493 BTC_BT_LINK_INFO btLinkInfo; 494 BTC_CHIP_INTERFACE chipInterface; 495 496 bool bInitilized; 497 bool bStopCoexDm; 498 bool bManualControl; 499 u8 *cliBuf; 500 BTC_STATISTICS statistics; 501 u8 pwrModeVal[10]; 502 503 /* function pointers */ 504 /* io related */ 505 BFP_BTC_R1 fBtcRead1Byte; 506 BFP_BTC_W1 fBtcWrite1Byte; 507 BFP_BTC_W1_BIT_MASK fBtcWrite1ByteBitMask; 508 BFP_BTC_R2 fBtcRead2Byte; 509 BFP_BTC_W2 fBtcWrite2Byte; 510 BFP_BTC_R4 fBtcRead4Byte; 511 BFP_BTC_W4 fBtcWrite4Byte; 512 BFP_BTC_LOCAL_REG_W1 fBtcWriteLocalReg1Byte; 513 /* read/write bb related */ 514 BFP_BTC_SET_BB_REG fBtcSetBbReg; 515 BFP_BTC_GET_BB_REG fBtcGetBbReg; 516 517 /* read/write rf related */ 518 BFP_BTC_SET_RF_REG fBtcSetRfReg; 519 BFP_BTC_GET_RF_REG fBtcGetRfReg; 520 521 /* fill h2c related */ 522 BFP_BTC_FILL_H2C fBtcFillH2c; 523 /* other */ 524 BFP_BTC_DISP_DBG_MSG fBtcDispDbgMsg; 525 /* normal get/set related */ 526 BFP_BTC_GET fBtcGet; 527 BFP_BTC_SET fBtcSet; 528 529 BFP_BTC_GET_BT_REG fBtcGetBtReg; 530 BFP_BTC_SET_BT_REG fBtcSetBtReg; 531 } BTC_COEXIST, *PBTC_COEXIST; 532 533 extern BTC_COEXIST GLBtCoexist; 534 535 void EXhalbtcoutsrc_PowerOnSetting(PBTC_COEXIST pBtCoexist); 536 void EXhalbtcoutsrc_InitHwConfig(PBTC_COEXIST pBtCoexist, u8 bWifiOnly); 537 void EXhalbtcoutsrc_InitCoexDm(PBTC_COEXIST pBtCoexist); 538 void EXhalbtcoutsrc_IpsNotify(PBTC_COEXIST pBtCoexist, u8 type); 539 void EXhalbtcoutsrc_LpsNotify(PBTC_COEXIST pBtCoexist, u8 type); 540 void EXhalbtcoutsrc_ScanNotify(PBTC_COEXIST pBtCoexist, u8 type); 541 void EXhalbtcoutsrc_ConnectNotify(PBTC_COEXIST pBtCoexist, u8 action); 542 void EXhalbtcoutsrc_MediaStatusNotify( 543 PBTC_COEXIST pBtCoexist, RT_MEDIA_STATUS mediaStatus 544 ); 545 void EXhalbtcoutsrc_SpecialPacketNotify(PBTC_COEXIST pBtCoexist, u8 pktType); 546 void EXhalbtcoutsrc_BtInfoNotify( 547 PBTC_COEXIST pBtCoexist, u8 *tmpBuf, u8 length 548 ); 549 void EXhalbtcoutsrc_HaltNotify(PBTC_COEXIST pBtCoexist); 550 void EXhalbtcoutsrc_PnpNotify(PBTC_COEXIST pBtCoexist, u8 pnpState); 551 void EXhalbtcoutsrc_Periodical(PBTC_COEXIST pBtCoexist); 552 void EXhalbtcoutsrc_SetChipType(u8 chipType); 553 void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum); 554 void EXhalbtcoutsrc_SetSingleAntPath(u8 singleAntPath); 555 void EXhalbtcoutsrc_DisplayBtCoexInfo(PBTC_COEXIST pBtCoexist); 556 557 #endif 558