GNU Linux-libre 4.14.294-gnu1
[releases.git] / drivers / staging / rtlwifi / phydm / phydm_ccx.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 #ifndef __PHYDMCCX_H__
26 #define __PHYDMCCX_H__
27
28 #define CCX_EN 1
29
30 #define SET_NHM_SETTING 0
31 #define STORE_NHM_SETTING 1
32 #define RESTORE_NHM_SETTING 2
33
34 enum nhm_inexclude_cca { NHM_EXCLUDE_CCA, NHM_INCLUDE_CCA };
35
36 enum nhm_inexclude_txon { NHM_EXCLUDE_TXON, NHM_INCLUDE_TXON };
37
38 struct ccx_info {
39         /*Settings*/
40         u8 NHM_th[11];
41         u16 NHM_period; /* 4us per unit */
42         u16 CLM_period; /* 4us per unit */
43         enum nhm_inexclude_txon nhm_inexclude_txon;
44         enum nhm_inexclude_cca nhm_inexclude_cca;
45
46         /*Previous Settings*/
47         u8 NHM_th_restore[11];
48         u16 NHM_period_restore; /* 4us per unit */
49         u16 CLM_period_restore; /* 4us per unit */
50         enum nhm_inexclude_txon NHM_inexclude_txon_restore;
51         enum nhm_inexclude_cca NHM_inexclude_cca_restore;
52
53         /*Report*/
54         u8 NHM_result[12];
55         u16 NHM_duration;
56         u16 CLM_result;
57
58         bool echo_NHM_en;
59         bool echo_CLM_en;
60         u8 echo_IGI;
61 };
62
63 /*NHM*/
64
65 void phydm_nhm_setting(void *dm_void, u8 nhm_setting);
66
67 void phydm_nhm_trigger(void *dm_void);
68
69 void phydm_get_nhm_result(void *dm_void);
70
71 bool phydm_check_nhm_ready(void *dm_void);
72
73 /*CLM*/
74
75 void phydm_clm_setting(void *dm_void);
76
77 void phydm_clm_trigger(void *dm_void);
78
79 bool phydm_check_cl_mready(void *dm_void);
80
81 void phydm_get_cl_mresult(void *dm_void);
82
83 #endif