Linux-libre 4.14.2-gnu
[librecmc/linux-libre.git] / drivers / staging / rtlwifi / phydm / phydm_acs.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 __PHYDMACS_H__
27 #define __PHYDMACS_H__
28
29 #define ACS_VERSION "1.1" /*20150729 by YuChen*/
30 #define CLM_VERSION "1.0"
31
32 #define ODM_MAX_CHANNEL_2G 14
33 #define ODM_MAX_CHANNEL_5G 24
34
35 /* For phydm_auto_channel_select_setting_ap() */
36 #define STORE_DEFAULT_NHM_SETTING 0
37 #define RESTORE_DEFAULT_NHM_SETTING 1
38 #define ACS_NHM_SETTING 2
39
40 struct acs_info {
41         bool is_force_acs_result;
42         u8 clean_channel_2g;
43         u8 clean_channel_5g;
44         /* channel_info[1]: channel score, channel_info[2]:channel_scan_times */
45         u16 channel_info_2g[2][ODM_MAX_CHANNEL_2G];
46         u16 channel_info_5g[2][ODM_MAX_CHANNEL_5G];
47 };
48
49 void odm_auto_channel_select_init(void *dm_void);
50
51 void odm_auto_channel_select_reset(void *dm_void);
52
53 void odm_auto_channel_select(void *dm_void, u8 channel);
54
55 u8 odm_get_auto_channel_select_result(void *dm_void, u8 band);
56
57 #endif /* #ifndef       __PHYDMACS_H__ */