net: wireless: rockchip_wlan: add rtl8723cs support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723cs / hal / phydm / phydm_acs.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 __PHYDMACS_H__
22 #define    __PHYDMACS_H__
23
24 #define ACS_VERSION     "1.1"   /*20150729 by YuChen*/
25 #define CLM_VERSION "1.0"
26
27 #define ODM_MAX_CHANNEL_2G                      14
28 #define ODM_MAX_CHANNEL_5G                      24
29
30 /* For phydm_auto_channel_select_setting_ap() */
31 #define STORE_DEFAULT_NHM_SETTING               0
32 #define RESTORE_DEFAULT_NHM_SETTING             1
33 #define ACS_NHM_SETTING                         2
34
35 struct _ACS_ {
36         boolean         is_force_acs_result;
37         u8              clean_channel_2g;
38         u8              clean_channel_5g;
39         u16             channel_info_2g[2][ODM_MAX_CHANNEL_2G];         /* Channel_Info[1]: channel score, Channel_Info[2]:Channel_Scan_Times */
40         u16             channel_info_5g[2][ODM_MAX_CHANNEL_5G];
41
42 #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
43         u8              acs_step;
44         /* NHM count 0-11 */
45         u8              nhm_cnt[14][11];
46
47         /* AC-Series, for storing previous setting */
48         u32              reg0x990;
49         u32              reg0x994;
50         u32              reg0x998;
51         u32              reg0x99c;
52         u8              reg0x9a0;   /* u8 */
53
54         /* N-Series, for storing previous setting */
55         u32              reg0x890;
56         u32              reg0x894;
57         u32              reg0x898;
58         u32              reg0x89c;
59         u8              reg0xe28;   /* u8 */
60 #endif
61
62 };
63
64
65 void
66 odm_auto_channel_select_init(
67         void                    *p_dm_void
68 );
69
70 void
71 odm_auto_channel_select_reset(
72         void                    *p_dm_void
73 );
74
75 void
76 odm_auto_channel_select(
77         void                    *p_dm_void,
78         u8                      channel
79 );
80
81 u8
82 odm_get_auto_channel_select_result(
83         void                    *p_dm_void,
84         u8                      band
85 );
86
87 #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
88
89 void
90 phydm_auto_channel_select_setting_ap(
91         void   *p_dm_void,
92         u32  setting,             /* 0: STORE_DEFAULT_NHM_SETTING; 1: RESTORE_DEFAULT_NHM_SETTING, 2: ACS_NHM_SETTING */
93         u32  acs_step
94 );
95
96 void
97 phydm_get_nhm_statistics_ap(
98         void       *p_dm_void,
99         u32      idx,                /* @ 2G, Real channel number = idx+1 */
100         u32      acs_step
101 );
102
103 #endif  /* #if ( DM_ODM_SUPPORT_TYPE & ODM_AP ) */
104
105 #endif  /* #ifndef      __PHYDMACS_H__ */