1 /******************************************************************************
3 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
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.
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
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
19 ******************************************************************************/
25 #define HAL_FW_ENABLE 0
26 #define HAL_MAC_ENABLE 0
27 #define HAL_BB_ENABLE 0
28 #define HAL_RF_ENABLE 0
29 #else // FPGA_PHY and ASIC
30 #define HAL_FW_ENABLE 1
31 #define HAL_MAC_ENABLE 1
32 #define HAL_BB_ENABLE 1
33 #define HAL_RF_ENABLE 1
36 #define RF6052_MAX_TX_PWR 0x3F
37 #define RF6052_MAX_REG_88E 0xFF
38 #define RF6052_MAX_REG_92C 0x7F
40 #define RF6052_MAX_REG \
41 (RF6052_MAX_REG_88E > RF6052_MAX_REG_92C) ? RF6052_MAX_REG_88E: RF6052_MAX_REG_92C
43 #define GET_RF6052_REAL_MAX_REG(_Adapter) \
44 IS_HARDWARE_TYPE_8188E(_Adapter) ? RF6052_MAX_REG_88E : RF6052_MAX_REG_92C
46 #define RF6052_MAX_PATH 2
49 // Antenna detection method, i.e., using single tone detection or RSSI reported from each antenna detected.
50 // Added by Roger, 2013.05.22.
52 #define ANT_DETECT_BY_SINGLE_TONE BIT0
53 #define ANT_DETECT_BY_RSSI BIT1
54 #define IS_ANT_DETECT_SUPPORT_SINGLE_TONE(__Adapter) ((GET_HAL_DATA(__Adapter)->AntDetection) & ANT_DETECT_BY_SINGLE_TONE)
55 #define IS_ANT_DETECT_SUPPORT_RSSI(__Adapter) ((GET_HAL_DATA(__Adapter)->AntDetection) & ANT_DETECT_BY_RSSI)
58 /*--------------------------Define Parameters-------------------------------*/
59 typedef enum _BAND_TYPE{
64 }BAND_TYPE,*PBAND_TYPE;
66 typedef enum _RF_TYPE{
68 RF_8225=1, // 1 11b/g RF for verification only
69 RF_8256=2, // 2 11b/g/n
70 RF_8258=3, // 3 11a/b/g/n RF
71 RF_6052=4, // 4 11b/g/n RF
72 RF_PSEUDO_11N=5, // 5, It is a temporality RF.
74 }RF_TYPE_E,*PRF_TYPE_E;
76 typedef enum _RF_PATH{
88 #define RF_PATH_MAX_92C_88E 2
89 #define RF_PATH_MAX_90_8812 4 //Max RF number 90 support
91 typedef enum _ANTENNA_PATH{
110 typedef enum _RF_CONTENT{
117 typedef enum _BaseBand_Config_Type{
118 BaseBand_Config_PHY_REG = 0, //Radio Path A
119 BaseBand_Config_AGC_TAB = 1, //Radio Path B
120 BaseBand_Config_AGC_TAB_2G = 2,
121 BaseBand_Config_AGC_TAB_5G = 3,
122 BaseBand_Config_PHY_REG_PG
123 }BaseBand_Config_Type, *PBaseBand_Config_Type;
125 typedef enum _HW_BLOCK{
130 HW_BLOCK_MAXIMUM = 4, // Never use this
131 }HW_BLOCK_E, *PHW_BLOCK_E;
133 typedef enum _WIRELESS_MODE {
134 WIRELESS_MODE_UNKNOWN = 0x00,
135 WIRELESS_MODE_A = 0x01,
136 WIRELESS_MODE_B = 0x02,
137 WIRELESS_MODE_G = 0x04,
138 WIRELESS_MODE_AUTO = 0x08,
139 WIRELESS_MODE_N_24G = 0x10,
140 WIRELESS_MODE_N_5G = 0x20,
141 WIRELESS_MODE_AC_5G = 0x40,
142 WIRELESS_MODE_AC_24G = 0x80,
143 WIRELESS_MODE_AC_ONLY = 0x100,
146 typedef enum _SwChnlCmdID{
148 CmdID_SetTxPowerLevel,
150 CmdID_WritePortUlong,
151 CmdID_WritePortUshort,
152 CmdID_WritePortUchar,
156 typedef struct _SwChnlCmd{
163 typedef struct _R_ANTENNA_SELECT_OFDM{
170 u32 r_ant_non_ht_s1:4;
173 }R_ANTENNA_SELECT_OFDM;
175 typedef struct _R_ANTENNA_SELECT_CCK{
176 u8 r_cckrx_enable_2:2;
179 }R_ANTENNA_SELECT_CCK;
181 typedef struct RF_Shadow_Compare_Map {
182 // Shadow register value
184 // Compare or not flag
186 // Record If it had ever modified unpredicted
194 /*--------------------------Exported Function prototype---------------------*/
197 PHY_CalculateBitShift(
221 PHY_RFShadowRecorver(
227 PHY_RFShadowCompareAll(
228 IN PADAPTER Adapter);
231 PHY_RFShadowRecorverAll(
232 IN PADAPTER Adapter);
235 PHY_RFShadowCompareFlagSet(
242 PHY_RFShadowRecorverFlagSet(
249 PHY_RFShadowCompareFlagSetAll(
250 IN PADAPTER Adapter);
253 PHY_RFShadowRecorverFlagSetAll(
254 IN PADAPTER Adapter);
258 IN PADAPTER Adapter);
260 #endif //__HAL_COMMON_H__