OSDN Git Service

Add rtl8723bu driver version 4.4.5
[android-x86/external-kernel-drivers.git] / rtl8723bu / 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.0"
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_AutoChannelSelectSettingAP()
31 #define STORE_DEFAULT_NHM_SETTING               0
32 #define RESTORE_DEFAULT_NHM_SETTING             1
33 #define ACS_NHM_SETTING                         2
34
35 typedef struct _ACS_
36 {
37         BOOLEAN         bForceACSResult;
38         u1Byte          CleanChannel_2G;
39         u1Byte          CleanChannel_5G;
40         u2Byte          Channel_Info_2G[2][ODM_MAX_CHANNEL_2G];         //Channel_Info[1]: Channel Score, Channel_Info[2]:Channel_Scan_Times
41         u2Byte          Channel_Info_5G[2][ODM_MAX_CHANNEL_5G];
42
43 #if ( DM_ODM_SUPPORT_TYPE & ODM_AP )
44     u1Byte              ACS_Step;
45     // NHM Count 0-11
46     u1Byte              NHM_Cnt[14][11];
47
48     // AC-Series, for storing previous setting
49     u4Byte              Reg0x990;
50     u4Byte              Reg0x994;
51     u4Byte              Reg0x998;
52     u4Byte              Reg0x99C;
53     u1Byte              Reg0x9A0;   // u1Byte
54
55     // N-Series, for storing previous setting
56     u4Byte              Reg0x890;
57     u4Byte              Reg0x894;
58     u4Byte              Reg0x898;
59     u4Byte              Reg0x89C;
60     u1Byte              Reg0xE28;   // u1Byte
61 #endif
62
63 }ACS, *PACS;
64
65
66 VOID
67 odm_AutoChannelSelectInit(
68         IN              PVOID                   pDM_VOID
69 );
70
71 VOID
72 odm_AutoChannelSelectReset(
73         IN              PVOID                   pDM_VOID
74 );
75
76 VOID
77 odm_AutoChannelSelect(
78         IN              PVOID                   pDM_VOID,
79         IN              u1Byte                  Channel
80 );
81
82 u1Byte
83 ODM_GetAutoChannelSelectResult(
84         IN              PVOID                   pDM_VOID,
85         IN              u1Byte                  Band
86 );
87
88 #if ( DM_ODM_SUPPORT_TYPE & ODM_AP )
89
90 VOID
91 phydm_AutoChannelSelectSettingAP(
92     IN  PVOID   pDM_VOID,
93     IN  u4Byte  Setting,             // 0: STORE_DEFAULT_NHM_SETTING; 1: RESTORE_DEFAULT_NHM_SETTING, 2: ACS_NHM_SETTING
94     IN  u4Byte  acs_step
95 );
96
97 VOID
98 phydm_GetNHMStatisticsAP(
99     IN  PVOID       pDM_VOID,
100     IN  u4Byte      idx,                // @ 2G, Real channel number = idx+1
101     IN  u4Byte      acs_step
102 );
103
104 #endif  //#if ( DM_ODM_SUPPORT_TYPE & ODM_AP )
105
106
107 VOID
108 phydm_CLMInit(
109         IN              PVOID                   pDM_VOID,
110         IN              u2Byte                  sampleNum
111 );
112
113 VOID
114 phydm_CLMtrigger(
115         IN              PVOID                   pDM_VOID
116 );
117
118 BOOLEAN
119 phydm_checkCLMready(
120         IN              PVOID                   pDM_VOID
121 );
122
123 u2Byte
124 phydm_getCLMresult(
125         IN              PVOID                   pDM_VOID
126 );
127
128
129 #endif  //#ifndef       __PHYDMACS_H__