Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/phydm_api.h
1307 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
* The full GNU General Public License is included in this distribution in the
15
* file called LICENSE.
16
*
17
* Contact Information:
18
* wlanfae <[email protected]>
19
* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20
* Hsinchu 300, Taiwan.
21
*
22
* Larry Finger <[email protected]>
23
*
24
*****************************************************************************/
25
26
#ifndef __PHYDM_API_H__
27
#define __PHYDM_API_H__
28
29
/* 2019.03.05 add reset txagc API for jgr3 ics*/
30
#define PHYDM_API_VERSION "2.1"
31
32
/* @1 ============================================================
33
* 1 Definition
34
* 1 ============================================================
35
*/
36
#define N_IC_TX_OFFEST_5_BIT (ODM_RTL8188E | ODM_RTL8192E)
37
38
#define N_IC_TX_OFFEST_6_BIT (ODM_RTL8723D | ODM_RTL8197F | ODM_RTL8710B |\
39
ODM_RTL8723B | ODM_RTL8703B | ODM_RTL8195A |\
40
ODM_RTL8188F)
41
42
#define N_IC_TX_OFFEST_7_BIT (ODM_RTL8721D | ODM_RTL8710C)
43
44
#define CN_CNT_MAX 10 /*@max condition number threshold*/
45
46
#define FUNC_ENABLE 1
47
#define FUNC_DISABLE 2
48
49
/*@NBI API------------------------------------*/
50
#define NBI_128TONE 27 /*register table size*/
51
#define NBI_256TONE 59 /*register table size*/
52
53
#define NUM_START_CH_80M 7
54
#define NUM_START_CH_40M 14
55
56
#define CH_OFFSET_40M 2
57
#define CH_OFFSET_80M 6
58
59
#define FFT_128_TYPE 1
60
#define FFT_256_TYPE 2
61
62
#define FREQ_POSITIVE 1
63
#define FREQ_NEGATIVE 2
64
/*@------------------------------------------------*/
65
66
enum phystat_rpt {
67
PHY_PWDB = 0,
68
PHY_EVM = 1,
69
PHY_CFO = 2,
70
PHY_RXSNR = 3,
71
PHY_LGAIN = 4,
72
PHY_HT_AAGC_GAIN = 5,
73
};
74
75
#ifndef PHYDM_COMMON_API_SUPPORT
76
#define INVALID_RF_DATA 0xffffffff
77
#define INVALID_TXAGC_DATA 0xff
78
#endif
79
80
/* @1 ============================================================
81
* 1 structure
82
* 1 ============================================================
83
*/
84
85
struct phydm_api_stuc {
86
u32 rxiqc_reg1; /*N-mode: for pathA REG0xc14*/
87
u32 rxiqc_reg2; /*N-mode: for pathB REG0xc1c*/
88
u8 tx_queue_bitmap; /*REG0x520[23:16]*/
89
u8 ccktx_path;
90
};
91
92
/* @1 ============================================================
93
* 1 enumeration
94
* 1 ============================================================
95
*/
96
97
/* @1 ============================================================
98
* 1 function prototype
99
* 1 ============================================================
100
*/
101
void phydm_reset_bb_hw_cnt(void *dm_void);
102
103
void phydm_dynamic_ant_weighting(void *dm_void);
104
105
#ifdef DYN_ANT_WEIGHTING_SUPPORT
106
void phydm_ant_weight_dbg(void *dm_void, char input[][16], u32 *_used,
107
char *output, u32 *_out_len);
108
#endif
109
110
void phydm_trx_antenna_setting_init(void *dm_void, u8 num_rf_path);
111
112
void phydm_config_ofdm_rx_path(void *dm_void, enum bb_path path);
113
114
void phydm_config_cck_rx_path(void *dm_void, enum bb_path path);
115
116
void phydm_config_cck_rx_antenna_init(void *dm_void);
117
118
void phydm_config_trx_path(void *dm_void, char input[][16], u32 *_used,
119
char *output, u32 *_out_len);
120
121
void phydm_config_ofdm_tx_path(void *dm_void, enum bb_path path);
122
123
void phydm_config_cck_tx_path(void *dm_void, enum bb_path path);
124
125
void phydm_tx_2path(void *dm_void);
126
127
void phydm_stop_3_wire(void *dm_void, u8 set_type);
128
129
u8 phydm_stop_ic_trx(void *dm_void, u8 set_type);
130
131
void phydm_dis_cck_trx(void *dm_void, u8 set_type);
132
133
void phydm_set_ext_switch(void *dm_void, u32 ext_ant_switch);
134
135
void phydm_nbi_enable(void *dm_void, u32 enable);
136
137
u8 phydm_csi_mask_setting(void *dm_void, u32 enable, u32 ch, u32 bw, u32 f_intf,
138
u32 sec_ch);
139
140
u8 phydm_nbi_setting(void *dm_void, u32 enable, u32 ch, u32 bw, u32 f_intf,
141
u32 sec_ch);
142
143
void phydm_nbi_debug(void *dm_void, char input[][16], u32 *_used,
144
char *output, u32 *_out_len);
145
146
void phydm_csi_debug(void *dm_void, char input[][16], u32 *_used,
147
char *output, u32 *_out_len);
148
149
void phydm_stop_ck320(void *dm_void, u8 enable);
150
151
boolean
152
phydm_set_bb_txagc_offset(void *dm_void, s8 power_offset, u8 add_half_db);
153
#ifdef PHYDM_IC_JGR3_SERIES_SUPPORT
154
u8 phydm_csi_mask_setting_jgr3(void *dm_void, u32 enable, u32 ch, u32 bw,
155
u32 f_intf, u32 sec_ch, u8 wgt);
156
157
void phydm_set_csi_mask_jgr3(void *dm_void, u32 tone_idx_tmp, u8 tone_direction,
158
u8 wgt);
159
160
u8 phydm_nbi_setting_jgr3(void *dm_void, u32 enable, u32 ch, u32 bw, u32 f_intf,
161
u32 sec_ch, u8 path);
162
163
void phydm_set_nbi_reg_jgr3(void *dm_void, u32 tone_idx_tmp, u8 tone_direction,
164
u8 path);
165
166
void phydm_nbi_enable_jgr3(void *dm_void, u32 enable, u8 path);
167
168
u8 phydm_phystat_rpt_jgr3(void *dm_void, enum phystat_rpt info,
169
enum rf_path ant_path);
170
void phydm_user_position_for_sniffer(void *dm_void, u8 user_position);
171
172
#endif
173
174
#ifdef PHYDM_COMMON_API_SUPPORT
175
void phydm_reset_txagc(void *dm_void);
176
177
boolean
178
phydm_api_shift_txagc(void *dm_void, u32 pwr_offset, enum rf_path path,
179
boolean is_positive);
180
boolean
181
phydm_api_set_txagc(void *dm_void, u32 power_index, enum rf_path path,
182
u8 hw_rate, boolean is_single_rate);
183
184
u8 phydm_api_get_txagc(void *dm_void, enum rf_path path, u8 hw_rate);
185
186
boolean
187
phydm_api_switch_bw_channel(void *dm_void, u8 central_ch, u8 primary_ch_idx,
188
enum channel_width bandwidth);
189
190
boolean
191
phydm_api_trx_mode(void *dm_void, enum bb_path tx_path, enum bb_path rx_path,
192
enum bb_path tx_path_ctrl);
193
194
#endif
195
196
#ifdef CONFIG_MCC_DM
197
#ifdef DYN_ANT_WEIGHTING_SUPPORT
198
void phydm_dynamic_ant_weighting_mcc_8822b(void *dm_void);
199
#endif /*#ifdef DYN_ANT_WEIGHTING_SUPPORT*/
200
void phydm_fill_mcccmd(void *dm_void, u8 regid, u16 reg_add,
201
u8 val0, u8 val1);
202
u8 phydm_check(void *dm_void);
203
void phydm_mcc_init(void *dm_void);
204
void phydm_mcc_switch(void *dm_void);
205
#endif /*#ifdef CONFIG_MCC_DM*/
206
207
#endif
208
209