net: wireless: rockchip_wlan: add rtl8723cs support
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rtl8723cs / include / Hal8812PhyCfg.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_HAL8812PHYCFG_H__
21 #define __INC_HAL8812PHYCFG_H__
22
23
24 /*--------------------------Define Parameters-------------------------------*/
25 #define LOOP_LIMIT                              5
26 #define MAX_STALL_TIME                  50              /* us */
27 #define AntennaDiversityValue   0x80    /* (Adapter->bSoftwareAntennaDiversity ? 0x00 : 0x80) */
28 #define MAX_TXPWR_IDX_NMODE_92S 63
29 #define Reset_Cnt_Limit                 3
30
31
32 #ifdef CONFIG_PCI_HCI
33         #define MAX_AGGR_NUM    0x0B
34 #else
35         #define MAX_AGGR_NUM    0x07
36 #endif /* CONFIG_PCI_HCI */
37
38
39 /*--------------------------Define Parameters-------------------------------*/
40
41 /*------------------------------Define structure----------------------------*/
42
43
44 /* BB/RF related */
45
46 /*------------------------------Define structure----------------------------*/
47
48
49 /*------------------------Export global variable----------------------------*/
50 /*------------------------Export global variable----------------------------*/
51
52
53 /*------------------------Export Marco Definition---------------------------*/
54 /*------------------------Export Marco Definition---------------------------*/
55
56
57 /*--------------------------Exported Function prototype---------------------*/
58 /*
59  * BB and RF register read/write
60  *   */
61 u32     PHY_QueryBBReg8812(IN   PADAPTER        Adapter,
62                            IN   u32                     RegAddr,
63                            IN   u32                     BitMask);
64 void    PHY_SetBBReg8812(IN     PADAPTER                Adapter,
65                          IN     u32                     RegAddr,
66                          IN     u32                     BitMask,
67                          IN     u32                     Data);
68 u32     PHY_QueryRFReg8812(IN   PADAPTER        Adapter,
69                            IN   u8                      eRFPath,
70                            IN   u32                     RegAddr,
71                            IN   u32                     BitMask);
72 void    PHY_SetRFReg8812(IN     PADAPTER                Adapter,
73                          IN     u8                      eRFPath,
74                          IN     u32                     RegAddr,
75                          IN     u32                     BitMask,
76                          IN     u32                     Data);
77
78 /*
79  * Initialization related function
80  *
81  * MAC/BB/RF HAL config */
82 int     PHY_MACConfig8812(IN PADAPTER   Adapter);
83 int     PHY_BBConfig8812(IN PADAPTER    Adapter);
84 void    PHY_BB8812_Config_1T(IN PADAPTER        Adapter);
85 int     PHY_RFConfig8812(IN PADAPTER    Adapter);
86
87 /* RF config */
88
89 s32
90 PHY_SwitchWirelessBand8812(
91         IN PADAPTER             Adapter,
92         IN u8                   Band
93 );
94
95 /*
96  * BB TX Power R/W
97  *   */
98 void    PHY_GetTxPowerLevel8812(IN PADAPTER     Adapter, OUT s32        *powerlevel);
99 void    PHY_SetTxPowerLevel8812(IN PADAPTER     Adapter, IN u8  Channel);
100
101 BOOLEAN PHY_UpdateTxPowerDbm8812(IN PADAPTER    Adapter, IN int powerInDbm);
102 u8 PHY_GetTxPowerIndex_8812A(
103         IN      PADAPTER                        pAdapter,
104         IN      u8                                      RFPath,
105         IN      u8                                      Rate,
106         IN      u8                                      BandWidth,
107         IN      u8                                      Channel,
108         struct txpwr_idx_comp *tic
109 );
110
111 u32 phy_get_tx_bb_swing_8812a(
112         IN      PADAPTER        Adapter,
113         IN      BAND_TYPE       Band,
114         IN      u8                      RFPath
115 );
116
117 VOID
118 PHY_SetTxPowerIndex_8812A(
119         IN      PADAPTER                        Adapter,
120         IN      u4Byte                          PowerIndex,
121         IN      u1Byte                          RFPath,
122         IN      u1Byte                          Rate
123 );
124
125 /*
126  * channel switch related funciton
127  *   */
128 VOID
129 PHY_SetSwChnlBWMode8812(
130         IN      PADAPTER                        Adapter,
131         IN      u8                                      channel,
132         IN      CHANNEL_WIDTH           Bandwidth,
133         IN      u8                                      Offset40,
134         IN      u8                                      Offset80
135 );
136
137 /*
138  * BB/MAC/RF other monitor API
139  *   */
140
141 VOID
142 phy_set_rf_path_switch_8812a(
143         IN      PADAPTER        pAdapter,
144         IN      bool            bMain
145 );
146
147 /*--------------------------Exported Function prototype---------------------*/
148 #endif /* __INC_HAL8192CPHYCFG_H */