1 /* SPDX-License-Identifier: GPL-2.0 */ 2 //=========================================== 3 // The following is for 8723A 1Ant BT Co-exist definition 4 //=========================================== 5 #define BT_INFO_8723A_1ANT_B_FTP BIT7 6 #define BT_INFO_8723A_1ANT_B_A2DP BIT6 7 #define BT_INFO_8723A_1ANT_B_HID BIT5 8 #define BT_INFO_8723A_1ANT_B_SCO_BUSY BIT4 9 #define BT_INFO_8723A_1ANT_B_ACL_BUSY BIT3 10 #define BT_INFO_8723A_1ANT_B_INQ_PAGE BIT2 11 #define BT_INFO_8723A_1ANT_B_SCO_ESCO BIT1 12 #define BT_INFO_8723A_1ANT_B_CONNECTION BIT0 13 14 typedef enum _BT_STATE_8723A_1ANT{ 15 BT_STATE_8723A_1ANT_DISABLED = 0, 16 BT_STATE_8723A_1ANT_NO_CONNECTION = 1, 17 BT_STATE_8723A_1ANT_CONNECT_IDLE = 2, 18 BT_STATE_8723A_1ANT_INQ_OR_PAG = 3, 19 BT_STATE_8723A_1ANT_ACL_ONLY_BUSY = 4, 20 BT_STATE_8723A_1ANT_SCO_ONLY_BUSY = 5, 21 BT_STATE_8723A_1ANT_ACL_SCO_BUSY = 6, 22 BT_STATE_8723A_1ANT_HID_BUSY = 7, 23 BT_STATE_8723A_1ANT_HID_SCO_BUSY = 8, 24 BT_STATE_8723A_1ANT_MAX 25 }BT_STATE_8723A_1ANT, *PBT_STATE_8723A_1ANT; 26 27 #define BTC_RSSI_COEX_THRESH_TOL_8723A_1ANT 2 28 29 typedef enum _BT_INFO_SRC_8723A_1ANT{ 30 BT_INFO_SRC_8723A_1ANT_WIFI_FW = 0x0, 31 BT_INFO_SRC_8723A_1ANT_BT_RSP = 0x1, 32 BT_INFO_SRC_8723A_1ANT_BT_ACTIVE_SEND = 0x2, 33 BT_INFO_SRC_8723A_1ANT_MAX 34 }BT_INFO_SRC_8723A_1ANT,*PBT_INFO_SRC_8723A_1ANT; 35 36 typedef enum _BT_8723A_1ANT_BT_STATUS{ 37 BT_8723A_1ANT_BT_STATUS_IDLE = 0x0, 38 BT_8723A_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1, 39 BT_8723A_1ANT_BT_STATUS_NON_IDLE = 0x2, 40 BT_8723A_1ANT_BT_STATUS_MAX 41 }BT_8723A_1ANT_BT_STATUS,*PBT_8723A_1ANT_BT_STATUS; 42 43 typedef enum _BT_8723A_1ANT_COEX_ALGO{ 44 BT_8723A_1ANT_COEX_ALGO_UNDEFINED = 0x0, 45 BT_8723A_1ANT_COEX_ALGO_SCO = 0x1, 46 BT_8723A_1ANT_COEX_ALGO_HID = 0x2, 47 BT_8723A_1ANT_COEX_ALGO_A2DP = 0x3, 48 BT_8723A_1ANT_COEX_ALGO_PANEDR = 0x4, 49 BT_8723A_1ANT_COEX_ALGO_PANHS = 0x5, 50 BT_8723A_1ANT_COEX_ALGO_PANEDR_A2DP = 0x6, 51 BT_8723A_1ANT_COEX_ALGO_PANEDR_HID = 0x7, 52 BT_8723A_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x8, 53 BT_8723A_1ANT_COEX_ALGO_HID_A2DP = 0x9, 54 BT_8723A_1ANT_COEX_ALGO_MAX 55 }BT_8723A_1ANT_COEX_ALGO,*PBT_8723A_1ANT_COEX_ALGO; 56 57 typedef struct _COEX_DM_8723A_1ANT{ 58 // fw mechanism 59 BOOLEAN bCurIgnoreWlanAct; 60 BOOLEAN bPreIgnoreWlanAct; 61 u1Byte prePsTdma; 62 u1Byte curPsTdma; 63 u1Byte psTdmaPara[5]; 64 u1Byte psTdmaDuAdjType; 65 u4Byte psTdmaMonitorCnt; 66 u4Byte psTdmaGlobalCnt; 67 BOOLEAN bResetTdmaAdjust; 68 BOOLEAN bPrePsTdmaOn; 69 BOOLEAN bCurPsTdmaOn; 70 71 // sw mechanism 72 BOOLEAN bPreRfRxLpfShrink; 73 BOOLEAN bCurRfRxLpfShrink; 74 u4Byte btRf0x1eBackup; 75 BOOLEAN bPreLowPenaltyRa; 76 BOOLEAN bCurLowPenaltyRa; 77 u4Byte preVal0x6c0; 78 u4Byte curVal0x6c0; 79 u4Byte preVal0x6c8; 80 u4Byte curVal0x6c8; 81 u1Byte preVal0x6cc; 82 u1Byte curVal0x6cc; 83 BOOLEAN bLimitedDig; 84 85 // algorithm related 86 u1Byte preAlgorithm; 87 u1Byte curAlgorithm; 88 u1Byte btStatus; 89 u1Byte wifiChnlInfo[3]; 90 } COEX_DM_8723A_1ANT, *PCOEX_DM_8723A_1ANT; 91 92 typedef struct _COEX_STA_8723A_1ANT{ 93 u4Byte highPriorityTx; 94 u4Byte highPriorityRx; 95 u4Byte lowPriorityTx; 96 u4Byte lowPriorityRx; 97 u1Byte btRssi; 98 u1Byte preBtRssiState; 99 u1Byte preBtRssiState1; 100 u1Byte preWifiRssiState[4]; 101 BOOLEAN bC2hBtInfoReqSent; 102 u1Byte btInfoC2h[BT_INFO_SRC_8723A_1ANT_MAX][10]; 103 u4Byte btInfoC2hCnt[BT_INFO_SRC_8723A_1ANT_MAX]; 104 BOOLEAN bC2hBtInquiryPage; 105 u1Byte btRetryCnt; 106 u1Byte btInfoExt; 107 //BOOLEAN bHoldForStackOperation; 108 //u1Byte bHoldPeriodCnt; 109 // this is for c2h hang work-around 110 u4Byte c2hHangDetectCnt; 111 }COEX_STA_8723A_1ANT, *PCOEX_STA_8723A_1ANT; 112 113 //=========================================== 114 // The following is interface which will notify coex module. 115 //=========================================== 116 VOID 117 EXhalbtc8723a1ant_InitHwConfig( 118 IN PBTC_COEXIST pBtCoexist 119 ); 120 VOID 121 EXhalbtc8723a1ant_InitCoexDm( 122 IN PBTC_COEXIST pBtCoexist 123 ); 124 VOID 125 EXhalbtc8723a1ant_IpsNotify( 126 IN PBTC_COEXIST pBtCoexist, 127 IN u1Byte type 128 ); 129 VOID 130 EXhalbtc8723a1ant_LpsNotify( 131 IN PBTC_COEXIST pBtCoexist, 132 IN u1Byte type 133 ); 134 VOID 135 EXhalbtc8723a1ant_ScanNotify( 136 IN PBTC_COEXIST pBtCoexist, 137 IN u1Byte type 138 ); 139 VOID 140 EXhalbtc8723a1ant_ConnectNotify( 141 IN PBTC_COEXIST pBtCoexist, 142 IN u1Byte type 143 ); 144 VOID 145 EXhalbtc8723a1ant_MediaStatusNotify( 146 IN PBTC_COEXIST pBtCoexist, 147 IN u1Byte type 148 ); 149 VOID 150 EXhalbtc8723a1ant_SpecialPacketNotify( 151 IN PBTC_COEXIST pBtCoexist, 152 IN u1Byte type 153 ); 154 VOID 155 EXhalbtc8723a1ant_BtInfoNotify( 156 IN PBTC_COEXIST pBtCoexist, 157 IN pu1Byte tmpBuf, 158 IN u1Byte length 159 ); 160 VOID 161 EXhalbtc8723a1ant_HaltNotify( 162 IN PBTC_COEXIST pBtCoexist 163 ); 164 VOID 165 EXhalbtc8723a1ant_Periodical( 166 IN PBTC_COEXIST pBtCoexist 167 ); 168 VOID 169 EXhalbtc8723a1ant_DisplayCoexInfo( 170 IN PBTC_COEXIST pBtCoexist 171 ); 172 173