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 ******************************************************************************/
31 #define SHORT_SLOT_TIME 9
32 #define NON_SHORT_SLOT_TIME 20
34 #define RTL8711_RF_MAX_SENS 6
35 #define RTL8711_RF_DEF_SENS 4
38 // We now define the following channels as the max channels in each channel plan.
40 // {1,2,3,4,5,6,7,8,9,10,11,12,13,14}
42 // {36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140,149,153,157,161,165}
43 #define MAX_CHANNEL_NUM_2G 14
44 #define MAX_CHANNEL_NUM_5G 24
45 #define MAX_CHANNEL_NUM 38//14+24
47 //#define NUM_REGULATORYS 21
48 #define NUM_REGULATORYS 1
52 #define EUROPE 0x1 //temp, should be provided later
53 #define JAPAN 0x2 //temp, should be provided later
55 struct regulatory_class {
56 u32 starting_freq; //MHz,
57 u8 channel_set[MAX_CHANNEL_NUM];
58 u8 channel_cck_power[MAX_CHANNEL_NUM];//dbm
59 u8 channel_ofdm_power[MAX_CHANNEL_NUM];//dbm
60 u8 txpower_limit; //dbm
61 u8 channel_spacing; //MHz
65 typedef enum _CAPABILITY{
71 cShortPreamble = 0x0020,
73 cChannelAgility = 0x0080,
74 cSpectrumMgnt = 0x0100,
75 cQos = 0x0200, // For HCCA, use with CF-Pollable and CF-PollReq
76 cShortSlotTime = 0x0400,
78 cRM = 0x1000, // RRM (Radio Request Measurement)
81 cImmediateBA = 0x8000,
82 }CAPABILITY, *PCAPABILITY;
84 enum _REG_PREAMBLE_MODE{
91 enum _RTL8712_RF_MIMO_CONFIG_{
92 RTL8712_RFCONFIG_1T=0x10,
93 RTL8712_RFCONFIG_2T=0x20,
94 RTL8712_RFCONFIG_1R=0x01,
95 RTL8712_RFCONFIG_2R=0x02,
96 RTL8712_RFCONFIG_1T1R=0x11,
97 RTL8712_RFCONFIG_1T2R=0x12,
98 RTL8712_RFCONFIG_TURBO=0x92,
99 RTL8712_RFCONFIG_2T2R=0x22
103 typedef enum _RF90_RADIO_PATH{
104 RF90_PATH_A = 0, //Radio Path A
105 RF90_PATH_B = 1, //Radio Path B
106 RF90_PATH_C = 2, //Radio Path C
107 RF90_PATH_D = 3 //Radio Path D
108 //RF90_PATH_MAX //Max RF number 90 support
109 }RF90_RADIO_PATH_E, *PRF90_RADIO_PATH_E;
112 #define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0
113 #define HAL_PRIME_CHNL_OFFSET_LOWER 1
114 #define HAL_PRIME_CHNL_OFFSET_UPPER 2
116 // Represent Channel Width in HT Capabilities
118 typedef enum _CHANNEL_WIDTH{
119 CHANNEL_WIDTH_20 = 0,
120 CHANNEL_WIDTH_40 = 1,
121 CHANNEL_WIDTH_80 = 2,
122 CHANNEL_WIDTH_160 = 3,
123 CHANNEL_WIDTH_80_80 = 4,
124 CHANNEL_WIDTH_MAX = 5,
125 }CHANNEL_WIDTH, *PCHANNEL_WIDTH;
128 // Represent Extention Channel Offset in HT Capabilities
129 // This is available only in 40Mhz mode.
131 typedef enum _EXTCHNL_OFFSET{
132 EXTCHNL_OFFSET_NO_EXT = 0,
133 EXTCHNL_OFFSET_UPPER = 1,
134 EXTCHNL_OFFSET_NO_DEF = 2,
135 EXTCHNL_OFFSET_LOWER = 3,
136 }EXTCHNL_OFFSET, *PEXTCHNL_OFFSET;
138 typedef enum _VHT_DATA_SC{
139 VHT_DATA_SC_DONOT_CARE = 0,
140 VHT_DATA_SC_20_UPPER_OF_80MHZ = 1,
141 VHT_DATA_SC_20_LOWER_OF_80MHZ = 2,
142 VHT_DATA_SC_20_UPPERST_OF_80MHZ = 3,
143 VHT_DATA_SC_20_LOWEST_OF_80MHZ = 4,
144 VHT_DATA_SC_20_RECV1 = 5,
145 VHT_DATA_SC_20_RECV2 = 6,
146 VHT_DATA_SC_20_RECV3 = 7,
147 VHT_DATA_SC_20_RECV4 = 8,
148 VHT_DATA_SC_40_UPPER_OF_80MHZ = 9,
149 VHT_DATA_SC_40_LOWER_OF_80MHZ = 10,
150 }VHT_DATA_SC, *PVHT_DATA_SC_E;
152 typedef enum _PROTECTION_MODE{
153 PROTECTION_MODE_AUTO = 0,
154 PROTECTION_MODE_FORCE_ENABLE = 1,
155 PROTECTION_MODE_FORCE_DISABLE = 2,
156 }PROTECTION_MODE, *PPROTECTION_MODE;
158 /* 2007/11/15 MH Define different RF type. */
159 typedef enum _RT_RF_TYPE_DEFINITION
170 u32 rtw_ch2freq(u32 ch);
171 u32 rtw_freq2ch(u32 freq);
174 #endif //_RTL8711_RF_H_