1 /* SPDX-License-Identifier: GPL-2.0 */ 2 //=========================================== 3 // The following is for 8723B 2Ant BT Co-exist definition 4 //=========================================== 5 #define BT_AUTO_REPORT_ONLY_8723B_2ANT 1 6 7 8 #define BT_INFO_8723B_2ANT_B_FTP BIT7 9 #define BT_INFO_8723B_2ANT_B_A2DP BIT6 10 #define BT_INFO_8723B_2ANT_B_HID BIT5 11 #define BT_INFO_8723B_2ANT_B_SCO_BUSY BIT4 12 #define BT_INFO_8723B_2ANT_B_ACL_BUSY BIT3 13 #define BT_INFO_8723B_2ANT_B_INQ_PAGE BIT2 14 #define BT_INFO_8723B_2ANT_B_SCO_ESCO BIT1 15 #define BT_INFO_8723B_2ANT_B_CONNECTION BIT0 16 17 #define BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT 2 18 19 20 #define BT_8723B_2ANT_WIFI_RSSI_COEXSWITCH_THRES 42 //WiFi RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation 21 #define BT_8723B_2ANT_BT_RSSI_COEXSWITCH_THRES 46 //BT RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation 22 23 typedef enum _BT_INFO_SRC_8723B_2ANT{ 24 BT_INFO_SRC_8723B_2ANT_WIFI_FW = 0x0, 25 BT_INFO_SRC_8723B_2ANT_BT_RSP = 0x1, 26 BT_INFO_SRC_8723B_2ANT_BT_ACTIVE_SEND = 0x2, 27 BT_INFO_SRC_8723B_2ANT_MAX 28 }BT_INFO_SRC_8723B_2ANT,*PBT_INFO_SRC_8723B_2ANT; 29 30 typedef enum _BT_8723B_2ANT_BT_STATUS{ 31 BT_8723B_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0, 32 BT_8723B_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1, 33 BT_8723B_2ANT_BT_STATUS_INQ_PAGE = 0x2, 34 BT_8723B_2ANT_BT_STATUS_ACL_BUSY = 0x3, 35 BT_8723B_2ANT_BT_STATUS_SCO_BUSY = 0x4, 36 BT_8723B_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5, 37 BT_8723B_2ANT_BT_STATUS_MAX 38 }BT_8723B_2ANT_BT_STATUS,*PBT_8723B_2ANT_BT_STATUS; 39 40 typedef enum _BT_8723B_2ANT_COEX_ALGO{ 41 BT_8723B_2ANT_COEX_ALGO_UNDEFINED = 0x0, 42 BT_8723B_2ANT_COEX_ALGO_SCO = 0x1, 43 BT_8723B_2ANT_COEX_ALGO_HID = 0x2, 44 BT_8723B_2ANT_COEX_ALGO_A2DP = 0x3, 45 BT_8723B_2ANT_COEX_ALGO_A2DP_PANHS = 0x4, 46 BT_8723B_2ANT_COEX_ALGO_PANEDR = 0x5, 47 BT_8723B_2ANT_COEX_ALGO_PANHS = 0x6, 48 BT_8723B_2ANT_COEX_ALGO_PANEDR_A2DP = 0x7, 49 BT_8723B_2ANT_COEX_ALGO_PANEDR_HID = 0x8, 50 BT_8723B_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9, 51 BT_8723B_2ANT_COEX_ALGO_HID_A2DP = 0xa, 52 BT_8723B_2ANT_COEX_ALGO_MAX = 0xb, 53 }BT_8723B_2ANT_COEX_ALGO,*PBT_8723B_2ANT_COEX_ALGO; 54 55 typedef struct _COEX_DM_8723B_2ANT{ 56 // fw mechanism 57 u1Byte preBtDecPwrLvl; 58 u1Byte curBtDecPwrLvl; 59 u1Byte preFwDacSwingLvl; 60 u1Byte curFwDacSwingLvl; 61 BOOLEAN bCurIgnoreWlanAct; 62 BOOLEAN bPreIgnoreWlanAct; 63 u1Byte prePsTdma; 64 u1Byte curPsTdma; 65 u1Byte psTdmaPara[5]; 66 u1Byte psTdmaDuAdjType; 67 BOOLEAN bResetTdmaAdjust; 68 BOOLEAN bAutoTdmaAdjust; 69 BOOLEAN bPrePsTdmaOn; 70 BOOLEAN bCurPsTdmaOn; 71 BOOLEAN bPreBtAutoReport; 72 BOOLEAN bCurBtAutoReport; 73 74 // sw mechanism 75 BOOLEAN bPreRfRxLpfShrink; 76 BOOLEAN bCurRfRxLpfShrink; 77 u4Byte btRf0x1eBackup; 78 BOOLEAN bPreLowPenaltyRa; 79 BOOLEAN bCurLowPenaltyRa; 80 BOOLEAN bPreDacSwingOn; 81 u4Byte preDacSwingLvl; 82 BOOLEAN bCurDacSwingOn; 83 u4Byte curDacSwingLvl; 84 BOOLEAN bPreAdcBackOff; 85 BOOLEAN bCurAdcBackOff; 86 BOOLEAN bPreAgcTableEn; 87 BOOLEAN bCurAgcTableEn; 88 u4Byte preVal0x6c0; 89 u4Byte curVal0x6c0; 90 u4Byte preVal0x6c4; 91 u4Byte curVal0x6c4; 92 u4Byte preVal0x6c8; 93 u4Byte curVal0x6c8; 94 u1Byte preVal0x6cc; 95 u1Byte curVal0x6cc; 96 BOOLEAN bLimitedDig; 97 98 // algorithm related 99 u1Byte preAlgorithm; 100 u1Byte curAlgorithm; 101 u1Byte btStatus; 102 u1Byte wifiChnlInfo[3]; 103 104 BOOLEAN bNeedRecover0x948; 105 u4Byte backup0x948; 106 107 u1Byte preLps; 108 u1Byte curLps; 109 u1Byte preRpwm; 110 u1Byte curRpwm; 111 112 BOOLEAN bIsSwitchTo1dot5Ant; 113 } COEX_DM_8723B_2ANT, *PCOEX_DM_8723B_2ANT; 114 115 typedef struct _COEX_STA_8723B_2ANT{ 116 BOOLEAN bBtLinkExist; 117 BOOLEAN bScoExist; 118 BOOLEAN bA2dpExist; 119 BOOLEAN bHidExist; 120 BOOLEAN bPanExist; 121 122 BOOLEAN bUnderLps; 123 BOOLEAN bUnderIps; 124 u4Byte highPriorityTx; 125 u4Byte highPriorityRx; 126 u4Byte lowPriorityTx; 127 u4Byte lowPriorityRx; 128 u1Byte btRssi; 129 BOOLEAN bBtTxRxMask; 130 u1Byte preBtRssiState; 131 u1Byte preWifiRssiState[4]; 132 BOOLEAN bC2hBtInfoReqSent; 133 u1Byte btInfoC2h[BT_INFO_SRC_8723B_2ANT_MAX][10]; 134 u4Byte btInfoC2hCnt[BT_INFO_SRC_8723B_2ANT_MAX]; 135 BOOLEAN bBtWhckTest; 136 BOOLEAN bC2hBtInquiryPage; 137 BOOLEAN bC2hBtRemoteNameReq; 138 u1Byte btRetryCnt; 139 u1Byte btInfoExt; 140 u4Byte popEventCnt; 141 u1Byte nScanAPNum; 142 143 u4Byte nCRCOK_CCK; 144 u4Byte nCRCOK_11g; 145 u4Byte nCRCOK_11n; 146 u4Byte nCRCOK_11nAgg; 147 148 u4Byte nCRCErr_CCK; 149 u4Byte nCRCErr_11g; 150 u4Byte nCRCErr_11n; 151 u4Byte nCRCErr_11nAgg; 152 153 u1Byte nCoexTableType; 154 BOOLEAN bForceLpsOn; 155 156 u1Byte disVerInfoCnt; 157 158 u1Byte nA2DPBitPool; 159 u1Byte nCutVersion; 160 }COEX_STA_8723B_2ANT, *PCOEX_STA_8723B_2ANT; 161 162 //=========================================== 163 // The following is interface which will notify coex module. 164 //=========================================== 165 VOID 166 EXhalbtc8723b2ant_PowerOnSetting( 167 IN PBTC_COEXIST pBtCoexist 168 ); 169 VOID 170 EXhalbtc8723b2ant_PreLoadFirmware( 171 IN PBTC_COEXIST pBtCoexist 172 ); 173 VOID 174 EXhalbtc8723b2ant_InitHwConfig( 175 IN PBTC_COEXIST pBtCoexist, 176 IN BOOLEAN bWifiOnly 177 ); 178 VOID 179 EXhalbtc8723b2ant_InitCoexDm( 180 IN PBTC_COEXIST pBtCoexist 181 ); 182 VOID 183 EXhalbtc8723b2ant_IpsNotify( 184 IN PBTC_COEXIST pBtCoexist, 185 IN u1Byte type 186 ); 187 VOID 188 EXhalbtc8723b2ant_LpsNotify( 189 IN PBTC_COEXIST pBtCoexist, 190 IN u1Byte type 191 ); 192 VOID 193 EXhalbtc8723b2ant_ScanNotify( 194 IN PBTC_COEXIST pBtCoexist, 195 IN u1Byte type 196 ); 197 VOID 198 EXhalbtc8723b2ant_ConnectNotify( 199 IN PBTC_COEXIST pBtCoexist, 200 IN u1Byte type 201 ); 202 VOID 203 EXhalbtc8723b2ant_MediaStatusNotify( 204 IN PBTC_COEXIST pBtCoexist, 205 IN u1Byte type 206 ); 207 VOID 208 EXhalbtc8723b2ant_SpecialPacketNotify( 209 IN PBTC_COEXIST pBtCoexist, 210 IN u1Byte type 211 ); 212 VOID 213 EXhalbtc8723b2ant_BtInfoNotify( 214 IN PBTC_COEXIST pBtCoexist, 215 IN pu1Byte tmpBuf, 216 IN u1Byte length 217 ); 218 VOID 219 EXhalbtc8723b2ant_HaltNotify( 220 IN PBTC_COEXIST pBtCoexist 221 ); 222 VOID 223 EXhalbtc8723b2ant_PnpNotify( 224 IN PBTC_COEXIST pBtCoexist, 225 IN u1Byte pnpState 226 ); 227 VOID 228 EXhalbtc8723b2ant_Periodical( 229 IN PBTC_COEXIST pBtCoexist 230 ); 231 VOID 232 EXhalbtc8723b2ant_DisplayCoexInfo( 233 IN PBTC_COEXIST pBtCoexist 234 ); 235 236