OSDN Git Service

Add rtl8723bu driver version 4.4.5
[android-x86/external-kernel-drivers.git] / rtl8723bu / include / Hal8723BPhyCfg.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 #ifndef __INC_HAL8723BPHYCFG_H__
21 #define __INC_HAL8723BPHYCFG_H__
22
23 /*--------------------------Define Parameters-------------------------------*/
24 #define LOOP_LIMIT                              5
25 #define MAX_STALL_TIME                  50              //us
26 #define AntennaDiversityValue   0x80    //(Adapter->bSoftwareAntennaDiversity ? 0x00:0x80)
27 #define MAX_TXPWR_IDX_NMODE_92S 63
28 #define Reset_Cnt_Limit                 3
29
30 #ifdef CONFIG_PCI_HCI
31 #define MAX_AGGR_NUM    0x0B
32 #else
33 #define MAX_AGGR_NUM    0x07
34 #endif // CONFIG_PCI_HCI
35
36
37 /*--------------------------Define Parameters End-------------------------------*/
38
39
40 /*------------------------------Define structure----------------------------*/
41
42 /*------------------------------Define structure End----------------------------*/
43
44 /*--------------------------Exported Function prototype---------------------*/
45 u32
46 PHY_QueryBBReg_8723B(
47         IN      PADAPTER        Adapter,
48         IN      u32             RegAddr,
49         IN      u32             BitMask
50         );
51
52 VOID
53 PHY_SetBBReg_8723B(
54         IN      PADAPTER        Adapter,
55         IN      u32             RegAddr,
56         IN      u32             BitMask,
57         IN      u32             Data
58         );
59
60 u32
61 PHY_QueryRFReg_8723B(
62         IN      PADAPTER                        Adapter,
63         IN      u8                              eRFPath,
64         IN      u32                             RegAddr,
65         IN      u32                             BitMask
66         );
67
68 VOID
69 PHY_SetRFReg_8723B(
70         IN      PADAPTER                        Adapter,
71         IN      u8                              eRFPath,
72         IN      u32                             RegAddr,
73         IN      u32                             BitMask,
74         IN      u32                             Data
75         );
76
77 /* MAC/BB/RF HAL config */
78 int PHY_BBConfig8723B(PADAPTER  Adapter );
79
80 int PHY_RFConfig8723B(PADAPTER  Adapter );
81
82 s32 PHY_MACConfig8723B(PADAPTER padapter);
83
84 int
85 PHY_ConfigRFWithParaFile_8723B(
86         IN      PADAPTER                        Adapter,
87         IN      u8*                             pFileName,
88         RF_PATH                         eRFPath
89 );
90
91 VOID
92 PHY_SetTxPowerIndex_8723B(
93         IN      PADAPTER                        Adapter,
94         IN      u32                                     PowerIndex,
95         IN      u8                                      RFPath,
96         IN      u8                                      Rate
97         );
98
99 u8
100 PHY_GetTxPowerIndex_8723B(
101         IN      PADAPTER                        pAdapter,
102         IN      u8                                      RFPath,
103         IN      u8                                      Rate,
104         IN      CHANNEL_WIDTH           BandWidth,
105         IN      u8                                      Channel
106         );
107
108 VOID
109 PHY_GetTxPowerLevel8723B(
110         IN      PADAPTER                Adapter,
111         OUT s32*                                powerlevel
112         );
113
114 VOID
115 PHY_SetTxPowerLevel8723B(
116         IN      PADAPTER                Adapter,
117         IN      u8                      channel
118         );
119
120 VOID
121 PHY_SetBWMode8723B(
122         IN      PADAPTER                                Adapter,
123         IN      CHANNEL_WIDTH                   Bandwidth,      // 20M or 40M
124         IN      unsigned char                           Offset          // Upper, Lower, or Don't care
125 );
126
127 VOID
128 PHY_SwChnl8723B(        // Call after initialization
129         IN      PADAPTER        Adapter,
130         IN      u8              channel
131         );
132
133 VOID
134 PHY_SetSwChnlBWMode8723B(
135         IN      PADAPTER                        Adapter,
136         IN      u8                                      channel,
137         IN      CHANNEL_WIDTH           Bandwidth,
138         IN      u8                                      Offset40,
139         IN      u8                                      Offset80
140 );
141
142 VOID PHY_SetRFPathSwitch_8723B(
143         IN      PADAPTER        pAdapter,
144         IN      BOOLEAN         bMain
145         );
146 /*--------------------------Exported Function prototype End---------------------*/
147
148 #endif