1 /* SPDX-License-Identifier: GPL-2.0 */ 2 //=========================================== 3 // The following is for 8723A 2Ant BT Co-exist definition 4 //=========================================== 5 #define BT_INFO_8723A_2ANT_B_FTP BIT7 6 #define BT_INFO_8723A_2ANT_B_A2DP BIT6 7 #define BT_INFO_8723A_2ANT_B_HID BIT5 8 #define BT_INFO_8723A_2ANT_B_SCO_BUSY BIT4 9 #define BT_INFO_8723A_2ANT_B_ACL_BUSY BIT3 10 #define BT_INFO_8723A_2ANT_B_INQ_PAGE BIT2 11 #define BT_INFO_8723A_2ANT_B_SCO_ESCO BIT1 12 #define BT_INFO_8723A_2ANT_B_CONNECTION BIT0 13 14 #define BTC_RSSI_COEX_THRESH_TOL_8723A_2ANT 2 15 16 typedef enum _BT_INFO_SRC_8723A_2ANT{ 17 BT_INFO_SRC_8723A_2ANT_WIFI_FW = 0x0, 18 BT_INFO_SRC_8723A_2ANT_BT_RSP = 0x1, 19 BT_INFO_SRC_8723A_2ANT_BT_ACTIVE_SEND = 0x2, 20 BT_INFO_SRC_8723A_2ANT_MAX 21 }BT_INFO_SRC_8723A_2ANT,*PBT_INFO_SRC_8723A_2ANT; 22 23 typedef enum _BT_8723A_2ANT_BT_STATUS{ 24 BT_8723A_2ANT_BT_STATUS_IDLE = 0x0, 25 BT_8723A_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1, 26 BT_8723A_2ANT_BT_STATUS_NON_IDLE = 0x2, 27 BT_8723A_2ANT_BT_STATUS_MAX 28 }BT_8723A_2ANT_BT_STATUS,*PBT_8723A_2ANT_BT_STATUS; 29 30 typedef enum _BT_8723A_2ANT_COEX_ALGO{ 31 BT_8723A_2ANT_COEX_ALGO_UNDEFINED = 0x0, 32 BT_8723A_2ANT_COEX_ALGO_SCO = 0x1, 33 BT_8723A_2ANT_COEX_ALGO_HID = 0x2, 34 BT_8723A_2ANT_COEX_ALGO_A2DP = 0x3, 35 BT_8723A_2ANT_COEX_ALGO_PANEDR = 0x4, 36 BT_8723A_2ANT_COEX_ALGO_PANHS = 0x5, 37 BT_8723A_2ANT_COEX_ALGO_PANEDR_A2DP = 0x6, 38 BT_8723A_2ANT_COEX_ALGO_PANEDR_HID = 0x7, 39 BT_8723A_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x8, 40 BT_8723A_2ANT_COEX_ALGO_HID_A2DP = 0x9, 41 BT_8723A_2ANT_COEX_ALGO_MAX 42 }BT_8723A_2ANT_COEX_ALGO,*PBT_8723A_2ANT_COEX_ALGO; 43 44 typedef struct _COEX_DM_8723A_2ANT{ 45 // fw mechanism 46 BOOLEAN bPreDecBtPwr; 47 BOOLEAN bCurDecBtPwr; 48 //BOOLEAN bPreBtLnaConstrain; 49 //BOOLEAN bCurBtLnaConstrain; 50 //u1Byte bPreBtPsdMode; 51 //u1Byte bCurBtPsdMode; 52 u1Byte preFwDacSwingLvl; 53 u1Byte curFwDacSwingLvl; 54 BOOLEAN bCurIgnoreWlanAct; 55 BOOLEAN bPreIgnoreWlanAct; 56 u1Byte prePsTdma; 57 u1Byte curPsTdma; 58 u1Byte psTdmaPara[5]; 59 u1Byte psTdmaDuAdjType; 60 BOOLEAN bResetTdmaAdjust; 61 BOOLEAN bPrePsTdmaOn; 62 BOOLEAN bCurPsTdmaOn; 63 //BOOLEAN bPreBtAutoReport; 64 //BOOLEAN bCurBtAutoReport; 65 66 // sw mechanism 67 BOOLEAN bPreRfRxLpfShrink; 68 BOOLEAN bCurRfRxLpfShrink; 69 u4Byte btRf0x1eBackup; 70 BOOLEAN bPreLowPenaltyRa; 71 BOOLEAN bCurLowPenaltyRa; 72 BOOLEAN bPreDacSwingOn; 73 u4Byte preDacSwingLvl; 74 BOOLEAN bCurDacSwingOn; 75 u4Byte curDacSwingLvl; 76 BOOLEAN bPreAdcBackOff; 77 BOOLEAN bCurAdcBackOff; 78 BOOLEAN bPreAgcTableEn; 79 BOOLEAN bCurAgcTableEn; 80 u4Byte preVal0x6c0; 81 u4Byte curVal0x6c0; 82 u4Byte preVal0x6c8; 83 u4Byte curVal0x6c8; 84 u1Byte preVal0x6cc; 85 u1Byte curVal0x6cc; 86 BOOLEAN bLimitedDig; 87 88 // algorithm related 89 u1Byte preAlgorithm; 90 u1Byte curAlgorithm; 91 u1Byte btStatus; 92 u1Byte wifiChnlInfo[3]; 93 } COEX_DM_8723A_2ANT, *PCOEX_DM_8723A_2ANT; 94 95 typedef struct _COEX_STA_8723A_2ANT{ 96 u4Byte highPriorityTx; 97 u4Byte highPriorityRx; 98 u4Byte lowPriorityTx; 99 u4Byte lowPriorityRx; 100 u1Byte btRssi; 101 u1Byte preBtRssiState; 102 u1Byte preBtRssiState1; 103 u1Byte preWifiRssiState[4]; 104 BOOLEAN bC2hBtInfoReqSent; 105 u1Byte btInfoC2h[BT_INFO_SRC_8723A_2ANT_MAX][10]; 106 u4Byte btInfoC2hCnt[BT_INFO_SRC_8723A_2ANT_MAX]; 107 BOOLEAN bC2hBtInquiryPage; 108 u1Byte btRetryCnt; 109 u1Byte btInfoExt; 110 BOOLEAN bHoldForStackOperation; 111 u1Byte bHoldPeriodCnt; 112 // this is for c2h hang work-around 113 u4Byte c2hHangDetectCnt; 114 }COEX_STA_8723A_2ANT, *PCOEX_STA_8723A_2ANT; 115 116 //=========================================== 117 // The following is interface which will notify coex module. 118 //=========================================== 119 VOID 120 EXhalbtc8723a2ant_PowerOnSetting( 121 IN PBTC_COEXIST pBtCoexist 122 ); 123 VOID 124 EXhalbtc8723a2ant_InitHwConfig( 125 IN PBTC_COEXIST pBtCoexist, 126 IN BOOLEAN bWifiOnly 127 ); 128 VOID 129 EXhalbtc8723a2ant_InitCoexDm( 130 IN PBTC_COEXIST pBtCoexist 131 ); 132 VOID 133 EXhalbtc8723a2ant_IpsNotify( 134 IN PBTC_COEXIST pBtCoexist, 135 IN u1Byte type 136 ); 137 VOID 138 EXhalbtc8723a2ant_LpsNotify( 139 IN PBTC_COEXIST pBtCoexist, 140 IN u1Byte type 141 ); 142 VOID 143 EXhalbtc8723a2ant_ScanNotify( 144 IN PBTC_COEXIST pBtCoexist, 145 IN u1Byte type 146 ); 147 VOID 148 EXhalbtc8723a2ant_ConnectNotify( 149 IN PBTC_COEXIST pBtCoexist, 150 IN u1Byte type 151 ); 152 VOID 153 EXhalbtc8723a2ant_MediaStatusNotify( 154 IN PBTC_COEXIST pBtCoexist, 155 IN u1Byte type 156 ); 157 VOID 158 EXhalbtc8723a2ant_SpecialPacketNotify( 159 IN PBTC_COEXIST pBtCoexist, 160 IN u1Byte type 161 ); 162 VOID 163 EXhalbtc8723a2ant_HaltNotify( 164 IN PBTC_COEXIST pBtCoexist 165 ); 166 VOID 167 EXhalbtc8723a2ant_Periodical( 168 IN PBTC_COEXIST pBtCoexist 169 ); 170 VOID 171 EXhalbtc8723a2ant_BtInfoNotify( 172 IN PBTC_COEXIST pBtCoexist, 173 IN pu1Byte tmpBuf, 174 IN u1Byte length 175 ); 176 VOID 177 EXhalbtc8723a2ant_StackOperationNotify( 178 IN PBTC_COEXIST pBtCoexist, 179 IN u1Byte type 180 ); 181 VOID 182 EXhalbtc8723a2ant_DisplayCoexInfo( 183 IN PBTC_COEXIST pBtCoexist 184 ); 185 186