1 /* SPDX-License-Identifier: GPL-2.0 */ 2 //=========================================== 3 // The following is for 8821A 1ANT BT Co-exist definition 4 //=========================================== 5 #define BT_AUTO_REPORT_ONLY_8821A_1ANT 1 6 7 #define BT_INFO_8821A_1ANT_B_FTP BIT7 8 #define BT_INFO_8821A_1ANT_B_A2DP BIT6 9 #define BT_INFO_8821A_1ANT_B_HID BIT5 10 #define BT_INFO_8821A_1ANT_B_SCO_BUSY BIT4 11 #define BT_INFO_8821A_1ANT_B_ACL_BUSY BIT3 12 #define BT_INFO_8821A_1ANT_B_INQ_PAGE BIT2 13 #define BT_INFO_8821A_1ANT_B_SCO_ESCO BIT1 14 #define BT_INFO_8821A_1ANT_B_CONNECTION BIT0 15 16 #define BT_INFO_8821A_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \ 17 (((_BT_INFO_EXT_&BIT0))? TRUE:FALSE) 18 19 #define BTC_RSSI_COEX_THRESH_TOL_8821A_1ANT 2 20 21 typedef enum _BT_INFO_SRC_8821A_1ANT{ 22 BT_INFO_SRC_8821A_1ANT_WIFI_FW = 0x0, 23 BT_INFO_SRC_8821A_1ANT_BT_RSP = 0x1, 24 BT_INFO_SRC_8821A_1ANT_BT_ACTIVE_SEND = 0x2, 25 BT_INFO_SRC_8821A_1ANT_MAX 26 }BT_INFO_SRC_8821A_1ANT,*PBT_INFO_SRC_8821A_1ANT; 27 28 typedef enum _BT_8821A_1ANT_BT_STATUS{ 29 BT_8821A_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0, 30 BT_8821A_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1, 31 BT_8821A_1ANT_BT_STATUS_INQ_PAGE = 0x2, 32 BT_8821A_1ANT_BT_STATUS_ACL_BUSY = 0x3, 33 BT_8821A_1ANT_BT_STATUS_SCO_BUSY = 0x4, 34 BT_8821A_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5, 35 BT_8821A_1ANT_BT_STATUS_MAX 36 }BT_8821A_1ANT_BT_STATUS,*PBT_8821A_1ANT_BT_STATUS; 37 38 typedef enum _BT_8821A_1ANT_WIFI_STATUS{ 39 BT_8821A_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0, 40 BT_8821A_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1, 41 BT_8821A_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2, 42 BT_8821A_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT = 0x3, 43 BT_8821A_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4, 44 BT_8821A_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5, 45 BT_8821A_1ANT_WIFI_STATUS_MAX 46 }BT_8821A_1ANT_WIFI_STATUS,*PBT_8821A_1ANT_WIFI_STATUS; 47 48 typedef enum _BT_8821A_1ANT_COEX_ALGO{ 49 BT_8821A_1ANT_COEX_ALGO_UNDEFINED = 0x0, 50 BT_8821A_1ANT_COEX_ALGO_SCO = 0x1, 51 BT_8821A_1ANT_COEX_ALGO_HID = 0x2, 52 BT_8821A_1ANT_COEX_ALGO_A2DP = 0x3, 53 BT_8821A_1ANT_COEX_ALGO_A2DP_PANHS = 0x4, 54 BT_8821A_1ANT_COEX_ALGO_PANEDR = 0x5, 55 BT_8821A_1ANT_COEX_ALGO_PANHS = 0x6, 56 BT_8821A_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7, 57 BT_8821A_1ANT_COEX_ALGO_PANEDR_HID = 0x8, 58 BT_8821A_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9, 59 BT_8821A_1ANT_COEX_ALGO_HID_A2DP = 0xa, 60 BT_8821A_1ANT_COEX_ALGO_MAX = 0xb, 61 }BT_8821A_1ANT_COEX_ALGO,*PBT_8821A_1ANT_COEX_ALGO; 62 63 typedef struct _COEX_DM_8821A_1ANT{ 64 // fw mechanism 65 BOOLEAN bCurIgnoreWlanAct; 66 BOOLEAN bPreIgnoreWlanAct; 67 u1Byte prePsTdma; 68 u1Byte curPsTdma; 69 u1Byte psTdmaPara[5]; 70 u1Byte psTdmaDuAdjType; 71 BOOLEAN bAutoTdmaAdjust; 72 BOOLEAN bPrePsTdmaOn; 73 BOOLEAN bCurPsTdmaOn; 74 BOOLEAN bPreBtAutoReport; 75 BOOLEAN bCurBtAutoReport; 76 u1Byte preLps; 77 u1Byte curLps; 78 u1Byte preRpwm; 79 u1Byte curRpwm; 80 81 // sw mechanism 82 BOOLEAN bPreLowPenaltyRa; 83 BOOLEAN bCurLowPenaltyRa; 84 u4Byte preVal0x6c0; 85 u4Byte curVal0x6c0; 86 u4Byte preVal0x6c4; 87 u4Byte curVal0x6c4; 88 u4Byte preVal0x6c8; 89 u4Byte curVal0x6c8; 90 u1Byte preVal0x6cc; 91 u1Byte curVal0x6cc; 92 93 u4Byte backupArfrCnt1; // Auto Rate Fallback Retry cnt 94 u4Byte backupArfrCnt2; // Auto Rate Fallback Retry cnt 95 u2Byte backupRetryLimit; 96 u1Byte backupAmpduMaxTime; 97 98 // algorithm related 99 u1Byte preAlgorithm; 100 u1Byte curAlgorithm; 101 u1Byte btStatus; 102 u1Byte wifiChnlInfo[3]; 103 104 u4Byte preRaMask; 105 u4Byte curRaMask; 106 u1Byte preArfrType; 107 u1Byte curArfrType; 108 u1Byte preRetryLimitType; 109 u1Byte curRetryLimitType; 110 u1Byte preAmpduTimeType; 111 u1Byte curAmpduTimeType; 112 u4Byte nArpCnt; 113 114 u1Byte errorCondition; 115 } COEX_DM_8821A_1ANT, *PCOEX_DM_8821A_1ANT; 116 117 typedef struct _COEX_STA_8821A_1ANT{ 118 BOOLEAN bBtLinkExist; 119 BOOLEAN bScoExist; 120 BOOLEAN bA2dpExist; 121 BOOLEAN bHidExist; 122 BOOLEAN bPanExist; 123 124 BOOLEAN bUnderLps; 125 BOOLEAN bUnderIps; 126 u4Byte specialPktPeriodCnt; 127 u4Byte highPriorityTx; 128 u4Byte highPriorityRx; 129 u4Byte lowPriorityTx; 130 u4Byte lowPriorityRx; 131 u1Byte btRssi; 132 BOOLEAN bBtTxRxMask; 133 u1Byte preBtRssiState; 134 u1Byte preWifiRssiState[4]; 135 BOOLEAN bC2hBtInfoReqSent; 136 u1Byte btInfoC2h[BT_INFO_SRC_8821A_1ANT_MAX][10]; 137 u4Byte btInfoC2hCnt[BT_INFO_SRC_8821A_1ANT_MAX]; 138 BOOLEAN bC2hBtInquiryPage; 139 BOOLEAN bC2hBtPage; //Add for win8.1 page out issue 140 BOOLEAN bWiFiIsHighPriTask; //Add for win8.1 page out issue 141 u1Byte btRetryCnt; 142 u1Byte btInfoExt; 143 }COEX_STA_8821A_1ANT, *PCOEX_STA_8821A_1ANT; 144 145 //=========================================== 146 // The following is interface which will notify coex module. 147 //=========================================== 148 VOID 149 EXhalbtc8821a1ant_PowerOnSetting( 150 IN PBTC_COEXIST pBtCoexist 151 ); 152 VOID 153 EXhalbtc8821a1ant_InitHwConfig( 154 IN PBTC_COEXIST pBtCoexist, 155 IN BOOLEAN bWifiOnly 156 ); 157 VOID 158 EXhalbtc8821a1ant_InitCoexDm( 159 IN PBTC_COEXIST pBtCoexist 160 ); 161 VOID 162 EXhalbtc8821a1ant_IpsNotify( 163 IN PBTC_COEXIST pBtCoexist, 164 IN u1Byte type 165 ); 166 VOID 167 EXhalbtc8821a1ant_LpsNotify( 168 IN PBTC_COEXIST pBtCoexist, 169 IN u1Byte type 170 ); 171 VOID 172 EXhalbtc8821a1ant_ScanNotify( 173 IN PBTC_COEXIST pBtCoexist, 174 IN u1Byte type 175 ); 176 VOID 177 EXhalbtc8821a1ant_ConnectNotify( 178 IN PBTC_COEXIST pBtCoexist, 179 IN u1Byte type 180 ); 181 VOID 182 EXhalbtc8821a1ant_MediaStatusNotify( 183 IN PBTC_COEXIST pBtCoexist, 184 IN u1Byte type 185 ); 186 VOID 187 EXhalbtc8821a1ant_SpecialPacketNotify( 188 IN PBTC_COEXIST pBtCoexist, 189 IN u1Byte type 190 ); 191 VOID 192 EXhalbtc8821a1ant_BtInfoNotify( 193 IN PBTC_COEXIST pBtCoexist, 194 IN pu1Byte tmpBuf, 195 IN u1Byte length 196 ); 197 VOID 198 EXhalbtc8821a1ant_HaltNotify( 199 IN PBTC_COEXIST pBtCoexist 200 ); 201 VOID 202 EXhalbtc8821a1ant_PnpNotify( 203 IN PBTC_COEXIST pBtCoexist, 204 IN u1Byte pnpState 205 ); 206 VOID 207 EXhalbtc8821a1ant_Periodical( 208 IN PBTC_COEXIST pBtCoexist 209 ); 210 VOID 211 EXhalbtc8821a1ant_DisplayCoexInfo( 212 IN PBTC_COEXIST pBtCoexist 213 ); 214 215