net: wireless: rockchip_wlan: add rtl8188eu support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8188eu / hal / phydm / halphyrf_win.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12  * more details.
13  *
14  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17  *
18  *
19  ******************************************************************************/
20  
21  #ifndef __HAL_PHY_RF_H__
22  #define __HAL_PHY_RF_H__
23  
24 #include "phydm_kfree.h"
25 #if (RTL8814A_SUPPORT == 1)
26 #include "rtl8814a/phydm_iqk_8814a.h"
27 #endif
28
29 #if (RTL8822B_SUPPORT == 1)
30 #include "rtl8822b/phydm_iqk_8822b.h"
31 #endif
32 #include "phydm_powertracking_win.h"
33
34 typedef enum _SPUR_CAL_METHOD {
35         PLL_RESET,
36         AFE_PHASE_SEL
37 } SPUR_CAL_METHOD;
38
39 typedef enum _PWRTRACK_CONTROL_METHOD {
40         BBSWING,
41         TXAGC,
42         MIX_MODE,
43         TSSI_MODE
44 } PWRTRACK_METHOD;
45
46 typedef VOID    (*FuncSetPwr)(PDM_ODM_T, PWRTRACK_METHOD, u1Byte, u1Byte);
47 typedef VOID(*FuncIQK)(PVOID, u1Byte, u1Byte, u1Byte);
48 typedef VOID    (*FuncLCK)(PDM_ODM_T);
49                                 //refine by YuChen for 8814A
50 typedef VOID    (*FuncSwing)(PDM_ODM_T, pu1Byte*, pu1Byte*, pu1Byte*, pu1Byte*);
51 typedef VOID    (*FuncSwing8814only)(PDM_ODM_T, pu1Byte*, pu1Byte*, pu1Byte*, pu1Byte*);
52
53 typedef struct _TXPWRTRACK_CFG {
54         u1Byte          SwingTableSize_CCK;     
55         u1Byte          SwingTableSize_OFDM;
56         u1Byte          Threshold_IQK;
57         u1Byte          Threshold_DPK;  
58         u1Byte          AverageThermalNum;
59         u1Byte          RfPathCount;
60         u4Byte          ThermalRegAddr; 
61         FuncSetPwr      ODM_TxPwrTrackSetPwr;
62         FuncIQK         DoIQK;
63         FuncLCK         PHY_LCCalibrate;
64         FuncSwing       GetDeltaSwingTable;
65         FuncSwing8814only       GetDeltaSwingTable8814only;
66 } TXPWRTRACK_CFG, *PTXPWRTRACK_CFG;
67
68 VOID 
69 ConfigureTxpowerTrack(
70         IN      PDM_ODM_T               pDM_Odm,
71         OUT     PTXPWRTRACK_CFG pConfig
72         );
73
74
75 VOID
76 ODM_ClearTxPowerTrackingState(
77         IN PDM_ODM_T            pDM_Odm
78         );
79
80 VOID
81 ODM_TXPowerTrackingCallback_ThermalMeter(
82 #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
83         IN PDM_ODM_T            pDM_Odm
84 #else
85         IN PADAPTER     Adapter
86 #endif
87         );
88
89
90
91 #define ODM_TARGET_CHNL_NUM_2G_5G       59
92
93
94 VOID
95 ODM_ResetIQKResult(
96         IN PDM_ODM_T    pDM_Odm 
97 );
98 u1Byte 
99 ODM_GetRightChnlPlaceforIQK(
100     IN u1Byte chnl
101 );
102
103 VOID odm_IQCalibrate(IN PDM_ODM_T       pDM_Odm);
104 VOID phydm_rf_init(     IN              PDM_ODM_T               pDM_Odm);
105 VOID phydm_rf_watchdog( IN              PDM_ODM_T               pDM_Odm);
106                                                                 
107 #endif  // #ifndef __HAL_PHY_RF_H__
108