OSDN Git Service

Add rtl8821ce driver version 5.5.2
[android-x86/external-kernel-drivers.git] / rtl8821ce / hal / phydm / halrf / halphyrf_ap.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2017 Realtek Corporation.
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  *****************************************************************************/
15
16 #ifndef __HALPHYRF_H__
17 #define __HALPHYRF_H__
18
19 #include "halrf/halrf_powertracking_ap.h"
20 #include "halrf/halrf_kfree.h"
21
22 #if (RTL8814A_SUPPORT == 1)
23         #include "halrf/rtl8814a/halrf_iqk_8814a.h"
24 #endif
25
26 #if (RTL8822B_SUPPORT == 1)
27         #include "halrf/rtl8822b/halrf_iqk_8822b.h"
28 #endif
29
30 #if (RTL8821C_SUPPORT == 1)
31         #include "halrf/rtl8821c/halrf_iqk_8821c.h"
32 #endif
33
34 #if (RTL8195B_SUPPORT == 1)
35 //      #include "halrf/rtl8195b/halrf.h"
36         #include "halrf/rtl8195b/halrf_iqk_8195b.h"
37         #include "halrf/rtl8195b/halrf_txgapk_8195b.h"
38         #include "halrf/rtl8195b/halrf_dpk_8195b.h"
39 #endif
40 #if (RTL8198F_SUPPORT == 1)
41         #include "halrf/rtl8198f/halrf_iqk_8198f.h"
42         #include "halrf/rtl8198f/halrf_dpk_8198f.h"
43 #endif
44
45 enum pwrtrack_method {
46         BBSWING,
47         TXAGC,
48         MIX_MODE,
49         TSSI_MODE
50 };
51
52 typedef void    (*func_set_pwr)(void *, enum pwrtrack_method, u8, u8);
53 typedef void(*func_iqk)(void *, u8, u8, u8);
54 typedef void    (*func_lck)(void *);
55 /* refine by YuChen for 8814A */
56 typedef void    (*func_swing)(void *, u8 **, u8 **, u8 **, u8 **);
57 typedef void    (*func_swing8814only)(void *, u8 **, u8 **, u8 **, u8 **);
58 typedef void    (*func_all_swing)(void *, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **);
59 typedef void    (*func_all_swing_ex)(void *, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **);
60
61 struct txpwrtrack_cfg {
62         u8              swing_table_size_cck;
63         u8              swing_table_size_ofdm;
64         u8              threshold_iqk;
65         u8              threshold_dpk;
66         u8              average_thermal_num;
67         u8              rf_path_count;
68         u32             thermal_reg_addr;
69         func_set_pwr    odm_tx_pwr_track_set_pwr;
70         func_iqk        do_iqk;
71         func_lck                phy_lc_calibrate;
72         func_swing      get_delta_swing_table;
73         func_swing8814only      get_delta_swing_table8814only;
74         func_all_swing          get_delta_all_swing_table;
75         func_all_swing_ex       get_delta_all_swing_table_ex;
76 };
77
78 void
79 configure_txpower_track(
80         void            *dm_void,
81         struct txpwrtrack_cfg   *config
82 );
83
84
85 void
86 odm_txpowertracking_callback_thermal_meter(
87         void            *dm_void
88 );
89
90 #if (RTL8192E_SUPPORT == 1)
91 void
92 odm_txpowertracking_callback_thermal_meter_92e(
93         void            *dm_void
94 );
95 #endif
96
97 #if (RTL8814A_SUPPORT == 1)
98 void
99 odm_txpowertracking_callback_thermal_meter_jaguar_series2(
100         void            *dm_void
101 );
102
103 #elif ODM_IC_11AC_SERIES_SUPPORT
104 void
105 odm_txpowertracking_callback_thermal_meter_jaguar_series(
106         void            *dm_void
107 );
108
109 #elif (RTL8197F_SUPPORT == 1 || RTL8822B_SUPPORT == 1)
110 void
111 odm_txpowertracking_callback_thermal_meter_jaguar_series3(
112         void            *dm_void
113 );
114
115 #endif
116
117 #define IS_CCK_RATE(_rate)                              (ODM_MGN_1M == _rate || _rate == ODM_MGN_2M || _rate == ODM_MGN_5_5M || _rate == ODM_MGN_11M)
118
119 #define ODM_TARGET_CHNL_NUM_2G_5G       59
120
121
122 void
123 odm_reset_iqk_result(
124         void            *dm_void
125 );
126 u8
127 odm_get_right_chnl_place_for_iqk(
128         u8 chnl
129 );
130
131 void phydm_rf_init(void         *dm_void);
132 void phydm_rf_watchdog(void             *dm_void);
133
134 #endif  /*#ifndef __HALPHYRF_H__*/