net: wireless: rockchip_wlan: add rtl8723cs support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723cs / hal / phydm / phydm_dynamic_rx_path.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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  * You should have received a copy of the GNU General Public License along with
15  * this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
17  *
18  *
19  ******************************************************************************/
20
21 #ifndef __PHYDMDYMICRXPATH_H__
22 #define    __PHYDMDYMICRXPATH_H__
23
24 #define DYNAMIC_RX_PATH_VERSION "1.0"  /*2016.07.15  Dino */
25
26
27 #define DRP_RSSI_TH     35
28
29 #define INIT_DRP_TIMMER         0
30 #define CANCEL_DRP_TIMMER               1
31 #define RELEASE_DRP_TIMMER              2
32
33 #if (CONFIG_DYNAMIC_RX_PATH == 1)
34
35 enum drp_state_e {
36         DRP_INIT_STATE                          = 0,
37         DRP_TRAINING_STATE_0    = 1,
38         DRP_TRAINING_STATE_1            = 2,
39         DRP_TRAINING_STATE_2            = 3,
40         DRP_DECISION_STATE              = 4
41 };
42
43 enum adjustable_value_e {
44         DRP_TRAINING_TIME               = 0,
45         DRP_TRAINING_PERIOD     = 1,
46         DRP_RSSI_THRESHOLD      = 2,
47         DRP_FA_THRESHOLD                = 3,
48         DRP_FA_DIFF_THRESHOLD = 4
49 };
50
51 struct _DYNAMIC_RX_PATH_ {
52         u8                      curr_rx_path;
53         u8                      drp_state;
54         u16                     training_time;
55         u8                      rssi_threshold;
56         u32                     fa_count_thresold;
57         u32                     fa_diff_threshold;
58         u32                     curr_cca_all_cnt_0;
59         u32                     curr_fa_all_cnt_0;
60         u32                     curr_cca_all_cnt_1;
61         u32                     curr_fa_all_cnt_1;
62         u32                     curr_cca_all_cnt_2;
63         u32                     curr_fa_all_cnt_2;
64         u8                      drp_skip_counter;
65         u8                      drp_period;
66         u8                      drp_init_finished;
67
68 #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
69 #if USE_WORKITEM
70         RT_WORK_ITEM    phydm_dynamic_rx_path_workitem;
71 #endif
72 #endif
73         struct timer_list               phydm_dynamic_rx_path_timer;
74
75 };
76
77
78
79 void
80 phydm_process_phy_status_for_dynamic_rx_path(
81         void                    *p_dm_void,
82         void                    *p_phy_info_void,
83         void                    *p_pkt_info_void
84 );
85
86 void
87 phydm_dynamic_rx_path(
88         void                    *p_dm_void
89 );
90
91 #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
92 void
93 phydm_dynamic_rx_path_callback(
94         struct timer_list               *p_timer
95 );
96
97 void
98 phydm_dynamic_rx_path_workitem_callback(
99         void            *p_context
100 );
101
102 #else if (DM_ODM_SUPPORT_TYPE == ODM_CE)
103
104 void
105 phydm_dynamic_rx_path_callback(
106         void *function_context
107 );
108
109 #endif
110
111 void
112 phydm_dynamic_rx_path_timers(
113         void            *p_dm_void,
114         u8              state
115 );
116
117 void
118 phydm_dynamic_rx_path_init(
119         void                    *p_dm_void
120 );
121
122 void
123 phydm_drp_debug(
124         void            *p_dm_void,
125         u32             *const dm_value,
126         u32             *_used,
127         char                    *output,
128         u32             *_out_len
129 );
130
131 void
132 phydm_dynamic_rx_path_caller(
133         void                    *p_dm_void
134 );
135
136 #endif
137 #endif