Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/halrf/halphyrf_ap.h
1308 views
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
41
#if (RTL8198F_SUPPORT == 1)
42
#include "halrf/rtl8198f/halrf_iqk_8198f.h"
43
#include "halrf/rtl8198f/halrf_dpk_8198f.h"
44
#endif
45
46
#if (RTL8812F_SUPPORT == 1)
47
#include "halrf/rtl8812f/halrf_iqk_8812f.h"
48
#include "halrf/rtl8812f/halrf_dpk_8812f.h"
49
#include "halrf/rtl8812f/halrf_tssi_8812f.h"
50
#endif
51
52
#if (RTL8814B_SUPPORT == 1)
53
#include "halrf/rtl8814b/halrf_iqk_8814b.h"
54
#include "halrf/rtl8814b/halrf_dpk_8814b.h"
55
#endif
56
57
#if (RTL8197G_SUPPORT == 1)
58
#include "halrf/rtl8197g/halrf_iqk_8197g.h"
59
#include "halrf/rtl8197g/halrf_dpk_8197g.h"
60
#include "halrf/rtl8197g/halrf_tssi_8197g.h"
61
#endif
62
63
enum pwrtrack_method {
64
BBSWING,
65
TXAGC,
66
MIX_MODE,
67
TSSI_MODE,
68
MIX_2G_TSSI_5G_MODE,
69
MIX_5G_TSSI_2G_MODE,
70
CLEAN_MODE
71
};
72
73
typedef void (*func_set_pwr)(void *, enum pwrtrack_method, u8, u8);
74
typedef void(*func_iqk)(void *, u8, u8, u8);
75
typedef void (*func_lck)(void *);
76
typedef void (*func_tssi_dck)(void *, u8);
77
/* refine by YuChen for 8814A */
78
typedef void (*func_swing)(void *, u8 **, u8 **, u8 **, u8 **);
79
typedef void (*func_swing8814only)(void *, u8 **, u8 **, u8 **, u8 **);
80
typedef void (*func_all_swing)(void *, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **);
81
typedef void (*func_all_swing_ex)(void *, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **, u8 **);
82
83
struct txpwrtrack_cfg {
84
u8 swing_table_size_cck;
85
u8 swing_table_size_ofdm;
86
u8 threshold_iqk;
87
u8 threshold_dpk;
88
u8 average_thermal_num;
89
u8 rf_path_count;
90
u32 thermal_reg_addr;
91
func_set_pwr odm_tx_pwr_track_set_pwr;
92
func_iqk do_iqk;
93
func_lck phy_lc_calibrate;
94
func_tssi_dck do_tssi_dck;
95
func_swing get_delta_swing_table;
96
func_swing8814only get_delta_swing_table8814only;
97
func_all_swing get_delta_all_swing_table;
98
func_all_swing_ex get_delta_all_swing_table_ex;
99
};
100
101
void
102
odm_clear_txpowertracking_state(
103
void *dm_void
104
);
105
106
void
107
configure_txpower_track(
108
void *dm_void,
109
struct txpwrtrack_cfg *config
110
);
111
112
113
void
114
odm_txpowertracking_callback_thermal_meter(
115
void *dm_void
116
);
117
118
#if (RTL8192E_SUPPORT == 1)
119
void
120
odm_txpowertracking_callback_thermal_meter_92e(
121
void *dm_void
122
);
123
#endif
124
125
#if (RTL8814A_SUPPORT == 1)
126
void
127
odm_txpowertracking_callback_thermal_meter_jaguar_series2(
128
void *dm_void
129
);
130
131
#elif ODM_IC_11AC_SERIES_SUPPORT
132
void
133
odm_txpowertracking_callback_thermal_meter_jaguar_series(
134
void *dm_void
135
);
136
137
#elif (RTL8197F_SUPPORT == 1 || RTL8192F_SUPPORT == 1 || RTL8822B_SUPPORT == 1 ||\
138
RTL8821C_SUPPORT == 1 || RTL8198F_SUPPORT == 1)
139
void
140
odm_txpowertracking_callback_thermal_meter_jaguar_series3(
141
void *dm_void
142
);
143
144
#elif (RTL8814B_SUPPORT == 1 || RTL8812F_SUPPORT == 1 || RTL8822C_SUPPORT == 1 || RTL8197G_SUPPORT == 1)
145
void
146
odm_txpowertracking_callback_thermal_meter_jaguar_series4(
147
void *dm_void
148
);
149
150
#endif
151
152
#define IS_CCK_RATE(_rate) (ODM_MGN_1M == _rate || _rate == ODM_MGN_2M || _rate == ODM_MGN_5_5M || _rate == ODM_MGN_11M)
153
154
#define ODM_TARGET_CHNL_NUM_2G_5G 59
155
156
157
void
158
odm_reset_iqk_result(
159
void *dm_void
160
);
161
u8
162
odm_get_right_chnl_place_for_iqk(
163
u8 chnl
164
);
165
166
void phydm_rf_init(void *dm_void);
167
void phydm_rf_watchdog(void *dm_void);
168
169
#endif /*#ifndef __HALPHYRF_H__*/
170
171