Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/phydm_dfs.h
1307 views
/******************************************************************************1*2* Copyright(c) 2007 - 2017 Realtek Corporation.3*4* This program is free software; you can redistribute it and/or modify it5* under the terms of version 2 of the GNU General Public License as6* published by the Free Software Foundation.7*8* This program is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for11* more details.12*13* The full GNU General Public License is included in this distribution in the14* file called LICENSE.15*16* Contact Information:17* wlanfae <[email protected]>18* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,19* Hsinchu 300, Taiwan.20*21* Larry Finger <[email protected]>22*23*****************************************************************************/2425#ifndef __PHYDM_DFS_H__26#define __PHYDM_DFS_H__2728#define DFS_VERSION "1.1"2930/*@31* ============================================================32* Definition33* ============================================================34*/3536/*@37* ============================================================38* 1 structure39* ============================================================40*/4142struct _DFS_STATISTICS {43u8 mask_idx;44u8 igi_cur;45u8 igi_pre;46u8 st_l2h_cur;47u16 fa_count_pre;48u16 fa_inc_hist[5];49u16 vht_crc_ok_cnt_pre;50u16 ht_crc_ok_cnt_pre;51u16 leg_crc_ok_cnt_pre;52u16 short_pulse_cnt_pre;53u16 long_pulse_cnt_pre;54u8 pwdb_th;55u8 pwdb_th_cur;56u8 pwdb_scalar_factor;57u8 peak_th;58u8 short_pulse_cnt_th;59u8 long_pulse_cnt_th;60u8 peak_window;61u8 three_peak_opt;62u8 three_peak_th2;63u8 fa_mask_th;64u8 det_flag_offset;65u8 st_l2h_max;66u8 st_l2h_min;67u8 mask_hist_checked;68boolean pulse_flag_hist[5];69boolean pulse_type_hist[5];70boolean radar_det_mask_hist[5];71boolean idle_mode;72boolean force_TP_mode;73boolean dbg_mode;74boolean sw_trigger_mode;75boolean det_print;76boolean det_print2;77boolean radar_type;78u8 dfs_polling_time;79/*@dfs histogram*/80boolean print_hist_rpt;81boolean hist_cond_on;82boolean pri_cond1;83boolean pri_cond2;84boolean pri_cond3;85boolean pri_cond4;86boolean pri_cond5;87boolean pw_cond1;88boolean pw_cond2;89boolean pw_cond3;90boolean pri_type3_4_cond1; /*@for ETSI*/91boolean pri_type3_4_cond2; /*@for ETSI*/92boolean pw_long_cond1; /*@for long radar*/93boolean pw_long_cond2; /*@for long radar*/94boolean pri_long_cond1; /*@for long radar*/95boolean pw_flag;96boolean pri_flag;97boolean pri_type3_4_flag; /*@for ETSI*/98boolean long_radar_flag;99u16 pri_hold_sum[6];100u16 pw_hold_sum[6];101u16 pri_long_hold_sum[6];102u16 pw_long_hold_sum[6];103u8 hist_idx;104u8 hist_long_idx;105u8 pw_hold[4][6];106u8 pri_hold[4][6];107u8 pw_long_hold[300][6];108u8 pri_long_hold[300][6];109u16 pw_std; /*@The std(var) of reasonable num of pw group*/110u16 pri_std;/*@The std(var) of reasonable num of pri group*/111/*@dfs histogram threshold*/112u8 pri_hist_th;113u8 pri_sum_g1_th;114u8 pri_sum_g5_th;115u8 pri_sum_g1_fcc_th;116u8 pri_sum_g3_fcc_th;117u8 pri_sum_safe_fcc_th;118u8 pri_sum_type4_th;119u8 pri_sum_type6_th;120u8 pri_sum_safe_th;121u8 pri_sum_g5_under_g1_th;122u8 pri_pw_diff_th;123u8 pri_pw_diff_fcc_th;124u8 pri_pw_diff_fcc_idle_th;125u8 pri_pw_diff_w53_th;126u8 pri_type1_low_fcc_th;127u8 pri_type1_upp_fcc_th;128u8 pri_type1_cen_fcc_th;129u8 pw_g0_th;130u8 pw_long_lower_20m_th;131u8 pw_long_lower_th;132u8 pri_long_upper_th;133u8 pw_long_sum_upper_th;134u8 pw_std_th;135u8 pw_std_idle_th;136u8 pri_std_th;137u8 pri_std_idle_th;138u8 type4_pw_max_cnt;139u8 type4_safe_pri_sum_th;140};141142/*@143* ============================================================144* enumeration145* ============================================================146*/147148enum phydm_dfs_region_domain {149PHYDM_DFS_DOMAIN_UNKNOWN = 0,150PHYDM_DFS_DOMAIN_FCC = 1,151PHYDM_DFS_DOMAIN_MKK = 2,152PHYDM_DFS_DOMAIN_ETSI = 3,153};154155/*@156* ============================================================157* function prototype158* ============================================================159*/160#if defined(CONFIG_PHYDM_DFS_MASTER)161void phydm_radar_detect_reset(void *dm_void);162void phydm_radar_detect_disable(void *dm_void);163void phydm_radar_detect_enable(void *dm_void);164boolean phydm_radar_detect(void *dm_void);165void phydm_dfs_histogram_radar_distinguish(void *dm_void);166boolean phydm_dfs_hist_log(void *dm_void, u8 index);167void phydm_dfs_parameter_init(void *dm_void);168void phydm_dfs_hist_dbg(void *dm_void, char input[][16], u32 *_used,169char *output, u32 *_out_len);170void phydm_dfs_debug(void *dm_void, char input[][16], u32 *_used,171char *output, u32 *_out_len);172u8 phydm_dfs_polling_time(void *dm_void);173#endif /* @defined(CONFIG_PHYDM_DFS_MASTER) */174175boolean176phydm_dfs_is_meteorology_channel(void *dm_void);177178void179phydm_dfs_segment_distinguish(void *dm_void, enum rf_syn syn_path);180181void182phydm_dfs_segment_flag_reset(void *dm_void);183184boolean185phydm_is_dfs_band(void *dm_void);186187boolean188phydm_dfs_master_enabled(void *dm_void);189190#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)191#ifdef PHYDM_IC_JGR3_SERIES_SUPPORT192void phydm_dfs_ap_reset_radar_detect_counter_and_flag(void *dm_void);193#endif194#endif195196#endif /*@#ifndef __PHYDM_DFS_H__ */197198199