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 ******************************************************************************/
25 /* slot time for 11g */
26 #define SHORT_SLOT_TIME 9
27 #define NON_SHORT_SLOT_TIME 20
29 #define RTL8711_RF_MAX_SENS 6
30 #define RTL8711_RF_DEF_SENS 4
33 /* We now define the following channels as the max channels in each channel plan. */
34 /* 2G, total 14 chnls */
35 /* {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14} */
36 /* 5G, total 24 chnls */
37 /* {36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120,
38 * 124, 128, 132, 136, 140, 149, 153, 157, 161, 165} */
39 #define MAX_CHANNEL_NUM_2G 14
40 #define MAX_CHANNEL_NUM_5G 24
41 #define MAX_CHANNEL_NUM 38/* 14+24 */
43 #define NUM_REGULATORYS 1
47 #define EUROPE 0x1 /* temp, should be provided later */
48 #define JAPAN 0x2 /* temp, should be provided later */
50 struct regulatory_class {
51 u32 starting_freq; /* MHz, */
52 u8 channel_set[MAX_CHANNEL_NUM];
53 u8 channel_cck_power[MAX_CHANNEL_NUM];/* dbm */
54 u8 channel_ofdm_power[MAX_CHANNEL_NUM];/* dbm */
55 u8 txpower_limit; /* dbm */
56 u8 channel_spacing; /* MHz */
66 cShortPreamble = 0x0020,
68 cChannelAgility = 0x0080,
69 cSpectrumMgnt = 0x0100,
70 cQos = 0x0200, /* For HCCA, use with CF-Pollable and CF-PollReq */
71 cShortSlotTime = 0x0400,
73 cRM = 0x1000, /* RRM (Radio Request Measurement) */
76 cImmediateBA = 0x8000,
79 enum _REG_PREAMBLE_MODE {
85 enum _RTL8712_RF_MIMO_CONFIG_ {
86 RTL8712_RFCONFIG_1T = 0x10,
87 RTL8712_RFCONFIG_2T = 0x20,
88 RTL8712_RFCONFIG_1R = 0x01,
89 RTL8712_RFCONFIG_2R = 0x02,
90 RTL8712_RFCONFIG_1T1R = 0x11,
91 RTL8712_RFCONFIG_1T2R = 0x12,
92 RTL8712_RFCONFIG_TURBO = 0x92,
93 RTL8712_RFCONFIG_2T2R = 0x22
96 enum RF90_RADIO_PATH {
97 RF90_PATH_A = 0, /* Radio Path A */
98 RF90_PATH_B = 1, /* Radio Path B */
99 RF90_PATH_C = 2, /* Radio Path C */
100 RF90_PATH_D = 3 /* Radio Path D */
103 /* Bandwidth Offset */
104 #define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0
105 #define HAL_PRIME_CHNL_OFFSET_LOWER 1
106 #define HAL_PRIME_CHNL_OFFSET_UPPER 2
108 /* Represent Channel Width in HT Capabilities */
110 CHANNEL_WIDTH_20 = 0,
111 CHANNEL_WIDTH_40 = 1,
112 CHANNEL_WIDTH_80 = 2,
113 CHANNEL_WIDTH_160 = 3,
114 CHANNEL_WIDTH_80_80 = 4,
115 CHANNEL_WIDTH_MAX = 5,
118 /* Represent Extension Channel Offset in HT Capabilities */
119 /* This is available only in 40Mhz mode. */
120 enum EXTCHNL_OFFSET {
121 EXTCHNL_OFFSET_NO_EXT = 0,
122 EXTCHNL_OFFSET_UPPER = 1,
123 EXTCHNL_OFFSET_NO_DEF = 2,
124 EXTCHNL_OFFSET_LOWER = 3,
128 VHT_DATA_SC_DONOT_CARE = 0,
129 VHT_DATA_SC_20_UPPER_OF_80MHZ = 1,
130 VHT_DATA_SC_20_LOWER_OF_80MHZ = 2,
131 VHT_DATA_SC_20_UPPERST_OF_80MHZ = 3,
132 VHT_DATA_SC_20_LOWEST_OF_80MHZ = 4,
133 VHT_DATA_SC_20_RECV1 = 5,
134 VHT_DATA_SC_20_RECV2 = 6,
135 VHT_DATA_SC_20_RECV3 = 7,
136 VHT_DATA_SC_20_RECV4 = 8,
137 VHT_DATA_SC_40_UPPER_OF_80MHZ = 9,
138 VHT_DATA_SC_40_LOWER_OF_80MHZ = 10,
141 enum PROTECTION_MODE {
142 PROTECTION_MODE_AUTO = 0,
143 PROTECTION_MODE_FORCE_ENABLE = 1,
144 PROTECTION_MODE_FORCE_DISABLE = 2,
147 /* 2007/11/15 MH Define different RF type. */
148 enum RT_RF_TYPE_DEFINITION {
157 u32 rtw_ch2freq(u32 ch);
159 #endif /* _RTL8711_RF_H_ */