GNU Linux-libre 4.19.286-gnu1
[releases.git] / drivers / staging / rtlwifi / phydm / phydm_cfotracking.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /******************************************************************************
3  *
4  * Copyright(c) 2007 - 2016  Realtek Corporation.
5  *
6  * Contact Information:
7  * wlanfae <wlanfae@realtek.com>
8  * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
9  * Hsinchu 300, Taiwan.
10  *
11  * Larry Finger <Larry.Finger@lwfinger.net>
12  *
13  *****************************************************************************/
14
15 #ifndef __PHYDMCFOTRACK_H__
16 #define __PHYDMCFOTRACK_H__
17
18 #define CFO_TRACKING_VERSION "1.4" /*2015.10.01 Stanley, Modify for 8822B*/
19
20 #define CFO_TH_XTAL_HIGH 20 /* kHz */
21 #define CFO_TH_XTAL_LOW 10 /* kHz */
22 #define CFO_TH_ATC 80 /* kHz */
23
24 struct cfo_tracking {
25         bool is_atc_status;
26         bool large_cfo_hit;
27         bool is_adjust;
28         u8 crystal_cap;
29         u8 def_x_cap;
30         s32 CFO_tail[4];
31         u32 CFO_cnt[4];
32         s32 CFO_ave_pre;
33         u32 packet_count;
34         u32 packet_count_pre;
35
36         bool is_force_xtal_cap;
37         bool is_reset;
38 };
39
40 void odm_cfo_tracking_reset(void *dm_void);
41
42 void odm_cfo_tracking_init(void *dm_void);
43
44 void odm_cfo_tracking(void *dm_void);
45
46 void odm_parsing_cfo(void *dm_void, void *pktinfo_void, s8 *pcfotail,
47                      u8 num_ss);
48
49 #endif