net: wireless: rockchip: add rtl8822be pcie wifi driver
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8822be / hal / btc / halbtc8723a2ant.h
diff --git a/drivers/net/wireless/rockchip_wlan/rtl8822be/hal/btc/halbtc8723a2ant.h b/drivers/net/wireless/rockchip_wlan/rtl8822be/hal/btc/halbtc8723a2ant.h
new file mode 100644 (file)
index 0000000..f0cc8b5
--- /dev/null
@@ -0,0 +1,184 @@
+//===========================================\r
+// The following is for 8723A 2Ant BT Co-exist definition\r
+//===========================================\r
+#define        BT_INFO_8723A_2ANT_B_FTP                                                BIT7\r
+#define        BT_INFO_8723A_2ANT_B_A2DP                                       BIT6\r
+#define        BT_INFO_8723A_2ANT_B_HID                                                BIT5\r
+#define        BT_INFO_8723A_2ANT_B_SCO_BUSY                           BIT4\r
+#define        BT_INFO_8723A_2ANT_B_ACL_BUSY                           BIT3\r
+#define        BT_INFO_8723A_2ANT_B_INQ_PAGE                           BIT2\r
+#define        BT_INFO_8723A_2ANT_B_SCO_ESCO                           BIT1\r
+#define        BT_INFO_8723A_2ANT_B_CONNECTION                         BIT0\r
+\r
+#define                BTC_RSSI_COEX_THRESH_TOL_8723A_2ANT             2\r
+\r
+typedef enum _BT_INFO_SRC_8723A_2ANT{\r
+       BT_INFO_SRC_8723A_2ANT_WIFI_FW                  = 0x0,\r
+       BT_INFO_SRC_8723A_2ANT_BT_RSP                           = 0x1,\r
+       BT_INFO_SRC_8723A_2ANT_BT_ACTIVE_SEND           = 0x2,\r
+       BT_INFO_SRC_8723A_2ANT_MAX\r
+}BT_INFO_SRC_8723A_2ANT,*PBT_INFO_SRC_8723A_2ANT;\r
+\r
+typedef enum _BT_8723A_2ANT_BT_STATUS{\r
+       BT_8723A_2ANT_BT_STATUS_IDLE                            = 0x0,\r
+       BT_8723A_2ANT_BT_STATUS_CONNECTED_IDLE  = 0x1,\r
+       BT_8723A_2ANT_BT_STATUS_NON_IDLE                        = 0x2,\r
+       BT_8723A_2ANT_BT_STATUS_MAX\r
+}BT_8723A_2ANT_BT_STATUS,*PBT_8723A_2ANT_BT_STATUS;\r
+\r
+typedef enum _BT_8723A_2ANT_COEX_ALGO{\r
+       BT_8723A_2ANT_COEX_ALGO_UNDEFINED                       = 0x0,\r
+       BT_8723A_2ANT_COEX_ALGO_SCO                             = 0x1,\r
+       BT_8723A_2ANT_COEX_ALGO_HID                             = 0x2,\r
+       BT_8723A_2ANT_COEX_ALGO_A2DP                            = 0x3,\r
+       BT_8723A_2ANT_COEX_ALGO_PANEDR                  = 0x4,\r
+       BT_8723A_2ANT_COEX_ALGO_PANHS                   = 0x5,\r
+       BT_8723A_2ANT_COEX_ALGO_PANEDR_A2DP             = 0x6,\r
+       BT_8723A_2ANT_COEX_ALGO_PANEDR_HID              = 0x7,\r
+       BT_8723A_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x8,\r
+       BT_8723A_2ANT_COEX_ALGO_HID_A2DP                        = 0x9,\r
+       BT_8723A_2ANT_COEX_ALGO_MAX\r
+}BT_8723A_2ANT_COEX_ALGO,*PBT_8723A_2ANT_COEX_ALGO;\r
+\r
+typedef struct _COEX_DM_8723A_2ANT{\r
+       // fw mechanism\r
+       BOOLEAN         bPreDecBtPwr;\r
+       BOOLEAN         bCurDecBtPwr;\r
+       //BOOLEAN               bPreBtLnaConstrain;\r
+       //BOOLEAN               bCurBtLnaConstrain;\r
+       //u1Byte                bPreBtPsdMode;\r
+       //u1Byte                bCurBtPsdMode;\r
+       u1Byte          preFwDacSwingLvl;\r
+       u1Byte          curFwDacSwingLvl;\r
+       BOOLEAN         bCurIgnoreWlanAct;\r
+       BOOLEAN         bPreIgnoreWlanAct;\r
+       u1Byte          prePsTdma;\r
+       u1Byte          curPsTdma;\r
+       u1Byte          psTdmaPara[5];\r
+       u1Byte          psTdmaDuAdjType;\r
+       BOOLEAN         bResetTdmaAdjust;\r
+       BOOLEAN         bPrePsTdmaOn;\r
+       BOOLEAN         bCurPsTdmaOn;\r
+       //BOOLEAN               bPreBtAutoReport;\r
+       //BOOLEAN               bCurBtAutoReport;\r
+\r
+       // sw mechanism\r
+       BOOLEAN         bPreRfRxLpfShrink;\r
+       BOOLEAN         bCurRfRxLpfShrink;\r
+       u4Byte          btRf0x1eBackup;\r
+       BOOLEAN         bPreLowPenaltyRa;\r
+       BOOLEAN         bCurLowPenaltyRa;\r
+       BOOLEAN         bPreDacSwingOn;\r
+       u4Byte          preDacSwingLvl;\r
+       BOOLEAN         bCurDacSwingOn;\r
+       u4Byte          curDacSwingLvl;\r
+       BOOLEAN         bPreAdcBackOff;\r
+       BOOLEAN         bCurAdcBackOff;\r
+       BOOLEAN         bPreAgcTableEn;\r
+       BOOLEAN         bCurAgcTableEn;\r
+       u4Byte          preVal0x6c0;\r
+       u4Byte          curVal0x6c0;\r
+       u4Byte          preVal0x6c8;\r
+       u4Byte          curVal0x6c8;\r
+       u1Byte          preVal0x6cc;\r
+       u1Byte          curVal0x6cc;\r
+       BOOLEAN         bLimitedDig;\r
+\r
+       // algorithm related\r
+       u1Byte          preAlgorithm;\r
+       u1Byte          curAlgorithm;\r
+       u1Byte          btStatus;\r
+       u1Byte          wifiChnlInfo[3];\r
+} COEX_DM_8723A_2ANT, *PCOEX_DM_8723A_2ANT;\r
+\r
+typedef struct _COEX_STA_8723A_2ANT{\r
+       u4Byte                                  highPriorityTx;\r
+       u4Byte                                  highPriorityRx;\r
+       u4Byte                                  lowPriorityTx;\r
+       u4Byte                                  lowPriorityRx;\r
+       u1Byte                                  btRssi;\r
+       u1Byte                                  preBtRssiState;\r
+       u1Byte                                  preBtRssiState1;\r
+       u1Byte                                  preWifiRssiState[4];\r
+       BOOLEAN                                 bC2hBtInfoReqSent;\r
+       u1Byte                                  btInfoC2h[BT_INFO_SRC_8723A_2ANT_MAX][10];\r
+       u4Byte                                  btInfoC2hCnt[BT_INFO_SRC_8723A_2ANT_MAX];\r
+       BOOLEAN                                 bC2hBtInquiryPage;\r
+       u1Byte                                  btRetryCnt;\r
+       u1Byte                                  btInfoExt;\r
+       BOOLEAN                                 bHoldForStackOperation;\r
+       u1Byte                                  bHoldPeriodCnt;\r
+       // this is for c2h hang work-around\r
+       u4Byte                                  c2hHangDetectCnt;\r
+}COEX_STA_8723A_2ANT, *PCOEX_STA_8723A_2ANT;\r
+\r
+//===========================================\r
+// The following is interface which will notify coex module.\r
+//===========================================\r
+VOID\r
+EXhalbtc8723a2ant_PowerOnSetting(\r
+       IN      PBTC_COEXIST            pBtCoexist\r
+       );\r
+VOID\r
+EXhalbtc8723a2ant_InitHwConfig(\r
+       IN      PBTC_COEXIST            pBtCoexist,\r
+       IN      BOOLEAN                         bWifiOnly\r
+       );\r
+VOID\r
+EXhalbtc8723a2ant_InitCoexDm(\r
+       IN      PBTC_COEXIST            pBtCoexist\r
+       );\r
+VOID\r
+EXhalbtc8723a2ant_IpsNotify(\r
+       IN      PBTC_COEXIST            pBtCoexist,\r
+       IN      u1Byte                  type\r
+       );\r
+VOID\r
+EXhalbtc8723a2ant_LpsNotify(\r
+       IN      PBTC_COEXIST            pBtCoexist,\r
+       IN      u1Byte                  type\r
+       );\r
+VOID\r
+EXhalbtc8723a2ant_ScanNotify(\r
+       IN      PBTC_COEXIST            pBtCoexist,\r
+       IN      u1Byte                  type\r
+       );\r
+VOID\r
+EXhalbtc8723a2ant_ConnectNotify(\r
+       IN      PBTC_COEXIST            pBtCoexist,\r
+       IN      u1Byte                  type\r
+       );\r
+VOID\r
+EXhalbtc8723a2ant_MediaStatusNotify(\r
+       IN      PBTC_COEXIST                    pBtCoexist,\r
+       IN      u1Byte                          type\r
+       );\r
+VOID\r
+EXhalbtc8723a2ant_SpecialPacketNotify(\r
+       IN      PBTC_COEXIST                    pBtCoexist,\r
+       IN      u1Byte                          type\r
+       );\r
+VOID\r
+EXhalbtc8723a2ant_HaltNotify(\r
+       IN      PBTC_COEXIST                    pBtCoexist\r
+       );\r
+VOID\r
+EXhalbtc8723a2ant_Periodical(\r
+       IN      PBTC_COEXIST                    pBtCoexist\r
+       );\r
+VOID\r
+EXhalbtc8723a2ant_BtInfoNotify(\r
+       IN      PBTC_COEXIST            pBtCoexist,\r
+       IN      pu1Byte                 tmpBuf,\r
+       IN      u1Byte                  length\r
+       );\r
+VOID\r
+EXhalbtc8723a2ant_StackOperationNotify(\r
+       IN      PBTC_COEXIST                    pBtCoexist,\r
+       IN      u1Byte                          type\r
+       );\r
+VOID\r
+EXhalbtc8723a2ant_DisplayCoexInfo(\r
+       IN      PBTC_COEXIST            pBtCoexist\r
+       );\r
+\r