GNU Linux-libre 4.14.251-gnu1
[releases.git] / drivers / staging / rtlwifi / phydm / phydm_cfotracking.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2016  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 <wlanfae@realtek.com>
19  * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20  * Hsinchu 300, Taiwan.
21  *
22  * Larry Finger <Larry.Finger@lwfinger.net>
23  *
24  *****************************************************************************/
25
26 #ifndef __PHYDMCFOTRACK_H__
27 #define __PHYDMCFOTRACK_H__
28
29 #define CFO_TRACKING_VERSION "1.4" /*2015.10.01 Stanley, Modify for 8822B*/
30
31 #define CFO_TH_XTAL_HIGH 20 /* kHz */
32 #define CFO_TH_XTAL_LOW 10 /* kHz */
33 #define CFO_TH_ATC 80 /* kHz */
34
35 struct cfo_tracking {
36         bool is_atc_status;
37         bool large_cfo_hit;
38         bool is_adjust;
39         u8 crystal_cap;
40         u8 def_x_cap;
41         s32 CFO_tail[4];
42         u32 CFO_cnt[4];
43         s32 CFO_ave_pre;
44         u32 packet_count;
45         u32 packet_count_pre;
46
47         bool is_force_xtal_cap;
48         bool is_reset;
49 };
50
51 void odm_cfo_tracking_reset(void *dm_void);
52
53 void odm_cfo_tracking_init(void *dm_void);
54
55 void odm_cfo_tracking(void *dm_void);
56
57 void odm_parsing_cfo(void *dm_void, void *pktinfo_void, s8 *pcfotail,
58                      u8 num_ss);
59
60 #endif