Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
nu11secur1ty
GitHub Repository: nu11secur1ty/Kali-Linux
Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/phydm_dfs.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_DFS_H__
27
#define __PHYDM_DFS_H__
28
29
#define DFS_VERSION "1.1"
30
31
/*@
32
* ============================================================
33
* Definition
34
* ============================================================
35
*/
36
37
/*@
38
* ============================================================
39
* 1 structure
40
* ============================================================
41
*/
42
43
struct _DFS_STATISTICS {
44
u8 mask_idx;
45
u8 igi_cur;
46
u8 igi_pre;
47
u8 st_l2h_cur;
48
u16 fa_count_pre;
49
u16 fa_inc_hist[5];
50
u16 vht_crc_ok_cnt_pre;
51
u16 ht_crc_ok_cnt_pre;
52
u16 leg_crc_ok_cnt_pre;
53
u16 short_pulse_cnt_pre;
54
u16 long_pulse_cnt_pre;
55
u8 pwdb_th;
56
u8 pwdb_th_cur;
57
u8 pwdb_scalar_factor;
58
u8 peak_th;
59
u8 short_pulse_cnt_th;
60
u8 long_pulse_cnt_th;
61
u8 peak_window;
62
u8 three_peak_opt;
63
u8 three_peak_th2;
64
u8 fa_mask_th;
65
u8 det_flag_offset;
66
u8 st_l2h_max;
67
u8 st_l2h_min;
68
u8 mask_hist_checked;
69
boolean pulse_flag_hist[5];
70
boolean pulse_type_hist[5];
71
boolean radar_det_mask_hist[5];
72
boolean idle_mode;
73
boolean force_TP_mode;
74
boolean dbg_mode;
75
boolean sw_trigger_mode;
76
boolean det_print;
77
boolean det_print2;
78
boolean radar_type;
79
u8 dfs_polling_time;
80
/*@dfs histogram*/
81
boolean print_hist_rpt;
82
boolean hist_cond_on;
83
boolean pri_cond1;
84
boolean pri_cond2;
85
boolean pri_cond3;
86
boolean pri_cond4;
87
boolean pri_cond5;
88
boolean pw_cond1;
89
boolean pw_cond2;
90
boolean pw_cond3;
91
boolean pri_type3_4_cond1; /*@for ETSI*/
92
boolean pri_type3_4_cond2; /*@for ETSI*/
93
boolean pw_long_cond1; /*@for long radar*/
94
boolean pw_long_cond2; /*@for long radar*/
95
boolean pri_long_cond1; /*@for long radar*/
96
boolean pw_flag;
97
boolean pri_flag;
98
boolean pri_type3_4_flag; /*@for ETSI*/
99
boolean long_radar_flag;
100
u16 pri_hold_sum[6];
101
u16 pw_hold_sum[6];
102
u16 pri_long_hold_sum[6];
103
u16 pw_long_hold_sum[6];
104
u8 hist_idx;
105
u8 hist_long_idx;
106
u8 pw_hold[4][6];
107
u8 pri_hold[4][6];
108
u8 pw_long_hold[300][6];
109
u8 pri_long_hold[300][6];
110
u16 pw_std; /*@The std(var) of reasonable num of pw group*/
111
u16 pri_std;/*@The std(var) of reasonable num of pri group*/
112
/*@dfs histogram threshold*/
113
u8 pri_hist_th;
114
u8 pri_sum_g1_th;
115
u8 pri_sum_g5_th;
116
u8 pri_sum_g1_fcc_th;
117
u8 pri_sum_g3_fcc_th;
118
u8 pri_sum_safe_fcc_th;
119
u8 pri_sum_type4_th;
120
u8 pri_sum_type6_th;
121
u8 pri_sum_safe_th;
122
u8 pri_sum_g5_under_g1_th;
123
u8 pri_pw_diff_th;
124
u8 pri_pw_diff_fcc_th;
125
u8 pri_pw_diff_fcc_idle_th;
126
u8 pri_pw_diff_w53_th;
127
u8 pri_type1_low_fcc_th;
128
u8 pri_type1_upp_fcc_th;
129
u8 pri_type1_cen_fcc_th;
130
u8 pw_g0_th;
131
u8 pw_long_lower_20m_th;
132
u8 pw_long_lower_th;
133
u8 pri_long_upper_th;
134
u8 pw_long_sum_upper_th;
135
u8 pw_std_th;
136
u8 pw_std_idle_th;
137
u8 pri_std_th;
138
u8 pri_std_idle_th;
139
u8 type4_pw_max_cnt;
140
u8 type4_safe_pri_sum_th;
141
};
142
143
/*@
144
* ============================================================
145
* enumeration
146
* ============================================================
147
*/
148
149
enum phydm_dfs_region_domain {
150
PHYDM_DFS_DOMAIN_UNKNOWN = 0,
151
PHYDM_DFS_DOMAIN_FCC = 1,
152
PHYDM_DFS_DOMAIN_MKK = 2,
153
PHYDM_DFS_DOMAIN_ETSI = 3,
154
};
155
156
/*@
157
* ============================================================
158
* function prototype
159
* ============================================================
160
*/
161
#if defined(CONFIG_PHYDM_DFS_MASTER)
162
void phydm_radar_detect_reset(void *dm_void);
163
void phydm_radar_detect_disable(void *dm_void);
164
void phydm_radar_detect_enable(void *dm_void);
165
boolean phydm_radar_detect(void *dm_void);
166
void phydm_dfs_histogram_radar_distinguish(void *dm_void);
167
boolean phydm_dfs_hist_log(void *dm_void, u8 index);
168
void phydm_dfs_parameter_init(void *dm_void);
169
void phydm_dfs_hist_dbg(void *dm_void, char input[][16], u32 *_used,
170
char *output, u32 *_out_len);
171
void phydm_dfs_debug(void *dm_void, char input[][16], u32 *_used,
172
char *output, u32 *_out_len);
173
u8 phydm_dfs_polling_time(void *dm_void);
174
#endif /* @defined(CONFIG_PHYDM_DFS_MASTER) */
175
176
boolean
177
phydm_dfs_is_meteorology_channel(void *dm_void);
178
179
void
180
phydm_dfs_segment_distinguish(void *dm_void, enum rf_syn syn_path);
181
182
void
183
phydm_dfs_segment_flag_reset(void *dm_void);
184
185
boolean
186
phydm_is_dfs_band(void *dm_void);
187
188
boolean
189
phydm_dfs_master_enabled(void *dm_void);
190
191
#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)
192
#ifdef PHYDM_IC_JGR3_SERIES_SUPPORT
193
void phydm_dfs_ap_reset_radar_detect_counter_and_flag(void *dm_void);
194
#endif
195
#endif
196
197
#endif /*@#ifndef __PHYDM_DFS_H__ */
198
199